login
Header Space

 
 

git-svn: Protect against "diff.color = true".

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Eric Wong <normalperson@...>, Robert Newson <robert.newson@...>
Cc: <git@...>
Date: Friday, August 31, 2007 - 5:29 pm

If the configuration of the user has "diff.color = true", the
output from "log" we invoke internally added color codes, which
broke the parser.

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

  Junio C Hamano <gitster@pobox.com> writes:

  > We probably should do two things to resolve this.
  >
  >  * Protect our scripts.  When parsing from "git log" and any
  >    other Porcelain, explicitly give --no-color.

  Here is my attempt -- I do not have an easy access to SVN repo
  to interoperate with, so a testing by real-world users and an
  Ack is appreciated.  I think some fix for this issue (not
  necessarily this patch) should be in 1.5.3 final.

 git-svn.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 4e325b7..98218da 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -807,7 +807,7 @@ sub cmt_metadata {
 
 sub working_head_info {
 	my ($head, $refs) = @_;
-	my ($fh, $ctx) = command_output_pipe('log', $head);
+	my ($fh, $ctx) = command_output_pipe('log', '--no-color', $head);
 	my $hash;
 	my %max;
 	while (<$fh>) {
@@ -2072,7 +2072,7 @@ sub rebuild {
 		return;
 	}
 	print "Rebuilding $db_path ...\n";
-	my ($log, $ctx) = command_output_pipe("log", $self->refname);
+	my ($log, $ctx) = command_output_pipe("log", '--no-color', $self->refname);
 	my $latest;
 	my $full_url = $self->full_url;
 	remove_username($full_url);
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Robert Newson, (Fri Aug 31, 8:58 am)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Junio C Hamano, (Fri Aug 31, 10:52 am)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Junio C Hamano, (Fri Aug 31, 4:50 pm)
git-svn: Protect against "diff.color = true"., Junio C Hamano, (Fri Aug 31, 5:29 pm)
Re: git-svn: Protect against "diff.color = true"., Eric Wong, (Fri Aug 31, 5:58 pm)
Re: git-svn: Protect against "diff.color = true"., Johannes Schindelin, (Fri Aug 31, 5:38 pm)
Re: git-svn: Protect against "diff.color = true"., Junio C Hamano, (Fri Aug 31, 5:46 pm)
Re: git-svn: Protect against "diff.color = true"., Johannes Schindelin, (Fri Aug 31, 5:53 pm)
Re: git-svn: Protect against "diff.color = true"., Junio C Hamano, (Fri Aug 31, 6:14 pm)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Junio C Hamano, (Fri Aug 31, 5:22 pm)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Johannes Schindelin, (Fri Aug 31, 7:51 pm)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Junio C Hamano, (Fri Aug 31, 12:09 pm)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Robert Newson, (Fri Aug 31, 12:18 pm)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Robert Newson, (Fri Aug 31, 12:25 pm)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Robert Newson, (Fri Aug 31, 12:25 pm)
Re: Perl warning in git-svn (git v1.5.3-rc7-16-ge340d7d), Robert Newson, (Fri Aug 31, 11:31 am)
speck-geostationary