All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santi <sbejar@gmail.com>
To: "Alex Riesen" <raa.lkml@gmail.com>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: "git add $ignored_file" fail
Date: Wed, 17 May 2006 15:41:05 +0200	[thread overview]
Message-ID: <8aa486160605170641p2ab8704o@mail.gmail.com> (raw)
In-Reply-To: <81b0412b0605170604i689a8f7axa5aeb7752dc72072@mail.gmail.com>

2006/5/17, Alex Riesen <raa.lkml@gmail.com>:
> On 5/17/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > >
> > > It's consistent from an implementation point of view, but not from the
> > > (my?) user point of view.
> >
> > So, you told git to ignore the file. And then you say "please add it". I
> > find it highly consistent that git does not do anything, because *you*
> > decided it should ignore it in the first place.
> >
>
> Well, he didn't say to ignore exactly this file. And Santi didn't know
> git-add uses git-ls-files here. So it actually is unexpected for a novice.
> It was unexpected for me too, until I looked into git-add.sh
>

Actually I'm not a novice, but that is the point.

In the other way, now I find the value of being able to say:

$ git add t*

and be sure that it does not add an ignored file. Unfortunately
git-add cannot distinguish between both. So what I propose is to
document it explicitly, something like:

diff --git a/Documentation/git-add.txt /Documentation/git-add.txt
index 5e31129..42f1e33 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -7,18 +7,20 @@ git-add - Add files to the index file

 SYNOPSIS
 --------
-'git-add' [-n] [-v] [--] <file>...
+'git-add' [-n] [-v] [--] <filespec>...

 DESCRIPTION
 -----------
 A simple wrapper for git-update-index to add files to the index,
 for people used to do "cvs add".

+It only adds non-ignored files, to add ignored files use
+"git-update-index --add".

 OPTIONS
 -------
-<file>...::
-       Files to add to the index.
+<filespec>...::
+       Files to add to the index (see git-ls-files).

 -n::
         Don't actually add the file(s), just show if they exist.
diff --git a/git-add.sh b/git-add.sh
index d6a4bc7..394793f 100755
--- a/git-add.sh
+++ b/git-add.sh
@@ -1,6 +1,6 @@
 #!/bin/sh

-USAGE='[-n] [-v] <file>...'
+USAGE='[-n] [-v] <filespec>...'
 SUBDIRECTORY_OK='Yes'
 . git-sh-setup

  parent reply	other threads:[~2006-05-17 13:41 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 [this message]
2006-05-17 13:46           ` Jakub Narebski
2006-05-17 19:23             ` Pavel Roskin
2006-05-17 19:39               ` Sean
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=8aa486160605170641p2ab8704o@mail.gmail.com \
    --to=sbejar@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    /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 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.