Re: Kernel headers git tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 14 Jul 2006, David Woodhouse wrote:
> On Thu, 2006-07-13 at 22:52 -0700, Linus Torvalds wrote:
> > Btw, I'm actually surprised that my path simplification didn't filter out 
> > the "." and make it mean exactly the same as not giving a path at all. I 
> > thought I had done that earlier, but if you say "-- ." matters, then it 
> > obviously does..
> 
> In this specific case where I have a whole bunch of commits which don't
> actually change anything, it definitely does make a difference...

Yes, I'm looking at "get_pathspec()", and noting that it really isn't able 
to optimize away the ".".

It does turn it into an empty string (which is correct - git internally 
does _not_ ever understand the notion of "." as the current working 
directory), but it doesn't ever do the optimization of noticing that a 
pathspec that consists solely of an empty string is "equivalent" to an 
empty pathspec.

Which is exactly what you _want_ in this case, of course, but maybe we 
should add a test-case for that, so that we never do that trivial 
optimization by mistake.

Maybe something like

	git init-db
	echo Hello > a
	git add a
	git commit -m "Initial commit" a

and then:

	commit=$(echo "Unchanged tree" | git-commit-tree "HEAD^{tree}" -p HEAD)
	git-rev-list $commit | wc -l 
	git-rev-list $commit -- . | wc -l

where the first git-rev-list should return 2, and the second one should 
return 1.

Anybody want to write that as a test, verify it, and send Junio a patch?

		Linus
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]