From: Junio C Hamano <gitster@pobox•com>
To: Duy Nguyen <pclouds@gmail•com>
Cc: Git Mailing List <git@vger•kernel.org>
Subject: Re: [PATCH 2/2] reset: support "--mixed --intent-to-add" mode
Date: Wed, 05 Feb 2014 16:43:38 -0800 [thread overview]
Message-ID: <xmqq1tzh135x.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPc5daXvBPTVCUv=qO++kiOMQck1daTc_rmhpWrDk-KbTuvZOQ@mail.gmail.com> (Junio C. Hamano's message of "Wed, 5 Feb 2014 16:08:15 -0800")
Junio C Hamano <gitster@pobox•com> writes:
> On Wed, Feb 5, 2014 at 3:48 PM, Duy Nguyen <pclouds@gmail•com> wrote:
>> No no. I found that duplicate, but I did not suggest removing it
>> because it is needed there..
>
> Hmph, if that is the case, we probably should make it the
> responsibility of the calling side to actually mark ce->flags with the
> bit (which would also mean the function must be renamed to make it
> clear that it does not mark).
After looking at the codepath that uses the record_intent_to_add()
before this patch, I am coming to the conclusion that it is the
right thing to do after all. The code appears in this section:
if (!intent_only) {
if (index_path(ce->sha1, path, st, HASH_WRITE_OBJECT))
return error("unable to index file %s", path);
} else
record_intent_to_add(ce);
which tells (at least) me: "We are not adding the contents of this
path, so we do not run index_path(); instead we call this helper
function to set the object name in ce to represent an intent-to-add
entry".
So I'll rename it to set_object_name_for_intent_to_add_entry() or
something, restore that flag manipulation back to the caller, and
add another to the new caller, and requeue.
next prev parent reply other threads:[~2014-02-06 0:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-01 10:48 splitting a commit that adds new files Duy Nguyen
2014-02-02 18:15 ` Junio C Hamano
2014-02-02 23:11 ` Jeff King
2014-02-03 18:11 ` Junio C Hamano
2014-02-04 0:54 ` Duy Nguyen
2014-02-04 2:20 ` [PATCH 1/2] t7101, t7014: rename test files to indicate what that file is for Nguyễn Thái Ngọc Duy
2014-02-04 2:20 ` [PATCH 2/2] reset: support "--mixed --intent-to-add" mode Nguyễn Thái Ngọc Duy
2014-02-04 19:09 ` Junio C Hamano
2014-02-04 22:25 ` Junio C Hamano
2014-02-05 0:27 ` Duy Nguyen
2014-02-05 17:16 ` Junio C Hamano
2014-02-05 18:25 ` Junio C Hamano
2014-02-05 23:48 ` Duy Nguyen
2014-02-06 0:08 ` Junio C Hamano
2014-02-06 0:43 ` Junio C Hamano [this message]
2014-02-04 16:05 ` [PATCH 1/2] t7101, t7014: rename test files to indicate what that file is for Jonathan Nieder
2014-02-06 1:58 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq1tzh135x.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=pclouds@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox