4 # stg-whatchanged - show a metadiff for the patch being modified,
5 # especially when resolving a merge.
7 # Copyright (c) 2006-2007 Yann Dirson <ydirson@altern.org>
8 # Subject to the GNU GPL, version 2.
11 # - should only exclude hunk headers differing only in line offsets
12 # - diff coloring should show changes in context lines differently than
14 # - filter on ^index lines is a bit wide
15 # - we should be able to ask diff to force a new hunk on "^@@ " to better
17 # - we should always show the hunk header for any changes within a hunk
19 # default to unified diff
24 # Merges via "push" leave top=bottom so we must look at old patch
25 # in this case (unlike, eg., "pick --fold")
26 patchdir
="$(git-rev-parse --git-dir)/patches/$(stg branch)/patches/$(stg top)"
27 if [ -s "$(git-rev-parse --git-dir)/conflicts" ];
29 current_cmd
="stg show //top.old"
31 current_cmd
="stg show"
35 -I '^index [0-9a-b]*..[0-9a-b]*' \
37 <($current_cmd) <(stg
diff -r//bottom
) |
less -RFX