git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Michael J Gruber <git@drmicha.warpmail.net>,
	git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCHv2 3/3] git-add: rename -u to -a
Date: Sun, 27 Feb 2011 22:40:19 -0800	[thread overview]
Message-ID: <7v39n8ll0s.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: AANLkTintuaM+p7XKmTy+hOa80nkbph7MP00cvEA+oHZJ@mail.gmail.com

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> Should -u now print warnings to help script writers migrate to -a? Or
> do we plan to keep hidden -u forever?

I'd rather not to apply 2 and 3 from this series for now, until we have a
more reasonable solution.  Yes, I said "add --add-tracked" _might_ be
worth considering, but that is in contrast to "add --tracked" which was
out of the question.

Like it or not, "add -u" has already been quite established, and the 'u'
stands for "update(d)" (i.e. "run update-index to the files updated in the
work tree"), which I think makes perfect sense.

I would suggest just keeping "add -u" as is.  As I said in the review in
the previous round, if Michael really wants to, it probably is Ok to give
"commit -a" a synonym "commit --update".

I further find that the verb form "--update" doesn't rhyme well as the
option name to select what classes of paths are operated on; it might make
sense to change the fully spelled version of the option for both commands
from "--update" to "--updated" while we are at it.  This would not bother
end users at all, as parse-options will complete "--update" typed by the
user or in scripts uniquely to "--updated" just fine.

Michael seems to be resisting against introducing "commit --update", and I
understand one reason is because "status -u" means something totally
different from "updated paths"; I am somewhat sympathetic to that fear.

But we started making "status" independent from being "commit --dry-run"
in 1.7.0 for a reason---it would be Ok if "status -u" means something
completely different from "commit -u", _as long as_ existing "commit -u"
does not make much sense.  I think that is the case here.

I don't think the distinction between "commit -a" vs "commit -A" is all
that bad.  When people talk about "all" files in the context of SCM, we
almost always think about already tracked paths, and other files do not
get into the picture unless you first "add" them (this is not limited to
git; even "svn commit" or "cvs commit" wouldn't touch untracked paths).
For this reason, it is not unexpected that the normal version of "all"
excludes untracked files, and you would need to ask for the unusual
version of "all" to include them (i.e. "commit -A" or "add -A") when
dealing with usual SCM commands.

The same argument however does _NOT_ hold for "add", as "add" (especially
in other SCM's context) is about making paths that haven't been tracked so
far into tracked ones; iow, it is natural to expect that "all" would mean
more than normal "all" (i.e. "all what are tracked") in the context of the
"add" command (and "add" command only).

IOW, renaming "add -u" to "add -a" and having "add -a" vs "add -A" is more
confusing than necessary, because of the nature of the word "add" that has
a connotation of affecting paths that have been untracked so far, and
keeping "add -u" and "add -A" distinct to avoid confusion is probably a
reasonable solution to avoid "which variant of 'all' are we talking about"
confusion.  This compromise unfortunately does not give us the uniformity
between '-a' vs '-A' applied to 'add' vs 'commit'.  That is why I would
suggest '-u' vs '-A' if we _really_ want to have such a uniformity between
two commands, i.e. not adding "add -a" but adding "commit -u".

  reply	other threads:[~2011-02-28  6:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 14:45 [PATCH/RFC 0/3] add/commit -u/-a/-A Michael J Gruber
2011-02-25 14:45 ` [PATCH/RFC 1/3] git-add: make -A description clearer vs. -u Michael J Gruber
2011-02-25 19:04   ` Junio C Hamano
2011-02-25 14:45 ` [PATCH/RFC 2/3] git-commit: rename --all to --track Michael J Gruber
2011-02-25 19:08   ` Junio C Hamano
2011-02-25 14:45 ` [PATCH/RFC 3/3] git-add: rename -u to -a Michael J Gruber
2011-02-25 19:40   ` Junio C Hamano
     [not found] ` <7vr5aw9b7m.fsf@alter.siamese.dyndns.org>
2011-02-26 10:30   ` [PATCH/RFC 0/3] add/commit -u/-a/-A Michael J Gruber
2011-02-27 15:50     ` [PATCHv2 " Michael J Gruber
2011-02-27 15:50       ` [PATCHv2 1/3] git-add: make -A description clearer vs. -u Michael J Gruber
2011-02-27 23:35         ` Junio C Hamano
2011-02-27 15:50       ` [PATCHv2 2/3] git-commit: rename --all to --all-tracked Michael J Gruber
2011-02-27 15:50       ` [PATCHv2 3/3] git-add: rename -u to -a Michael J Gruber
2011-02-27 16:38         ` Nguyen Thai Ngoc Duy
2011-02-28  6:40           ` Junio C Hamano [this message]
2011-02-28  8:30             ` Michael J Gruber
2011-02-28  8:42               ` Miles Bader
2011-02-28  8:46                 ` Michael J Gruber
2011-02-28  8:53                   ` Miles Bader
2011-02-28  9:05                     ` Snipping on this list (Was: Re: [PATCHv2 3/3] git-add: rename -u to -a) Michael J Gruber
2011-02-28 18:18                       ` Snipping on this list Junio C Hamano
2011-02-28  9:03                   ` [PATCHv2 3/3] git-add: rename -u to -a Miles Bader
2011-02-28  9:08                     ` Michael J Gruber
2011-02-28  9:40               ` Matthieu Moy
2011-02-28  9:49                 ` Michael J Gruber
2011-02-28 10:01                   ` Tor Arntsen
2011-02-28 10:03                     ` Michael J Gruber
2011-02-28 10:05                   ` Matthieu Moy
2011-02-28 10:53                     ` Michael J Gruber
2011-02-28 18:21                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v39n8ll0s.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).