git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "git add $ignored_file" fail

From
PRPavel Roskin <proski@gnu.org>
Date
May 17, 2006, 19:23 UTC
Message-ID
<1147893786.16654.5.camel@dv>
In-Reply-To
<e4f9eo$b60$1@sea.gmane.org>
On Wed, 2006-05-17 at 15:46 +0200, Jakub Narebski wrote:
Show 12 quoted lines
> Santi wrote:
> 
> > 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.
> 
> Well, it could. If 'git add <filespec>' would result in NO files 
> added, take <filespec> as literate <file> (filename), regardless
> of ignores.
Can we apply the ignore rules to the directories but not the files?

This way, "git-add *" would add all files (rarely a good idea), whereas "git-add ." would respect the ignore rules.

Kludgy as it is, this approach would generally produce more expected results than others. If you let the shell expand the pattern, expect all junk to be added. If you let git expand the pattern, expect it to adhere to the ignore rules.

-- 
Regards,
Pavel Roskin
Previous: Jakub NarebskiNext: Sean
Message 8 of 18 in “"git add $ignored_file" fail”
  1. SantiMay 16, 2006
  2. Linus TorvaldsMay 16, 2006
  3. Jakub NarebskiMay 16, 2006
  4. SantiMay 16, 2006
  5. Johannes SchindelinMay 17, 2006
  6. SantiMay 17, 2006
  7. Jakub NarebskiMay 17, 2006
  8. Pavel RoskinMay 17, 2006
  9. SeanMay 17, 2006
  10. Jakub NarebskiMay 17, 2006
  11. Johannes SchindelinMay 17, 2006
  12. Linus TorvaldsMay 17, 2006
  13. Pavel RoskinMay 17, 2006
  14. Linus TorvaldsMay 17, 2006
  15. Jakub NarebskiMay 17, 2006
  16. Linus TorvaldsMay 17, 2006
  17. Junio C HamanoMay 17, 2006
  18. Linus TorvaldsMay 17, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.