From 26d0a976e88cf2e1ccb0b4d8172e9ce24d144d1f Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 23 Sep 2006 01:00:12 +0200 Subject: [PATCH 1/6] Make path in tree view look nicer Based on talk on the IRC with Junio some evenings ago, I've updated the path showing in tree view to look better and sent updated patches privately, but it seems the old version ended up being used, so here's the new one again. Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 1ce49732bb..b9df3cc06b 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1520,14 +1520,14 @@ sub git_print_page_path { print "
"; print $cgi->a({-href => href(action=>"tree", hash_base=>$hb), - -title => '/'}, '/'); - print " "; + -title => 'tree root'}, "[$project]"); + print " / "; foreach my $dir (@dirname) { $fullname .= ($fullname ? '/' : '') . $dir; print $cgi->a({-href => href(action=>"tree", file_name=>$fullname, hash_base=>$hb), - -title => $fullname}, esc_html($dir . '/')); - print " "; + -title => $fullname}, esc_html($dir)); + print " / "; } if (defined $type && $type eq 'blob') { print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name, @@ -1536,7 +1536,7 @@ sub git_print_page_path { } elsif (defined $type && $type eq 'tree') { print $cgi->a({-href => href(action=>"tree", file_name=>$file_name, hash_base=>$hb), - -title => $name}, esc_html($basename . '/')); + -title => $name}, esc_html($basename)); } else { print esc_html($basename); } From d72672074361a738afbf3139d8921ddf8bd782f8 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 22 Sep 2006 16:56:43 -0700 Subject: [PATCH 2/6] gitweb: Fix tree link associated with each commit log entry. The link forgot to have hb parameter and the resulting tree view failed to show the navbar for that commit. Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index b9df3cc06b..30d7d76723 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2871,7 +2871,7 @@ sub git_log { " | " . $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " . - $cgi->a({-href => href(action=>"tree", hash=>$commit), hash_base=>$commit}, "tree") . + $cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree") . "
\n" . "
\n" . "" . esc_html($co{'author_name'}) . " [$ad{'rfc2822'}]
\n" . From 74d6166751ddcf08029ffc90a14158a86f80cd40 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 23 Sep 2006 01:15:18 +0200 Subject: [PATCH 3/6] gitweb: Fix @git_base_url_list usage As it is now, that array was never used because the customurl accessor was broken and ''unless @url_list'' never happenned. Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 30d7d76723..7ff5c047f3 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -752,7 +752,7 @@ sub git_get_project_description { sub git_get_project_url_list { my $path = shift; - open my $fd, "$projectroot/$path/cloneurl" or return undef; + open my $fd, "$projectroot/$path/cloneurl" or return; my @git_project_url_list = map { chomp; $_ } <$fd>; close $fd; From 5c7d2cf3d6a059038d8d0bda6a76fa7818a9caa0 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 23 Sep 2006 01:21:20 +0200 Subject: [PATCH 4/6] Fix snapshot link in tree view It would just give HEAD snapshot instead of one of the particular tree. Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 7ff5c047f3..3d06181229 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2762,7 +2762,7 @@ sub git_tree { if ($have_snapshot) { # FIXME: Should be available when we have no hash base as well. push @views_nav, - $cgi->a({-href => href(action=>"snapshot")}, + $cgi->a({-href => href(action=>"snapshot", hash=>$hash)}, "snapshot"); } git_print_page_nav('tree','', $hash_base, undef, undef, join(' | ', @views_nav)); From 3d5c0cc9387b35df47c988fbc0e4379e413d783e Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sat, 23 Sep 2006 00:35:20 +0200 Subject: [PATCH 5/6] Quote arguments to tr in test-lib When there are single-character filenames in the test directory, the shell tries to expand regexps meant for tr. Signed-off-by: Junio C Hamano --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index e2629339d4..e75ad5faac 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -34,7 +34,7 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME export EDITOR VISUAL -case $(echo $GIT_TRACE |tr [A-Z] [a-z]) in +case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in 1|2|true) echo "* warning: Some tests will not work if GIT_TRACE" \ "is set as to trace on STDERR ! *" From ae35b30433f5b732bd21f9577711584e3f9bba06 Mon Sep 17 00:00:00 2001 From: Sasha Khapyorsky Date: Tue, 5 Sep 2006 21:46:11 +0300 Subject: [PATCH 6/6] git-svnimport: Parse log message for Signed-off-by: lines This add '-S' option. When specified svn-import will try to parse commit message for 'Signed-off-by: ...' line, and if found will use the name and email address extracted at first occurrence as this commit author name and author email address. Committer name and email are extracted in usual way. Signed-off-by: Sasha Khapyorsky Signed-off-by: Junio C Hamano --- git-svnimport.perl | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/git-svnimport.perl b/git-svnimport.perl index 26dc454795..ed628974d7 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -31,7 +31,7 @@ $SIG{'PIPE'}="IGNORE"; $ENV{'TZ'}="UTC"; our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T, - $opt_b,$opt_r,$opt_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D); + $opt_b,$opt_r,$opt_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D,$opt_S); sub usage() { print STDERR <$/) { - ($author_name, $author_email) = ($1, $2); + ($committer_name, $committer_email) = ($1, $2); } else { $author =~ s/^<(.*)>$/$1/; - $author_name = $author_email = $author; + $committer_name = $committer_email = $author; } + + if ($opt_S && $message =~ /Signed-off-by:\s+(.*?)\s+<(.*)>\s*\n/) { + ($author_name, $author_email) = ($1, $2); + } else { + $author_name = $committer_name; + $author_email = $committer_email; + } + $date = pdate($date); my $tag; @@ -772,8 +781,8 @@ sub commit { "GIT_AUTHOR_NAME=$author_name", "GIT_AUTHOR_EMAIL=$author_email", "GIT_AUTHOR_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)), - "GIT_COMMITTER_NAME=$author_name", - "GIT_COMMITTER_EMAIL=$author_email", + "GIT_COMMITTER_NAME=$committer_name", + "GIT_COMMITTER_EMAIL=$committer_email", "GIT_COMMITTER_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)), "git-commit-tree", $tree,@par); die "Cannot exec git-commit-tree: $!\n"; @@ -825,7 +834,7 @@ sub commit { print $out ("object $cid\n". "type commit\n". "tag $dest\n". - "tagger $author_name <$author_email>\n") and + "tagger $committer_name <$committer_email>\n") and close($out) or die "Cannot create tag object $dest: $!\n";