From: Jakub Narebski Date: Fri, 21 Sep 2007 21:41:12 GMT Subject: [PATCH 5/5] gitweb: Add 'status_str' to parse_difftree_raw_line output Message-ID: <8fe92b430709211441x59489fc7u5b784ad70e8e903f@mail.gmail.com> 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 --- 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(-) From d5d0886111e98dc281d8503daa1ce655ea7729bf Mon Sep 17 00:00:00 2001 From: Jakub Narebski 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 --- 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