git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Brockman <gdb@MIT.EDU>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jens.Lehmann@web.de
Subject: Re: [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked  files
Date: Wed, 11 Aug 2010 23:19:53 -0400	[thread overview]
Message-ID: <AANLkTi=uKceZZGLDP5+9DN8yBtWwt070ftWSc3J-Y63i@mail.gmail.com> (raw)
In-Reply-To: <7vaaosv8lt.fsf@alter.siamese.dyndns.org>

> Here is the one that troubles me the most:
>
>  (6) git add dir/f*
>
> This _looks_ like very explicitly named from git's point of view, but from
> the end user's point of view it is not.  Depending on presense (or absense)
> of another file whose name begins with 'f' in the directory, the add will
> be either prevented or silently accepted.
>
> I am not sure what the best solution would be; I tend to think the current
> behaviour is slightly saner in the face of shell globbing.
I agree that case seems rather gray.  But in what circumstances would
you expect it to be a problem?  I think only if the user has a tracked
file with local changes that he or she does not wish to be committed.
How common is it that a user will do this and expect gitignores to
protect that file's changes  I don't believe I've ever tried that in
practice, but I also wouldn't trust gitignores to protect me from
myself, as a careless 'git commit -a' would still commit my changes.

Perhaps one could add some syntax to .gitignore files that configures
this behavior.  I can come up with a proposal for something along
those lines if you believe it would be useful.  However, I don't have
great use case for it, unless we also make 'git commit -a' and friends
respect this configuration.  (As an example, perhaps a line like
+dir
would mean that file should be excluded even if the user runs 'git add
dir/file' while a line like
dir
would mean that 'git add dir/file' should succeed if dir/file is
already tracked.)

  reply	other threads:[~2010-08-12  3:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11  7:03 [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked files Greg Brockman
2010-08-11 12:24 ` Ævar Arnfjörð Bjarmason
2010-08-11 20:50   ` Jens Lehmann
2010-08-12  2:11     ` Greg Brockman
2010-08-11 18:22 ` Junio C Hamano
2010-08-11 18:36   ` Greg Brockman
2010-08-12  2:59     ` Junio C Hamano
2010-08-12  3:19       ` Greg Brockman [this message]
2010-08-12  8:30 ` Matthieu Moy
2010-08-12 15:54   ` Greg Brockman
2010-08-12 16:31     ` Matthieu Moy
2010-08-12 20:00     ` Junio C Hamano
2010-08-12 20:19       ` Greg Brockman
2010-08-12 20:40         ` Jonathan Nieder
2010-08-12 20:26     ` Ævar Arnfjörð Bjarmason
2010-08-18  9:07       ` Greg Brockman
2010-08-18  9:29         ` [RFC/PATCH] Add test case for dealing with a tracked file in an ignored directory Greg Brockman
2010-08-18  9:43           ` Greg Brockman
2010-08-18  9:50           ` Matthieu Moy
2010-08-19  7:52             ` Greg Brockman
2010-08-19  8:50               ` Matthieu Moy
2010-08-18 13:43           ` Ævar Arnfjörð Bjarmason
2010-08-18 13:47             ` Matthieu Moy
2010-08-18 14:02               ` Ævar Arnfjörð Bjarmason
2010-08-19  0:00               ` Jonathan Nieder
2010-08-19  0:24                 ` Ævar Arnfjörð Bjarmason
2010-08-25  3:13                   ` Jonathan Nieder
2010-08-29 18:27                     ` Ævar Arnfjörð Bjarmason

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='AANLkTi=uKceZZGLDP5+9DN8yBtWwt070ftWSc3J-Y63i@mail.gmail.com' \
    --to=gdb@mit.edu \
    --cc=Jens.Lehmann@web.de \
    --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.
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).