All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Petr Baudis <pasky@ucw.cz>, git <git@vger.kernel.org>
Subject: [PATCH] Identical trees should not trigger error in cg-diff
Date: Tue, 16 Aug 2005 23:42:43 -0400	[thread overview]
Message-ID: <1124250163.26240.19.camel@dv> (raw)

Hello!

cg-diff reports error when comparing identical trees.  It's not as
useless as it may seem.  For example, I make local changes, e-mail them
upstream and then get them back via cg-update with minor changes.  I
revert the minor differences between master and origin.  Here's what I
get when I want to make sure the trees are identical (their history is
not):

$ cg-diff -r origin:master
cg-diff: trying to diff b00f462cee5b02455abdbb476fa7c9e94a9fcb4c against
itself

What's worse, cg-diff exists with exit status 1, indicating an error.  I
don't see any reason for this to be an error.  No difference between
branches is OK.  This may be especially important when cg-diff is used
non-interactively in a script.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/cg-diff b/cg-diff
--- a/cg-diff
+++ b/cg-diff
@@ -167,7 +167,7 @@ fi
 id1=$(tree-id "$id1") || exit 1
 id2=$(tree-id "$id2") || exit 1
 
-[ "$id1" = "$id2" ] && die "trying to diff $id1 against itself"
+[ "$id1" = "$id2" ] && exit 0
 
 cat $filter | xargs git-diff-tree -r -p $id1 $id2 | colorize | pager
 


-- 
Regards,
Pavel Roskin

                 reply	other threads:[~2005-08-17  3:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1124250163.26240.19.camel@dv \
    --to=proski@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=pasky@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.