{"thread":{"id":"1545","subject":"[PATCH] Identical trees should not trigger error in cg-diff","startedAt":"2005-08-17T03:42:43Z","lastAt":"2005-08-17T03:42:43Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7414","messageId":"1124250163.26240.19.camel@dv","threadId":"1545","inReplyTo":null,"subject":"[PATCH] Identical trees should not trigger error in cg-diff","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-08-17T03:42:43Z","receivedAt":"2005-08-17T03:42:43Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\ncg-diff reports error when comparing identical trees.  It's not as\nuseless as it may seem.  For example, I make local changes, e-mail them\nupstream and then get them back via cg-update with minor changes.  I\nrevert the minor differences between master and origin.  Here's what I\nget when I want to make sure the trees are identical (their history is\nnot):\n\n$ cg-diff -r origin:master\ncg-diff: trying to diff b00f462cee5b02455abdbb476fa7c9e94a9fcb4c against\nitself\n\nWhat's worse, cg-diff exists with exit status 1, indicating an error.  I\ndon't see any reason for this to be an error.  No difference between\nbranches is OK.  This may be especially important when cg-diff is used\nnon-interactively in a script.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/cg-diff b/cg-diff\n--- a/cg-diff\n+++ b/cg-diff\n@@ -167,7 +167,7 @@ fi\n id1=$(tree-id \"$id1\") || exit 1\n id2=$(tree-id \"$id2\") || exit 1\n \n-[ \"$id1\" = \"$id2\" ] && die \"trying to diff $id1 against itself\"\n+[ \"$id1\" = \"$id2\" ] && exit 0\n \n cat $filter | xargs git-diff-tree -r -p $id1 $id2 | colorize | pager\n \n\n\n-- \nRegards,\nPavel Roskin\n"}]}