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

Re: Inconsistency with -a vs -A

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 18, 2011, 15:04 UTC
Message-ID
<7v7hara9ea.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vbp03ann1.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> The only uppercase "-A" I am aware of are these two, and both are about
> "everything under the sun", which is a special case in the context of SCM.
> All the other usual "all" options are spelled "-a".
>
> I think we could give "add -a" as a synonym to "add -u", which would be a
> safe addition that would not break any existing user, if we wanted to be
> picky and really make things more consistent.
>
> Also in the longer term, I suspect we probably should deprecate "add -A"
> as a failed experiment, if we are not going to do "commit -A" after all.
> "add ." and "add :/" (from a subdirectory) would be much less ambiguous,
> and it will get rid of the only instance of "-A" that means something
> slightly different from the usual "all".

The last paragraph is really "in the _longer_ term". Two things need to happen before we get there:

 - we need to teach "add ." or with any pathspec to do what the current
   "-A" with the same pathspec does implicitly, while keeping "add"
   without any pathspec a no-op.
 - ":/" (from root, whole tree) needs to be added.  We already know how
   that pathspec will behave and how to implement it.

The former may need a bit of thought and discussion, but I personally think that "git add" with pathspec should notice deletion of tracked paths. It may have been Ok back when "git add $path" was only for adding new paths, but we have changed from that semantics a long time ago and the command deals with both tracked and untracked paths. It does not make much sense to special case tracked but removed paths anymore [*1*]

The latter we know we will have in a release or two.
[Footnote]
* The code does not do any special casing at the design level, but they
fall within the cracks of the implementation.
Previous: Junio C Hamano
Message 4 of 4 in “Inconsistency with -a vs -A”
  1. Bradly FeeleyApr 18, 2011
  2. Michael J GruberApr 18, 2011
  3. Junio C HamanoApr 18, 2011
  4. Junio C HamanoApr 18, 2011

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.