From: Junio C Hamano Date: Tue, 22 Apr 2008 07:10:20 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.5.6-rc0~127 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/bdb87afb4b425d97f7b5e957cbed1589969d9a24?ds=inline;hp=-c 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 --- bdb87afb4b425d97f7b5e957cbed1589969d9a24 diff --combined contrib/completion/git-completion.bash index 6012047ee5,6949cac45d..665a895f5e --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -152,7 -152,7 +152,7 @@@ __git_heads ( done return fi - for i in $(git-ls-remote "$1" 2>/dev/null); do + for i in $(git ls-remote "$1" 2>/dev/null); do case "$is_hash,$i" in y,*) is_hash=n ;; n,*^{}) is_hash=y ;; @@@ -173,7 -173,7 +173,7 @@@ __git_tags ( done return fi - for i in $(git-ls-remote "$1" 2>/dev/null); do + for i in $(git ls-remote "$1" 2>/dev/null); do case "$is_hash,$i" in y,*) is_hash=n ;; n,*^{}) is_hash=y ;; @@@ -200,7 -200,7 +200,7 @@@ __git_refs ( done return fi - for i in $(git-ls-remote "$dir" 2>/dev/null); do + for i in $(git ls-remote "$dir" 2>/dev/null); do case "$is_hash,$i" in y,*) is_hash=n ;; n,*^{}) is_hash=y ;; @@@ -223,7 -223,7 +223,7 @@@ __git_refs2 ( __git_refs_remotes () { local cmd i is_hash=y - for i in $(git-ls-remote "$1" 2>/dev/null); do + for i in $(git ls-remote "$1" 2>/dev/null); do case "$is_hash,$i" in n,refs/heads/*) is_hash=y @@@ -641,6 -641,7 +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 ;; @@@ -1052,7 -1053,6 +1053,7 @@@ _git_remote ( local subcommands="add rm show prune update" local subcommand="$(__git_find_subcommand "$subcommands")" if [ -z "$subcommand" ]; then + __gitcomp "$subcommands" return fi diff --combined gitweb/gitweb.perl index a48bebb1bc,12843a4846..f83567ec39 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@@ -369,12 -369,7 +369,12 @@@ sub filter_snapshot_fmts } our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++"; -do $GITWEB_CONFIG if -e $GITWEB_CONFIG; +if (-e $GITWEB_CONFIG) { + do $GITWEB_CONFIG; +} else { + our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++"; + do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM; +} # version of the core git binary our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown"; @@@ -511,7 -506,7 +511,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/" @@@ -633,7 -628,7 +633,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 @@@ -2575,7 -2570,7 +2575,7 @@@ EO 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); }