git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2014, 00:43 UTC
Message-ID
<xmqq1tzh135x.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPc5daXvBPTVCUv=qO++kiOMQck1daTc_rmhpWrDk-KbTuvZOQ@mail.gmail.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> 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.

Previous: Junio C HamanoNext: Jonathan Nieder
Message 15 of 17 in “splitting a commit that adds new files”
  1. Duy NguyenFeb 1, 2014
  2. Junio C HamanoFeb 2, 2014
  3. Jeff KingFeb 2, 2014
  4. Junio C HamanoFeb 3, 2014
  5. Duy NguyenFeb 4, 2014
  6. 1/2 t7101, t7014: rename test files to indicate what that file is forNguyễn Thái Ngọc Duy, Feb 4, 2014
  7. 2/2 reset: support "--mixed --intent-to-add" modeNguyễn Thái Ngọc Duy, Feb 4, 2014
  8. Junio C HamanoFeb 4, 2014
  9. Junio C HamanoFeb 4, 2014
  10. Duy NguyenFeb 5, 2014
  11. Junio C HamanoFeb 5, 2014
  12. Junio C HamanoFeb 5, 2014
  13. Duy NguyenFeb 5, 2014
  14. Junio C HamanoFeb 6, 2014
  15. Junio C HamanoFeb 6, 2014
  16. Jonathan NiederFeb 4, 2014
  17. Duy NguyenFeb 6, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.