From: Yann Dirson <ydirson@altern.org>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [StGIT PATCH 3/4] Add to stg-mdiff the ability to pass options to underlying diff opts.
Date: Tue, 24 Jul 2007 20:57:41 +0200 [thread overview]
Message-ID: <20070724185740.17180.72586.stgit@gandelf.nowhere.earth> (raw)
In-Reply-To: <20070724185535.17180.24577.stgit@gandelf.nowhere.earth>
From: Yann Dirson <yann.dirson@sagem.com>
So we now have -O, similar to the existing option in stg diff, to pass
flags to git-diff when computing the 2 diffs to compare (-M, -C and -w
come to mind as being potentially useful here), and -o can be used to
tune the invocation of diff on those 2 diffs.
Note that -o is only there temporarily, and will disappear when a more
sophisticated process than plain diff will be used.
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
contrib/stg-mdiff | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/contrib/stg-mdiff b/contrib/stg-mdiff
index 9bb324a..61cba9e 100755
--- a/contrib/stg-mdiff
+++ b/contrib/stg-mdiff
@@ -12,21 +12,38 @@ set -e
usage()
{
- echo "Usage: $(basename $0) <from1>..[<to1>]|<patch1> <from2>..[<to2>]|<patch2>"
+ echo "Usage: [-o <diff-flags>] [-O <gitdiff-flags>] $(basename $0) <from1>..[<to1>]|<patch1> <from2>..[<to2>]|<patch2>"
exit 1
}
+diffopts=
+subdiffopts=
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -o) diffopts="$2"; shift ;;
+ -O) subdiffopts="-O $2"; shift ;;
+ -*) usage ;;
+ *) break ;;
+ esac
+ shift
+done
+
if [ "$#" != 2 ]; then
usage
fi
+if [ -z "$diffopts" ]; then
+ diffopts="-u"
+fi
+
case "$1" in
-*..*) cmd1="stg diff" ;;
-*) cmd1="stg show" ;;
+*..*) cmd1="stg diff $subdiffopts -r" ;;
+*) cmd1="stg show $subdiffopts" ;;
esac
case "$2" in
-*..*) cmd2="stg diff" ;;
-*) cmd2="stg show" ;;
+*..*) cmd2="stg diff $subdiffopts -r" ;;
+*) cmd2="stg show $subdiffopts" ;;
esac
-colordiff -u <($cmd1 "$1") <($cmd2 "$2") | less -RFX
+colordiff $diffopts \
+ <($cmd1 "$1") <($cmd2 "$2") | less -RFX
next prev parent reply other threads:[~2007-07-24 18:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 18:57 [StGIT PATCH 0/4] stg-whatchanged improvements Yann Dirson
2007-07-24 18:57 ` [StGIT PATCH 1/4] Fix stg-whatchanged to deal with conflicts already solved Yann Dirson
2007-07-24 18:57 ` [StGIT PATCH 2/4] Add range comparison support to stg-mdiff Yann Dirson
2007-07-24 18:57 ` Yann Dirson [this message]
2007-07-24 18:57 ` [StGIT PATCH 4/4] Port stg-whatchanged improvements to stg-mdiff and have the former use the latter Yann Dirson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070724185740.17180.72586.stgit@gandelf.nowhere.earth \
--to=ydirson@altern.org \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).