git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] git add: notice removal of tracked paths by default
Date: Wed, 20 Apr 2011 01:57:58 -0400	[thread overview]
Message-ID: <20110420055758.GC28597@sigill.intra.peff.net> (raw)
In-Reply-To: <7v1v0y59tv.fsf@alter.siamese.dyndns.org>

On Tue, Apr 19, 2011 at 12:18:20PM -0700, Junio C Hamano wrote:

> Make "git add" to pretend as if "-A" is given when there is a pathspec on
> the command line.  "git add" without any argument continues to be a no-op.

I like your proposed semantics much better. I remember many times early
on with git cursing the current behavior, until I finally trained myself
to do "git add -A".

>  This might not be such a good idea, and I do not have a strong opinion
>  for this change, but merely a weatherbaloon.
> 
>  Having "git add ." notice removals might lead to mistakes ("oh, I only
>  meant to record additions, and didn't want to record the removals"), but
>  at the same time, leaving it not notice removals would lead to mistakes
>  by the other people ("I added, removed and edited different paths, but
>  why only removals are ignored?").

I suspect most people will want the new semantics, because no matter
what your overall workflow, it is generally going to be some variant of:

  1. hack hack hack
  2. tell git about changes

And you don't really care about deletions versus modifications, you just
want them all added. But you probably _do_ care about additions versus
modififications, since step 1 often involves creating cruft that should
remain untracked (whereas it very rarely involves _deleting_ precious
files). And that's why we have "add -u", which should not go away.

My biggest worry would be people saying "eh? Add removes my files? That
makes no sense!" But we more or less already have that with "add -u",
and I think people have learned to accept that it is about "add the
current state to the index" and not "add files to git".

-Peff

  parent reply	other threads:[~2011-04-20  5:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 19:18 [RFC/PATCH] git add: notice removal of tracked paths by default Junio C Hamano
2011-04-19 19:46 ` Sverre Rabbelier
2011-04-19 21:41   ` Junio C Hamano
2011-04-19 21:47     ` Sverre Rabbelier
2011-04-20  5:57 ` Jeff King [this message]
2011-04-20  8:18   ` Michael J Gruber

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20110420055758.GC28597@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).