diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-25T23·06+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-25T23·06+0100 |
commit | 93ba78d6f4632ef1c5228965e3edc8c0faf88c1e (patch) | |
tree | 85730c182a9f5f492ade8e8ccdb1c2356f9900bd /third_party/git/contrib | |
parent | 6f8fbf4aa4b1654ab27d4829e114538761817de0 (diff) |
revert(3p/git): Revert merge of git upstream at v2.26.2 r/852
This causes cgit to serve error pages, which is undesirable. This reverts commit 5229c9b232de5bfa959ad6ebbb4c8192ac513352, reversing changes made to f2b211131f2347342dde63975b09cf603149f1a3.
Diffstat (limited to 'third_party/git/contrib')
24 files changed, 213 insertions, 451 deletions
diff --git a/third_party/git/contrib/buildsystems/Generators/Vcxproj.pm b/third_party/git/contrib/buildsystems/Generators/Vcxproj.pm index 5c666f9ac03b..576ccabe1dbd 100644 --- a/third_party/git/contrib/buildsystems/Generators/Vcxproj.pm +++ b/third_party/git/contrib/buildsystems/Generators/Vcxproj.pm @@ -79,8 +79,7 @@ sub createProject { if (!$static_library) { $libs_release = join(";", sort(grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib)/, @{$$build_structure{"$prefix${name}_LIBS"}})); $libs_debug = $libs_release; - $libs_debug =~ s/zlib\.lib/zlibd\.lib/g; - $libs_debug =~ s/libcurl\.lib/libcurl-d\.lib/g; + $libs_debug =~ s/zlib\.lib/zlibd\.lib/; } $defines =~ s/-D//g; @@ -120,13 +119,13 @@ sub createProject { <VCPKGArch Condition="'\$(Platform)'=='Win32'">x86-windows</VCPKGArch> <VCPKGArch Condition="'\$(Platform)'!='Win32'">x64-windows</VCPKGArch> <VCPKGArchDirectory>$cdup\\compat\\vcbuild\\vcpkg\\installed\\\$(VCPKGArch)</VCPKGArchDirectory> - <VCPKGBinDirectory Condition="'\$(Configuration)'=='Debug'">\$(VCPKGArchDirectory)\\debug\\bin</VCPKGBinDirectory> - <VCPKGLibDirectory Condition="'\$(Configuration)'=='Debug'">\$(VCPKGArchDirectory)\\debug\\lib</VCPKGLibDirectory> - <VCPKGBinDirectory Condition="'\$(Configuration)'!='Debug'">\$(VCPKGArchDirectory)\\bin</VCPKGBinDirectory> - <VCPKGLibDirectory Condition="'\$(Configuration)'!='Debug'">\$(VCPKGArchDirectory)\\lib</VCPKGLibDirectory> + <VCPKGBinDirectory Condition="'\(Configuration)'=='Debug'">\$(VCPKGArchDirectory)\\debug\\bin</VCPKGBinDirectory> + <VCPKGLibDirectory Condition="'\(Configuration)'=='Debug'">\$(VCPKGArchDirectory)\\debug\\lib</VCPKGLibDirectory> + <VCPKGBinDirectory Condition="'\(Configuration)'!='Debug'">\$(VCPKGArchDirectory)\\bin</VCPKGBinDirectory> + <VCPKGLibDirectory Condition="'\(Configuration)'!='Debug'">\$(VCPKGArchDirectory)\\lib</VCPKGLibDirectory> <VCPKGIncludeDirectory>\$(VCPKGArchDirectory)\\include</VCPKGIncludeDirectory> - <VCPKGLibs Condition="'\$(Configuration)'=='Debug'">$libs_debug</VCPKGLibs> - <VCPKGLibs Condition="'\$(Configuration)'!='Debug'">$libs_release</VCPKGLibs> + <VCPKGLibs Condition="'\(Configuration)'=='Debug'">$libs_debug</VCPKGLibs> + <VCPKGLibs Condition="'\(Configuration)'!='Debug'">$libs_release</VCPKGLibs> </PropertyGroup> <Import Project="\$(VCTargetsPath)\\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'\$(Configuration)'=='Debug'" Label="Configuration"> @@ -278,9 +277,6 @@ EOM if ($target eq 'git') { print F " <Import Project=\"LinkOrCopyBuiltins.targets\" />\n"; } - if ($target eq 'git-remote-http') { - print F " <Import Project=\"LinkOrCopyRemoteHttp.targets\" />\n"; - } print F << "EOM"; </Project> EOM diff --git a/third_party/git/contrib/buildsystems/engine.pl b/third_party/git/contrib/buildsystems/engine.pl index 070978506ad5..fba8a3f056a0 100755 --- a/third_party/git/contrib/buildsystems/engine.pl +++ b/third_party/git/contrib/buildsystems/engine.pl @@ -343,9 +343,9 @@ sub handleLinkLine } elsif ("$part" eq "-lz") { push(@libs, "zlib.lib"); } elsif ("$part" eq "-lcrypto") { - push(@libs, "libcrypto.lib"); + push(@libs, "libeay32.lib"); } elsif ("$part" eq "-lssl") { - push(@libs, "libssl.lib"); + push(@libs, "ssleay32.lib"); } elsif ("$part" eq "-lcurl") { push(@libs, "libcurl.lib"); } elsif ("$part" eq "-lexpat") { diff --git a/third_party/git/contrib/coccinelle/commit.cocci b/third_party/git/contrib/coccinelle/commit.cocci index 778e4704f6a2..d03453341e84 100644 --- a/third_party/git/contrib/coccinelle/commit.cocci +++ b/third_party/git/contrib/coccinelle/commit.cocci @@ -20,7 +20,7 @@ expression s; + set_commit_tree(c, s) ...>} -// These excluded functions must access c->maybe_tree directly. +// These excluded functions must access c->maybe_tree direcly. // Note that if c->maybe_tree is written somewhere outside of these // functions, then the recommended transformation will be bogus with // repo_get_commit_tree() on the LHS. diff --git a/third_party/git/contrib/coccinelle/hashmap.cocci b/third_party/git/contrib/coccinelle/hashmap.cocci deleted file mode 100644 index d69e120ccffc..000000000000 --- a/third_party/git/contrib/coccinelle/hashmap.cocci +++ /dev/null @@ -1,16 +0,0 @@ -@ hashmap_entry_init_usage @ -expression E; -struct hashmap_entry HME; -@@ -- HME.hash = E; -+ hashmap_entry_init(&HME, E); - -@@ -identifier f !~ "^hashmap_entry_init$"; -expression E; -struct hashmap_entry *HMEP; -@@ - f(...) {<... -- HMEP->hash = E; -+ hashmap_entry_init(HMEP, E); - ...>} diff --git a/third_party/git/contrib/coccinelle/object_id.cocci b/third_party/git/contrib/coccinelle/object_id.cocci index ddf4f22bd722..3e536a9834b6 100644 --- a/third_party/git/contrib/coccinelle/object_id.cocci +++ b/third_party/git/contrib/coccinelle/object_id.cocci @@ -13,6 +13,38 @@ struct object_id *OIDPTR; @@ struct object_id OID; @@ +- sha1_to_hex(OID.hash) ++ oid_to_hex(&OID) + +@@ +identifier f != oid_to_hex; +struct object_id *OIDPTR; +@@ + f(...) {<... +- sha1_to_hex(OIDPTR->hash) ++ oid_to_hex(OIDPTR) + ...>} + +@@ +expression E; +struct object_id OID; +@@ +- sha1_to_hex_r(E, OID.hash) ++ oid_to_hex_r(E, &OID) + +@@ +identifier f != oid_to_hex_r; +expression E; +struct object_id *OIDPTR; +@@ + f(...) {<... +- sha1_to_hex_r(E, OIDPTR->hash) ++ oid_to_hex_r(E, OIDPTR) + ...>} + +@@ +struct object_id OID; +@@ - hashclr(OID.hash) + oidclr(&OID) diff --git a/third_party/git/contrib/completion/git-completion.bash b/third_party/git/contrib/completion/git-completion.bash index c21786f2fd00..e087c4bf0085 100644 --- a/third_party/git/contrib/completion/git-completion.bash +++ b/third_party/git/contrib/completion/git-completion.bash @@ -340,7 +340,7 @@ __gitcomp () c="$c${4-}" if [[ $c == "$cur_"* ]]; then case $c in - --*=|*.) ;; + --*=*|*.) ;; *) c="$c " ;; esac COMPREPLY[i++]="${2-}$c" @@ -360,7 +360,7 @@ __gitcomp () c="$c${4-}" if [[ $c == "$cur_"* ]]; then case $c in - *=|*.) ;; + --*=*|*.) ;; *) c="$c " ;; esac COMPREPLY[i++]="${2-}$c" @@ -524,7 +524,7 @@ __git_index_files () # Even when a directory name itself does not contain # any special characters, it will still be quoted if # any of its (stripped) trailing path components do. - # Because of this we may have seen the same directory + # Because of this we may have seen the same direcory # both quoted and unquoted. if (p in paths) # We have seen the same directory unquoted, @@ -550,7 +550,7 @@ __git_index_files () esc_idx, 1) } else if (esc == "n") { # Uh-oh, a newline character. - # We cannot reliably put a pathname + # We cant reliably put a pathname # containing a newline into COMPREPLY, # and the newline would create a mess. # Skip this path. @@ -565,7 +565,7 @@ __git_index_files () } } # Drop closing double quote, if there is one. - # (There is not any if this is a directory, as it was + # (There isnt any if this is a directory, as it was # already stripped with the trailing path components.) if (substr(p, length(p), 1) == "\"") out = out substr(p, 1, length(p) - 1) @@ -1069,32 +1069,15 @@ __git_aliased_command () done } -# Check whether one of the given words is present on the command line, -# and print the first word found. -# -# Usage: __git_find_on_cmdline [<option>]... "<wordlist>" -# --show-idx: Optionally show the index of the found word in the $words array. +# __git_find_on_cmdline requires 1 argument __git_find_on_cmdline () { - local word c=1 show_idx - - while test $# -gt 1; do - case "$1" in - --show-idx) show_idx=y ;; - *) return 1 ;; - esac - shift - done - local wordlist="$1" - + local word subcommand c=1 while [ $c -lt $cword ]; do - for word in $wordlist; do - if [ "$word" = "${words[c]}" ]; then - if [ -n "$show_idx" ]; then - echo "$c $word" - else - echo "$word" - fi + word="${words[c]}" + for subcommand in $1; do + if [ "$subcommand" = "$word" ]; then + echo "$subcommand" return fi done @@ -1197,7 +1180,6 @@ __git_count_arguments () __git_whitespacelist="nowarn warn error error-all fix" __git_patchformat="mbox stgit stgit-series hg mboxrd" -__git_showcurrentpatch="diff raw" __git_am_inprogress_options="--skip --continue --resolved --abort --quit --show-current-patch" _git_am () @@ -1216,10 +1198,6 @@ _git_am () __gitcomp "$__git_patchformat" "" "${cur##--patch-format=}" return ;; - --show-current-patch=*) - __gitcomp "$__git_showcurrentpatch" "" "${cur##--show-current-patch=}" - return - ;; --*) __gitcomp_builtin am "" \ "$__git_am_inprogress_options" @@ -1272,7 +1250,10 @@ _git_archive () return ;; --*) - __gitcomp_builtin archive "--format= --list --verbose --prefix= --worktree-attributes" + __gitcomp " + --format= --list --verbose + --prefix= --remote= --exec= --output + " return ;; esac @@ -1380,9 +1361,7 @@ _git_checkout () esac } -__git_sequencer_inprogress_options="--continue --quit --abort --skip" - -__git_cherry_pick_inprogress_options=$__git_sequencer_inprogress_options +__git_cherry_pick_inprogress_options="--continue --quit --abort" _git_cherry_pick () { @@ -1420,18 +1399,7 @@ _git_clean () _git_clone () { - case "$prev" in - -c|--config) - __git_complete_config_variable_name_and_value - return - ;; - esac case "$cur" in - --config=*) - __git_complete_config_variable_name_and_value \ - --cur="${cur##--config=}" - return - ;; --*) __gitcomp_builtin clone return @@ -1492,16 +1460,9 @@ __git_diff_algorithms="myers minimal patience histogram" __git_diff_submodule_formats="diff log short" -__git_color_moved_opts="no default plain blocks zebra dimmed-zebra" - -__git_color_moved_ws_opts="no ignore-space-at-eol ignore-space-change - ignore-all-space allow-indentation-change" - __git_diff_common_options="--stat --numstat --shortstat --summary --patch-with-stat --name-only --name-status --color --no-color --color-words --no-renames --check - --color-moved --color-moved= --no-color-moved - --color-moved-ws= --no-color-moved-ws --full-index --binary --abbrev --diff-filter= --find-copies-harder --ignore-cr-at-eol --text --ignore-space-at-eol --ignore-space-change @@ -1515,8 +1476,6 @@ __git_diff_common_options="--stat --numstat --shortstat --summary --dirstat-by-file= --cumulative --diff-algorithm= --submodule --submodule= --ignore-submodules - --indent-heuristic --no-indent-heuristic - --textconv --no-textconv " _git_diff () @@ -1532,14 +1491,6 @@ _git_diff () __gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}" return ;; - --color-moved=*) - __gitcomp "$__git_color_moved_opts" "" "${cur##--color-moved=}" - return - ;; - --color-moved-ws=*) - __gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}" - return - ;; --*) __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex --base --ours --theirs --no-index @@ -1786,7 +1737,7 @@ __git_log_shortlog_options=" --all-match --invert-grep " -__git_log_pretty_formats="oneline short medium full fuller reference email raw format: tformat: mboxrd" +__git_log_pretty_formats="oneline short medium full fuller email raw format: mboxrd" __git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default raw unix format:" _git_log () @@ -1833,10 +1784,6 @@ _git_log () __gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}" return ;; - --no-walk=*) - __gitcomp "sorted unsorted" "" "${cur##--no-walk=}" - return - ;; --*) __gitcomp " $__git_log_common_options @@ -1844,19 +1791,16 @@ _git_log () $__git_log_gitk_options --root --topo-order --date-order --reverse --follow --full-diff - --abbrev-commit --no-abbrev-commit --abbrev= + --abbrev-commit --abbrev= --relative-date --date= --pretty= --format= --oneline --show-signature --cherry-mark --cherry-pick --graph - --decorate --decorate= --no-decorate + --decorate --decorate= --walk-reflogs - --no-walk --no-walk= --do-walk --parents --children - --expand-tabs --expand-tabs= --no-expand-tabs - --patch $merge $__git_diff_common_options --pickaxe-all --pickaxe-regex @@ -2060,18 +2004,15 @@ _git_range_diff () __git_complete_revlist } -__git_rebase_inprogress_options="--continue --skip --abort --quit --show-current-patch" -__git_rebase_interactive_inprogress_options="$__git_rebase_inprogress_options --edit-todo" - _git_rebase () { __git_find_repo_path if [ -f "$__git_repo_path"/rebase-merge/interactive ]; then - __gitcomp "$__git_rebase_interactive_inprogress_options" + __gitcomp "--continue --skip --abort --quit --edit-todo --show-current-patch" return elif [ -d "$__git_repo_path"/rebase-apply ] || \ [ -d "$__git_repo_path"/rebase-merge ]; then - __gitcomp "$__git_rebase_inprogress_options" + __gitcomp "--continue --skip --abort --quit --show-current-patch" return fi __git_complete_strategy && return @@ -2080,13 +2021,20 @@ _git_rebase () __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" return ;; - --onto=*) - __git_complete_refs --cur="${cur##--onto=}" - return - ;; --*) - __gitcomp_builtin rebase "" \ - "$__git_rebase_interactive_inprogress_options" + __gitcomp " + --onto --merge --strategy --interactive + --rebase-merges --preserve-merges --stat --no-stat + --committer-date-is-author-date --ignore-date + --ignore-whitespace --whitespace= + --autosquash --no-autosquash + --fork-point --no-fork-point + --autostash --no-autostash + --verify --no-verify + --keep-empty --root --force-rebase --no-ff + --rerere-autoupdate + --exec + " return esac @@ -2277,282 +2225,181 @@ __git_config_vars= __git_compute_config_vars () { test -n "$__git_config_vars" || - __git_config_vars="$(git help --config-for-completion | sort -u)" + __git_config_vars="$(git help --config-for-completion | sort | uniq)" } -# Completes possible values of various configuration variables. -# -# Usage: __git_complete_config_variable_value [<option>]... -# --varname=<word>: The name of the configuration variable whose value is -# to be completed. Defaults to the previous word on the -# command line. -# --cur=<word>: The current value to be completed. Defaults to the current -# word to be completed. -__git_complete_config_variable_value () +_git_config () { - local varname="$prev" cur_="$cur" - - while test $# != 0; do - case "$1" in - --varname=*) varname="${1##--varname=}" ;; - --cur=*) cur_="${1##--cur=}" ;; - *) return 1 ;; - esac - shift - done + local varname if [ "${BASH_VERSINFO[0]:-0}" -ge 4 ]; then - varname="${varname,,}" + varname="${prev,,}" else - varname="$(echo "$varname" |tr A-Z a-z)" + varname="$(echo "$prev" |tr A-Z a-z)" fi case "$varname" in branch.*.remote|branch.*.pushremote) - __gitcomp_nl "$(__git_remotes)" "" "$cur_" + __gitcomp_nl "$(__git_remotes)" return ;; branch.*.merge) - __git_complete_refs --cur="$cur_" + __git_complete_refs return ;; branch.*.rebase) - __gitcomp "false true merges preserve interactive" "" "$cur_" + __gitcomp "false true merges preserve interactive" return ;; remote.pushdefault) - __gitcomp_nl "$(__git_remotes)" "" "$cur_" + __gitcomp_nl "$(__git_remotes)" return ;; remote.*.fetch) - local remote="${varname#remote.}" + local remote="${prev#remote.}" remote="${remote%.fetch}" - if [ -z "$cur_" ]; then + if [ -z "$cur" ]; then __gitcomp_nl "refs/heads/" "" "" "" return fi - __gitcomp_nl "$(__git_refs_remotes "$remote")" "" "$cur_" + __gitcomp_nl "$(__git_refs_remotes "$remote")" return ;; remote.*.push) - local remote="${varname#remote.}" + local remote="${prev#remote.}" remote="${remote%.push}" __gitcomp_nl "$(__git for-each-ref \ - --format='%(refname):%(refname)' refs/heads)" "" "$cur_" + --format='%(refname):%(refname)' refs/heads)" return ;; pull.twohead|pull.octopus) __git_compute_merge_strategies - __gitcomp "$__git_merge_strategies" "" "$cur_" + __gitcomp "$__git_merge_strategies" + return + ;; + color.branch|color.diff|color.interactive|\ + color.showbranch|color.status|color.ui) + __gitcomp "always never auto" return ;; color.pager) - __gitcomp "false true" "" "$cur_" + __gitcomp "false true" return ;; color.*.*) __gitcomp " normal black red green yellow blue magenta cyan white bold dim ul blink reverse - " "" "$cur_" - return - ;; - color.*) - __gitcomp "false true always never auto" "" "$cur_" + " return ;; diff.submodule) - __gitcomp "$__git_diff_submodule_formats" "" "$cur_" + __gitcomp "$__git_diff_submodule_formats" return ;; help.format) - __gitcomp "man info web html" "" "$cur_" + __gitcomp "man info web html" return ;; log.date) - __gitcomp "$__git_log_date_formats" "" "$cur_" + __gitcomp "$__git_log_date_formats" return ;; sendemail.aliasfiletype) - __gitcomp "mutt mailrc pine elm gnus" "" "$cur_" + __gitcomp "mutt mailrc pine elm gnus" return ;; sendemail.confirm) - __gitcomp "$__git_send_email_confirm_options" "" "$cur_" + __gitcomp "$__git_send_email_confirm_options" return ;; sendemail.suppresscc) - __gitcomp "$__git_send_email_suppresscc_options" "" "$cur_" + __gitcomp "$__git_send_email_suppresscc_options" return ;; sendemail.transferencoding) - __gitcomp "7bit 8bit quoted-printable base64" "" "$cur_" + __gitcomp "7bit 8bit quoted-printable base64" + return + ;; + --get|--get-all|--unset|--unset-all) + __gitcomp_nl "$(__git_config_get_set_variables)" return ;; *.*) return ;; esac -} - -# Completes configuration sections, subsections, variable names. -# -# Usage: __git_complete_config_variable_name [<option>]... -# --cur=<word>: The current configuration section/variable name to be -# completed. Defaults to the current word to be completed. -# --sfx=<suffix>: A suffix to be appended to each fully completed -# configuration variable name (but not to sections or -# subsections) instead of the default space. -__git_complete_config_variable_name () -{ - local cur_="$cur" sfx - - while test $# != 0; do - case "$1" in - --cur=*) cur_="${1##--cur=}" ;; - --sfx=*) sfx="${1##--sfx=}" ;; - *) return 1 ;; - esac - shift - done - - case "$cur_" in + case "$cur" in + --*) + __gitcomp_builtin config + return + ;; branch.*.*) - local pfx="${cur_%.*}." - cur_="${cur_##*.}" - __gitcomp "remote pushRemote merge mergeOptions rebase" "$pfx" "$cur_" "$sfx" + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "remote pushRemote merge mergeOptions rebase" "$pfx" "$cur_" return ;; branch.*) - local pfx="${cur%.*}." - cur_="${cur#*.}" + local pfx="${cur%.*}." cur_="${cur#*.}" __gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")" - __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "$sfx" + __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" return ;; guitool.*.*) - local pfx="${cur_%.*}." - cur_="${cur_##*.}" + local pfx="${cur%.*}." cur_="${cur##*.}" __gitcomp " argPrompt cmd confirm needsFile noConsole noRescan prompt revPrompt revUnmerged title - " "$pfx" "$cur_" "$sfx" + " "$pfx" "$cur_" return ;; difftool.*.*) - local pfx="${cur_%.*}." - cur_="${cur_##*.}" - __gitcomp "cmd path" "$pfx" "$cur_" "$sfx" + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "cmd path" "$pfx" "$cur_" return ;; man.*.*) - local pfx="${cur_%.*}." - cur_="${cur_##*.}" - __gitcomp "cmd path" "$pfx" "$cur_" "$sfx" + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "cmd path" "$pfx" "$cur_" return ;; mergetool.*.*) - local pfx="${cur_%.*}." - cur_="${cur_##*.}" - __gitcomp "cmd path trustExitCode" "$pfx" "$cur_" "$sfx" + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "cmd path trustExitCode" "$pfx" "$cur_" return ;; pager.*) - local pfx="${cur_%.*}." - cur_="${cur_#*.}" + local pfx="${cur%.*}." cur_="${cur#*.}" __git_compute_all_commands - __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" "$sfx" + __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" return ;; remote.*.*) - local pfx="${cur_%.*}." - cur_="${cur_##*.}" + local pfx="${cur%.*}." cur_="${cur##*.}" __gitcomp " url proxy fetch push mirror skipDefaultUpdate receivepack uploadpack tagOpt pushurl - " "$pfx" "$cur_" "$sfx" + " "$pfx" "$cur_" return ;; remote.*) - local pfx="${cur_%.*}." - cur_="${cur_#*.}" + local pfx="${cur%.*}." cur_="${cur#*.}" __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "." - __gitcomp_nl_append "pushDefault" "$pfx" "$cur_" "$sfx" + __gitcomp_nl_append "pushDefault" "$pfx" "$cur_" return ;; url.*.*) - local pfx="${cur_%.*}." - cur_="${cur_##*.}" - __gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_" "$sfx" + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_" return ;; *.*) __git_compute_config_vars - __gitcomp "$__git_config_vars" "" "$cur_" "$sfx" + __gitcomp "$__git_config_vars" ;; *) __git_compute_config_vars - __gitcomp "$(echo "$__git_config_vars" | - awk -F . '{ - sections[$1] = 1 - } - END { - for (s in sections) - print s "." - } - ')" "" "$cur_" - ;; - esac -} - -# Completes '='-separated configuration sections/variable names and values -# for 'git -c section.name=value'. -# -# Usage: __git_complete_config_variable_name_and_value [<option>]... -# --cur=<word>: The current configuration section/variable name/value to be -# completed. Defaults to the current word to be completed. -__git_complete_config_variable_name_and_value () -{ - local cur_="$cur" - - while test $# != 0; do - case "$1" in - --cur=*) cur_="${1##--cur=}" ;; - *) return 1 ;; - esac - shift - done - - case "$cur_" in - *=*) - __git_complete_config_variable_value \ - --varname="${cur_%%=*}" --cur="${cur_#*=}" - ;; - *) - __git_complete_config_variable_name --cur="$cur_" --sfx='=' - ;; - esac -} - -_git_config () -{ - case "$prev" in - --get|--get-all|--unset|--unset-all) - __gitcomp_nl "$(__git_config_get_set_variables)" - return - ;; - *.*) - __git_complete_config_variable_value - return - ;; - esac - case "$cur" in - --*) - __gitcomp_builtin config - ;; - *) - __git_complete_config_variable_name - ;; + __gitcomp "$(echo "$__git_config_vars" | sed 's/\.[^ ]*/./g')" esac } @@ -2665,7 +2512,7 @@ _git_restore () esac } -__git_revert_inprogress_options=$__git_sequencer_inprogress_options +__git_revert_inprogress_options="--continue --quit --abort" _git_revert () { @@ -2733,9 +2580,8 @@ _git_show () return ;; --*) - __gitcomp "--pretty= --format= --abbrev-commit --no-abbrev-commit - --oneline --show-signature --patch - --expand-tabs --expand-tabs= --no-expand-tabs + __gitcomp "--pretty= --format= --abbrev-commit --oneline + --show-signature $__git_diff_common_options " return @@ -2755,27 +2601,6 @@ _git_show_branch () __git_complete_revlist } -_git_sparse_checkout () -{ - local subcommands="list init set disable" - local subcommand="$(__git_find_on_cmdline "$subcommands")" - if [ -z "$subcommand" ]; then - __gitcomp "$subcommands" - return - fi - - case "$subcommand,$cur" in - init,--*) - __gitcomp "--cone" - ;; - set,--*) - __gitcomp "--stdin" - ;; - *) - ;; - esac -} - _git_stash () { local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' @@ -2841,7 +2666,7 @@ _git_submodule () { __git_has_doubledash && return - local subcommands="add status init deinit update set-branch set-url summary foreach sync absorbgitdirs" + local subcommands="add status init deinit update set-branch summary foreach sync absorbgitdirs" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then case "$cur" in @@ -2905,7 +2730,6 @@ _git_svn () --log-window-size= --no-checkout --quiet --repack-flags --use-log-author --localtime --add-author-from - --recursive --ignore-paths= --include-paths= $remote_opts " local init_opts=" @@ -3027,83 +2851,33 @@ _git_whatchanged () _git_log } -__git_complete_worktree_paths () -{ - local IFS=$'\n' - __gitcomp_nl "$(git worktree list --porcelain | - # Skip the first entry: it's the path of the main worktree, - # which can't be moved, removed, locked, etc. - sed -n -e '2,$ s/^worktree //p')" -} - _git_worktree () { local subcommands="add list lock move prune remove unlock" - local subcommand subcommand_idx - - subcommand="$(__git_find_on_cmdline --show-idx "$subcommands")" - subcommand_idx="${subcommand% *}" - subcommand="${subcommand#* }" - - case "$subcommand,$cur" in - ,*) + local subcommand="$(__git_find_on_cmdline "$subcommands")" + if [ -z "$subcommand" ]; then __gitcomp "$subcommands" - ;; - *,--*) - __gitcomp_builtin worktree_$subcommand - ;; - add,*) # usage: git worktree add [<options>] <path> [<commit-ish>] - # Here we are not completing an --option, it's either the - # path or a ref. - case "$prev" in - -b|-B) # Complete refs for branch to be created/reseted. - __git_complete_refs + else + case "$subcommand,$cur" in + add,--*) + __gitcomp_builtin worktree_add ;; - -*) # The previous word is an -o|--option without an - # unstuck argument: have to complete the path for - # the new worktree, so don't list anything, but let - # Bash fall back to filename completion. - ;; - *) # The previous word is not an --option, so it must - # be either the 'add' subcommand, the unstuck - # argument of an option (e.g. branch for -b|-B), or - # the path for the new worktree. - if [ $cword -eq $((subcommand_idx+1)) ]; then - # Right after the 'add' subcommand: have to - # complete the path, so fall back to Bash - # filename completion. - : - else - case "${words[cword-2]}" in - -b|-B) # After '-b <branch>': have to - # complete the path, so fall back - # to Bash filename completion. - ;; - *) # After the path: have to complete - # the ref to be checked out. - __git_complete_refs - ;; - esac - fi + list,--*) + __gitcomp_builtin worktree_list + ;; + lock,--*) + __gitcomp_builtin worktree_lock + ;; + prune,--*) + __gitcomp_builtin worktree_prune + ;; + remove,--*) + __gitcomp "--force" + ;; + *) ;; esac - ;; - lock,*|remove,*|unlock,*) - __git_complete_worktree_paths - ;; - move,*) - if [ $cword -eq $((subcommand_idx+1)) ]; then - # The first parameter must be an existing working - # tree to be moved. - __git_complete_worktree_paths - else - # The second parameter is the destination: it could - # be any path, so don't list anything, but let Bash - # fall back to filename completion. - : - fi - ;; - esac + fi } __git_complete_common () { @@ -3182,11 +2956,7 @@ __git_main () # Bash filename completion return ;; - -c) - __git_complete_config_variable_name_and_value - return - ;; - --namespace) + -c|--namespace) # we don't support completing these options' arguments return ;; diff --git a/third_party/git/contrib/completion/git-completion.zsh b/third_party/git/contrib/completion/git-completion.zsh index eef4eff53dff..886bf95d1f59 100644 --- a/third_party/git/contrib/completion/git-completion.zsh +++ b/third_party/git/contrib/completion/git-completion.zsh @@ -11,9 +11,8 @@ # # zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh # -# The recommended way to install this script is to make a copy of it in -# ~/.zsh/ directory as ~/.zsh/git-completion.zsh and then add the following -# to your ~/.zshrc file: +# The recommended way to install this script is to copy to '~/.zsh/_git', and +# then add the following to your ~/.zshrc file: # # fpath=(~/.zsh $fpath) diff --git a/third_party/git/contrib/completion/git-prompt.sh b/third_party/git/contrib/completion/git-prompt.sh index 014cd7c3cfcc..1d510cd47bef 100644 --- a/third_party/git/contrib/completion/git-prompt.sh +++ b/third_party/git/contrib/completion/git-prompt.sh @@ -429,7 +429,11 @@ __git_ps1 () __git_eread "$g/rebase-merge/head-name" b __git_eread "$g/rebase-merge/msgnum" step __git_eread "$g/rebase-merge/end" total - r="|REBASE" + if [ -f "$g/rebase-merge/interactive" ]; then + r="|REBASE-i" + else + r="|REBASE-m" + fi else if [ -d "$g/rebase-apply" ]; then __git_eread "$g/rebase-apply/next" step diff --git a/third_party/git/contrib/credential/netrc/.gitignore b/third_party/git/contrib/credential/netrc/.gitignore deleted file mode 100644 index d41cdde84b6a..000000000000 --- a/third_party/git/contrib/credential/netrc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -git-credential-netrc diff --git a/third_party/git/contrib/credential/netrc/Makefile b/third_party/git/contrib/credential/netrc/Makefile index c284fb8ac490..6174e3bb8382 100644 --- a/third_party/git/contrib/credential/netrc/Makefile +++ b/third_party/git/contrib/credential/netrc/Makefile @@ -1,30 +1,8 @@ # The default target of this Makefile is... all:: -SCRIPT_PERL = git-credential-netrc.perl -GIT_ROOT_DIR = ../../.. -HERE = contrib/credential/netrc - -SCRIPT_PERL_FULL = $(patsubst %,$(HERE)/%,$(SCRIPT_PERL)) - -all:: build - -build: - $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \ - build-perl-script - -install: build - $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \ - install-perl-script - -clean: - $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \ - clean-perl-script - -test: build +test: ./t-git-credential-netrc.sh -testverbose: build +testverbose: ./t-git-credential-netrc.sh -d -v - -.PHONY: all build install clean test testverbose diff --git a/third_party/git/contrib/credential/netrc/git-credential-netrc.perl b/third_party/git/contrib/credential/netrc/git-credential-netrc index bc57cc65884b..ebfc123ec641 100755 --- a/third_party/git/contrib/credential/netrc/git-credential-netrc.perl +++ b/third_party/git/contrib/credential/netrc/git-credential-netrc @@ -423,7 +423,7 @@ sub load_config { # load settings from git config my $options = shift; # set from command argument, gpg.program option, or default to gpg - $options->{'gpg'} //= Git::config('gpg.program') + $options->{'gpg'} //= Git->repository()->config('gpg.program') // 'gpg'; log_verbose("using $options{'gpg'} for GPG operations"); } diff --git a/third_party/git/contrib/diff-highlight/DiffHighlight.pm b/third_party/git/contrib/diff-highlight/DiffHighlight.pm index e2589922a659..7440aa1c4638 100644 --- a/third_party/git/contrib/diff-highlight/DiffHighlight.pm +++ b/third_party/git/contrib/diff-highlight/DiffHighlight.pm @@ -72,7 +72,7 @@ sub handle_line { (?:$COLOR?\|$COLOR?[ ])* # zero or more trailing "|" [ ]* # trailing whitespace for merges /x) { - my $graph_prefix = $&; + my $graph_prefix = $&; # We must flush before setting graph indent, since the # new commit may be indented differently from what we diff --git a/third_party/git/contrib/hg-to-git/hg-to-git.py b/third_party/git/contrib/hg-to-git/hg-to-git.py index 7eb1b24cc7a1..de3f81667ed9 100755 --- a/third_party/git/contrib/hg-to-git/hg-to-git.py +++ b/third_party/git/contrib/hg-to-git/hg-to-git.py @@ -42,7 +42,7 @@ hgnewcsets = 0 def usage(): - print("""\ + print """\ %s: [OPTIONS] <hgprj> options: @@ -54,7 +54,7 @@ options: required: hgprj: name of the HG project to import (directory) -""" % sys.argv[0]) +""" % sys.argv[0] #------------------------------------------------------------------------------ @@ -104,22 +104,22 @@ os.chdir(hgprj) if state: if os.path.exists(state): if verbose: - print('State does exist, reading') + print 'State does exist, reading' f = open(state, 'r') hgvers = pickle.load(f) else: - print('State does not exist, first run') + print 'State does not exist, first run' sock = os.popen('hg tip --template "{rev}"') tip = sock.read() if sock.close(): sys.exit(1) if verbose: - print('tip is', tip) + print 'tip is', tip # Calculate the branches if verbose: - print('analysing the branches...') + print 'analysing the branches...' hgchildren["0"] = () hgparents["0"] = (None, None) hgbranch["0"] = "master" @@ -154,15 +154,15 @@ for cset in range(1, int(tip) + 1): else: hgbranch[str(cset)] = "branch-" + str(cset) -if "0" not in hgvers: - print('creating repository') +if not hgvers.has_key("0"): + print 'creating repository' os.system('git init') # loop through every hg changeset for cset in range(int(tip) + 1): # incremental, already seen - if str(cset) in hgvers: + if hgvers.has_key(str(cset)): continue hgnewcsets += 1 @@ -180,27 +180,27 @@ for cset in range(int(tip) + 1): os.write(fdcomment, csetcomment) os.close(fdcomment) - print('-----------------------------------------') - print('cset:', cset) - print('branch:', hgbranch[str(cset)]) - print('user:', user) - print('date:', date) - print('comment:', csetcomment) + print '-----------------------------------------' + print 'cset:', cset + print 'branch:', hgbranch[str(cset)] + print 'user:', user + print 'date:', date + print 'comment:', csetcomment if parent: - print('parent:', parent) + print 'parent:', parent if mparent: - print('mparent:', mparent) + print 'mparent:', mparent if tag: - print('tag:', tag) - print('-----------------------------------------') + print 'tag:', tag + print '-----------------------------------------' # checkout the parent if necessary if cset != 0: if hgbranch[str(cset)] == "branch-" + str(cset): - print('creating new branch', hgbranch[str(cset)]) + print 'creating new branch', hgbranch[str(cset)] os.system('git checkout -b %s %s' % (hgbranch[str(cset)], hgvers[parent])) else: - print('checking out branch', hgbranch[str(cset)]) + print 'checking out branch', hgbranch[str(cset)] os.system('git checkout %s' % hgbranch[str(cset)]) # merge @@ -209,7 +209,7 @@ for cset in range(int(tip) + 1): otherbranch = hgbranch[mparent] else: otherbranch = hgbranch[parent] - print('merging', otherbranch, 'into', hgbranch[str(cset)]) + print 'merging', otherbranch, 'into', hgbranch[str(cset)] os.system(getgitenv(user, date) + 'git merge --no-commit -s ours "" %s %s' % (hgbranch[str(cset)], otherbranch)) # remove everything except .git and .hg directories @@ -233,12 +233,12 @@ for cset in range(int(tip) + 1): # delete branch if not used anymore... if mparent and len(hgchildren[str(cset)]): - print("Deleting unused branch:", otherbranch) + print "Deleting unused branch:", otherbranch os.system('git branch -d %s' % otherbranch) # retrieve and record the version vvv = os.popen('git show --quiet --pretty=format:%H').read() - print('record', cset, '->', vvv) + print 'record', cset, '->', vvv hgvers[str(cset)] = vvv if hgnewcsets >= opt_nrepack and opt_nrepack != -1: @@ -247,7 +247,7 @@ if hgnewcsets >= opt_nrepack and opt_nrepack != -1: # write the state for incrementals if state: if verbose: - print('Writing state') + print 'Writing state' f = open(state, 'w') pickle.dump(hgvers, f) diff --git a/third_party/git/contrib/hooks/multimail/git_multimail.py b/third_party/git/contrib/hooks/multimail/git_multimail.py index f563be82fc7e..8823399e7522 100755 --- a/third_party/git/contrib/hooks/multimail/git_multimail.py +++ b/third_party/git/contrib/hooks/multimail/git_multimail.py @@ -95,7 +95,7 @@ if PYTHON3: unicode = str def write_str(f, msg): - # Try outputting with the default encoding. If it fails, + # Try outputing with the default encoding. If it fails, # try UTF-8. try: f.buffer.write(msg.encode(sys.getdefaultencoding())) @@ -2129,7 +2129,7 @@ class SMTPMailer(Mailer): # equivalent to # self.smtp.ehlo() # self.smtp.starttls() - # with access to the ssl layer + # with acces to the ssl layer self.smtp.ehlo() if not self.smtp.has_extn("starttls"): raise smtplib.SMTPException("STARTTLS extension not supported by server") @@ -2148,7 +2148,7 @@ class SMTPMailer(Mailer): cert_reqs=ssl.CERT_NONE ) self.environment.get_logger().error( - '*** Warning, the server certificate is not verified (smtp) ***\n' + '*** Warning, the server certificat is not verified (smtp) ***\n' '*** set the option smtpCACerts ***\n' ) if not hasattr(self.smtp.sock, "read"): @@ -3189,7 +3189,7 @@ class ProjectdescEnvironmentMixin(Environment): self.COMPUTED_KEYS += ['projectdesc'] def get_projectdesc(self): - """Return a one-line description of the project.""" + """Return a one-line descripition of the project.""" git_dir = get_git_dir() try: diff --git a/third_party/git/contrib/hooks/multimail/post-receive.example b/third_party/git/contrib/hooks/multimail/post-receive.example index 0f98c5a23db1..b9bb11834e1f 100755 --- a/third_party/git/contrib/hooks/multimail/post-receive.example +++ b/third_party/git/contrib/hooks/multimail/post-receive.example @@ -56,7 +56,7 @@ config = git_multimail.Config('multimailhook') # Set some Git configuration variables. Equivalent to passing var=val # to "git -c var=val" each time git is called, or to adding the -# configuration in .git/config (must come before instantiating the +# configuration in .git/config (must come before instanciating the # environment) : #git_multimail.Config.add_config_parameters('multimailhook.commitEmailFormat=html') #git_multimail.Config.add_config_parameters(('user.name=foo', 'user.email=foo@example.com')) diff --git a/third_party/git/contrib/hooks/post-receive-email b/third_party/git/contrib/hooks/post-receive-email index ff565eb3d881..8747b84334f3 100755 --- a/third_party/git/contrib/hooks/post-receive-email +++ b/third_party/git/contrib/hooks/post-receive-email @@ -329,7 +329,7 @@ generate_update_branch_email() # # git rev-parse --not --all | grep -v $(git rev-parse $refname) # - # Gets us to something pretty safe (apart from the small time + # Get's us to something pretty safe (apart from the small time # between refname being read, and git rev-parse running - for that, # I give up) # diff --git a/third_party/git/contrib/hooks/update-paranoid b/third_party/git/contrib/hooks/update-paranoid index 0092d67b8a47..d18b317b2f01 100755 --- a/third_party/git/contrib/hooks/update-paranoid +++ b/third_party/git/contrib/hooks/update-paranoid @@ -49,7 +49,7 @@ opcode. Repository sections are matched on the basename of the repository (after removing the .git suffix). -The opcode abbreviations are: +The opcode abbrevations are: C: create new ref D: delete existing ref diff --git a/third_party/git/contrib/mw-to-git/.perlcriticrc b/third_party/git/contrib/mw-to-git/.perlcriticrc index b7333267adad..158958d36357 100644 --- a/third_party/git/contrib/mw-to-git/.perlcriticrc +++ b/third_party/git/contrib/mw-to-git/.perlcriticrc @@ -14,7 +14,7 @@ # This rule states that each system call should have its return value checked # The problem is that it includes the print call. Checking every print call's -# return value would be harmful to the code readability. +# return value would be harmful to the code readabilty. # This configuration keeps all default function but print. [InputOutput::RequireCheckedSyscalls] functions = open say close diff --git a/third_party/git/contrib/mw-to-git/git-remote-mediawiki.perl b/third_party/git/contrib/mw-to-git/git-remote-mediawiki.perl index d8ff2e69c498..af9cbc9d0f7b 100755 --- a/third_party/git/contrib/mw-to-git/git-remote-mediawiki.perl +++ b/third_party/git/contrib/mw-to-git/git-remote-mediawiki.perl @@ -79,7 +79,7 @@ chomp($export_media); $export_media = !($export_media eq 'false'); my $wiki_login = run_git("config --get remote.${remotename}.mwLogin"); -# Note: mwPassword is discouraged. Use the credential system instead. +# Note: mwPassword is discourraged. Use the credential system instead. my $wiki_passwd = run_git("config --get remote.${remotename}.mwPassword"); my $wiki_domain = run_git("config --get remote.${remotename}.mwDomain"); chomp($wiki_login); diff --git a/third_party/git/contrib/mw-to-git/t/install-wiki/db_install.php b/third_party/git/contrib/mw-to-git/t/install-wiki/db_install.php index b033849800bc..0f3f4e018a05 100644 --- a/third_party/git/contrib/mw-to-git/t/install-wiki/db_install.php +++ b/third_party/git/contrib/mw-to-git/t/install-wiki/db_install.php @@ -24,7 +24,7 @@ $url = 'http://localhost:'.$port.'/wiki/mw-config/index.php'; $db_dir = urlencode($tmp); $tmp_cookie = tempnam($tmp, "COOKIE_"); /* - * Fetches a page with cURL. + * Fetchs a page with cURL. */ function get($page_name = "") { $curl = curl_init(); diff --git a/third_party/git/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh b/third_party/git/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh index 9106833578e0..cfbfe7ddf622 100755 --- a/third_party/git/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh +++ b/third_party/git/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh @@ -143,7 +143,7 @@ test_expect_success 'Git clone works with one specific page cloned ' ' test_expect_success 'Git clone works with multiple specific page cloned ' ' wiki_reset && wiki_editpage foo "I will be there" false && - wiki_editpage bar "I will not disappear" false && + wiki_editpage bar "I will not disapear" false && wiki_editpage namnam "I be erased" false && wiki_editpage nyancat "nyan nyan nyan you will not erase me" false && wiki_delete_page namnam && diff --git a/third_party/git/contrib/mw-to-git/t/test-gitmw-lib.sh b/third_party/git/contrib/mw-to-git/t/test-gitmw-lib.sh index 3948a0028283..6546294f159e 100755 --- a/third_party/git/contrib/mw-to-git/t/test-gitmw-lib.sh +++ b/third_party/git/contrib/mw-to-git/t/test-gitmw-lib.sh @@ -279,7 +279,7 @@ start_lighttpd () { "$LIGHTTPD_DIR"/lighttpd -f "$WEB"/lighttpd.conf if test $? -ne 0 ; then - echo "Could not execute http daemon lighttpd" + echo "Could not execute http deamon lighttpd" exit 1 fi } diff --git a/third_party/git/contrib/svn-fe/svn-fe.txt b/third_party/git/contrib/svn-fe/svn-fe.txt index 19333fc8dff3..a3425f4770c5 100644 --- a/third_party/git/contrib/svn-fe/svn-fe.txt +++ b/third_party/git/contrib/svn-fe/svn-fe.txt @@ -56,7 +56,7 @@ line. This line has the form `git-svn-id: URL@REVNO UUID`. The resulting repository will generally require further processing to put each project in its own repository and to separate the history -of each branch. The 'git filter-repo --subdirectory-filter' command +of each branch. The 'git filter-branch --subdirectory-filter' command may be useful for this purpose. BUGS @@ -67,5 +67,5 @@ The exit status does not reflect whether an error was detected. SEE ALSO -------- -git-svn(1), svn2git(1), svk(1), git-filter-repo(1), git-fast-import(1), +git-svn(1), svn2git(1), svk(1), git-filter-branch(1), git-fast-import(1), https://svn.apache.org/repos/asf/subversion/trunk/notes/dump-load-format.txt diff --git a/third_party/git/contrib/svn-fe/svnrdump_sim.py b/third_party/git/contrib/svn-fe/svnrdump_sim.py index 8a3cee617524..11ac6f692733 100755 --- a/third_party/git/contrib/svn-fe/svnrdump_sim.py +++ b/third_party/git/contrib/svn-fe/svnrdump_sim.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python """ Simulates svnrdump by replaying an existing dump from a file, taking care of the specified revision range. @@ -54,7 +54,7 @@ if __name__ == "__main__": print("usage: %s dump URL -rLOWER:UPPER") sys.exit(1) if not sys.argv[1] == 'dump': - raise NotImplementedError('only "dump" is supported.') + raise NotImplementedError('only "dump" is suppported.') url = sys.argv[2] r = ('0', 'HEAD') if len(sys.argv) == 4 and sys.argv[3][0:2] == '-r': |