Git development
 help / color / mirror / Atom feed
* [PATCH] Fix "git-diff-script A B"
@ 2005-08-23  1:07 Junio C Hamano
  0 siblings, 0 replies; only message in thread
From: Junio C Hamano @ 2005-08-23  1:07 UTC (permalink / raw)
  To: git

When "git-diff-script A..B" notation was introduced, it ended up breaking
the traditional two revisions notation.

[jc: there are other issues with the current "git diff" I would like to
 address, but they would be left to later rounds.  For example, -M and -p flags
 should not be hardcoded default, and it shouldn't be too hard to rewrite
 the script without using shell arrays.]

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 git-diff-script |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

30e852431bd6b6f8395646749c5baa8cfca88b51
diff --git a/git-diff-script b/git-diff-script
--- a/git-diff-script
+++ b/git-diff-script
@@ -8,8 +8,14 @@ case "${#rev[*]}" in
 1)
 	git-diff-cache -M -p "$@";;
 2)
-	begin=$(echo "${rev[1]}" | tr -d '^')
-	end="${rev[0]}"
+	case "${rev[1]}" in
+	^?*)
+		begin=$(echo "${rev[1]}" | tr -d '^')
+		end="${rev[0]}" ;;
+	*)
+		begin="${rev[0]}"
+		end="${rev[1]}"	;;
+	esac
 	git-diff-tree -M -p $flags $begin $end $files;;
 *)
 	echo "I don't understand"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-23  1:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-23  1:07 [PATCH] Fix "git-diff-script A B" Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox