# [Not A Patch] Octopus demo

1 messages from 2005-08-19 to 2005-08-19. Participants: Junio C Hamano.
Thread: https://gitlist.dev/t/1582

## Junio C Hamano, 2005-08-19 01:05

Subject: [Not A Patch] Octopus demo
Message-ID: <7vy86yd9do.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vy86yd9do.fsf%40assigned-by-dhcp.cox.net

```
Create an empty directory and running this script in there would
let you see the original Octopus in action.


---
#!/bin/sh

test -d .saved-git || {
    U=http://www.kernel.org/pub/scm/git/git.git
    GIT_DIR=.saved-git
    export GIT_DIR
    git-init-db
    : >$GIT_DIR/FETCH_HEAD
    h=0
    while read SHA1
    do
	    git-http-pull -a -v $SHA1 $U
	    h=$(expr $h + 1)
	    echo $SHA1 >$GIT_DIR/refs/heads/H$h
	    echo "$SHA1	heads/H$h" >>$GIT_DIR/FETCH_HEAD
    done <<\EOF
fc54a9c30ccad3fde5890d2c0ca2e2acc0848fbc
9e30dd7c0ecc9f10372f31539d0122db97418353
c4b83e618f1df7d8ecc9392fa40e5bebccbe6b5a
660265909fc178581ef327076716dfd3550e6e7b
b28858bf65d4fd6d8bb070865518ec43817fe7f3
EOF
    echo ed4eeaf203d0f293bd5ffc2a0ad8711f052db1f3 >$GIT_DIR/HEAD
}

rm -fr testing
git clone -l ./.saved-git testing
cp .saved-git/FETCH_HEAD testing/.git/.

cd testing || exit

git show-branches
git checkout

git octopus || exit

git show-branches
git-rev-list --max-count=1 --pretty HEAD

```
