All of lore.kernel.org
 help / color / mirror / Atom feed
* Regression in `git add' in 1.7's 48ffef966c with a wildcard in  .gitignore
@ 2010-03-08 17:08 Ævar Arnfjörð Bjarmason
  2010-03-08 20:06 ` Michael J Gruber
  2010-03-08 20:20 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-03-08 17:08 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

I've discovered a regression in git-add the 1.7 release which I can't
see reported anywhere. It was introduced in
48ffef966c762578eb818c0c54a7e11dd054f5db by Junio C Hamano at Fri Jan
8 23:05:41 2010.

The problem is that when you have a .gitignore file with * in it
git-add will only complain that you're trying to add ignored files if
they're in the top level of your repository, for files in
subdirectories it now just silently fails:

    $ mkdir test && cd test && git init
    $ echo "*" > .gitignore
    $ mkdir directory && touch foo directory/foo

So far so good, now if I try to add 'foo' I get an error from both 1.6 and 1.7:

    $ git add foo
    The following paths are ignored by one of your .gitignore files:
    foo

But 1.7 just silently fails to add directory/foo to the index:

    $ git add directory/foo
    $ echo $?
    0

1.6 however does the right thing:

    $ git add directory/foo
    The following paths are ignored by one of your .gitignore files:
    directory/foo
    $ echo $?
    128

A test script / bisect script I used is available at
git://github.com/avar/git-add-fail.git I couldn't figure out how to
turn it into a Git test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-08 20:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-08 17:08 Regression in `git add' in 1.7's 48ffef966c with a wildcard in .gitignore Ævar Arnfjörð Bjarmason
2010-03-08 20:06 ` Michael J Gruber
2010-03-08 20:21   ` Ævar Arnfjörð Bjarmason
2010-03-08 20:20 ` Junio C Hamano

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.