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

40 messages from 2005-09-29 to 2005-10-02. Participants: Jeff Garzik, David Leimbach, Alberto Patino, Oliver Neukum, Jon Loeliger, Dave Jones, Anton Altaparmakov, Junio C Hamano, Linus Torvalds, Chuck Lever, Elfyn McBratney, Erik Mouw, Johannes Schindelin, Francois Romieu.
Thread: https://gitlist.dev/t/1975

## Jeff Garzik, 2005-09-29 11:03

Subject: [howto] Kernel hacker's guide to git, updated
Message-ID: <433BC9E9.6050907@pobox.com>
URL: https://gitlist.dev/e/433BC9E9.6050907%40pobox.com

```

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

```

## David Leimbach, 2005-09-29 15:18

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <3e1162e605092908187e181936@mail.gmail.com>
URL: https://gitlist.dev/e/3e1162e605092908187e181936%40mail.gmail.com
In-Reply-To: <433BC9E9.6050907@pobox.com>

```
On 9/29/05, Jeff Garzik <jgarzik@pobox.com> 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

```

## Alberto Patino, 2005-09-29 16:03

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <4489a22a050929090358badd29@mail.gmail.com>
URL: https://gitlist.dev/e/4489a22a050929090358badd29%40mail.gmail.com
In-Reply-To: <3e1162e605092908187e181936@mail.gmail.com>

```
On 9/29/05, David Leimbach <leimy2k@gmail.com> wrote:
> On 9/29/05, Jeff Garzik <jgarzik@pobox.com> 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?
> - Dave

The  KHGtG page is updated to September 29, 2005.



--
Don't be evil!!!

```

## David Leimbach, 2005-09-29 16:13

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <3e1162e605092909137a0da92e@mail.gmail.com>
URL: https://gitlist.dev/e/3e1162e605092909137a0da92e%40mail.gmail.com
In-Reply-To: <4489a22a050929090358badd29@mail.gmail.com>

```
On 9/29/05, Alberto Patino <pato.lukaz@gmail.com> wrote:
> On 9/29/05, David Leimbach <leimy2k@gmail.com> wrote:
> > On 9/29/05, Jeff Garzik <jgarzik@pobox.com> 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?
> > - 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

```

## Oliver Neukum, 2005-09-29 19:08

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <200509292108.11092.oliver@neukum.org>
URL: https://gitlist.dev/e/200509292108.11092.oliver%40neukum.org
In-Reply-To: <433BC9E9.6050907@pobox.com>

```
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

```

## Jon Loeliger, 2005-09-29 19:34

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <1128022473.14595.6.camel@cashmere.sps.mot.com>
URL: https://gitlist.dev/e/1128022473.14595.6.camel%40cashmere.sps.mot.com
In-Reply-To: <200509292108.11092.oliver@neukum.org>

```
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

```

## Oliver Neukum, 2005-09-29 19:38

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <200509292138.26183.oliver@neukum.org>
URL: https://gitlist.dev/e/200509292138.26183.oliver%40neukum.org
In-Reply-To: <1128022473.14595.6.camel@cashmere.sps.mot.com>

```
Am Donnerstag, 29. September 2005 21:34 schrieb Jon Loeliger:
> 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...?

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

```

## Dave Jones, 2005-09-29 20:02

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <20050929200252.GA31516@redhat.com>
URL: https://gitlist.dev/e/20050929200252.GA31516%40redhat.com
In-Reply-To: <433BC9E9.6050907@pobox.com>

```
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

```

## Anton Altaparmakov, 2005-09-29 20:07

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.60.0509292106080.17860@hermes-1.csi.cam.ac.uk>
URL: https://gitlist.dev/e/Pine.LNX.4.60.0509292106080.17860%40hermes-1.csi.cam.ac.uk
In-Reply-To: <20050929200252.GA31516@redhat.com>

```
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/

```

## Dave Jones, 2005-09-29 20:11

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <20050929201127.GB31516@redhat.com>
URL: https://gitlist.dev/e/20050929201127.GB31516%40redhat.com
In-Reply-To: <Pine.LNX.4.60.0509292106080.17860@hermes-1.csi.cam.ac.uk>

```
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

```

## Jeff Garzik, 2005-09-29 20:15

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <433C4B6D.6030701@pobox.com>
URL: https://gitlist.dev/e/433C4B6D.6030701%40pobox.com
In-Reply-To: <20050929200252.GA31516@redhat.com>

```
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

```

## Junio C Hamano, 2005-09-29 21:04

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <7virwjegb5.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7virwjegb5.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <433C4B6D.6030701@pobox.com>

```
Jeff Garzik <jgarzik@pobox.com> writes:

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

clone does (or should), fetch (and hence pull) does not
automatically.  Running the following one-liner every once in a
while would sync your set of tags with Linus:

git fetch origin `git-ls-remote --tags origin | sed -ne 's|^.*refs/tags/|tag |p'`

```

## Linus Torvalds, 2005-09-29 21:14

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.64.0509291413060.5362@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0509291413060.5362%40g5.osdl.org
In-Reply-To: <20050929201127.GB31516@redhat.com>

```


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"

```

## Chuck Lever, 2005-09-29 21:23

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <433C5B34.9060907@citi.umich.edu>
URL: https://gitlist.dev/e/433C5B34.9060907%40citi.umich.edu
In-Reply-To: <433C4B6D.6030701@pobox.com>

```
Jeff Garzik wrote:
> 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...

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/ ...


begin:vcard
fn:Chuck Lever
n:Lever;Charles
org:Network Appliance, Incorporated;Linux NFS Client Development
adr:535 West William Street, Suite 3100;;Center for Information Technology Integration;Ann Arbor;MI;48103-4943;USA
email;internet:cel@citi.umich.edu
title:Member of Technical Staff
tel;work:+1 734 763 4415
tel;fax:+1 734 763 4434
tel;home:+1 734 668 1089
x-mozilla-html:FALSE
url:http://www.monkey.org/~cel/
version:2.1
end:vcard


```

## Linus Torvalds, 2005-09-29 21:26

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.64.0509291425560.5362@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0509291425560.5362%40g5.osdl.org
In-Reply-To: <Pine.LNX.4.64.0509291413060.5362@g5.osdl.org>

```


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

```

## Dave Jones, 2005-09-29 21:33

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <20050929213312.GD31516@redhat.com>
URL: https://gitlist.dev/e/20050929213312.GD31516%40redhat.com
In-Reply-To: <Pine.LNX.4.64.0509291425560.5362@g5.osdl.org>

```
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

```

## Elfyn McBratney, 2005-09-29 21:33

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <20050929213315.GA13542@zippy.emcb.local>
URL: https://gitlist.dev/e/20050929213315.GA13542%40zippy.emcb.local
In-Reply-To: <Pine.LNX.4.64.0509291425560.5362@g5.osdl.org>

```
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

```

## Linus Torvalds, 2005-09-29 21:35

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.64.0509291433040.5362@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0509291433040.5362%40g5.osdl.org
In-Reply-To: <Pine.LNX.4.64.0509291425560.5362@g5.osdl.org>

```


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"
 

```

## Dave Jones, 2005-09-29 21:40

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <20050929214043.GE31516@redhat.com>
URL: https://gitlist.dev/e/20050929214043.GE31516%40redhat.com
In-Reply-To: <Pine.LNX.4.64.0509291433040.5362@g5.osdl.org>

```
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

```

## Linus Torvalds, 2005-09-29 21:55

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.64.0509291451540.5362@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0509291451540.5362%40g5.osdl.org
In-Reply-To: <20050929213312.GD31516@redhat.com>

```


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

```

## Anton Altaparmakov, 2005-09-29 22:12

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.60.0509292309470.17860@hermes-1.csi.cam.ac.uk>
URL: https://gitlist.dev/e/Pine.LNX.4.60.0509292309470.17860%40hermes-1.csi.cam.ac.uk
In-Reply-To: <Pine.LNX.4.64.0509291451540.5362@g5.osdl.org>

```
On Thu, 29 Sep 2005, Linus Torvalds wrote:
> 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.

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/

```

## Linus Torvalds, 2005-09-29 22:25

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.64.0509291521300.5362@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0509291521300.5362%40g5.osdl.org
In-Reply-To: <Pine.LNX.4.60.0509292309470.17860@hermes-1.csi.cam.ac.uk>

```


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

```

## Anton Altaparmakov, 2005-09-29 22:32

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.60.0509292330130.17860@hermes-1.csi.cam.ac.uk>
URL: https://gitlist.dev/e/Pine.LNX.4.60.0509292330130.17860%40hermes-1.csi.cam.ac.uk
In-Reply-To: <Pine.LNX.4.64.0509291521300.5362@g5.osdl.org>

```
On Thu, 29 Sep 2005, Linus Torvalds wrote:
> 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.

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/

```

## Junio C Hamano, 2005-09-29 23:19

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <7vek77ea2s.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vek77ea2s.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.60.0509292309470.17860@hermes-1.csi.cam.ac.uk>

```
Anton Altaparmakov <aia21@cam.ac.uk> writes:

> On Thu, 29 Sep 2005, Linus Torvalds wrote:
>> 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.
>
> Indeed.  I use those two options like that, too.  (-:

Anybody interested in adding entry to SubmittingPatches MUA
Specific Help section?

```

## Junio C Hamano, 2005-09-30 07:37

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <7vslvn6m6y.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vslvn6m6y.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <200509292138.26183.oliver@neukum.org>

```
Oliver Neukum <oliver@neukum.org> writes:

> Am Donnerstag, 29. September 2005 21:34 schrieb Jon Loeliger:
>> 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...?
>
> 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

I wonder what that 32-byte small file called 'index' is doing
there.  If this is the kernel tree, its index file should weigh
about 1.7MB if I recall correctly.

```

## Oliver Neukum, 2005-09-30 08:36

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <200509301036.16887.oliver@neukum.org>
URL: https://gitlist.dev/e/200509301036.16887.oliver%40neukum.org
In-Reply-To: <7vslvn6m6y.fsf@assigned-by-dhcp.cox.net>

```
Am Freitag, 30. September 2005 09:37 schrieb Junio C Hamano:
> Oliver Neukum <oliver@neukum.org> writes:
> 
> > Am Donnerstag, 29. September 2005 21:34 schrieb Jon Loeliger:
> >> 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...?
> >
> > 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
> 
> I wonder what that 32-byte small file called 'index' is doing
> there.  If this is the kernel tree, its index file should weigh
> about 1.7MB if I recall correctly.

I have no idea, but the instructions as stated didn't work for me.
Can you replicate that?

	Regards
		Oliver

```

## Jeff Garzik, 2005-09-30 11:15

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <433D1E5D.20303@pobox.com>
URL: https://gitlist.dev/e/433D1E5D.20303%40pobox.com
In-Reply-To: <7virwjegb5.fsf@assigned-by-dhcp.cox.net>

```

Thanks for all the comments.  I just updated the KHGtG with the feedback 
I received.  Go to

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

and click reload.  Continued criticism^H^H^Hcomments welcome!



Two items of note:

1)
> automatically.  Running the following one-liner every once in a
> while would sync your set of tags with Linus:
> 
> git fetch origin `git-ls-remote --tags origin | sed -ne 's|^.*refs/tags/|tag |p'`

that's way too long and convoluted to deal with.  Once the 'git fetch 
--tags' changes make it into the official repository (are they there 
already?), I'll remove all the remaining direct references to running rsync.


2) What is the easiest way to obtain a list of changes present in 
repository B, that are not present in repository A?  I used to use 
git-changes-script [hacked cg-log script] for this:

	$ cd /repo/netdev-2.6
	$ git-changes-script -L ../linux-2.6

would display all changes in /repo/netdev-2.6 which are not present in 
/repo/linux-2.6.  This is similar to 'git log master..HEAD', except for 
repositories rather than branches.

	Jeff

```

## Junio C Hamano, 2005-09-30 11:55

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <7v64si4von.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v64si4von.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <433D1E5D.20303@pobox.com>

```
Jeff Garzik <jgarzik@pobox.com> writes:

> ...  Once the 'git fetch --tags' changes make it into the
> official repository (are they there already?), I'll remove all
> the remaining direct references to running rsync.

Sounds like a thinly veiled threat and/or very effective
prodding ;-).

It is not there yet only because I simply have not got around to
it, but it will happen before 0.99.8.

I suspect the version Linus posted has a funny interaction with
'git-pull'; 'git pull --tags' by mistake, or intentionally to
file a bug report to annoy me ;-), would create an Octopus out
of those tags, if I am not mistaken.

> 2) What is the easiest way to obtain a list of changes present in 
> repository B, that are not present in repository A?  I used to use 
> git-changes-script [hacked cg-log script] for this:

I think I still have the copy you sent to the list.  If you do
not mind me placing in the master branch just holler -- better
yet please send a patch with commit log and signoff to add the
latest, and I will apply it.

-jc

```

## Oliver Neukum, 2005-09-30 12:02

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <200509301402.46740.oliver@neukum.org>
URL: https://gitlist.dev/e/200509301402.46740.oliver%40neukum.org
In-Reply-To: <433D1E5D.20303@pobox.com>

```
Am Freitag, 30. September 2005 13:15 schrieb Jeff Garzik:
> 
> Thanks for all the comments.  I just updated the KHGtG with the feedback 
> I received.  Go to
> 
> 	http://linux.yyz.us/git-howto.html
> 
> and click reload.  Continued criticism^H^H^Hcomments welcome!
> 

The error is still there.

oliver@oenone:~/linux-2.6> git checkout -f master
usage: read-tree (<sha> | -m <sha1> [<sha2> <sha3>])

	Regards
		Oliver

```

## Erik Mouw, 2005-09-30 12:07

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <20050930120739.GB9328@harddisk-recovery.com>
URL: https://gitlist.dev/e/20050930120739.GB9328%40harddisk-recovery.com
In-Reply-To: <433D1E5D.20303@pobox.com>

```
On Fri, Sep 30, 2005 at 07:15:41AM -0400, Jeff Garzik wrote:
> >automatically.  Running the following one-liner every once in a
> >while would sync your set of tags with Linus:
> >
> >git fetch origin `git-ls-remote --tags origin | sed -ne 
> >'s|^.*refs/tags/|tag |p'`
> 
> that's way too long and convoluted to deal with.  Once the 'git fetch 
> --tags' changes make it into the official repository (are they there 
> already?), I'll remove all the remaining direct references to running rsync.

FYI, the rsync command to get the tags blows away .git/branches/origin,
so on the next "git pull", git will tell you "Where do you want to
fetch from today?".

In the mean time, better make it two separate rsync commands (sorry for
the long lines):

rsync -a --delete --verbose --stats --progress \
  rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/tags/ \
  .git/tags/

rsync -a --delete --verbose --stats --progress \
  rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/heads/ \
  .git/heads/


Erik

-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands

```

## Johannes Schindelin, 2005-09-30 12:22

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.63.0509301421160.15604@wgmdd8.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0509301421160.15604%40wgmdd8.biozentrum.uni-wuerzburg.de
In-Reply-To: <7vek77ea2s.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Thu, 29 Sep 2005, Junio C Hamano wrote:

> Anton Altaparmakov <aia21@cam.ac.uk> writes:
> 
> > On Thu, 29 Sep 2005, Linus Torvalds wrote:
> >> 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.
> >
> > Indeed.  I use those two options like that, too.  (-:
> 
> Anybody interested in adding entry to SubmittingPatches MUA
> Specific Help section?

Did I miss something? Straight from my local git directory:

-- snip --

Pine
----

(Johannes Schindelin)

I don't know how many people still use pine, but for those poor
souls it may be good to mention that the quell-flowed-text is
needed for recent versions.

... the "no-strip-whitespace-before-send" option, too. AFAIK it
was introduced in 4.60.

-- snap --

Hth,
Dscho

```

## Jeff Garzik, 2005-09-30 13:58

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <433D447E.9030103@pobox.com>
URL: https://gitlist.dev/e/433D447E.9030103%40pobox.com
In-Reply-To: <200509301402.46740.oliver@neukum.org>

```
Oliver Neukum wrote:
> Am Freitag, 30. September 2005 13:15 schrieb Jeff Garzik:
> 
>>Thanks for all the comments.  I just updated the KHGtG with the feedback 
>>I received.  Go to
>>
>>	http://linux.yyz.us/git-howto.html
>>
>>and click reload.  Continued criticism^H^H^Hcomments welcome!
>>
> 
> 
> The error is still there.
> 
> oliver@oenone:~/linux-2.6> git checkout -f master
> usage: read-tree (<sha> | -m <sha1> [<sha2> <sha3>])

Something's wrong with your installation, not the instructions.  Works 
fine here.

	Jeff

```

## Jeff Garzik, 2005-09-30 14:08

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <433D46F1.9010209@pobox.com>
URL: https://gitlist.dev/e/433D46F1.9010209%40pobox.com
In-Reply-To: <20050930120739.GB9328@harddisk-recovery.com>

```
Erik Mouw wrote:
> FYI, the rsync command to get the tags blows away .git/branches/origin,
> so on the next "git pull", git will tell you "Where do you want to
> fetch from today?".

Agreed, though I always run 'git pull $url' each time, so I never 
noticed this.

Since git clone pulls the tags, I have eliminated the first rsync 
completely.

	Jeff

```

## Jeff Garzik, 2005-09-30 14:11

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <433D477A.4010009@pobox.com>
URL: https://gitlist.dev/e/433D477A.4010009%40pobox.com
In-Reply-To: <7v64si4von.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:
> Jeff Garzik <jgarzik@pobox.com> writes:
>>2) What is the easiest way to obtain a list of changes present in 
>>repository B, that are not present in repository A?  I used to use 
>>git-changes-script [hacked cg-log script] for this:
> 
> 
> I think I still have the copy you sent to the list.  If you do
> not mind me placing in the master branch just holler -- better
> yet please send a patch with commit log and signoff to add the
> latest, and I will apply it.

It's archived here:
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-changes-script

but it needs a git expert (read: not me :)) to fix it up for the very 
latest git-core stuff.

Currently, using 'git-changes-script -L ../linux-2.6' spits out
> --------------------------
> commit 2fca877b68b2b4fc5b94277858a1bedd46017cde
> usage: git-cat-file [-t | -s | <type>] <sha1>
> 
> --------------------------
> commit ff40c6d3d1437ecdf295b8e39adcb06c3d6021ef
> usage: git-cat-file [-t | -s | <type>] <sha1>
> 
> --------------------------
> commit 8bf62ecee58360749c5f0e68bc97d5e02a6816b1
> usage: git-cat-file [-t | -s | <type>] <sha1>
> 
> --------------------------

Regards,

	Jeff

```

## Alberto Patino, 2005-09-30 15:10

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <4489a22a0509300810y723e5ef5tb9109a29508a1e38@mail.gmail.com>
URL: https://gitlist.dev/e/4489a22a0509300810y723e5ef5tb9109a29508a1e38%40mail.gmail.com
In-Reply-To: <433D447E.9030103@pobox.com>

```
On 9/30/05, Jeff Garzik <jgarzik@pobox.com> wrote:
> Oliver Neukum wrote:
> >
> > The error is still there.
> >
> > oliver@oenone:~/linux-2.6> git checkout -f master
> > usage: read-tree (<sha> | -m <sha1> [<sha2> <sha3>])
>
> Something's wrong with your installation, not the instructions.  Works
> fine here.
>

Right , you must have a corrupted copy of the git repo. Do the initial
cloning of the linux repository again, and then retry the git
checkout.

```

## Linus Torvalds, 2005-09-30 16:39

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.64.0509300937130.3378@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0509300937130.3378%40g5.osdl.org
In-Reply-To: <7vslvn6m6y.fsf@assigned-by-dhcp.cox.net>

```


On Fri, 30 Sep 2005, Junio C Hamano wrote:
> 
> I wonder what that 32-byte small file called 'index' is doing
> there.  If this is the kernel tree, its index file should weigh
> about 1.7MB if I recall correctly.

32 bytes is what you get for an empty index (it's a 12-byte header, 
followed by a 20-byte SHA1 of the contents).

In general, such an index file it should be 100% equivalent to not having 
an index file at all.

		Linus

```

## Linus Torvalds, 2005-09-30 18:14

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <Pine.LNX.4.64.0509301112100.3378@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0509301112100.3378%40g5.osdl.org
In-Reply-To: <7v64si4von.fsf@assigned-by-dhcp.cox.net>

```


On Fri, 30 Sep 2005, Junio C Hamano wrote:
> 
> I suspect the version Linus posted has a funny interaction with
> 'git-pull'; 'git pull --tags' by mistake, or intentionally to
> file a bug report to annoy me ;-), would create an Octopus out
> of those tags, if I am not mistaken.

Hey, even more impressive is "git pull --all", which will happily try to 
create an octopus of every single ref available at the other end.

Now, I think that octopus merges in _general_ are likely to be driver 
error, and that it might make sense to have a separate flag to enable 
them in the first place. That would solve the confusion..

So then you could do

	git pull --all --octopus xyzzy

if you _really_ meant to do that. 

		Linus

```

## Francois Romieu, 2005-09-30 22:52

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <20050930225207.GC24548@electric-eye.fr.zoreil.com>
URL: https://gitlist.dev/e/20050930225207.GC24548%40electric-eye.fr.zoreil.com
In-Reply-To: <433D1E5D.20303@pobox.com>

```
Jeff Garzik <jgarzik@pobox.com> :
[...]
> Thanks for all the comments.  I just updated the KHGtG with the feedback 
> I received.  Go to
> 
> 	http://linux.yyz.us/git-howto.html
> 
> and click reload.  Continued criticism^H^H^Hcomments welcome!

The basic tasks make no use of git-whatchanged.

Even if it is a CVSism, it is quite handful to retrieve the history of
the patchsets by aiming at a specific file.

--
Ueimor

```

## Junio C Hamano, 2005-10-01 07:36

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <7voe69664a.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7voe69664a.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.64.0509301112100.3378@g5.osdl.org>

```
Linus Torvalds <torvalds@osdl.org> writes:

> Hey, even more impressive is "git pull --all", which will happily try to 
> create an octopus of every single ref available at the other end.

True.

However, I think --all is a mistake even if you use it without
merging in 'git fetch', so I am not planning to do refs/heads/
side, at least not yet.  Even if you prevent an Octopus, what
would you do then?  If you choose to merge one of them, which
one?  Not merging any that is not explicitly specified on the
command line, seems to me the most sensible and safe option.

The rule for 'pull' to decide which refs to merge is:

 (1) if command line has explicit refspecs (--tags and --heads
     do not count), they are all merged.

 (2) if command line has no explicit refspecs (--tags and
     --heads do not count), the default one found from either
     remotes or branches file is merged.

Notice that I am forbidding remotes file to say "by default I
always merge these three heads from there to make an Octopus" by
the above rule (branches file cannot even name more than one
head so this is not an issue).  Since everybody seems to agree
that Octopus is not something that is done mechanically and
routinely anyway [*1*], I think this is a sensible way to guard
against accidental Octopus.

We could consider fetching all heads, by minimally renaming
remote master to origin and getting everything else under the
same name, but I'd really want to keep the local namespace for
branches isolated from each other.  Many kernel.org public
repositories seem to have 'test' and 'release' branches and if
you are a maintainer of such a tree, and if you are interested
in another maintainer's tree, and if that other maintainer has
the 'test' and 'release' branches, --heads (or --tags)
overwriting your 'test' with his 'test' is obviously not what
you want.

Possibly, something like this could be arranged later:

	* git fetch --heads=$ns $remote "$@"

	In addition to the usual refspecs (the rest of the
	command line arguments), fetch all remote heads and
	store remote refs/heads/$a under local refs/heads/$ns/$a
	for all $a.  If $ns is empty, remote "master" is renamed
	"origin".

	* git fetch --heads $remote "$@"

        shorthand for empty $ns

[Footnote]

*1* I do make many Octopus merges, but they happen across my
local topic branches.  Topics merged change day-by-day, and even
the set of topics alive at the time changes everyday.  IOW, it
is not something I would want to do with the same sets of heads
every time by describing them in the remotes file.

```

## Junio C Hamano, 2005-10-02 08:47

Subject: Re: [howto] Kernel hacker's guide to git, updated
Message-ID: <7vr7b41f1f.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vr7b41f1f.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <433D477A.4010009@pobox.com>

```
Jeff Garzik <jgarzik@pobox.com> writes:

> Junio C Hamano wrote:
>> Jeff Garzik <jgarzik@pobox.com> writes:

>>> 2) What is the easiest way to obtain a list of changes present in
>>> repository B, that are not present in repository A?  I used to use
>>> git-changes-script [hacked cg-log script] for this:

I haven't really *read* that script, but I think it is trying to
make a list of commits from both repositories and trying to find
the set that are in one side and not in the other using diff (a
real shell programer probably would have used "comm" for this
kind of task, not "diff"), then doing a handcrafted git-log on
each of them.

Attached is my quick hack, based on your original question,
without really trying to understand what the script is doing, so
I cannot claim it is a rewrite nor even attempting to be
compatible.  Please take a look at it and tell me if this is
any close to what you need.

I have a suspition that this might be better done as a natural
extension of git-log, though.

------------
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#

. git-sh-setup || die "Not a git archive"

usage () {
	echo >&2 "$0 ( -L | -R ) <dir> [<ref>] [<ref>]

-L shows changes in local not in remote.
-R shows changes in remote not in local.
<dir> names the remote repository.

If given no refs, local and remote HEADs are compared.
If given one ref, local HEAD and named remote ref are compared.
If given two refs, the first names a local ref, and the second names
remote ref to be compared.
"
	exit 1
}

case "$1" in
-L | -R)
	;;
*)
	usage ;;
esac

other="$2"

(
	unset GIT_DIR GIT_OBJECT_DIRECTORY
	cd "$other" && . git-sh-setup ||
	die "$other is not a valid git repository."
)

local=${3:-HEAD}
remote=${4:-HEAD}

# Basic validation.
local=$(git-rev-parse --verify "$local^0" 2>/dev/null) ||
die "local ref $local is not valid."
remote=$(GIT_DIR="$other" git-rev-parse --verify "$remote^0" 2>/dev/null) ||
die "remote ref $remote is not valid."

case "$1" in
-L)
	list_args="$local ^$remote" ;;
-R)
	list_args="^$local $remote" ;;
esac

GAOD="$GIT_ALTERNATE_OBJECT_DIRECTORIES"

GIT_ALTERNATE_OBJECT_DIRECTORIES="$other/.git/objects:$GAOD" \
git-rev-list --pretty $list_args |
LESS=-S ${PAGER:-less}

```
