Port stg-whatchanged improvements to stg-mdiff and have the former use the latter.
authorYann Dirson <yann.dirson@sagem.com>
Tue, 24 Jul 2007 18:57:46 +0000 (20:57 +0200)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 24 Jul 2007 22:49:25 +0000 (23:49 +0100)
Signed-off-by: Yann Dirson <ydirson@altern.org>
contrib/stg-mdiff
contrib/stg-whatchanged

index 61cba9e..74d7f77 100755 (executable)
@@ -46,4 +46,6 @@ case "$2" in
 esac
 
 colordiff $diffopts \
+    -I '^index [0-9a-b]*..[0-9a-b]*' \
+    -I '^@@ .* @@' \
     <($cmd1 "$1") <($cmd2 "$2") | less -RFX
index 231f4f5..afeda2c 100755 (executable)
@@ -25,11 +25,9 @@ fi
 # 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\)*) current_cmd="stg show //top.old" ;;
-    *) current_cmd="stg show" ;;
+    *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..