Thread (92 messages) 92 messages, 29 authors, 2016-06-15

Re: Updated git HOWTO for kernel hackers

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-06-23 16:04:29
Also in: lkml


On Thu, 23 Jun 2005, Jeff Garzik wrote:
Chuckle.  What does one call a Freudian slip, in computer-land?
A "Knuthian slip"?
WARNING:  You have previously called git-changes-script quite ugly (not 
surprising), and this 'git log x..y' will probably replace it in my 
usage, long term.
Even short-term, you could actually make it prettier. 

You can actually use git across multiple directories by setting the
GIT_ALTERNATE_OBJECT_DIRECTORIES environment variable to point to the
alternate ones, so you should be able to do a "compare with remote" with 
something like this:

	export GIT_ALTERNATE_OBJECT_DIRECTORIES=$remote/.git/objects
	remote_head=$(cat $remote/.git/HEAD)
	git log $remote_head..

which should literally give a nice log of what is in your HEAD but not in 
$remote_head. And if you want to see it the other way? Just change the 
last line to

	git log HEAD..$remote_head

and voila, you're done.

The nice thing about this approach is that this works with other git
programs too, ie you can replace "git log" with "gitk", and suddenly you
see graphically the commits that are in your tree but not in the remote
HEAD or vice versa.

Yeah, yeah, totally untested and maybe I'm talking through by *ss, but it 
should work in theory.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help