Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: [PATCH 2/6] git commit --dry-run -v: show diff in color when asked
Date: Sat, 15 Aug 2009 03:06:39 -0700	[thread overview]
Message-ID: <1250330803-22171-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1250330803-22171-2-git-send-email-gitster@pobox.com>

The earlier implementation of --dry-run didn't duplicate the use of color
"git status -v" set up for diff output.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

* Fixes what is already queued in 'next'.

 builtin-commit.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index 1c200eb..200ffda 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -979,9 +979,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 	argc = parse_and_validate_options(argc, argv, builtin_commit_usage,
 					  prefix, &s);
-	if (dry_run)
+	if (dry_run) {
+		if (diff_use_color_default == -1)
+			diff_use_color_default = git_use_color_default;
 		return dry_run_commit(argc, argv, prefix, &s);
-
+	}
 	index_file = prepare_index(argc, argv, prefix, 0);
 
 	/* Set up everything for writing the commit object.  This includes
-- 
1.6.4.224.g3be84

  reply	other threads:[~2009-08-15 10:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-15 10:06 [PATCH 0/6] "git commit --dry-run" updates Junio C Hamano
2009-08-15 10:06 ` [PATCH 1/6] Documentation/git-commit.txt: describe --dry-run Junio C Hamano
2009-08-15 10:06   ` Junio C Hamano [this message]
2009-08-15 10:06     ` [PATCH 3/6] git stat: the beginning Junio C Hamano
2009-08-15 10:06       ` [PATCH 4/6] git stat: pathspec limits, unlike traditional "git status" Junio C Hamano
2009-08-15 10:06         ` [PATCH 5/6] git stat -s: short status output Junio C Hamano
2009-08-15 10:06           ` [PATCH 6/6] git status: not "commit --dry-run" anymore Junio C Hamano
2009-08-17 10:01 ` [PATCH 0/6] "git commit --dry-run" updates Thomas Rast
2009-08-17 15:57   ` Junio C Hamano
2009-08-17 19:16     ` Thomas Rast

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=1250330803-22171-3-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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