git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* negated list in .gitignore no fun
@ 2008-12-18 21:53 jidanni
  2008-12-18 22:34 ` Boyd Stephen Smith Jr.
  2008-12-18 22:38 ` Linus Torvalds
  0 siblings, 2 replies; 4+ messages in thread
From: jidanni @ 2008-12-18 21:53 UTC (permalink / raw)
  To: git; +Cc: joey

I discovered git is so negative: it has very good .gitignore negative
matching facilities, but not as good positive matching facilities.
(Maybe positive glob lists are merely fed to git-add from the command line.)

I had dreams of tracking only a few files in a large tree.
I thought I would maintain that list as a negated list in .gitignore,
and then always use "git-add ." to keep git's index reflecting my list.

However that's just not possible.

# head -n 5 .gitignore
*
!X11/xorg.conf
!anacrontab
!apt/apt.conf.d/10jidanni
!apt/sources.list
# git-add .
But git-status only shows anacrontab got added. None of the files in
the subdirectories get added. We continue,
# sed -n s/^!//p .gitignore|xargs git-add #no help!
# sed -n s/^!//p .gitignore|xargs -n 1 git-add #Geez. Finally worked.
OK, I suppose my next step is just to rm .gitignore and just add any
future files I want to add to my list one by one with git-add... like
git was designed to do in the first place. OK, thanks. Bye.
Next episode: some kind of middle ground with etckeeper.

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

end of thread, other threads:[~2008-12-18 23:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 21:53 negated list in .gitignore no fun jidanni
2008-12-18 22:34 ` Boyd Stephen Smith Jr.
2008-12-18 22:38 ` Linus Torvalds
2008-12-18 22:54   ` Linus Torvalds

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