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

Re: [PATCH RFC] commit: allow to commit even if there are intent-to-add entries

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Jan 12, 2012, 02:53 UTC
Message-ID
<CACsJy8CHOuZMP4hWp6Lb_TbdfwSgofSg_0tDZ4oDcD0veie2Dw@mail.gmail.com>
In-Reply-To
<7vr4z654m3.fsf@alter.siamese.dyndns.org>
2012/1/12 Junio C Hamano <gitster@pobox.com>:
Show 18 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>>> When running "commit" and "status" with files marked with "intent to add",
>>> I think there are three possible interpretations of what the user
>>> wants to do.
>> [ (1) thanks for stopping me, I had forgotten about that file;
>>   (2) I changed my mind, please leave that file out; or (3) please
>>   dwim and add the file ]
>>
>> I think (3) was a trick --- no one that does not use the "-a" option
>> would want that. :)
>
> I really wish it were the case, but I doubt it.
>
> People from other VCS background seem to still think that "commit" without
> paths should commit everything; after getting told that "what you add to
> the index is what you will commit", I can easily see this commint: but but
> but I told Git that I _want_ to add with -N! Why aren't you committing it?

I see "-N" just as an indication, not really an "add" operation. Perhaps update-index is a better place for it.

Show 8 quoted lines
>> (2) makes intent-to-add entries just like any other tracked index
>> entry with some un-added content.
>
> You are comparing files edited in the working tree without the user
> telling anything about them to Git (both tracked and untracked) and files
> the user explicitly told Git that the user hasn't made up her mind
> about. Why is it a good thing to make the latter behave "just like any
> other"?

The way I see this flag is "include these files in my diff in addition to tracked files", and therefore should not have any effects at commit time. I might turn some of those extra files to tracked some time if I want to commit.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 12 in “commit: allow to commit even if there are intent-to-add entries”
  1. commit: allow to commit even if there are intent-to-add entriesNguyễn Thái Ngọc Duy, Jan 11, 2012
  2. Junio C HamanoJan 11, 2012
  3. Jonathan NiederJan 11, 2012
  4. Junio C HamanoJan 11, 2012
  5. Nguyen Thai Ngoc DuyJan 12, 2012
  6. Junio C HamanoJan 12, 2012
  7. Nguyễn Thái Ngọc DuyJan 11, 2012
  8. 1/2 cache-tree: update API to take abitrary flagsNguyễn Thái Ngọc Duy, Jan 11, 2012
  9. Junio C HamanoJan 11, 2012
  10. Nguyen Thai Ngoc DuyJan 12, 2012
  11. 2/2 commit: add --skip-intent-to-add to allow commit with i-t-a entries in indexNguyễn Thái Ngọc Duy, Jan 11, 2012
  12. Junio C HamanoJan 11, 2012

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.