{"thread":{"id":"7989","subject":"[PATCH] Add colour support in rebase and merge tree diff stats output.","startedAt":"2007-05-05T20:48:54Z","lastAt":"2007-05-05T20:48:54Z","messageCount":1,"participants":["James Bowes"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"41161","messageId":"1178398134288-git-send-email-jbowes@dangerouslyinc.com","threadId":"7989","inReplyTo":null,"subject":"[PATCH] Add colour support in rebase and merge tree diff stats output.","fromName":"James Bowes","fromEmail":"jbowes@dangerouslyinc.com","sentAt":"2007-05-05T20:48:54Z","receivedAt":"2007-05-05T20:48:54Z","isPatch":true,"sender":{"key":"jbowes@dangerouslyinc.com","avatar":"https://gravatar.com/avatar/a2fe98c66b2b47a9fa9d2ba92ff949d54c3208b1f8acc2e745b4b84ae3c4483a?d=mp&s=160"},"body":"The rebase and merge commands used diff-tree to display the summary stats of\nwhat files had changed from the operation. diff-tree does not read the\ndiff ui configuration options, so the diff.color setting was not used.\n\nHave rebase and merge call diff rather than diff-tree, which does read the\ndiff ui options.\n\nSigned-off-by: James Bowes <jbowes@dangerouslyinc.com>\n---\n \nI'm not sure if setting GIT_PAGER to '' is the best way to disable the pager\nin this case (though I'm quite certain it should be disabled), but it does\nthe trick. Perhaps there should be a git --no-pager option?\n\n git-merge.sh  |    3 ++-\n git-rebase.sh |    3 ++-\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 7ebbce4..351676f 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -90,7 +90,8 @@ finish () {\n \t?*)\n \t\tcase \"$no_summary\" in\n \t\t'')\n-\t\t\tgit-diff-tree --stat --summary -M \"$head\" \"$1\"\n+\t\t\t# We want color (if set), but no pager\n+\t\t\tGIT_PAGER='' git-diff --stat --summary -M \"$head\" \"$1\"\n \t\t\t;;\n \t\tesac\n \t\t;;\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 2dc2c4f..61770b5 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -307,7 +307,8 @@ fi\n if test -n \"$verbose\"\n then\n \techo \"Changes from $mb to $onto:\"\n-\tgit-diff-tree --stat --summary \"$mb\" \"$onto\"\n+\t# We want color (if set), but no pager\n+\tGIT_PAGER='' git-diff --stat --summary \"$mb\" \"$onto\"\n fi\n \n # Rewind the head to \"$onto\"; this saves our current head in ORIG_HEAD.\n-- \n1.5.2.rc1.741.g85102-dirty\n"}]}