mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2026-01-29 09:23:02 +01:00
16 lines
439 B
Bash
Executable file
16 lines
439 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Git automatic range diff
|
|
|
|
# Enforce being in a git repository
|
|
git rev-parse --is-inside-work-tree >/dev/null || exit $?
|
|
|
|
GIT_REMOTE=origin
|
|
|
|
HEAD_REMOT="$(git rev-parse --abbrev-ref ${GIT_REMOTE}/HEAD | cut -d/ -f2)"
|
|
HEAD_LOCAL="$(git rev-parse --abbrev-ref HEAD)"
|
|
|
|
# Show the next command
|
|
set -x
|
|
|
|
git range-diff "${GIT_REMOTE}/${HEAD_REMOT}..${GIT_REMOTE}/${HEAD_LOCAL}" "${HEAD_REMOT}..${HEAD_LOCAL}"
|