git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/5] gitweb: Add 'status_str' to parse_difftree_raw_line output
@ 2007-09-21 21:41 Jakub Narebski
  0 siblings, 0 replies; only message in thread
From: Jakub Narebski @ 2007-09-21 21:41 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

Add 'status_str' to diffinfo output, which stores status (also for
merge commit) as a string.  This allows for easy checking if there is
given status among all for merge commit, e.g.
  $diffinfo->{'status_str'} =~ /D/

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is to simplify _future_ code, so I won't cry if it is not
accepted without some code that needs it.

 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

[-- Attachment #2: 0005-gitweb-Add-status_str-to-parse_difftree_raw_line.patch --]
[-- Type: application/octet-stream, Size: 1501 bytes --]

From d5d0886111e98dc281d8503daa1ce655ea7729bf Mon Sep 17 00:00:00 2001
From: Jakub Narebski <jnareb@gmail.com>
Date: Thu, 13 Sep 2007 21:57:20 +0200
Subject: [PATCH 5/5] gitweb: Add 'status_str' to parse_difftree_raw_line output

Add 'status_str' to diffinfo output, which stores status (also for
merge commit) as a string.  This allows for easy checking if there is
given status among all for merge commit, e.g.
  $diffinfo->{'status_str'} =~ /D/

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is to simplify _future_ code, so I won't cry if it is not
accepted without some code that needs it.

 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6c79a95..adc1b32 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1963,7 +1963,7 @@ sub parse_difftree_raw_line {
 		$res{'to_mode'} = $2;
 		$res{'from_id'} = $3;
 		$res{'to_id'} = $4;
-		$res{'status'} = $5;
+		$res{'status'} = $res{'status_str'} = $5;
 		$res{'similarity'} = $6;
 		if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied
 			($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7);
@@ -1979,6 +1979,7 @@ sub parse_difftree_raw_line {
 		$res{'to_mode'} = pop @{$res{'from_mode'}};
 		$res{'from_id'} = [ split(' ', $3) ];
 		$res{'to_id'} = pop @{$res{'from_id'}};
+		$res{'status_str'} = $4;
 		$res{'status'} = [ split('', $4) ];
 		$res{'to_file'} = unquote($5);
 	}
-- 
1.5.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-21 21:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-21 21:41 [PATCH 5/5] gitweb: Add 'status_str' to parse_difftree_raw_line output Jakub Narebski

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).