aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-07-10 11:21:21 +0800
committerAaron LI <aly@aaronly.me>2019-07-10 11:21:21 +0800
commitd87201c7b95cd3b89665b4074c3c67f38e7eb376 (patch)
tree44c023c45fab030ee39fefb139c6c2297f62b9cc
parent9bada0bf30622f7529d041d46a3cc5a48e2c56fb (diff)
downloaddotfiles-d87201c7b95cd3b89665b4074c3c67f38e7eb376.tar.bz2
gitconfig: Add 'ref-next' and 'log-next' aliases
The 'ref-next' alias determines the *next* commit hash for the given commit. Credit: * Referening the child of a commit https://stackoverflow.com/a/21032988 * Git alias with positional parameters https://stackoverflow.com/a/3326971
-rw-r--r--_gitconfig4
1 files changed, 4 insertions, 0 deletions
diff --git a/_gitconfig b/_gitconfig
index 06237b0..880b03d 100644
--- a/_gitconfig
+++ b/_gitconfig
@@ -38,6 +38,10 @@
# Show space and tabs
wsErrorHighlight = all
+[alias]
+ ref-next = !sh -c 'git log --ancestry-path --format=%H ${1:-HEAD}..master | tail -n 1' -
+ log-next = !git ref-next $1 | xargs git log
+
# Large file storage
[filter "lfs"]
clean = git-lfs clean -- %f