Merge branch 'sk/svnimport' into next

* sk/svnimport:
  git-svnimport: Parse log message for Signed-off-by: lines
  Quote arguments to tr in test-lib
  Fix snapshot link in tree view
  gitweb: Fix @git_base_url_list usage
  gitweb: Fix tree link associated with each commit log entry.
  Make path in tree view look nicer
This commit is contained in:
Junio C Hamano
2006-09-22 20:53:16 -07:00
3 changed files with 29 additions and 20 deletions

View File

@@ -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 <<END;
@@ -39,12 +39,12 @@ Usage: ${\basename $0} # fetch/update GIT from SVN
[-o branch-for-HEAD] [-h] [-v] [-l max_rev]
[-C GIT_repository] [-t tagname] [-T trunkname] [-b branchname]
[-d|-D] [-i] [-u] [-r] [-I ignorefilename] [-s start_chg]
[-m] [-M regex] [-A author_file] [SVN_URL]
[-m] [-M regex] [-A author_file] [-S] [SVN_URL]
END
exit(1);
}
getopts("A:b:C:dDhiI:l:mM:o:rs:t:T:uv") or usage();
getopts("A:b:C:dDhiI:l:mM:o:rs:t:T:Suv") or usage();
usage if $opt_h;
my $tag_name = $opt_t || "tags";
@@ -531,21 +531,30 @@ sub copy_path($$$$$$$$) {
sub commit {
my($branch, $changed_paths, $revision, $author, $date, $message) = @_;
my($author_name,$author_email,$dest);
my($committer_name,$committer_email,$dest);
my($author_name,$author_email);
my(@old,@new,@parents);
if (not defined $author or $author eq "") {
$author_name = $author_email = "unknown";
$committer_name = $committer_email = "unknown";
} elsif (defined $users_file) {
die "User $author is not listed in $users_file\n"
unless exists $users{$author};
($author_name,$author_email) = @{$users{$author}};
($committer_name,$committer_email) = @{$users{$author}};
} elsif ($author =~ /^(.*?)\s+<(.*)>$/) {
($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";

View File

@@ -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;
@@ -1520,14 +1520,14 @@ sub git_print_page_path {
print "<div class=\"page_path\">";
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);
}
@@ -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));
@@ -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") .
"<br/>\n" .
"</div>\n" .
"<i>" . esc_html($co{'author_name'}) . " [$ad{'rfc2822'}]</i><br/>\n" .

View File

@@ -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 ! *"