Re: file rename causes history to disappear

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff Garzik <jeff@...>
Cc: Git Mailing List <git@...>
Date: Wednesday, September 6, 2006 - 12:37 pm

On Wed, 6 Sep 2006, Linus Torvalds wrote:

Side note: one thing that I wanted to do, but never got around to, is to 
allow wildcards in the tree-parsing code. It might be too expensive, but 
it's still occasionally something I'd like to do:

	git log -- 'mm/*.c'

to track every single C file in the VM (even if they don't exist right 
_now_).

Notice the difference between

	git log mm/*.c

and the above idea - the latter does actually work, but it only tracks the 
C files that exist right now under mm/. But it should be possible (and is 
potentially useful) to let the wildcard act over the history, rather than 
just a single point in time.

Because one additional advantage of thinking in terms of pathnames is 
exactly the fact that wildcards make sense in a way that they do _not_ 
make sense if you think of tracking "inodes". Exactly because "pathnames 
are forever", and a pathname has validity and exists regardless of whether 
a repository contains a _file_ with that name at any particular point in 
time.

So right now git does do the wildcard thing, but only for "git ls-files" 
(and through that, things like "git add", which used to be implemented in 
terms of ls-files). So you can do

	git add '*.c'

to add all C files (recursively - it's not the shell matcher).

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
file rename causes history to disappear, Jeff Garzik, (Wed Sep 6, 10:52 am)
Re: file rename causes history to disappear, Linus Torvalds, (Wed Sep 6, 11:38 am)
Re: file rename causes history to disappear, Jeff Garzik, (Wed Sep 6, 11:46 am)
Re: file rename causes history to disappear, Linus Torvalds, (Wed Sep 6, 12:14 pm)
Re: file rename causes history to disappear, Linus Torvalds, (Wed Sep 6, 12:37 pm)
Re: file rename causes history to disappear, Junio C Hamano, (Wed Sep 6, 3:29 pm)
Re: file rename causes history to disappear, Alex Riesen, (Thu Sep 7, 6:16 am)
Re: file rename causes history to disappear, Randal L. Schwartz, (Wed Sep 6, 5:45 pm)
Re: file rename causes history to disappear, Junio C Hamano, (Wed Sep 6, 8:52 pm)
Re: file rename causes history to disappear, Timo Hirvonen, (Wed Sep 6, 11:05 am)