Add range comparison support to stg-mdiff.
[stgit] / contrib / stg-mdiff
CommitLineData
92172b2b
YD
1#!/bin/bash
2set -e
3
4# stg-mdiff - display meta-diffs, ie. diffs of diffs
5
6# Main use: show evolutions of a patch.
7# eg. stg-mdiff foo@stable foo
8# stg-mdiff foo 012345567ABCD # sha1 for "foo" as integrated upstream
9
10# Copyright (c) 2007 Yann Dirson <ydirson@altern.org>
11# Subject to the GNU GPL, version 2.
12
13usage()
14{
67e5c1c6 15 echo "Usage: $(basename $0) <from1>..[<to1>]|<patch1> <from2>..[<to2>]|<patch2>"
92172b2b
YD
16 exit 1
17}
18
19if [ "$#" != 2 ]; then
20 usage
21fi
22
67e5c1c6
YD
23case "$1" in
24*..*) cmd1="stg diff" ;;
25*) cmd1="stg show" ;;
26esac
27case "$2" in
28*..*) cmd2="stg diff" ;;
29*) cmd2="stg show" ;;
30esac
31
32colordiff -u <($cmd1 "$1") <($cmd2 "$2") | less -RFX