From: Santi <sbejar@gmail.com>
To: "Linus Torvalds" <torvalds@osdl.org>
Cc: git@vger.kernel.org, "Junio C Hamano" <junkio@cox.net>
Subject: Re: "git add $ignored_file" fail
Date: Wed, 17 May 2006 00:42:25 +0200 [thread overview]
Message-ID: <8aa486160605161542u704ccf03w@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0605161526210.16475@g5.osdl.org>
2006/5/17, Linus Torvalds <torvalds@osdl.org>:
>
>
> On Wed, 17 May 2006, Santi wrote:
> >
> > When you try to add ignored files with the git-add command it
> > fails because the call to:
> >
> > git-ls-files -z \
> > --exclude-from="$GIT_DIR/info/exclude" \
> > --others --exclude-per-directory=.gitignore
> >
> > does not output this file because it is ignored. I know I can do it with:
> >
> > git-update-index --add $ignored_file
> >
> > I understand the behaviour of git-ls-files but I think it is no the
> > expected for git-add, at least for me.
>
> Well, the thing is, git-add doesn't really take a "file name", it takes a
> filename _pattern_.
>
> Clearly we can't add everything that matches the pattern, because one
> common case is to add a whole subdirectory, and thus clearly the
> .gitignore file must override the pattern.
>
> So it's consistent that it overrides it also for a single filename case,
> no?
>
It's consistent from an implementation point of view, but not from the
(my?) user point of view. This is why I say I understand it for
git-ls-files. For the case of git-add even the usage and the man page
talk about <file>...
Clearly for the case of a whole subdirectory, or even ".", the
.gitignore file must override the pattern, but not for the case of a
pattern that is a single existing file.
Santi
next prev parent reply other threads:[~2006-05-16 22:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-16 22:07 "git add $ignored_file" fail Santi
2006-05-16 22:28 ` Linus Torvalds
2006-05-16 22:41 ` Jakub Narebski
2006-05-16 22:42 ` Santi [this message]
2006-05-17 11:08 ` Johannes Schindelin
[not found] ` <81b0412b0605170604i689a8f7axa5aeb7752dc72072@mail.gmail.com>
2006-05-17 13:41 ` Santi
2006-05-17 13:46 ` Jakub Narebski
2006-05-17 19:23 ` Pavel Roskin
[not found] ` <20060517153903.6b896fdd.seanlkml@sympatico.ca>
2006-05-17 19:39 ` Sean
2006-05-17 19:52 ` Jakub Narebski
2006-05-17 19:56 ` Pavel Roskin
2006-05-17 20:26 ` Linus Torvalds
2006-05-17 20:35 ` Jakub Narebski
2006-05-17 20:53 ` Linus Torvalds
2006-05-17 23:07 ` Junio C Hamano
2006-05-17 23:20 ` Linus Torvalds
2006-05-17 13:48 ` Johannes Schindelin
2006-05-17 14:49 ` Linus Torvalds
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=8aa486160605161542u704ccf03w@mail.gmail.com \
--to=sbejar@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.org \
/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).