Allow showing git diff interactively to inspect release commits.
This commit is contained in:
parent
74fe2fae8b
commit
a127f167ee
|
@ -319,6 +319,39 @@ function git_log_summary {
|
|||
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 {
|
||||
url="${1#https://}"
|
||||
url="${url#git@}"
|
||||
|
|
|
@ -97,8 +97,13 @@ function confirm_git_push_changes {
|
|||
ret=1
|
||||
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
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue