# [PATCH] gitweb: Add history and blame to git_difftree_body()

4 messages from 2006-09-28 to 2006-10-02. Participants: Luben Tuikov, Jakub Narebski.
Thread: https://gitlist.dev/t/5727

## Luben Tuikov, 2006-09-28 00:24

Subject: [PATCH] gitweb: Add history and blame to git_difftree_body()
Message-ID: <20060928002449.64051.qmail@web31802.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20060928002449.64051.qmail%40web31802.mail.mud.yahoo.com

```
Add blame and history to Deleted files.
Add blame and history to Modified or Type changed files.
Add blame and history to Renamed or Copied files.

This allows us to do
	blame->commit->blame->commit->blame->...
instead of
	blame->commit->file->blame->commit->file->blame->...
which is longer and easier to get wrong.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)


diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c87f60e..f772fa3 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1721,9 +1721,12 @@ sub git_difftree_body {
 				print $cgi->a({-href => "#patch$patchno"}, "patch");
 				print " | ";
 			}
+			print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
+						     file_name=>$diff{'file'})},
+				      "blame") . " | ";
 			print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
-			                             file_name=>$diff{'file'})},
-			              "history");
+						     file_name=>$diff{'file'})},
+				      "history");
 			print "</td>\n";
 
 		} elsif ($diff{'status'} eq "M" || $diff{'status'} eq "T") { # modified, or type changed
@@ -1763,8 +1766,11 @@ sub git_difftree_body {
 				}
 				print " | ";
 			}
-			print $cgi->a({-href => href(action=>"history",
-						     hash_base=>$hash, file_name=>$diff{'file'})},
+			print $cgi->a({-href => href(action=>"blame", hash_base=>$hash,
+						     file_name=>$diff{'file'})},
+				      "blame") . " | ";
+			print $cgi->a({-href => href(action=>"history", hash_base=>$hash,
+						     file_name=>$diff{'file'})},
 				      "history");
 			print "</td>\n";
 
@@ -1790,17 +1796,22 @@ sub git_difftree_body {
 				if ($action eq 'commitdiff') {
 					# link to patch
 					$patchno++;
-					print " | " .
-						$cgi->a({-href => "#patch$patchno"}, "patch");
+					print $cgi->a({-href => "#patch$patchno"}, "patch");
 				} else {
-					print " | " .
-						$cgi->a({-href => href(action=>"blobdiff",
-						                       hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
-						                       hash_base=>$hash, hash_parent_base=>$parent,
-						                       file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},
-						        "diff");
+					print $cgi->a({-href => href(action=>"blobdiff",
+								     hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+								     hash_base=>$hash, hash_parent_base=>$parent,
+								     file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},
+						      "diff");
 				}
+				print " | ";
 			}
+			print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
+						     file_name=>$diff{'from_file'})},
+				      "blame") . " | ";
+			print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
+						     file_name=>$diff{'from_file'})},
+				      "history");
 			print "</td>\n";
 
 		} # we should not encounter Unmerged (U) or Unknown (X) status
-- 
1.4.2.1.g271e


```

## Jakub Narebski, 2006-10-01 16:41

Subject: Re: [PATCH] gitweb: Add history and blame to git_difftree_body()
Message-ID: <efor2e$d0i$1@sea.gmane.org>
URL: https://gitlist.dev/e/efor2e%24d0i%241%40sea.gmane.org
In-Reply-To: <20060928002449.64051.qmail@web31802.mail.mud.yahoo.com>

```
Luben Tuikov wrote:

> Add blame and history to Deleted files.
> Add blame and history to Modified or Type changed files.
> Add blame and history to Renamed or Copied files.

Blame has to be added conditionally (gitweb_have_blame).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Luben Tuikov, 2006-10-02 19:32

Subject: Re: [PATCH] gitweb: Add history and blame to git_difftree_body()
Message-ID: <20061002193217.86165.qmail@web31814.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20061002193217.86165.qmail%40web31814.mail.mud.yahoo.com
In-Reply-To: <efor2e$d0i$1@sea.gmane.org>

```
--- Jakub Narebski <jnareb@gmail.com> wrote:
> Luben Tuikov wrote:
> 
> > Add blame and history to Deleted files.
> > Add blame and history to Modified or Type changed files.
> > Add blame and history to Renamed or Copied files.
> 
> Blame has to be added conditionally (gitweb_have_blame).

Can you please not edit the CC field when you reply?
I can see that only the GIT mailing list was left,
but my email had been removed.

Thanks,
   Luben

```

## Jakub Narebski, 2006-10-02 19:55

Subject: Re: [PATCH] gitweb: Add history and blame to git_difftree_body()
Message-ID: <200610022155.24487.jnareb@gmail.com>
URL: https://gitlist.dev/e/200610022155.24487.jnareb%40gmail.com
In-Reply-To: <20061002193217.86165.qmail@web31814.mail.mud.yahoo.com>

```
Luben Tuikov wrote:
> --- Jakub Narebski <jnareb@gmail.com> wrote:
> > Luben Tuikov wrote:
> > 
> > > Add blame and history to Deleted files.
> > > Add blame and history to Modified or Type changed files.
> > > Add blame and history to Renamed or Copied files.
> > 
> > Blame has to be added conditionally (gitweb_have_blame).
> 
> Can you please not edit the CC field when you reply?
I do not edit Cc: field. I reply via GMane NNTP (Usenet)
interface.

> I can see that only the GIT mailing list was left,
> but my email had been removed.
It was not removed, it was not added.

-- 
Jakub Narebski
Poland

```
