[howto] Kernel hacker's guide to git, updated

22 messages, 10 authors, 2005-09-29 · open the first message on its own page

[howto] Kernel hacker's guide to git, updated

From: Jeff Garzik <hidden>
Date: 2005-09-29 11:03:12

Just updated my KHGtG to include the latest goodies available in 
git-core, the Linux kernel standard SCM tool:

	http://linux.yyz.us/git-howto.html

Several changes in git-core have made working with git a lot easier, so 
be sure to re-familiarize yourself with the development process.

Comments, corrections, and notes of omission welcome.  This document 
mainly reflects my typical day-to-day git activities, and may not be 
very applicable outside of kernel work.

	Jeff

Re: [howto] Kernel hacker's guide to git, updated

From: David Leimbach <hidden>
Date: 2005-09-29 15:18:53

On 9/29/05, Jeff Garzik [off-list ref] wrote:
Just updated my KHGtG to include the latest goodies available in
git-core, the Linux kernel standard SCM tool:

        http://linux.yyz.us/git-howto.html
Can you update the date on that page to reflect your latest updates? 
I was digging around with git yesterday and had a few surprises...
like checking out the kernel and being told I modified a bunch of
files I never touched.

- Dave

Re: [howto] Kernel hacker's guide to git, updated

From: Alberto Patino <hidden>
Date: 2005-09-29 16:03:27

On 9/29/05, David Leimbach [off-list ref] wrote:
On 9/29/05, Jeff Garzik [off-list ref] wrote:
quoted
Just updated my KHGtG to include the latest goodies available in
git-core, the Linux kernel standard SCM tool:

        http://linux.yyz.us/git-howto.html
Can you update the date on that page to reflect your latest updates?
- Dave
The  KHGtG page is updated to September 29, 2005.



--
Don't be evil!!!

Re: [howto] Kernel hacker's guide to git, updated

From: David Leimbach <hidden>
Date: 2005-09-29 16:13:21

On 9/29/05, Alberto Patino [off-list ref] wrote:
On 9/29/05, David Leimbach [off-list ref] wrote:
quoted
On 9/29/05, Jeff Garzik [off-list ref] wrote:
quoted
Just updated my KHGtG to include the latest goodies available in
git-core, the Linux kernel standard SCM tool:

        http://linux.yyz.us/git-howto.html
Can you update the date on that page to reflect your latest updates?
- Dave
The  KHGtG page is updated to September 29, 2005.
Awesome!  Thanks. :-)  I'm looking at cogito and darcs-git for working
with v9fs and other goodies.

Dave

Re: [howto] Kernel hacker's guide to git, updated

From: Oliver Neukum <oliver@neukum.org>
Date: 2005-09-29 19:08:14

Am Donnerstag, 29. September 2005 13:03 schrieb Jeff Garzik:
Just updated my KHGtG to include the latest goodies available in 
git-core, the Linux kernel standard SCM tool:

	http://linux.yyz.us/git-howto.html

Several changes in git-core have made working with git a lot easier, so 
be sure to re-familiarize yourself with the development process.

Comments, corrections, and notes of omission welcome.  This document 
mainly reflects my typical day-to-day git activities, and may not be 
very applicable outside of kernel work.
Unfortunately, following the instructions to the letter produces this:
oliver@oenone:~/linux-2.6> git checkout
usage: read-tree (<sha> | -m <sha1> [<sha2> <sha3>])

	Regards
		Oliver

Re: [howto] Kernel hacker's guide to git, updated

From: Jon Loeliger <hidden>
Date: 2005-09-29 19:35:10

On Thu, 2005-09-29 at 14:08, Oliver Neukum wrote:
Unfortunately, following the instructions to the letter produces this:
oliver@oenone:~/linux-2.6> git checkout
usage: read-tree (<sha> | -m <sha1> [<sha2> <sha3>])
Yeah.  See if you still have a .git/HEADS that symlinks
to a valid place or not...?

jdl

Re: [howto] Kernel hacker's guide to git, updated

From: Oliver Neukum <oliver@neukum.org>
Date: 2005-09-29 19:38:40

Am Donnerstag, 29. September 2005 21:34 schrieb Jon Loeliger:
On Thu, 2005-09-29 at 14:08, Oliver Neukum wrote:
quoted
Unfortunately, following the instructions to the letter produces this:
oliver@oenone:~/linux-2.6> git checkout
usage: read-tree (<sha> | -m <sha1> [<sha2> <sha3>])
Yeah.  See if you still have a .git/HEADS that symlinks
to a valid place or not...?
oliver@oenone:~/linux-2.6> ls -la .git/
insgesamt 14
drwxrwxr-x    6 oliver users  224 2005-09-29 21:06 .
drwxr-xr-x    3 oliver users   72 2005-09-29 20:45 ..
-rw-rw-r--    1 oliver users   19 2005-05-02 01:02 description
lrwxrwxrwx    1 oliver users   17 2005-09-29 21:06 HEAD -> refs/heads/master
-rw-------    1 oliver users   32 2005-09-29 21:06 index
drwxrwxr-x    2 oliver users  104 2005-09-11 21:41 info
drwxr-xr-x  260 oliver users 6240 2005-09-29 19:05 objects
drwxrwxr-x    4 oliver users   96 2005-05-02 02:15 refs
drwxr-xr-x    2 oliver users   72 2005-09-29 21:05 remotes
oliver@oenone:~/linux-2.6> ls -la .git/refs/
insgesamt 1
drwxrwxr-x  4 oliver users  96 2005-05-02 02:15 .
drwxrwxr-x  6 oliver users 224 2005-09-29 21:06 ..
drwxrwxr-x  2 oliver users  72 2005-09-29 19:05 heads
drwxrwxr-x  2 oliver users 600 2005-09-20 05:02 tags
oliver@oenone:~/linux-2.6> ls -la .git/refs/heads/
insgesamt 4
drwxrwxr-x  2 oliver users 72 2005-09-29 19:05 .
drwxrwxr-x  4 oliver users 96 2005-05-02 02:15 ..
-rw-rw-r--  1 oliver users 41 2005-09-29 19:05 master
oliver@oenone:~/linux-2.6> cat .git/refs/heads/master
aa55a08687059aa169d10a313c41f238c2070488

	Regards
		Oliver

Re: [howto] Kernel hacker's guide to git, updated

From: Dave Jones <hidden>
Date: 2005-09-29 20:03:21

On Thu, Sep 29, 2005 at 07:03:05AM -0400, Jeff Garzik wrote:
 > 
 > Just updated my KHGtG to include the latest goodies available in 
 > git-core, the Linux kernel standard SCM tool:
 > 
 > 	http://linux.yyz.us/git-howto.html
 > 
 > Several changes in git-core have made working with git a lot easier, so 
 > be sure to re-familiarize yourself with the development process.
 > 
 > Comments, corrections, and notes of omission welcome.  This document 
 > mainly reflects my typical day-to-day git activities, and may not be 
 > very applicable outside of kernel work.

You wrote..

$ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
$ cd linux-2.6
$ rsync -a --verbose --stats --progress \
  rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ \
  .git/

Could be just..

$ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
$ cd linux-2.6
$ git pull

Likewise, in the next section, git pull doesn't need an argument
if pulling from the repo it cloned.

		Dave

Re: [howto] Kernel hacker's guide to git, updated

From: Anton Altaparmakov <hidden>
Date: 2005-09-29 20:07:37

On Thu, 29 Sep 2005, Dave Jones wrote:
On Thu, Sep 29, 2005 at 07:03:05AM -0400, Jeff Garzik wrote:
 > Just updated my KHGtG to include the latest goodies available in 
 > git-core, the Linux kernel standard SCM tool:
 > 
 > 	http://linux.yyz.us/git-howto.html
 > 
 > Several changes in git-core have made working with git a lot easier, so 
 > be sure to re-familiarize yourself with the development process.
 > 
 > Comments, corrections, and notes of omission welcome.  This document 
 > mainly reflects my typical day-to-day git activities, and may not be 
 > very applicable outside of kernel work.

You wrote..

$ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
$ cd linux-2.6
$ rsync -a --verbose --stats --progress \
  rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ \
  .git/

Could be just..

$ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
$ cd linux-2.6
$ git pull
That is not actually the same.  "git pull" for example will not download 
Linus' tags whilst the rsync would get everything.
Likewise, in the next section, git pull doesn't need an argument
if pulling from the repo it cloned.
Now that is definitely correct.  (-:

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

Re: [howto] Kernel hacker's guide to git, updated

From: Dave Jones <hidden>
Date: 2005-09-29 20:11:45

On Thu, Sep 29, 2005 at 09:07:29PM +0100, Anton Altaparmakov wrote:

 > > $ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
 > > $ cd linux-2.6
 > > $ rsync -a --verbose --stats --progress \
 > >   rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ \
 > >   .git/
 > > 
 > > Could be just..
 > > 
 > > $ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
 > > $ cd linux-2.6
 > > $ git pull
 > 
 > That is not actually the same.  "git pull" for example will not download 
 > Linus' tags whilst the rsync would get everything.

Ah. I didn't know this. Thanks.
Hmm, it'd be nice to have a shorthand 'not have to type the url, pull everything'.
Something like 'git pull all'.

		Dave

Re: [howto] Kernel hacker's guide to git, updated

From: Jeff Garzik <hidden>
Date: 2005-09-29 20:15:49

Dave Jones wrote:
You wrote..

$ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
$ cd linux-2.6
$ rsync -a --verbose --stats --progress \
  rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ \
  .git/

Could be just..

$ git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
$ cd linux-2.6
$ git pull

Likewise, in the next section, git pull doesn't need an argument
if pulling from the repo it cloned.

Nope.  It intentionally includes the manual rsync because clone/pull 
doesn't seem to grab tags.  Or at least last time I checked...

	Jeff

Re: [howto] Kernel hacker's guide to git, updated

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-09-29 21:15:01


On Thu, 29 Sep 2005, Dave Jones wrote:
Ah. I didn't know this. Thanks.
Hmm, it'd be nice to have a shorthand 'not have to type the url, pull everything'.
Something like 'git pull all'.
Something like this?

Except it's called "git fetch --all", and it's obviously totally untested.

 		Linus
--
diff --git a/git-fetch.sh b/git-fetch.sh
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -5,6 +5,8 @@
  _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
  _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"

+all=
+tags=
  append=
  force=
  update_head_ok=
@@ -17,6 +19,12 @@ do
  	-f|--f|--fo|--for|--forc|--force)
  		force=t
  		;;
+	--tags)
+		tags=t
+		;;
+	--all)
+		all=t
+		;;
  	-u|--u|--up|--upd|--upda|--updat|--update|--update-|--update-h|\
  	--update-he|--update-hea|--update-head|--update-head-|\
  	--update-head-o|--update-head-ok)
@@ -158,7 +166,16 @@ case "$update_head_ok" in
  	;;
  esac

-for ref in $(get_remote_refs_for_fetch "$@")
+taglist=
+if [ "$tags$all" ]; then
+	pattern='/refs\/tags/'
+	if [ "$all" ]; then
+		pattern='/refs/'
+	fi
+	taglist=$(git-ls-remote "$remote" | awk "$pattern"' { print $2":"$2 }')
+fi
+
+for ref in $(get_remote_refs_for_fetch "$@" $taglist)
  do
      refs="$refs $ref"

Re: [howto] Kernel hacker's guide to git, updated

From: Chuck Lever <hidden>
Date: 2005-09-29 21:23:07

Jeff Garzik wrote:
Dave Jones wrote:
quoted
You wrote..

$ git clone 
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 
linux-2.6
$ cd linux-2.6
$ rsync -a --verbose --stats --progress \
  
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ 
\
  .git/

Could be just..

$ git clone 
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 
linux-2.6
$ cd linux-2.6
$ git pull

Likewise, in the next section, git pull doesn't need an argument
if pulling from the repo it cloned.


Nope.  It intentionally includes the manual rsync because clone/pull 
doesn't seem to grab tags.  Or at least last time I checked...
i just used the instructions at the bottom of your web page to grab new 
tags, and it completely wiped all my Stacked Git metadata.  (fortunately 
i was trying this in a test repository, and it will be simple to recover 
the missing files).

so, this is probably something that should have a warning, or maybe you 
might consider providing an example that won't wipe out existing files 
and directories under .git/ ...

Re: [howto] Kernel hacker's guide to git, updated

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-09-29 21:26:57


On Thu, 29 Sep 2005, Linus Torvalds wrote:
Something like this?
Gaah. Using a new pine version, and it is back to corrupting whitespace.

Damn all mailer writers. Do they think email is just for grandma?

 		Linus

Re: [howto] Kernel hacker's guide to git, updated

From: Elfyn McBratney <hidden>
Date: 2005-09-29 21:33:18

On Thu, Sep 29, 2005 at 02:26:42PM -0700, Linus Torvalds wrote:
 > 
 > 
 > On Thu, 29 Sep 2005, Linus Torvalds wrote:
 > >Something like this?
 > 
 > Gaah. Using a new pine version, and it is back to corrupting whitespace.
 > 
 > Damn all mailer writers. Do they think email is just for grandma?

Of course - grandma uses pine, hackers use mutt ;)

*hides*

Best,
Elfyn

-- 
Elfyn McBratney
Gentoo Developer/Perl Team Lead
beu/irc.freenode.net                            http://dev.gentoo.org/~beu/
+------------O.o--------------------- http://dev.gentoo.org/~beu/pubkey.asc

PGP Key ID: 0x69DF17AD
PGP Key Fingerprint:
  DBD3 B756 ED58 B1B4 47B9  B3BD 8D41 E597 69DF 17AD

Re: [howto] Kernel hacker's guide to git, updated

From: Dave Jones <hidden>
Date: 2005-09-29 21:33:36

On Thu, Sep 29, 2005 at 02:26:42PM -0700, Linus Torvalds wrote:

 > On Thu, 29 Sep 2005, Linus Torvalds wrote:
 > >
 > >Something like this?
 > 
 > Gaah. Using a new pine version, and it is back to corrupting whitespace.
 > 
 > Damn all mailer writers. Do they think email is just for grandma?

What I find amusing is that it was a patch rejection mail from you
*years* back (circa 2000 iirc), telling me my pine corrupted whitespace,
that made me switch MUA ;-)

All these years later, and it's still buggered ?

		Dave

Re: [howto] Kernel hacker's guide to git, updated

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-09-29 21:36:17


On Thu, 29 Sep 2005, Linus Torvalds wrote:
Gaah. Using a new pine version, and it is back to corrupting whitespace.
Ok, disabling "text flowing" seems to have fixed it. It still leaves empty 
spaces at the end of lines when doing normal word-wrapping in the editor 
(and then seems to use those empty spaces as a "marker" for flowing), but 
that's at least just a small silly detail.

So how about this patch now? With it you can do

	git fetch --tags <linus-kernel-repo>

and it should fetch all my tags automatically.

		Linus
---
diff --git a/git-fetch.sh b/git-fetch.sh
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -5,6 +5,8 @@
 _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
 _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
 
+all=
+tags=
 append=
 force=
 update_head_ok=
@@ -17,6 +19,12 @@ do
 	-f|--f|--fo|--for|--forc|--force)
 		force=t
 		;;
+	--tags)
+		tags=t
+		;;
+	--all)
+		all=t
+		;;
 	-u|--u|--up|--upd|--upda|--updat|--update|--update-|--update-h|\
 	--update-he|--update-hea|--update-head|--update-head-|\
 	--update-head-o|--update-head-ok)
@@ -158,7 +166,16 @@ case "$update_head_ok" in
 	;;
 esac
 
-for ref in $(get_remote_refs_for_fetch "$@")
+taglist=
+if [ "$tags$all" ]; then
+	pattern='/refs\/tags/'
+	if [ "$all" ]; then
+		pattern='/refs/'
+	fi
+	taglist=$(git-ls-remote "$remote" | awk "$pattern"' { print $2":"$2 }')
+fi
+
+for ref in $(get_remote_refs_for_fetch "$@" $taglist)
 do
     refs="$refs $ref"
 

Re: [howto] Kernel hacker's guide to git, updated

From: Dave Jones <hidden>
Date: 2005-09-29 21:40:54

On Thu, Sep 29, 2005 at 02:35:15PM -0700, Linus Torvalds wrote:
 > 
 > 
 > On Thu, 29 Sep 2005, Linus Torvalds wrote:
 > > 
 > > Gaah. Using a new pine version, and it is back to corrupting whitespace.
 > 
 > Ok, disabling "text flowing" seems to have fixed it. It still leaves empty 
 > spaces at the end of lines when doing normal word-wrapping in the editor 
 > (and then seems to use those empty spaces as a "marker" for flowing), but 
 > that's at least just a small silly detail.
 > 
 > So how about this patch now? With it you can do
 > 
 > 	git fetch --tags <linus-kernel-repo>
 > 
 > and it should fetch all my tags automatically.

Seems to work. I blew away git/refs/tags/v2.6.13*
and git fetch --tags fetched them all back just fine.

		Dave

Re: [howto] Kernel hacker's guide to git, updated

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-09-29 21:56:06


On Thu, 29 Sep 2005, Dave Jones wrote:
What I find amusing is that it was a patch rejection mail from you
*years* back (circa 2000 iirc), telling me my pine corrupted whitespace,
that made me switch MUA ;-)

All these years later, and it's still buggered ?
Actually, it seems better. It seems to be buggered by default, but it used 
to be that you had to actually recompile pine to make it behave. Now you 
can just disable "strip-whitespace-before-send" and _enable_ 
"quell-flowed-text" and those together seem to do the trick. No extra 
patches or recompiles necessary.

So there's progress. 

Of course, pico is still pico. Which I find a bit sad: my editor of choise 
is still an improved version of uemacs, and pico actually comes from the 
same uemacs history, but has different key-bindings for just enough keys 
to be slightly confusing.

Still, that shared history means that I find pico a lot more to my taste 
than just about any other emailer editor out there. It may have a few 
differences, but it has more things in common..

		Linus

Re: [howto] Kernel hacker's guide to git, updated

From: Anton Altaparmakov <hidden>
Date: 2005-09-29 22:12:49

On Thu, 29 Sep 2005, Linus Torvalds wrote:
On Thu, 29 Sep 2005, Dave Jones wrote:
quoted
What I find amusing is that it was a patch rejection mail from you
*years* back (circa 2000 iirc), telling me my pine corrupted whitespace,
that made me switch MUA ;-)

All these years later, and it's still buggered ?
Actually, it seems better. It seems to be buggered by default, but it used 
to be that you had to actually recompile pine to make it behave. Now you 
can just disable "strip-whitespace-before-send" and _enable_ 
"quell-flowed-text" and those together seem to do the trick. No extra 
patches or recompiles necessary.
Indeed.  I use those two options like that, too.  (-:
So there's progress. 

Of course, pico is still pico. Which I find a bit sad: my editor of choise 
is still an improved version of uemacs, and pico actually comes from the 
same uemacs history, but has different key-bindings for just enough keys 
to be slightly confusing.

Still, that shared history means that I find pico a lot more to my taste 
than just about any other emailer editor out there. It may have a few 
differences, but it has more things in common..
Why don't you enable "enable-alternate-editor-implicitly" and set 
editor = "your-editor-of-choice" in the pine config?  It is integrated in 
a quite seamless way.

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

Re: [howto] Kernel hacker's guide to git, updated

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-09-29 22:29:05


On Thu, 29 Sep 2005, Anton Altaparmakov wrote:
Why don't you enable "enable-alternate-editor-implicitly" and set 
editor = "your-editor-of-choice" in the pine config?  It is integrated in 
a quite seamless way.
You think so? I don't find it that way.

With an alternate editor you have to edit the headers separately, and 
things like postponing a message suddenly turns into a big deal, not just 
a trivial ^O. In fact, almost everything gets more involved.

And pico _is_ pretty close to uemacs.

		Linus

Re: [howto] Kernel hacker's guide to git, updated

From: Anton Altaparmakov <hidden>
Date: 2005-09-29 22:33:08

On Thu, 29 Sep 2005, Linus Torvalds wrote:
On Thu, 29 Sep 2005, Anton Altaparmakov wrote:
quoted
Why don't you enable "enable-alternate-editor-implicitly" and set 
editor = "your-editor-of-choice" in the pine config?  It is integrated in 
a quite seamless way.
You think so? I don't find it that way.

With an alternate editor you have to edit the headers separately, and 
things like postponing a message suddenly turns into a big deal, not just 
a trivial ^O. In fact, almost everything gets more involved.
Well using vim as alternate editor a postpone turns into a "ZZ" followed 
by ^O which I don't think is such a big deal but in general I agree that 
it adds hassle.  It is a shame that the text based headers do not appear 
as part of the message in the editor in particular...
 
And pico _is_ pretty close to uemacs.
I wouldn't know about that.  Never used uemacs.  I am a vim addict myself.  
(-;

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help