* Behavior of 'git add \*.txt': bug or feature?
@ 2009-09-16 19:46 Matthieu Moy
2009-09-16 20:30 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Matthieu Moy @ 2009-09-16 19:46 UTC (permalink / raw)
To: git
Hi,
I find the behavior of 'git add \*.txt' strange: for adding untracked
files, it considers \*.txt as a pattern to match, but for updating
existing file's staged content, it seems to consider it as a filename:
$ git status
# On branch master
# Changed but not updated:
#
# modified: three.txt
# modified: two.txt
#
# Untracked files:
#
# one.txt
no changes added to commit (use "git add" and/or "git commit -a")
$ git add -v '*.txt'
add 'one.txt'
$ git add -v '*.txt'
$
I would have expected this "git add -v '*.txt'" to update the staged
content of two.txt and three.txt too.
It this the intended behavior? If so, what's the rationale for this?
Thanks,
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Behavior of 'git add \*.txt': bug or feature?
2009-09-16 19:46 Behavior of 'git add \*.txt': bug or feature? Matthieu Moy
@ 2009-09-16 20:30 ` Junio C Hamano
2009-09-16 21:26 ` Matthieu Moy
2009-09-17 14:25 ` Clemens Buchacher
0 siblings, 2 replies; 4+ messages in thread
From: Junio C Hamano @ 2009-09-16 20:30 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> It this the intended behavior? If so, what's the rationale for this?
I strongly suspect that it comes from the fact that we have two
definitions and three implementations of pathspec-aware tree traversal.
One family is unaware of shell-glob wildcards (they only do leading
directory path match) while the other know both leading directory path and
shell-glob.
It is on the list of long-term items to fix, as the change required is
quite involved.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Behavior of 'git add \*.txt': bug or feature?
2009-09-16 20:30 ` Junio C Hamano
@ 2009-09-16 21:26 ` Matthieu Moy
2009-09-17 14:25 ` Clemens Buchacher
1 sibling, 0 replies; 4+ messages in thread
From: Matthieu Moy @ 2009-09-16 21:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano <gitster@pobox.com> writes:
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> It this the intended behavior? If so, what's the rationale for this?
>
> I strongly suspect that it comes from the fact that we have two
> definitions and three implementations of pathspec-aware tree traversal.
> One family is unaware of shell-glob wildcards (they only do leading
> directory path match) while the other know both leading directory path and
> shell-glob.
>
> It is on the list of long-term items to fix, as the change required is
> quite involved.
OK, that answers my question.
Thanks,
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Behavior of 'git add \*.txt': bug or feature?
2009-09-16 20:30 ` Junio C Hamano
2009-09-16 21:26 ` Matthieu Moy
@ 2009-09-17 14:25 ` Clemens Buchacher
1 sibling, 0 replies; 4+ messages in thread
From: Clemens Buchacher @ 2009-09-17 14:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Matthieu Moy, git
On Wed, Sep 16, 2009 at 01:30:15PM -0700, Junio C Hamano wrote:
> I strongly suspect that it comes from the fact that we have two
> definitions and three implementations of pathspec-aware tree traversal.
> One family is unaware of shell-glob wildcards (they only do leading
> directory path match) while the other know both leading directory path and
> shell-glob.
We had a discussion about this in January:
Subject: Re: [PATCH 3/3] implement pattern matching in ce_path_match
Message-ID: <7vljtd20m6.fsf@gitster.siamese.dyndns.org>
http://article.gmane.org/gmane.comp.version-control.git/105679
I was going to fix it, but motivation left me after the above discussion,
since I don't really care about this feature.
Clemens
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-09-17 14:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-16 19:46 Behavior of 'git add \*.txt': bug or feature? Matthieu Moy
2009-09-16 20:30 ` Junio C Hamano
2009-09-16 21:26 ` Matthieu Moy
2009-09-17 14:25 ` Clemens Buchacher
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).