X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/b778633bf53e926a1e632d2413a0da3facea78f9..ea696de91d6b8e99497cf9c67c3385d0709f242c:/contrib/stg-whatchanged diff --git a/contrib/stg-whatchanged b/contrib/stg-whatchanged index d5b6965..f1f5308 100755 --- a/contrib/stg-whatchanged +++ b/contrib/stg-whatchanged @@ -23,15 +23,11 @@ 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)" -if [ $(cat "$patchdir/bottom") = $(cat "$patchdir/top") ]; -then - current_cmd="stg show //top.old" -else - current_cmd="stg show" -fi +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 -colordiff "$@" \ - -I '^index [0-9a-b]*..[0-9a-b]*' \ - -I '^@@ .* @@' \ - <($current_cmd) <(stg diff -r//bottom) | less -RFX +stg-mdiff -o "$*" \ + $former //bottom..