git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: "git add $ignored_file" fail
Date: Wed, 17 May 2006 16:07:35 -0700	[thread overview]
Message-ID: <7vd5ecb688.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0605171342370.10823@g5.osdl.org> (Linus Torvalds's message of "Wed, 17 May 2006 13:53:09 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

> Well, with the new-and-improved builtin "git add", you could probably do 
> something like the appended (on top of my most recent patch).
>
> It says
>
> 	No added files - did you perhaps mean to do a 'git update-index'?
>
> whenever it finds that "git add" has ignored a file and not actually added 
> anything. That, btw, can happen either because it refused to see the file 
> in the first place (ie it was ignored), or because all the files listed 
> were already added.
>
> In both cases the warning may or may not be sensible.
>
> Anyway, I dunno. I don't have any strong opinions on this.

If you give a pattern that would match two files but one of them
were hidden by .gitignore, this approach would not help you
much.

Even if we wanted to say something like "if the user explicitly
tells us to add etc/mtab~ by spelling it out, we should ignore
*~ entry in .gitignore", the shell expansion bites us because it
is done before we get to what the user give us.  We cannot
distinguish that with the user typing etc/?tab* for example.

If somebody (Jakub, perhaps?) cares strong enough, we could show
by default "matched the pathspec but ignored by .gitignore"
paths with fprintf(stderr, "ignoring '%s'\n"), and have an
option -q to squelch it.

I do not have strong feeling on this, so I'll see if somebody
comes up with a better implementation.

  reply	other threads:[~2006-05-17 23:07 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
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 [this message]
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=7vd5ecb688.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --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).