Get changes newer than this version using git show
Using a simple example of the commits A
, B
, C
, D
that's all right (no strange tree structure), and the fact that I have SHA
to A
and D
I am using git show
the following:
git show --no-patch --abbrev-commit --abbrev=7 --format=short A D
It gives me commit A
, B
, C
and D
. But I want to receive revisions newer than A
(excluding A
). I don't know SHA
for B
and C
, and I hope I can change my revision spec without requiring a second git call.
Is it possible? I've looked at gitrevisions and couldn't find anything that is applicable. A^
and A~1
go in the wrong direction.
My use case is to find changes to be deployed, so I have the git of the SHA
latest deployment.
source to share
git show A..D
This set operation appears so often that there is a shorthand for it. When you have two commits r1 and r2 (named according to the syntax explained in SPECIFYING REVISIONS above), you can ask for commits that are reachable from r2 excluding those that are reachable from r1 by ^ r1 r2 and it can be written as r1..r2.
source to share