I am at the commit on master
, and I need to get to the next commit wrt origin/master
.
git log --ancestry-path --date-order --reverse HEAD..origin/master
or a similar git rev-list
command gives me the right commits, properly reversed, so I could |head -n 1
that and be done with it.
However, I wonder it it's possible to get it by using just one process (one git invokation). Limiting with -1
limits first, and then reverses the list, which I not what I need.
How to accomplish this?
I know what a DAG is, I also know enough graph theory to understand why -1
behaves like that. What I'm asking here is not a matter of theory, it's a matter of using a tool used in software development.