git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git add <single file> and git add <list of files> behave differentely for ignored files
@ 2014-12-04  9:06 Guilherme
  2014-12-04 11:11 ` Konstantin Khomoutov
  2014-12-04 15:02 ` Michael J Gruber
  0 siblings, 2 replies; 7+ messages in thread
From: Guilherme @ 2014-12-04  9:06 UTC (permalink / raw)
  To: git@vger.kernel.org

Hello,

I reported this issue on the git-user mailing list and they redirected me here.

The problem I have observed is that with a ignored path `git add
<single file>` behaves differently then `git add <list of files>`.

I my git/info/excludes file i have

/COM/config
!COM/config/Project.gny

The file COM/config/Project.gny has already been added to the
repository via `git add -f`.

When doing

    git add -- COM/config/Projec.gny

git will not complain but when doing

    git add -- COM/config/Project.gny otherfiles.c

it will report:

    The following paths are ignored by one of your .gitignore files:
    COM/config
    Use -f if you really want to add them.
    fatal: no files added

This odd behaviour is also present in `git check-ignore`.

Before adding the file `git check-ignore` correctly reports the file
as ignored. After having added it via `git add -f` it won't report it
as ignored anymore.

Even if not a bug this behaviour is inconsistent and might want to be
addressed as it makes scripting a little bit harder.

Thank you.

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

end of thread, other threads:[~2014-12-08 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04  9:06 git add <single file> and git add <list of files> behave differentely for ignored files Guilherme
2014-12-04 11:11 ` Konstantin Khomoutov
2014-12-04 11:49   ` Guilherme
2014-12-04 15:02 ` Michael J Gruber
2014-12-04 15:23   ` [PATCH] check-ignore: clarify treatment of tracked files Michael J Gruber
2014-12-04 20:15     ` Junio C Hamano
2014-12-08 16:13       ` Michael J Gruber

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).