Skip to content

Commit bdb87af

Browse files
committed
Merge branch 'maint'
* maint: post-receive-email: fix accidental removal of a trailing space in signature line Escape project names before creating pathinfo URLs Escape project name in regexp bash: Add completion for git diff --base --ours --theirs diff-options.txt: document the new "--dirstat" option
2 parents 799596a + 71bd81a commit bdb87af

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

Documentation/diff-options.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ endif::git-format-patch[]
5858
number of modified files, as well as number of added and deleted
5959
lines.
6060

61+
--dirstat[=limit]::
62+
Output only the sub-directories that are impacted by a diff,
63+
and to what degree they are impacted. You can override the
64+
default cut-off in percent (3) by "--dirstat=limit". If you
65+
want to enable "cumulative" directory statistics, you can use
66+
the "--cumulative" flag, which adds up percentages recursively
67+
even when they have been already reported for a sub-directory.
68+
6169
--summary::
6270
Output a condensed summary of extended header information
6371
such as creations, renames and mode changes.

contrib/completion/git-completion.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ _git_diff ()
641641
--ignore-all-space --exit-code --quiet --ext-diff
642642
--no-ext-diff
643643
--no-prefix --src-prefix= --dst-prefix=
644+
--base --ours --theirs
644645
"
645646
return
646647
;;

contrib/hooks/post-receive-email

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,12 @@ generate_email_header()
202202

203203
generate_email_footer()
204204
{
205+
SPACE=" "
205206
cat <<-EOF
206207
207208
208209
hooks/post-receive
209-
--
210+
--${SPACE}
210211
$projectdesc
211212
EOF
212213
}

gitweb/gitweb.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ sub evaluate_path_info {
511511
}
512512
# do not change any parameters if an action is given using the query string
513513
return if $action;
514-
$path_info =~ s,^$project/*,,;
514+
$path_info =~ s,^\Q$project\E/*,,;
515515
my ($refname, $pathname) = split(/:/, $path_info, 2);
516516
if (defined $pathname) {
517517
# we got "project.git/branch:filename" or "project.git/branch:dir/"
@@ -633,7 +633,7 @@ (%)
633633
my ($use_pathinfo) = gitweb_check_feature('pathinfo');
634634
if ($use_pathinfo) {
635635
# use PATH_INFO for project name
636-
$href .= "/$params{'project'}" if defined $params{'project'};
636+
$href .= "/".esc_url($params{'project'}) if defined $params{'project'};
637637
delete $params{'project'};
638638

639639
# Summary just uses the project path URL
@@ -2575,7 +2575,7 @@ sub git_header_html {
25752575
my $action = $my_uri;
25762576
my ($use_pathinfo) = gitweb_check_feature('pathinfo');
25772577
if ($use_pathinfo) {
2578-
$action .= "/$project";
2578+
$action .= "/".esc_url($project);
25792579
} else {
25802580
$cgi->param("p", $project);
25812581
}

0 commit comments

Comments
 (0)