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

Re: [PATCH 2/4] commit: introduce a config key to allow as-is commit with i-t-a entries

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2012, 06:10 UTC
Message-ID
<7v1uq741ip.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vwr7z653f.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> It still is not clear to me how best to sell this change to the end-user
> community.
OK, sorry for wavering.

Unless you are doing "commit -a" or "commit pathspec", you are responsible for adding all contents you want to have in the commit before you run the "git commit" command (and for the purpose of this statement, "add -N" to tell Git to keey an eye on a path does _not_ add contents). A change to the file in the working tree that is left unadded is what you decided to deliberately leave out of the commit, be it a change to a path already in HEAD, or a path marked with "add -N". Forgetting to add modified file and forgetting to add a file you earlier used "add -N" amount to the same kind of risk, and "git status" is the way to make sure your partial commit has exactly what you want (if you are not worried about partial commit, you would be doing "commit -a", so the "safety" is a moot point).

I was worried too much about backward compatibility and was blind to the above, and was mistakenly defending a false "safety" that did not exist at all. Sorry for wasting everybody's time.

So let's bite the bullet and admit in the Release Notes that the current behaviour was a UI mistake based on the misguided assumption that we can give some kind of "safety" by committing when there are "add -N" entries in the index, which is untrue, and we are fixing it in the new release. We do not need configuration nor command line options.

Let me try to reroll your patch tomorrow (unless you beat me to it) and see if I can come up with an easy-to-understand explanation to it.

Thanks.
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 13 of 20 in “Deprecate "not allow as-is commit with i-t-a entries"”
  1. 0/4 Deprecate "not allow as-is commit with i-t-a entries"Nguyễn Thái Ngọc Duy, Feb 6, 2012
  2. 1/4 cache-tree: update API to take abitrary flagsNguyễn Thái Ngọc Duy, Feb 6, 2012
  3. Junio C HamanoFeb 6, 2012
  4. 2/4 commit: introduce a config key to allow as-is commit with i-t-a entriesNguyễn Thái Ngọc Duy, Feb 6, 2012
  5. Junio C HamanoFeb 6, 2012
  6. Nguyen Thai Ngoc DuyFeb 7, 2012
  7. Jonathan NiederFeb 7, 2012
  8. Junio C HamanoFeb 6, 2012
  9. Jonathan NiederFeb 6, 2012
  10. Junio C HamanoFeb 6, 2012
  11. Nguyen Thai Ngoc DuyFeb 7, 2012
  12. Junio C HamanoFeb 7, 2012
  13. Junio C HamanoFeb 7, 2012
  14. Nguyen Thai Ngoc DuyFeb 7, 2012
  15. Junio C HamanoFeb 7, 2012
  16. 3/4 commit: turn commit.ignoreIntentToAdd to true by defaultNguyễn Thái Ngọc Duy, Feb 6, 2012
  17. Junio C HamanoFeb 6, 2012
  18. Nguyen Thai Ngoc DuyFeb 7, 2012
  19. 4/4 commit: remove commit.ignoreIntentToAdd, assume it's always trueNguyễn Thái Ngọc Duy, Feb 6, 2012
  20. Junio C HamanoFeb 6, 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.