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

Re: [RFC] A unique way to express "all" (vs "add vs "update") ?

From
Junio C Hamano <junkio@cox.net>
Date
Dec 15, 2006, 21:55 UTC
Message-ID
<7vzm9on7su.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<4582906A.7020204@op5.se>
Andreas Ericsson <ae@op5.se> writes:
Show 18 quoted lines
> Jerome Lovy wrote:
> ...
> But this isn't "commit" at all. It's "git add".
>
>>     (This would allow the typical usage "git commit -u ." which is
>>     barely longer than the current "git commit -a")
>>
>> For interface completeness, "git commit -u|--update <files>" could also
>> exist but would probably be of no use.
>>
>> To sum up, "all" would be consistently expressed with the <dir> syntax.
>> "git commit -a" would not mean "--all" anymore. Lastly, a distinction
>> would be made between "--add" and "--update":
>> - "git commit -add" would have the same semantics as "git add"
>
> This is bollocks. git commit should commit things. We'll be in some
> serious trouble if "git commit -a" stops working the way it has and
> starts just adding things to index.

I agree everything you said in your response to Jerome, except for one thing.

We might want to allow:
	$ git commit untracked.c tracked.c
to internally 'git add' untracked files while making the commit.
Currently you would get:
	$ git commit untracked.c tracked.c
        error: pathspec 'untracked.c' did not match any file(s) known to git.
        Did you forget to 'git add'?

which is usable, safe, and helpful, so changing it to automatically including it would not help the end user that much and one could argue that it removes the safety which is a bad idea.

So, let's not do this; sorry for the noise.
Previous: Andreas EricssonNext: Jerome Lovy
Message 3 of 6 in “[RFC] A unique way to express "all" (vs "add vs "update") ?”
  1. Jerome LovyDec 15, 2006
  2. Andreas EricssonDec 15, 2006
  3. Junio C HamanoDec 15, 2006
  4. Jerome LovyDec 18, 2006
  5. Carl WorthDec 15, 2006
  6. Jerome LovyDec 18, 2006

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.