git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Wong <andrew.kw.w@gmail.com>
To: git@vger.kernel.org
Cc: Matthieu.Moy@imag.fr, Andrew Wong <andrew.kw.w@gmail.com>
Subject: [PATCH] git add -e: Explicitly specify that patch should have no color
Date: Thu, 18 Jul 2013 18:58:04 -0400	[thread overview]
Message-ID: <1374188284-27638-1-git-send-email-andrew.kw.w@gmail.com> (raw)

After this commit:
    4c7f1819b3c142ace98269a556bc929c80e7c9fd make color.ui default to 'auto'
the patch file for 'git add -e' receives all the color codes.  This is because
diffopt.use_color defaults to -1, which causes want_color to now return 'auto'.

By explicitly setting use_color to 0, we can ensure the diff output has no
color codes in it.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
---
 builtin/add.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/builtin/add.c b/builtin/add.c
index f45d9d4..8266a9c 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -343,6 +343,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 
 	argc = setup_revisions(argc, argv, &rev, NULL);
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
+	rev.diffopt.use_color = 0;
 	DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
 	out = open(file, O_CREAT | O_WRONLY, 0666);
 	if (out < 0)
-- 
1.8.3.3.755.gbf91598

             reply	other threads:[~2013-07-18 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 22:58 Andrew Wong [this message]
2013-07-19  8:49 ` [PATCH] git add -e: Explicitly specify that patch should have no color Matthieu Moy

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=1374188284-27638-1-git-send-email-andrew.kw.w@gmail.com \
    --to=andrew.kw.w@gmail.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).