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
Duy Nguyen <pclouds@gmail.com>
Date
Feb 5, 2014, 23:48 UTC
Message-ID
<CACsJy8Aj-5MzRjDxfWkOVtqxjo+w7v6uEjGfGAj_9s59t5eiYA@mail.gmail.com>
In-Reply-To
<xmqqbnyl5sde.fsf@gitster.dls.corp.google.com>
On Thu, Feb 6, 2014 at 1:25 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>> Yes, indeed.  I wonder why your new test did not notice it, though
>> ;-)
>
> ... and the answer turns out to be that it was not testing the right
> thing.  On top of that faulty version, this will fix it.
Yes, write-tree should test that well.
> Your suggestion to move CE_INTENT_TO_ADD to mark-intent-to-add makes
> sense but a caller needs to be adjusted to drop the duplicated flag
> manipulation.

No no. I found that duplicate, but I did not suggest removing it because it is needed there..

Show 9 quoted lines
> @@ -613,8 +614,6 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
>         ce->ce_namelen = namelen;
>         if (!intent_only)
>                 fill_stat_cache_info(ce, st);
> -       else
> -               ce->ce_flags |= CE_INTENT_TO_ADD;
>
>         if (trust_executable_bit && has_symlinks)
>                 ce->ce_mode = create_ce_mode(st_mode);

A few lines down, there's ie_match_stat() call that will check CE_INTENT_TO_ADD and returns "changed" immediately without looking at stat data. If stat info is used, it may (not so sure) return "not changed", the exit path is taken and mark_intent_to_add() is ignored.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 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.