/usr/bin/stg-whatchanged is in stgit-contrib 0.17.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/bin/bash
set -e
# stg-whatchanged - show a metadiff for the patch being modified,
# especially when resolving a merge.
# Copyright (c) 2006-2007 Yann Dirson <ydirson@altern.org>
# Subject to the GNU GPL, version 2.
# FIXME:
# - should only exclude hunk headers differing only in line offsets
# - diff coloring should show changes in context lines differently than
# changes in contents
# - filter on ^index lines is a bit wide
# - we should be able to ask diff to force a new hunk on "^@@ " to better
# handle them
# - we should always show the hunk header for any changes within a hunk
# default to unified diff
if [ "$#" = 0 ]; then
set -- -u
fi
# Merges via "push" leave top=bottom so we must look at old patch
# in this case (unlike, eg., "pick --fold")
patchdir="$(git rev-parse --git-dir)/patches/$(stg branch)/patches/$(stg top)"
case $(stg log | head -n1) in
*push\(c\)*) former="//top.old" ;;
*) former="//top" ;;
esac
stg-mdiff -o "$*" \
$former //bottom..
|