mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 00:46:43 +00:00
Allow showing git diff interactively to inspect release commits.
This commit is contained in:
parent
60ee47ea11
commit
f35692daa6
@ -319,6 +319,39 @@ function git_log_summary {
|
|||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function git_diff {
|
||||||
|
# Arguments:
|
||||||
|
# $1 - Path to the git repo (optional - assumes pwd is git repo otherwise)
|
||||||
|
# $2 .. $N - Optional path specification
|
||||||
|
#
|
||||||
|
# Returns:
|
||||||
|
# 0 - success
|
||||||
|
# * - failure
|
||||||
|
#
|
||||||
|
|
||||||
|
local gdir="$(pwd)"
|
||||||
|
if test -d "$1"
|
||||||
|
then
|
||||||
|
gdir="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
shift
|
||||||
|
|
||||||
|
pushd "${gdir}" > /dev/null
|
||||||
|
|
||||||
|
local ret=0
|
||||||
|
|
||||||
|
local head=$(git_branch) || ret=1
|
||||||
|
local upstream=$(git_upstream) || ret=1
|
||||||
|
|
||||||
|
if test ${ret} -eq 0
|
||||||
|
then
|
||||||
|
status "Git Diff - Paths: $@"
|
||||||
|
git diff ${HEAD} ${upstream} -- "$@" || ret=1
|
||||||
|
fi
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
function normalize_git_url {
|
function normalize_git_url {
|
||||||
url="${1#https://}"
|
url="${1#https://}"
|
||||||
url="${url#git@}"
|
url="${url#git@}"
|
||||||
|
@ -97,8 +97,13 @@ function confirm_git_push_changes {
|
|||||||
ret=1
|
ret=1
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
?)
|
||||||
|
# bindata_assetfs.go will make these meaningless
|
||||||
|
git_diff "$(pwd)" ":!agent/bindata_assetfs.go"|| ret 1
|
||||||
|
answer=""
|
||||||
|
;;
|
||||||
* )
|
* )
|
||||||
read -p "Are these changes correct? [y/n]: " answer
|
read -p "Are these changes correct? [y/n] (or type ? to show the diff output): " answer
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user