From 37152d831048a0b30600a7b7e7926af2d5bcfab8 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Mon, 21 Apr 2008 18:15:52 +0000 Subject: diff-options.txt: document the new "--dirstat" option This commit adds the documentation for the new option added by 7df7c01 (Add "--dirstat" for some directory statistics, 2008-02-12). Noticed by Clint Adams, reported through http://bugs.debian.org/476437 Signed-off-by: Gerrit Pape Signed-off-by: Junio C Hamano diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 8dc5b00..01e7a57 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -58,6 +58,14 @@ endif::git-format-patch[] number of modified files, as well as number of added and deleted lines. +--dirstat[=limit]:: + Output only the sub-directories that are impacted by a diff, + and to what degree they are impacted. You can override the + default cut-off in percent (3) by "--dirstat=limit". If you + want to enable "cumulative" directory statistics, you can use + the "--cumulative" flag, which adds up percentages recursively + even when they have been already reported for a sub-directory. + --summary:: Output a condensed summary of extended header information such as creations, renames and mode changes. -- cgit v0.10.2-6-g49f6 From f45741390844778f5b286cf6607cd767636e5c57 Mon Sep 17 00:00:00 2001 From: Teemu Likonen Date: Sun, 20 Apr 2008 22:32:47 +0300 Subject: bash: Add completion for git diff --base --ours --theirs Signed-off-by: Teemu Likonen Acked-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 4d81963..6949cac 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -641,6 +641,7 @@ _git_diff () --ignore-all-space --exit-code --quiet --ext-diff --no-ext-diff --no-prefix --src-prefix= --dst-prefix= + --base --ours --theirs " return ;; -- cgit v0.10.2-6-g49f6 From bbd4c307fc315847c975efd4c9aa32eb0e8470fb Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 20 Apr 2008 23:03:56 +0200 Subject: Escape project name in regexp The project name, when used in a regular expression, needs to be quoted properly, so that stuff like '++' in the project name does not cause Perl to barf. Related info: http://bugs.debian.org/476076 This is a bug in Perl's CGI.pm, but fixing that exposed a similar bug in gitweb.perl Signed-off-by: martin f. krafft Signed-off-by: Junio C Hamano diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 746153f..4abd7ac 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -506,7 +506,7 @@ sub evaluate_path_info { } # do not change any parameters if an action is given using the query string return if $action; - $path_info =~ s,^$project/*,,; + $path_info =~ s,^\Q$project\E/*,,; my ($refname, $pathname) = split(/:/, $path_info, 2); if (defined $pathname) { # we got "project.git/branch:filename" or "project.git/branch:dir/" -- cgit v0.10.2-6-g49f6 From 85d17a123ba59b90744e311e40f80fd8838fbdc5 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 20 Apr 2008 23:23:38 +0200 Subject: Escape project names before creating pathinfo URLs If a project name contains special URL characters like +, gitweb's links break in subtle ways. The solution is to pass the project name through esc_url() and using the return value. Signed-off-by: martin f. krafft Signed-off-by: Junio C Hamano diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 4abd7ac..12843a4 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -628,7 +628,7 @@ sub href(%) { my ($use_pathinfo) = gitweb_check_feature('pathinfo'); if ($use_pathinfo) { # use PATH_INFO for project name - $href .= "/$params{'project'}" if defined $params{'project'}; + $href .= "/".esc_url($params{'project'}) if defined $params{'project'}; delete $params{'project'}; # Summary just uses the project path URL @@ -2570,7 +2570,7 @@ EOF my $action = $my_uri; my ($use_pathinfo) = gitweb_check_feature('pathinfo'); if ($use_pathinfo) { - $action .= "/$project"; + $action .= "/".esc_url($project); } else { $cgi->param("p", $project); } -- cgit v0.10.2-6-g49f6 From 71bd81ade2973a304889d94426c922cc096019a2 Mon Sep 17 00:00:00 2001 From: Andy Parkins Date: Mon, 21 Apr 2008 14:44:44 +0100 Subject: post-receive-email: fix accidental removal of a trailing space in signature line post-receive-email adds a signature to the end of emails in generate_email_footer(). The signature was separated from the main email body using the standard string "-- ". (see RFC 3676) a6080a0 (War on whitespace, 2007-06-07) removed the trailing whitespace from "-- ", leaving it as "--", which is not a correct signature separator. This patch restores the missing space, but does it in a way that will not set off the trailing whitespace alarms. Signed-off-by: Andy Parkins Signed-off-by: Junio C Hamano diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email index 62a740c..4136895 100644 --- a/contrib/hooks/post-receive-email +++ b/contrib/hooks/post-receive-email @@ -202,11 +202,12 @@ generate_email_header() generate_email_footer() { + SPACE=" " cat <<-EOF hooks/post-receive - -- + --${SPACE} $projectdesc EOF } -- cgit v0.10.2-6-g49f6