git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* script for reproducing history example in git-log(1) man page
@ 2013-12-19 18:36 Adam Spiers
  2013-12-19 19:03 ` questions / suggestions about history simplification Adam Spiers
  0 siblings, 1 reply; 14+ messages in thread
From: Adam Spiers @ 2013-12-19 18:36 UTC (permalink / raw)
  To: git mailing list

I wanted to be able to experiment with the TREESAME example given in
the git-log(1) man page, so I built this script which recreates it:

--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------
#!/bin/bash

mkdir git-log-example
cd git-log-example

git init

# I
echo asdf > foo; echo quux > quux
git add .
git commit -mI; git tag I

# A
echo foo > foo
git add .
git commit -mA; git tag A

# B
git checkout -b b I
echo foo > foo
git add .
git commit -mB; git tag B

# M
git checkout master
git merge --no-commit b
git commit -m"M: merge of A and B"; git tag M

# C
git checkout -b c I
git commit --allow-empty -mC; git tag C

# N
git checkout master
git merge --no-commit c
git commit -m"N: merge of M and C"; git tag N

# D
git checkout -b d I
echo baz > foo
git add .
git commit -mD; git tag D

# O
git checkout master
git merge --no-commit d
echo foobarbaz > foo
git add .
git commit -m"O: merge of N and D"; git tag O

# E
git checkout -b e I
echo xyzzy > quux
git add .
git commit -mE; git tag E

# P
git checkout master
git merge --no-commit e
echo "quux xyzzy" > quux
git add .
git commit -m"P: merge of O and E"; git tag P

# X
git checkout -b x I
rm foo quux; echo side > side
git add -A .
git commit --amend -m"X"; git tag X

# Y
git checkout -b y x
echo side2 > side
git add .
git commit -m"Y"; git tag Y

# Q
git checkout master
git merge --no-commit y
git commit -mQ; git tag Q

# cleanup unneeded branches
git branch -D b c d e x y
--------- 8< --------- 8< --------- 8< --------- 8< --------- 8< ---------

Would it be worth including this in (say) contrib/, and then referring
to it from the man page, in case anyone else feels a similar urge?

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-12-26  9:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 18:36 script for reproducing history example in git-log(1) man page Adam Spiers
2013-12-19 19:03 ` questions / suggestions about history simplification Adam Spiers
2013-12-19 19:10   ` Jonathan Nieder
2013-12-19 20:38     ` Adam Spiers
2013-12-19 20:20   ` Junio C Hamano
2013-12-19 20:36     ` Adam Spiers
2013-12-19 20:39       ` Junio C Hamano
2013-12-19 20:46         ` Adam Spiers
2013-12-19 20:37   ` Junio C Hamano
2013-12-19 20:58     ` Adam Spiers
2013-12-22  6:44       ` Junio C Hamano
2013-12-22 13:41         ` Adam Spiers
2013-12-26  9:56           ` Junio C Hamano
2013-12-19 21:04   ` Adam Spiers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).