Re: Updated git HOWTO for kernel hackers
From: Linus Torvalds
Date: Thu Jun 23 2005 - 11:06:04 EST
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/