All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Junio C Hamano <gitster@pobox.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCHv2 3/3] git-add: rename -u to -a
Date: Mon, 28 Feb 2011 10:49:11 +0100	[thread overview]
Message-ID: <4D6B6F97.8030409@drmicha.warpmail.net> (raw)
In-Reply-To: <vpqwrkkpkea.fsf@bauges.imag.fr>

Matthieu Moy venit, vidit, dixit 28.02.2011 10:40:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> But just how useful is our default that "git add" is a no-op?
> 
> I dont care very much myself, but if you consider "git add ." as a
> potentially destructive operation (discards changes that may be precious
> in the index), then it's good that "git add" is a no-op.
> 
> Many beginners will try commands expecting to get a help message or a
> hint on how to use it when ran without argument (principle of least
> surprise)
> 
> Like:
> 
> $ ls
> file1 file2
> => oh, so "ls" lists files.
> $ rm
> rm: missing operand
> Try `rm --help' for more information.
> => ok, so rm needs more operands
> 
> A user typing "git add" just "to see what happens" may be disapointed to
> have all its files added. In particular since "git add" is silent by
> default, hence
> 
> # let's see what happens ...
> $ git add
> $ 
> # ok, nothing happened ...
> # continue hacking without noticing that a bunch of files have been added.

No no, I said "add" would default to what "-u" does now (see below).

A user "starting to experiment with add" while have nothing in the index.

> Mercurial has taken the other way, making "hg add" add everything by
> default, and some users do complain:
> 
> http://osdir.com/ml/version-control.mercurial.general/2007-08/msg00316.html

Since when do we care about them (as in "hg", not in "users", mind you...).

> If you change this for Git, you'll have people complaining about
> backward compatibility plus people complaining about least surprise :-(
> 
>> - "add" should be about tracked paths by default (default pathspec "."),

See, here!

>>
>> - "commit -a,--add <addopts>" be "add <addopts> && commit", and
>>
>> - "-A,--all pathspec" (default pathspec ".") be about tracked and
>> untracked paths (whether add or commit).
> 
> Today, "git add ." adds new content in tracked files, and new files, but
> doesn't notice files deletions. Did I miss something, or is there no way
> to do that with your proposal?

What in

> That would need a proper migration
> plan etc., and some thinking about -i/-o. Just brain-storming.

reads "proposal" to you?

Besides, current "git add ." is a really strange thing, doing more and
less than "git add -u", mixing "update" with "track", but not
completely. What is it even good for? ;)

(We could have an option for that, of course. Have I mentioned "radical"?)

Michael

  reply	other threads:[~2011-02-28  9:52 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
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 [this message]
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=4D6B6F97.8030409@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.