Git Log

Revision Range

git init -b foo
touch A && git add A && git commit -m "A"
touch B && git add B && git commit -m "B"

git checkout -b baz
git checkout -b bar
touch C && git add C && git commit -m "C"
touch D && git add D && git commit -m "D"

git checkout foo
touch E && git add E && git commit -m "E"
touch F && git add F && git commit -m "F"
gitdot --png --msg
Range1.png
git log foo bar ^baz
#+RESULTS:
commit 602324372bd8336b6b0a017411b1cda26928c80b
Author: Chris Clark <cfclrk@gmail.com>
Date:   Tue Oct 12 05:08:07 2021 -0400

    F

commit 91d3e6df6430b6941312f023276431698a5bd664
Author: Chris Clark <cfclrk@gmail.com>
Date:   Tue Oct 12 05:08:07 2021 -0400

    D

commit 7fe5fbdaaef26951eaadd84fc855065002e944fe
Author: Chris Clark <cfclrk@gmail.com>
Date:   Tue Oct 12 05:08:07 2021 -0400

    E

commit 6232832ac71956876873c7361d7ee67980425eb9
Author: Chris Clark <cfclrk@gmail.com>
Date:   Tue Oct 12 05:08:07 2021 -0400

    C
gitdot --png --msg --log-paths foo bar ^baz

means "list all the commits which are reachable from foo or bar, but not from baz".

A special notation <commit1>..<commit2> can be used as a short-hand for ^<commit1> <commit2>. For example, either of the following may be used interchangeably:

git log origin..HEAD git log HEAD ^origin