Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 2/2] reset: support "--mixed --intent-to-add" mode

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:50

Junio C Hamano [off-list ref] writes:
On Wed, Feb 5, 2014 at 3:48 PM, Duy Nguyen [off-list ref] wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help