Web lists-archives.com

Re: Git log print commits between a revision range (inclusive)




wuzhouhui <wuzhouhui14@xxxxxxxxxxxxxxxx> writes:

> I want to know how to display logs between a revision range (both
> start and end are inclusive). I searched it and only found[1],
> which doesn't resolve my problem completely, because
>
>   git log <older hash>..<newer hash>
>
> doesn't contains the log of <older hash>.

 $ git log maint --not v2.20.0^@

gives you commits that are reachable from (i.e. ancestors of) maint,
excluding those that are reachable from the set of commits denoted
by v2.20.0^@.

v2.20.0^@ is how you spell the set of commits that are parents of
the commit v2.20.0.

If your "range" is simple and "old" is a single-parent commit,

 $ git log <old>~1..<new>

is equivalent, because <old>~1 (i.e. the first parent of commit
<old>) would be the same as <old>^@ for a single-parent commit, and
because the short-hand "git log A..B" is the same as the long-hand
"git log B --not A".