]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'es/perf-export-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 18 Dec 2020 23:15:18 +0000 (15:15 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Dec 2020 23:15:18 +0000 (15:15 -0800)
Dev-support fix for BSD.

* es/perf-export-fix:
  t/perf: fix test_export() failure with BSD `sed`

562 files changed:
.github/workflows/check-whitespace.yml [new file with mode: 0644]
.github/workflows/main.yml
.gitignore
Documentation/Makefile
Documentation/MyFirstContribution.txt
Documentation/MyFirstObjectWalk.txt
Documentation/RelNotes/2.30.0.txt [new file with mode: 0644]
Documentation/SubmittingPatches
Documentation/blame-options.txt
Documentation/config.txt
Documentation/config/advice.txt
Documentation/config/checkout.txt
Documentation/config/clone.txt [new file with mode: 0644]
Documentation/config/core.txt
Documentation/config/credential.txt
Documentation/config/format.txt
Documentation/config/gc.txt
Documentation/config/help.txt
Documentation/config/maintenance.txt
Documentation/config/push.txt
Documentation/config/transfer.txt
Documentation/diff-options.txt
Documentation/git-am.txt
Documentation/git-blame.txt
Documentation/git-branch.txt
Documentation/git-checkout.txt
Documentation/git-cherry-pick.txt
Documentation/git-clone.txt
Documentation/git-commit-graph.txt
Documentation/git-commit.txt
Documentation/git-config.txt
Documentation/git-diff-index.txt
Documentation/git-diff-tree.txt
Documentation/git-diff.txt
Documentation/git-for-each-repo.txt [new file with mode: 0644]
Documentation/git-format-patch.txt
Documentation/git-grep.txt
Documentation/git-init.txt
Documentation/git-log.txt
Documentation/git-ls-files.txt
Documentation/git-ls-tree.txt
Documentation/git-maintenance.txt
Documentation/git-p4.txt
Documentation/git-parse-remote.txt [deleted file]
Documentation/git-push.txt
Documentation/git-rebase.txt
Documentation/git-remote.txt
Documentation/git-restore.txt
Documentation/git-rev-parse.txt
Documentation/git-revert.txt
Documentation/git-send-email.txt
Documentation/git-svn.txt
Documentation/git-switch.txt
Documentation/git-update-ref.txt
Documentation/git-worktree.txt
Documentation/gitattributes.txt
Documentation/githooks.txt
Documentation/gitk.txt
Documentation/glossary-content.txt
Documentation/line-range-format.txt
Documentation/line-range-options.txt [new file with mode: 0644]
Documentation/merge-options.txt
Documentation/pretty-options.txt
Documentation/signoff-option.txt [new file with mode: 0644]
Documentation/technical/api-trace2.txt
Documentation/technical/directory-rename-detection.txt
Documentation/technical/index-format.txt
Documentation/technical/multi-pack-index.txt
Documentation/technical/protocol-capabilities.txt
Documentation/technical/protocol-v2.txt
GIT-VERSION-GEN
INSTALL
Makefile
RelNotes
add-interactive.c
add-patch.c
advice.c
advice.h
apply.c
archive-tar.c
archive.c
archive.h
attr.c
banned.h
bisect.c
blame.c
blame.h
block-sha1/sha1.c
block-sha1/sha1.h
bloom.c
builtin.h
builtin/am.c
builtin/bisect--helper.c
builtin/blame.c
builtin/branch.c
builtin/bugreport.c
builtin/checkout-index.c
builtin/checkout.c
builtin/clone.c
builtin/commit.c
builtin/config.c
builtin/credential-store.c
builtin/credential.c
builtin/diff-index.c
builtin/diff-tree.c
builtin/diff.c
builtin/difftool.c
builtin/fast-export.c
builtin/fast-import.c
builtin/fetch.c
builtin/for-each-repo.c [new file with mode: 0644]
builtin/gc.c
builtin/grep.c
builtin/index-pack.c
builtin/init-db.c
builtin/log.c
builtin/merge-tree.c
builtin/merge.c
builtin/pack-redundant.c
builtin/pull.c
builtin/push.c
builtin/rebase.c
builtin/receive-pack.c
builtin/remote.c
builtin/repack.c
builtin/rev-parse.c
builtin/revert.c
builtin/send-pack.c
builtin/shortlog.c
builtin/stash.c
builtin/update-ref.c
builtin/worktree.c
cache.h
ci/print-test-failures.sh
command-list.txt
commit-graph.c
commit.c
compat/bswap.h
compat/vcbuild/scripts/clink.pl
config.c
config.h
config.mak.dev
config.mak.uname
contrib/buildsystems/CMakeLists.txt
contrib/buildsystems/engine.pl
contrib/completion/git-completion.bash
contrib/completion/git-completion.zsh
contrib/completion/git-prompt.sh
contrib/git-resurrect.sh
csum-file.h
diff-lib.c
diff.c
diff.h
diffcore-rename.c
dir.c
fetch-pack.c
fmt-merge-msg.c
git-add--interactive.perl
git-bisect.sh
git-compat-util.h
git-gui/Makefile
git-gui/git-gui--askpass
git-gui/git-gui.sh
git-gui/lib/commit.tcl
git-gui/lib/themed.tcl
git-gui/po/ru.po
git-mergetool--lib.sh
git-p4.py
git-parse-remote.sh [deleted file]
git-submodule.sh
git-svn.perl
git.c
gitweb/Makefile
grep.c
grep.h
hash.h
hashmap.c
hashmap.h
help.c
imap-send.c
line-log.c
list-objects-filter-options.c
log-tree.c
log-tree.h
merge-ort-wrappers.c [new file with mode: 0644]
merge-ort-wrappers.h [new file with mode: 0644]
merge-ort.c [new file with mode: 0644]
merge-ort.h [new file with mode: 0644]
merge-recursive.c
mergetools/bc
midx.c
name-hash.c
notes.c
object.c
object.h
oid-array.c
oid-array.h
oidmap.c
oidset.c
pack-check.c
pack-revindex.c
pack-write.c
packfile.c
patch-ids.c
perl/FromCPAN/Error.pm
perl/Git.pm
perl/Git/I18N.pm
perl/Git/IndexInfo.pm
perl/Git/LoadCPAN.pm
perl/Git/LoadCPAN/Error.pm
perl/Git/LoadCPAN/Mail/Address.pm
perl/Git/Packet.pm
perl/Git/SVN.pm
perl/Git/SVN/Editor.pm
perl/Git/SVN/Fetcher.pm
perl/Git/SVN/GlobSpec.pm
perl/Git/SVN/Log.pm
perl/Git/SVN/Memoize/YAML.pm
perl/Git/SVN/Migration.pm
perl/Git/SVN/Prompt.pm
perl/Git/SVN/Ra.pm
perl/Git/SVN/Utils.pm
pkt-line.c
range-diff.c
ref-filter.c
refs.c
refs.h
refspec.c
refspec.h
remote-curl.c
remote.c
remote.h
repo-settings.c
repository.h
revision.c
revision.h
run-command.c
send-pack.c
sequencer.c
sequencer.h
serve.c
sha1-file.c
sideband.c
sideband.h
strmap.c [new file with mode: 0644]
strmap.h [new file with mode: 0644]
submodule-config.c
t/Makefile
t/README
t/annotate-tests.sh
t/helper/test-crontab.c [new file with mode: 0644]
t/helper/test-fast-rebase.c [new file with mode: 0644]
t/helper/test-hashmap.c
t/helper/test-pkt-line.c
t/helper/test-proc-receive.c
t/helper/test-tool.c
t/helper/test-tool.h
t/lib-merge.sh [new file with mode: 0644]
t/lib-submodule-update.sh
t/perf/Makefile
t/perf/README
t/perf/p1400-update-ref.sh
t/perf/p3400-rebase.sh
t/perf/p7519-fsmonitor.sh
t/t0000-basic.sh
t/t0001-init.sh
t/t0021-conversion.sh
t/t0064-oid-array.sh [moved from t/t0064-sha1-array.sh with 90% similarity]
t/t0068-for-each-repo.sh [new file with mode: 0755]
t/t0070-fundamental.sh
t/t0300-credentials.sh
t/t1004-read-tree-m-u-wf.sh
t/t1050-large.sh
t/t1300-config.sh
t/t1309-early-config.sh
t/t1400-update-ref.sh
t/t1503-rev-parse-verify.sh
t/t1506-rev-parse-diagnosis.sh
t/t1510-repo-setup.sh
t/t2004-checkout-cache-temp.sh
t/t2006-checkout-index-basic.sh
t/t2016-checkout-patch.sh
t/t2024-checkout-dwim.sh
t/t2060-switch.sh
t/t2071-restore-patch.sh
t/t2106-update-index-assume-unchanged.sh
t/t2200-add-update.sh
t/t2402-worktree-list.sh
t/t3040-subprojects-basic.sh
t/t3200-branch.sh
t/t3201-branch-contains.sh
t/t3203-branch-output.sh
t/t3205-branch-color.sh
t/t3301-notes.sh
t/t3404-rebase-interactive.sh
t/t3406-rebase-message.sh
t/t3427-rebase-subtree.sh
t/t3435-rebase-gpg-sign.sh
t/t3701-add-interactive.sh
t/t3920-crlf-messages.sh [new file with mode: 0755]
t/t4013-diff-various.sh
t/t4013/diff.log_-IA_-IB_-I1_-I2_-p_master [new file with mode: 0644]
t/t4014-format-patch.sh
t/t4015-diff-whitespace.sh
t/t4018-diff-funcname.sh
t/t4018/bash-arithmetic-function [new file with mode: 0644]
t/t4018/bash-bashism-style-compact [new file with mode: 0644]
t/t4018/bash-bashism-style-function [new file with mode: 0644]
t/t4018/bash-bashism-style-whitespace [new file with mode: 0644]
t/t4018/bash-conditional-function [new file with mode: 0644]
t/t4018/bash-missing-parentheses [new file with mode: 0644]
t/t4018/bash-mixed-style-compact [new file with mode: 0644]
t/t4018/bash-mixed-style-function [new file with mode: 0644]
t/t4018/bash-nested-functions [new file with mode: 0644]
t/t4018/bash-other-characters [new file with mode: 0644]
t/t4018/bash-posix-style-compact [new file with mode: 0644]
t/t4018/bash-posix-style-function [new file with mode: 0644]
t/t4018/bash-posix-style-whitespace [new file with mode: 0644]
t/t4018/bash-subshell-function [new file with mode: 0644]
t/t4018/bash-trailing-comment [new file with mode: 0644]
t/t4018/css-attribute-value-selector [new file with mode: 0644]
t/t4018/css-block-level-@-statements [new file with mode: 0644]
t/t4018/css-class-selector [new file with mode: 0644]
t/t4018/css-id-selector [new file with mode: 0644]
t/t4018/css-root-selector [new file with mode: 0644]
t/t4018/php-abstract-method [new file with mode: 0644]
t/t4018/php-final-method [new file with mode: 0644]
t/t4018/rust-macro-rules [new file with mode: 0644]
t/t4068-diff-symmetric-merge-base.sh [new file with mode: 0755]
t/t4068-diff-symmetric.sh [deleted file]
t/t4114-apply-typechange.sh
t/t4127-apply-same-fn.sh
t/t4129-apply-samemode.sh
t/t4211-line-log.sh
t/t5310-pack-bitmaps.sh
t/t5315-pack-objects-compression.sh
t/t5319-multi-pack-index.sh
t/t5324-split-commit-graph.sh
t/t5400-send-pack.sh
t/t5402-post-merge-hook.sh
t/t5411-proc-receive-hook.sh
t/t5411/common-functions.sh
t/t5411/once-0010-report-status-v1.sh
t/t5411/test-0000-standard-git-push.sh
t/t5411/test-0001-standard-git-push--porcelain.sh
t/t5411/test-0002-pre-receive-declined.sh
t/t5411/test-0003-pre-receive-declined--porcelain.sh
t/t5411/test-0011-no-hook-error.sh
t/t5411/test-0012-no-hook-error--porcelain.sh
t/t5411/test-0013-bad-protocol.sh
t/t5411/test-0014-bad-protocol--porcelain.sh
t/t5411/test-0020-report-ng.sh
t/t5411/test-0021-report-ng--porcelain.sh
t/t5411/test-0022-report-unexpect-ref.sh
t/t5411/test-0023-report-unexpect-ref--porcelain.sh
t/t5411/test-0024-report-unknown-ref.sh
t/t5411/test-0025-report-unknown-ref--porcelain.sh
t/t5411/test-0026-push-options.sh
t/t5411/test-0027-push-options--porcelain.sh
t/t5411/test-0030-report-ok.sh
t/t5411/test-0031-report-ok--porcelain.sh
t/t5411/test-0032-report-with-options.sh
t/t5411/test-0033-report-with-options--porcelain.sh
t/t5411/test-0034-report-ft.sh
t/t5411/test-0035-report-ft--porcelain.sh
t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
t/t5411/test-0038-report-mixed-refs.sh
t/t5411/test-0039-report-mixed-refs--porcelain.sh
t/t5411/test-0040-process-all-refs.sh
t/t5411/test-0041-process-all-refs--porcelain.sh
t/t5411/test-0050-proc-receive-refs-with-modifiers.sh
t/t5505-remote.sh
t/t5510-fetch.sh
t/t5511-refspec.sh
t/t5515-fetch-merge-logic.sh
t/t5515/fetch.br-branches-default
t/t5515/fetch.br-branches-default-merge
t/t5515/fetch.br-branches-default-merge_branches-default
t/t5515/fetch.br-branches-default-octopus
t/t5515/fetch.br-branches-default-octopus_branches-default
t/t5515/fetch.br-branches-default_branches-default
t/t5515/fetch.br-branches-one
t/t5515/fetch.br-branches-one-merge
t/t5515/fetch.br-branches-one-merge_branches-one
t/t5515/fetch.br-branches-one-octopus
t/t5515/fetch.br-branches-one-octopus_branches-one
t/t5515/fetch.br-branches-one_branches-one
t/t5515/fetch.br-config-explicit
t/t5515/fetch.br-config-explicit-merge
t/t5515/fetch.br-config-explicit-merge_config-explicit
t/t5515/fetch.br-config-explicit-octopus
t/t5515/fetch.br-config-explicit-octopus_config-explicit
t/t5515/fetch.br-config-explicit_config-explicit
t/t5515/fetch.br-config-glob
t/t5515/fetch.br-config-glob-merge
t/t5515/fetch.br-config-glob-merge_config-glob
t/t5515/fetch.br-config-glob-octopus
t/t5515/fetch.br-config-glob-octopus_config-glob
t/t5515/fetch.br-config-glob_config-glob
t/t5515/fetch.br-remote-explicit
t/t5515/fetch.br-remote-explicit-merge
t/t5515/fetch.br-remote-explicit-merge_remote-explicit
t/t5515/fetch.br-remote-explicit-octopus
t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
t/t5515/fetch.br-remote-explicit_remote-explicit
t/t5515/fetch.br-remote-glob
t/t5515/fetch.br-remote-glob-merge
t/t5515/fetch.br-remote-glob-merge_remote-glob
t/t5515/fetch.br-remote-glob-octopus
t/t5515/fetch.br-remote-glob-octopus_remote-glob
t/t5515/fetch.br-remote-glob_remote-glob
t/t5515/fetch.br-unconfig
t/t5515/fetch.br-unconfig_--tags_.._.git
t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
t/t5515/fetch.br-unconfig_branches-default
t/t5515/fetch.br-unconfig_branches-one
t/t5515/fetch.br-unconfig_config-explicit
t/t5515/fetch.br-unconfig_config-glob
t/t5515/fetch.br-unconfig_remote-explicit
t/t5515/fetch.br-unconfig_remote-glob
t/t5515/fetch.main [moved from t/t5515/fetch.master with 78% similarity]
t/t5515/fetch.main_--tags_.._.git [moved from t/t5515/fetch.master_--tags_.._.git with 81% similarity]
t/t5515/fetch.main_.._.git [moved from t/t5515/fetch.master_.._.git with 73% similarity]
t/t5515/fetch.main_.._.git_one [moved from t/t5515/fetch.master_.._.git_one with 74% similarity]
t/t5515/fetch.main_.._.git_one_tag_tag-one_tag_tag-three-file [moved from t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file with 77% similarity]
t/t5515/fetch.main_.._.git_one_two [moved from t/t5515/fetch.master_.._.git_one_two with 83% similarity]
t/t5515/fetch.main_.._.git_tag_tag-one-tree_tag_tag-three-file [moved from t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file with 74% similarity]
t/t5515/fetch.main_.._.git_tag_tag-one_tag_tag-three [moved from t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three with 75% similarity]
t/t5515/fetch.main_branches-default [moved from t/t5515/fetch.master_branches-default with 69% similarity]
t/t5515/fetch.main_branches-one [moved from t/t5515/fetch.master_branches-one with 81% similarity]
t/t5515/fetch.main_config-explicit [moved from t/t5515/fetch.master_config-explicit with 78% similarity]
t/t5515/fetch.main_config-glob [moved from t/t5515/fetch.master_config-glob with 77% similarity]
t/t5515/fetch.main_remote-explicit [moved from t/t5515/fetch.master_remote-explicit with 78% similarity]
t/t5515/fetch.main_remote-glob [new file with mode: 0644]
t/t5515/fetch.master_remote-glob [deleted file]
t/t5515/refs.br-branches-default
t/t5515/refs.br-branches-default-merge
t/t5515/refs.br-branches-default-merge_branches-default
t/t5515/refs.br-branches-default-octopus
t/t5515/refs.br-branches-default-octopus_branches-default
t/t5515/refs.br-branches-default_branches-default
t/t5515/refs.br-branches-one
t/t5515/refs.br-branches-one-merge
t/t5515/refs.br-branches-one-merge_branches-one
t/t5515/refs.br-branches-one-octopus
t/t5515/refs.br-branches-one-octopus_branches-one
t/t5515/refs.br-branches-one_branches-one
t/t5515/refs.br-config-explicit
t/t5515/refs.br-config-explicit-merge
t/t5515/refs.br-config-explicit-merge_config-explicit
t/t5515/refs.br-config-explicit-octopus
t/t5515/refs.br-config-explicit-octopus_config-explicit
t/t5515/refs.br-config-explicit_config-explicit
t/t5515/refs.br-config-glob
t/t5515/refs.br-config-glob-merge
t/t5515/refs.br-config-glob-merge_config-glob
t/t5515/refs.br-config-glob-octopus
t/t5515/refs.br-config-glob-octopus_config-glob
t/t5515/refs.br-config-glob_config-glob
t/t5515/refs.br-remote-explicit
t/t5515/refs.br-remote-explicit-merge
t/t5515/refs.br-remote-explicit-merge_remote-explicit
t/t5515/refs.br-remote-explicit-octopus
t/t5515/refs.br-remote-explicit-octopus_remote-explicit
t/t5515/refs.br-remote-explicit_remote-explicit
t/t5515/refs.br-remote-glob
t/t5515/refs.br-remote-glob-merge
t/t5515/refs.br-remote-glob-merge_remote-glob
t/t5515/refs.br-remote-glob-octopus
t/t5515/refs.br-remote-glob-octopus_remote-glob
t/t5515/refs.br-remote-glob_remote-glob
t/t5515/refs.br-unconfig
t/t5515/refs.br-unconfig_--tags_.._.git
t/t5515/refs.br-unconfig_.._.git
t/t5515/refs.br-unconfig_.._.git_one
t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
t/t5515/refs.br-unconfig_.._.git_one_two
t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three
t/t5515/refs.br-unconfig_branches-default
t/t5515/refs.br-unconfig_branches-one
t/t5515/refs.br-unconfig_config-explicit
t/t5515/refs.br-unconfig_config-glob
t/t5515/refs.br-unconfig_remote-explicit
t/t5515/refs.br-unconfig_remote-glob
t/t5515/refs.main [moved from t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file with 81% similarity]
t/t5515/refs.main_--tags_.._.git [moved from t/t5515/refs.master_--tags_.._.git with 81% similarity]
t/t5515/refs.main_.._.git [moved from t/t5515/refs.master_.._.git_one_two with 79% similarity]
t/t5515/refs.main_.._.git_one [moved from t/t5515/refs.master_.._.git_one with 79% similarity]
t/t5515/refs.main_.._.git_one_tag_tag-one_tag_tag-three-file [moved from t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file with 81% similarity]
t/t5515/refs.main_.._.git_one_two [moved from t/t5515/refs.master_.._.git with 79% similarity]
t/t5515/refs.main_.._.git_tag_tag-one-tree_tag_tag-three-file [moved from t/t5515/refs.master with 81% similarity]
t/t5515/refs.main_.._.git_tag_tag-one_tag_tag-three [new file with mode: 0644]
t/t5515/refs.main_branches-default [moved from t/t5515/refs.master_branches-default with 74% similarity]
t/t5515/refs.main_branches-one [moved from t/t5515/refs.master_branches-one with 83% similarity]
t/t5515/refs.main_config-explicit [moved from t/t5515/refs.master_config-explicit with 79% similarity]
t/t5515/refs.main_config-glob [moved from t/t5515/refs.master_config-glob with 79% similarity]
t/t5515/refs.main_remote-explicit [moved from t/t5515/refs.master_remote-explicit with 79% similarity]
t/t5515/refs.main_remote-glob [moved from t/t5515/refs.master_remote-glob with 79% similarity]
t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three [deleted file]
t/t5516-fetch-push.sh
t/t5526-fetch-submodules.sh
t/t5530-upload-pack-error.sh
t/t5533-push-cas.sh
t/t5570-git-daemon.sh
t/t5572-pull-submodule.sh
t/t5606-clone-options.sh
t/t5616-partial-clone.sh
t/t5703-upload-pack-ref-in-want.sh
t/t5705-session-id-in-capabilities.sh [new file with mode: 0755]
t/t6006-rev-list-format.sh
t/t6012-rev-list-simplify.sh
t/t6200-fmt-merge-msg.sh
t/t6300-for-each-ref.sh
t/t6302-for-each-ref-filter.sh
t/t6400-merge-df.sh
t/t6402-merge-rename.sh
t/t6404-recursive-merge.sh
t/t6416-recursive-corner-cases.sh
t/t6422-merge-rename-corner-cases.sh
t/t6423-merge-rename-directories.sh
t/t6426-merge-skip-unneeded-updates.sh
t/t6430-merge-recursive.sh
t/t6436-merge-overwrite.sh
t/t6437-submodule-merge.sh
t/t7006-pager.sh
t/t7064-wtstatus-pv2.sh
t/t7101-reset-empty-subdirs.sh
t/t7102-reset.sh
t/t7201-co.sh
t/t7518-ident-corner-cases.sh
t/t7601-merge-pull-config.sh
t/t7602-merge-octopus-many.sh
t/t7610-mergetool.sh
t/t7800-difftool.sh
t/t7900-maintenance.sh
t/t8013-blame-ignore-revs.sh
t/t9003-help-autocorrect.sh
t/t9303-fast-import-compression.sh
t/t9304-fast-import-marks.sh [new file with mode: 0755]
t/t9603-cvsimport-patchsets.sh
t/t9801-git-p4-branch.sh
t/t9832-unshelve.sh
t/t9902-completion.sh
t/test-lib-functions.sh
t/test-lib.sh
templates/hooks--push-to-checkout.sample [new file with mode: 0755]
trace2.c
trace2.h
transport-helper.c
transport.c
transport.h
upload-pack.c
usage.c
userdiff.c
xdiff/xdiff.h
xdiff/xdiffi.c
xdiff/xhistogram.c
xdiff/xpatience.c

diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
new file mode 100644 (file)
index 0000000..f148305
--- /dev/null
@@ -0,0 +1,71 @@
+name: check-whitespace
+
+# Get the repo with the commits(+1) in the series.
+# Process `git log --check` output to extract just the check errors.
+# Add a comment to the pull request with the check errors.
+
+on:
+  pull_request:
+    types: [opened, synchronize]
+
+jobs:
+  check-whitespace:
+    runs-on: ubuntu-latest
+    steps:
+    - name: Set commit count
+      shell: bash
+      run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV
+      env:
+        COMMITS: ${{ github.event.pull_request.commits }}
+
+    - uses: actions/checkout@v2
+      with:
+        fetch-depth: ${{ env.COMMIT_DEPTH }}
+
+    - name: git log --check
+      id: check_out
+      run: |
+        log=
+        commit=
+        while read dash etc
+        do
+          case "${dash}" in
+          "---")
+            commit="${etc}"
+            ;;
+          "")
+            ;;
+          *)
+            if test -n "${commit}"
+            then
+              log="${log}\n${commit}"
+              echo ""
+              echo "--- ${commit}"
+            fi
+            commit=
+            log="${log}\n${dash} ${etc}"
+            echo "${dash} ${etc}"
+            ;;
+          esac
+        done <<< $(git log --check --pretty=format:"---% h% s" -${{github.event.pull_request.commits}})
+
+        if test -n "${log}"
+        then
+          echo "::set-output name=checkout::"${log}""
+          exit 2
+        fi
+
+    - name: Add Check Output as Comment
+      uses: actions/github-script@v3
+      id: add-comment
+      env:
+        log: ${{ steps.check_out.outputs.checkout }}
+      with:
+        script: |
+            await github.issues.createComment({
+              issue_number: context.issue.number,
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              body: `Whitespace errors found in workflow ${{ github.workflow }}:\n\n\`\`\`\n${process.env.log.replace(/\\n/g, "\n")}\n\`\`\``
+            })
+      if: ${{ failure() }}
index a940997f1b660c412d24ca54f15571a4af6d38ff..aef66436484af18fb91504f8c9701de7b25e7059 100644 (file)
@@ -41,35 +41,39 @@ jobs:
         with:
           github-token: ${{secrets.GITHUB_TOKEN}}
           script: |
-            // Figure out workflow ID, commit and tree
-            const { data: run } = await github.actions.getWorkflowRun({
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              run_id: context.runId,
-            });
-            const workflow_id = run.workflow_id;
-            const head_sha = run.head_sha;
-            const tree_id = run.head_commit.tree_id;
+            try {
+              // Figure out workflow ID, commit and tree
+              const { data: run } = await github.actions.getWorkflowRun({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                run_id: context.runId,
+              });
+              const workflow_id = run.workflow_id;
+              const head_sha = run.head_sha;
+              const tree_id = run.head_commit.tree_id;
 
-            // See whether there is a successful run for that commit or tree
-            const { data: runs } = await github.actions.listWorkflowRuns({
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              per_page: 500,
-              status: 'success',
-              workflow_id,
-            });
-            for (const run of runs.workflow_runs) {
-              if (head_sha === run.head_sha) {
-                core.warning(`Successful run for the commit ${head_sha}: ${run.html_url}`);
-                core.setOutput('enabled', ' but skip');
-                break;
-              }
-              if (tree_id === run.head_commit.tree_id) {
-                core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
-                core.setOutput('enabled', ' but skip');
-                break;
+              // See whether there is a successful run for that commit or tree
+              const { data: runs } = await github.actions.listWorkflowRuns({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                per_page: 500,
+                status: 'success',
+                workflow_id,
+              });
+              for (const run of runs.workflow_runs) {
+                if (head_sha === run.head_sha) {
+                  core.warning(`Successful run for the commit ${head_sha}: ${run.html_url}`);
+                  core.setOutput('enabled', ' but skip');
+                  break;
+                }
+                if (run.head_commit && tree_id === run.head_commit.tree_id) {
+                  core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
+                  core.setOutput('enabled', ' but skip');
+                  break;
+                }
               }
+            } catch (e) {
+              core.warning(e);
             }
 
   windows-build:
@@ -201,7 +205,6 @@ jobs:
       shell: bash
       run: |
         cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
-        -DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
         -DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
     - name: MSBuild
       run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
index 6232d339247fae5fdaeffed77ae0bbe4176ab2de..3dcdb6bb5ab8d14b626c8bd9c568944e0d05955e 100644 (file)
@@ -67,6 +67,7 @@
 /git-filter-branch
 /git-fmt-merge-msg
 /git-for-each-ref
+/git-for-each-repo
 /git-format-patch
 /git-fsck
 /git-fsck-objects
 /git-pack-redundant
 /git-pack-objects
 /git-pack-refs
-/git-parse-remote
 /git-patch-id
 /git-prune
 /git-prune-packed
 /git-remote-ftps
 /git-remote-fd
 /git-remote-ext
-/git-remote-testpy
 /git-repack
 /git-replace
 /git-request-pull
 /git-rm
 /git-send-email
 /git-send-pack
-/git-serve
 /git-sh-i18n
 /git-sh-i18n--envsubst
 /git-sh-setup
-/git-sh-i18n
 /git-shell
 /git-shortlog
 /git-show
index 80d1908a44ca38058c58dcc4e3444ee96060757b..b9804070594d9cd33dfc1e30cdd925c6e83a2187 100644 (file)
@@ -272,7 +272,9 @@ install-html: html
 ../GIT-VERSION-FILE: FORCE
        $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
 
+ifneq ($(MAKECMDGOALS),clean)
 -include ../GIT-VERSION-FILE
+endif
 
 #
 # Determine "include::" file references in asciidoc files.
@@ -286,7 +288,9 @@ doc.dep : $(docdep_prereqs) $(wildcard *.txt) $(wildcard config/*.txt) build-doc
        $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
        mv $@+ $@
 
+ifneq ($(MAKECMDGOALS),clean)
 -include doc.dep
+endif
 
 cmds_txt = cmds-ancillaryinterrogators.txt \
        cmds-ancillarymanipulators.txt \
@@ -380,7 +384,10 @@ SubmittingPatches.txt: SubmittingPatches
        $(QUIET_GEN) cp $< $@
 
 XSLT = docbook.xsl
-XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
+XSLTOPTS =
+XSLTOPTS += --xinclude
+XSLTOPTS += --stringparam html.stylesheet docbook-xsl.css
+XSLTOPTS += --param generate.consistent.ids 1
 
 user-manual.html: user-manual.xml $(XSLT)
        $(QUIET_XSLTPROC)$(RM) $@+ $@ && \
index 4f85a089ef9d99e868dd1550992ac234e13266ff..7c9a037cc21f2b7f3adc97b6ae1133a3238d8bee 100644 (file)
@@ -249,7 +249,7 @@ component you're working on, followed by a blank line (always required) and then
 the body of your commit message, which should provide the bulk of the context.
 Remember to be explicit and provide the "Why" of your change, especially if it
 couldn't easily be understood from your diff. When editing your commit message,
-don't remove the Signed-off-by line which was added by `-s` above.
+don't remove the `Signed-off-by` trailer which was added by `-s` above.
 
 ----
 psuh: add a built-in by popular demand
@@ -507,6 +507,9 @@ documentation is consistent with other Git and UNIX manpages; this makes life
 easier for your user, who can skip to the section they know contains the
 information they need.
 
+NOTE: Before trying to build the docs, make sure you have the package `asciidoc`
+installed.
+
 Now that you've written your manpage, you'll need to build it explicitly. We
 convert your AsciiDoc to troff which is man-readable like so:
 
@@ -522,8 +525,6 @@ $ make -C Documentation/ git-psuh.1
 $ man Documentation/git-psuh.1
 ----
 
-NOTE: You may need to install the package `asciidoc` to get this to work.
-
 While this isn't as satisfying as running through `git help`, you can at least
 check that your help page looks right.
 
@@ -1142,11 +1143,25 @@ After a few days, you will hopefully receive a reply to your patchset with some
 comments. Woohoo! Now you can get back to work.
 
 It's good manners to reply to each comment, notifying the reviewer that you have
-made the change requested, feel the original is better, or that the comment
+made the change suggested, feel the original is better, or that the comment
 inspired you to do something a new way which is superior to both the original
 and the suggested change. This way reviewers don't need to inspect your v2 to
 figure out whether you implemented their comment or not.
 
+Reviewers may ask you about what you wrote in the patchset, either in
+the proposed commit log message or in the changes themselves.  You
+should answer these questions in your response messages, but often the
+reason why reviewers asked these questions to understand what you meant
+to write is because your patchset needed clarification to be understood.
+
+Do not be satisfied by just answering their questions in your response
+and hear them say that they now understand what you wanted to say.
+Update your patches to clarify the points reviewers had trouble with,
+and prepare your v2; the words you used to explain your v1 to answer
+reviewers' questions may be useful thing to use.  Your goal is to make
+your v2 clear enough so that it becomes unnecessary for you to give the
+same explanation to the next person who reads it.
+
 If you are going to push back on a comment, be polite and explain why you feel
 your original is better; be prepared that the reviewer may still disagree with
 you, and the rest of the community may weigh in on one side or the other. As
index c3f2d1a831e3b1d9c3e7cd5d555248e01bffbd73..2d10eea7a9f65f23f766dc3b730495018e8f1234 100644 (file)
@@ -182,30 +182,6 @@ its `init_log_defaults()` sets its own state (`decoration_style`) and asks
 `grep` and `diff` to initialize themselves by calling each of their
 initialization functions.
 
-For our first example within `git walken`, we don't intend to use any other
-components within Git, and we don't have any configuration to do.  However, we
-may want to add some later, so for now, we can add an empty placeholder. Create
-a new function in `builtin/walken.c`:
-
-----
-static void init_walken_defaults(void)
-{
-       /*
-        * We don't actually need the same components `git log` does; leave this
-        * empty for now.
-        */
-}
-----
-
-Make sure to add a line invoking it inside of `cmd_walken()`.
-
-----
-int cmd_walken(int argc, const char **argv, const char *prefix)
-{
-       init_walken_defaults();
-}
-----
-
 ==== Configuring From `.gitconfig`
 
 Next, we should have a look at any relevant configuration settings (i.e.,
@@ -388,17 +364,9 @@ Next, let's try to filter the commits we see based on their author. This is
 equivalent to running `git log --author=<pattern>`. We can add a filter by
 modifying `rev_info.grep_filter`, which is a `struct grep_opt`.
 
-First some setup. Add `init_grep_defaults()` to `init_walken_defaults()` and add
-`grep_config()` to `git_walken_config()`:
+First some setup. Add `grep_config()` to `git_walken_config()`:
 
 ----
-static void init_walken_defaults(void)
-{
-       init_grep_defaults(the_repository);
-}
-
-...
-
 static int git_walken_config(const char *var, const char *value, void *cb)
 {
        grep_config(var, value, cb);
diff --git a/Documentation/RelNotes/2.30.0.txt b/Documentation/RelNotes/2.30.0.txt
new file mode 100644 (file)
index 0000000..16955c7
--- /dev/null
@@ -0,0 +1,395 @@
+Git 2.30 Release Notes
+======================
+
+Updates since v2.29
+-------------------
+
+UI, Workflows & Features
+
+ * Userdiff for PHP update.
+
+ * Userdiff for Rust update.
+
+ * Userdiff for CSS update.
+
+ * The command line completion script (in contrib/) learned that "git
+   stash show" takes the options "git diff" takes.
+
+ * "git worktree list" now shows if each worktree is locked.  This
+   possibly may open us to show other kinds of states in the future.
+
+ * "git maintenance", an extended big brother of "git gc", continues
+   to evolve.
+
+ * "git push --force-with-lease[=<ref>]" can easily be misused to lose
+   commits unless the user takes good care of their own "git fetch".
+   A new option "--force-if-includes" attempts to ensure that what is
+   being force-pushed was created after examining the commit at the
+   tip of the remote ref that is about to be force-replaced.
+
+ * "git clone" learned clone.defaultremotename configuration variable
+   to customize what nickname to use to call the remote the repository
+   was cloned from.
+
+ * "git checkout" learned to use checkout.guess configuration variable
+   and enable/disable its "--[no-]guess" option accordingly.
+
+ * "git resurrect" script (in contrib/) learned that the object names
+   may be longer than 40-hex depending on the hash function in use.
+
+ * "git diff A...B" learned "git diff --merge-base A B", which is a
+   longer short-hand to say the same thing.
+
+ * A sample 'push-to-checkout' hook, that performs the same as
+   what the built-in default action does, has been added.
+
+ * "git diff" family of commands learned the "-I<regex>" option to
+   ignore hunks whose changed lines all match the given pattern.
+
+ * The userdiff pattern learned to identify the function definition in
+   POSIX shells and bash.
+
+ * "git checkout-index" did not consistently signal an error with its
+   exit status, but now it does.
+
+ * A commit and tag object may have CR at the end of each and
+   every line (you can create such an object with hash-object or
+   using --cleanup=verbatim to decline the default clean-up
+   action), but it would make it impossible to have a blank line
+   to separate the title from the body of the message.  We are now
+   more lenient and accept a line with lone CR on it as a blank line,
+   too.
+
+ * Exit codes from "git remote add" etc. were not usable by scripted
+   callers, but now they are.
+
+ * "git archive" now allows compression level higher than "-9"
+   when generating tar.gz output.
+
+ * Zsh autocompletion (in contrib/) update.
+
+ * The maximum length of output filenames "git format-patch" creates
+   has become configurable (used to be capped at 64).
+
+ * "git rev-parse" learned the "--end-of-options" to help scripts to
+   safely take a parameter that is supposed to be a revision, e.g.
+   "git rev-parse --verify -q --end-of-options $rev".
+
+ * The command line completion script (in contrib/) learned to expand
+   commands that are alias of alias.
+
+ * "git update-ref --stdin" learns to take multiple transactions in a
+   single session.
+
+ * Various subcommands of "git config" that takes value_regex
+   learn the "--literal-value" option to take the value_regex option
+   as a literal string.
+
+ * The transport layer was taught to optionally exchange the session
+   ID assigned by the trace2 subsystem during fetch/push transactions.
+
+ * "git imap-send" used to ignore configuration variables like
+   core.askpass; this has been corrected.
+
+ * "git $cmd $args", when $cmd is not a recognised subcommand, by
+   default tries to see if $cmd is a typo of an existing subcommand
+   and optionally executes the corrected command if there is only one
+   possibility, depending on the setting of help.autocorrect; the
+   users can now disable the whole thing, including the cycles spent
+   to find a likely typo, by setting the configuration variable to
+   'never'.
+
+ * "@" sometimes worked (e.g. "git push origin @:there") as a part of
+   a refspec element, but "git push origin @" did not work, which has
+   been corrected.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * Use "git archive" more to produce the release tarball.
+
+ * GitHub Actions automated test improvement to skip tests on a tree
+   identical to what has already been tested.
+
+ * Test-coverage for running commit-graph task "git maintenance" has
+   been extended.
+
+ * Our test scripts can be told to run only individual pieces while
+   skipping others with the "--run=..." option; they were taught to
+   take a substring of test title, in addition to numbers, to name the
+   test pieces to run.
+
+ * Adjust tests so that they won't scream when the default initial
+   branch name is changed to 'main'.
+
+ * Rewriting "git bisect" in C continues.
+
+ * More preliminary tests have been added to document desired outcome
+   of various "directory rename" situations.
+
+ * Micro clean-up of a couple of test scripts.
+
+ * "git diff" and other commands that share the same machinery to
+   compare with working tree files have been taught to take advantage
+   of the fsmonitor data when available.
+
+ * The code to detect premature EOF in the sideband demultiplexer has
+   been cleaned up.
+
+ * Test scripts are being prepared to transition of the default branch
+   name to 'main'.
+
+ * "git fetch --depth=<n>" over the stateless RPC / smart HTTP
+   transport handled EOF from the client poorly at the server end.
+
+ * A specialization of hashmap that uses a string as key has been
+   introduced.  Hopefully it will see wider use over time.
+
+ * "git bisect start/next" in a large span of history spends a lot of
+   time trying to come up with exactly the half-way point; this can be
+   optimized by stopping when we see a commit that is close enough to
+   the half-way point.
+
+ * A lazily defined test prerequisite can now be defined in terms of
+   another lazily defined test prerequisite.
+
+ * Expectation for the original contributor after responding to a
+   review comment to use the explanation in a patch update has been
+   described.
+
+ * Multiple "credential-store" backends can race to lock the same
+   file, causing everybody else but one to fail---reattempt locking
+   with some timeout to reduce the rate of the failure.
+
+ * "git-parse-remote" shell script library outlived its usefulness.
+
+ * Like die() and error(), a call to warning() will also trigger a
+   trace2 event.
+
+ * Use of non-reentrant localtime() has been removed.
+
+ * Non-reentrant time-related library functions and ctime/asctime with
+   awkward calling interfaces are banned from the codebase.
+
+
+Fixes since v2.29
+-----------------
+
+ * In 2.29, "--committer-date-is-author-date" option of "rebase" and
+   "am" subcommands lost the e-mail address by mistake, which has been
+   corrected.
+   (merge 5f35edd9d7 jk/committer-date-is-author-date-fix later to maint).
+
+ * "git checkout -p A...B [-- <path>]" did not work, even though the
+   same command without "-p" correctly used the merge-base between
+   commits A and B.
+   (merge 35166b1fb5 dl/checkout-p-merge-base later to maint).
+
+ * The side-band status report can be sent at the same time as the
+   primary payload multiplexed, but the demultiplexer on the receiving
+   end incorrectly split a single status report into two, which has
+   been corrected.
+   (merge 712b0377db js/avoid-split-sideband-message later to maint).
+
+ * "git fast-import" wasted a lot of memory when many marks were in use.
+   (merge 3f018ec716 jk/fast-import-marks-alloc-fix later to maint).
+
+ * A test helper "test_cmp A B" was taught to diagnose missing files A
+   or B as a bug in test, but some tests legitimately wanted to notice
+   a failure to even create file B as an error, in addition to leaving
+   the expected result in it, and were misdiagnosed as a bug.  This
+   has been corrected.
+   (merge 262d5ad5a5 es/test-cmp-typocatcher later to maint).
+
+ * When "git commit-graph" detects the same commit recorded more than
+   once while it is merging the layers, it used to die.  The code now
+   ignores all but one of them and continues.
+   (merge 85102ac71b ds/commit-graph-merging-fix later to maint).
+
+ * The meaning of a Signed-off-by trailer can vary from project to
+   project; this and also what it means to this project has been
+   clarified in the documentation.
+   (merge 3abd4a67d9 bk/sob-dco later to maint).
+
+ * "git credential' didn't honor the core.askPass configuration
+   variable (among other things), which has been corrected.
+   (merge 567ad2c0f9 tk/credential-config later to maint).
+
+ * Dev support to catch a tentative definition of a variable in our C
+   code as an error.
+   (merge 5539183622 jk/no-common later to maint).
+
+ * "git rebase --rebase-merges" did not correctly pass --gpg-sign
+   command line option to underlying "git merge" when replaying a merge
+   using non-default merge strategy or when replaying an octopus merge
+   (because replaying a two-head merge with the default strategy was
+   done in a separate codepath, the problem did not trigger for most
+   users), which has been corrected.
+   (merge 43ad4f2eca sc/sequencer-gpg-octopus later to maint).
+
+ * "git apply -R" did not handle patches that touch the same path
+   twice correctly, which has been corrected.  This is most relevant
+   in a patch that changes a path from a regular file to a symbolic
+   link (and vice versa).
+   (merge b0f266de11 jt/apply-reverse-twice later to maint).
+
+ * A recent oid->hash conversion missed one spot, breaking "git svn".
+   (merge 03bb366de4 bc/svn-hash-oid-fix later to maint).
+
+ * The documentation on the "--abbrev=<n>" option did not say the
+   output may be longer than "<n>" hexdigits, which has been
+   clarified.
+   (merge cda34e0d0c jc/abbrev-doc later to maint).
+
+ * "git p4" now honors init.defaultBranch configuration.
+   (merge 1b09d1917f js/p4-default-branch later to maint).
+
+ * Recently the format of an internal state file "rebase -i" uses has
+   been tightened up for consistency, which would hurt those who start
+   "rebase -i" with old git and then continue with new git.  Loosen
+   the reader side a bit (which we may want to tighten again in a year
+   or so).
+   (merge c779386182 jc/sequencer-stopped-sha-simplify later to maint).
+
+ * The code to see if "git stash drop" can safely remove refs/stash
+   has been made more carerful.
+   (merge 4f44c5659b rs/empty-reflog-check-fix later to maint).
+
+ * "git log -L<range>:<path>" is documented to take no pathspec, but
+   this was not enforced by the command line option parser, which has
+   been corrected.
+   (merge 39664cb0ac jc/line-log-takes-no-pathspec later to maint).
+
+ * "git format-patch --output=there" did not work as expected and
+   instead crashed.  The option is now supported.
+   (merge dc1672dd10 jk/format-patch-output later to maint).
+
+ * Define ARM64 compiled with MSVC to be little-endian.
+   (merge 0c038fc65a dg/bswap-msvc later to maint).
+
+ * "git rebase -i" did not store ORIG_HEAD correctly.
+   (merge 8843302307 pw/rebase-i-orig-head later to maint).
+
+ * "git blame -L :funcname -- path" did not work well for a path for
+   which a userdiff driver is defined.
+
+ * "make DEVELOPER=1 sparse" used to run sparse and let it emit
+   warnings; now such warnings will cause an error.
+   (merge 521dc56270 jc/sparse-error-for-developer-build later to maint).
+
+ * "git blame --ignore-revs-file=<file>" learned to ignore a
+   non-existent object name in the input, instead of complaining.
+   (merge c714d05875 jc/blame-ignore-fix later to maint).
+
+ * Running "git diff" while allowing external diff in a state with
+   unmerged paths used to segfault, which has been corrected.
+   (merge d66851806f jk/diff-release-filespec-fix later to maint).
+
+ * Build configuration cleanup.
+   (merge b990f02fd8 ab/config-mak-uname-simplify later to maint).
+
+ * Fix regression introduced when nvimdiff support in mergetool was added.
+   (merge 12026f46e7 pd/mergetool-nvimdiff later to maint).
+
+ * The exchange between receive-pack and proc-receive hook did not
+   carefully check for errors.
+
+ * The code was not prepared to deal with pack .idx file that is
+   larger than 4GB.
+   (merge 81c4c5cf2e jk/4gb-idx later to maint).
+
+ * Since jgit does not yet work with SHA-256 repositories, mark the
+   tests that uses it not to run unless we are testing with ShA-1
+   repositories.
+   (merge ea699b4adc sg/t5310-jgit-wants-sha1 later to maint).
+
+ * Config parser fix for "git notes".
+   (merge 45fef1599a na/notes-displayref-is-not-boolean later to maint).
+
+ * Move a definition of compatibility wrapper from cache.h to
+   git-compat-util.h
+   (merge a76b138daa hn/sleep-millisec-decl later to maint).
+
+ * Error message fix.
+   (merge eaf5341538 km/stash-error-message-fix later to maint).
+
+ * "git pull --rebase --recurse-submodules" checked for local changes
+   in a wrong range and failed to run correctly when it should.
+   (merge 5176f20ffe pb/pull-rebase-recurse-submodules later to maint).
+
+ * "git push" that is killed may leave a pack-objects process behind,
+   still computing to find a good compression, wasting cycles.  This
+   has been corrected.
+   (merge 8b59935114 jk/stop-pack-objects-when-push-is-killed later to maint).
+
+ * "git fetch" that is killed may leave a pack-objects process behind,
+   still computing to find a good compression, wasting cycles.  This
+   has been corrected.
+   (merge 309a4028e7 jk/stop-pack-objects-when-fetch-is-killed later to maint).
+
+ * "git add -i" failed to honor custom colors configured to show
+   patches, which has been corrected.
+   (merge 96386faa03 js/add-i-color-fix later to maint).
+
+ * Processes that access packdata while the .idx file gets removed
+   (e.g. while repacking) did not fail or fall back gracefully as they
+   could.
+   (merge 506ec2fbda tb/idx-midx-race-fix later to maint).
+
+ * "git apply" adjusted the permission bits of working-tree files and
+   directories according core.sharedRepository setting by mistake and
+   for a long time, which has been corrected.
+   (merge eb3c027e17 mt/do-not-use-scld-in-working-tree later to maint).
+
+ * "fetch-pack" could pass NULL pointer to unlink(2) when it sees an
+   invalid filename; the error checking has been tightened to make
+   this impossible.
+   (merge 6031af387e rs/fetch-pack-invalid-lockfile later to maint).
+
+ * "git maintenance run/start/stop" needed to be run in a repository
+   to hold the lockfile they use, but didn't make sure they are
+   actually in a repository, which has been corrected.
+
+ * The glossary described a branch as an "active" line of development,
+   which is misleading---a stale and non-moving branch is still a
+   branch.
+   (merge eef1ceabd8 so/glossary-branch-is-not-necessarily-active later to maint).
+
+ * Newer versions of xsltproc can assign IDs in HTML documents it
+   generates in a consistent manner.  Use the feature to help format
+   HTML version of the user manual reproducibly.
+   (merge 3569e11d69 ae/doc-reproducible-html later to maint).
+
+ * Tighten error checking in the codepath that responds to "git fetch".
+   (merge d43a21bdbb jk/check-config-parsing-error-in-upload-pack later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+   (merge 3e0a5dc9af cc/doc-filter-branch-typofix later to maint).
+   (merge 32c83afc2c cw/ci-ghwf-check-ws-errors later to maint).
+   (merge 5eb2ed691b rs/tighten-callers-of-deref-tag later to maint).
+   (merge 6db29ab213 jk/fast-import-marks-cleanup later to maint).
+   (merge e5cf6d3df4 nk/dir-c-comment-update later to maint).
+   (merge 5710dcce74 jk/report-fn-typedef later to maint).
+   (merge 9a82db1056 en/sequencer-rollback-lock-cleanup later to maint).
+   (merge 4e1bee9a99 js/t7006-cleanup later to maint).
+   (merge f5bcde6c58 es/tutorial-mention-asciidoc-early later to maint).
+   (merge 714d491af0 so/format-patch-doc-on-default-diff-format later to maint).
+   (merge 0795df4b9b rs/clear-commit-marks-in-repo later to maint).
+   (merge 9542d56379 sd/prompt-local-variable later to maint).
+   (merge 06d43fad18 rs/pack-write-hashwrite-simplify later to maint).
+   (merge b7e20b4373 mc/typofix later to maint).
+   (merge f6bcd9a8a4 js/test-whitespace-fixes later to maint).
+   (merge 53b67a801b js/test-file-size later to maint).
+   (merge 970909c2a7 rs/hashwrite-be64 later to maint).
+   (merge 5a923bb1f0 ma/list-object-filter-opt-msgfix later to maint).
+   (merge 1c3e412916 rs/archive-plug-leak-refname later to maint).
+   (merge d44e5267ea rs/plug-diff-cache-leak later to maint).
+   (merge 793c1464d3 ab/gc-keep-base-option later to maint).
+   (merge b86339b12b mt/worktree-error-message-fix later to maint).
+   (merge e01ae2a4a7 js/pull-rebase-use-advise later to maint).
+   (merge e63d774242 sn/config-doc-typofix later to maint).
+   (merge 08e9df2395 jk/multi-line-indent-style-fix later to maint).
+   (merge e66590348a da/vs-build-iconv-fix later to maint).
+   (merge 7fe07275be js/cmake-extra-built-ins-fix later to maint).
+   (merge 633eebe142 jb/midx-doc-update later to maint).
+   (merge 5885367e8f jh/index-v2-doc-on-fsmn later to maint).
index 291b61e2621321e30277cd426fc842982c845ca6..d12094bac5f46a3d8df1aee0b380e563a51dad47 100644 (file)
@@ -209,7 +209,7 @@ send them as replies to either an additional "cover letter" message
 (see below), the first patch, or the respective preceding patch.
 
 If your log message (including your name on the
-Signed-off-by line) is not writable in ASCII, make sure that
+`Signed-off-by` trailer) is not writable in ASCII, make sure that
 you send off a message in the correct encoding.
 
 WARNING: Be wary of your MUAs word-wrap
@@ -229,7 +229,7 @@ previously sent.
 The `git format-patch` command follows the best current practice to
 format the body of an e-mail message.  At the beginning of the
 patch should come your commit message, ending with the
-Signed-off-by: lines, and a line that consists of three dashes,
+`Signed-off-by` trailers, and a line that consists of three dashes,
 followed by the diffstat information and the patch itself.  If
 you are forwarding a patch from somebody else, optionally, at
 the beginning of the e-mail message just before the commit
@@ -290,25 +290,24 @@ identify them), to solicit comments and reviews.
 :git-ml: footnote:[The mailing list: git@vger.kernel.org]
 
 After the list reached a consensus that it is a good idea to apply the
-patch, re-send it with "To:" set to the maintainer{current-maintainer} and "cc:" the
-list{git-ml} for inclusion.
+patch, re-send it with "To:" set to the maintainer{current-maintainer}
+and "cc:" the list{git-ml} for inclusion.  This is especially relevant
+when the maintainer did not heavily participate in the discussion and
+instead left the review to trusted others.
 
 Do not forget to add trailers such as `Acked-by:`, `Reviewed-by:` and
 `Tested-by:` lines as necessary to credit people who helped your
-patch.
+patch, and "cc:" them when sending such a final version for inclusion.
 
 [[sign-off]]
-=== Certify your work by adding your "Signed-off-by: " line
+=== Certify your work by adding your `Signed-off-by` trailer
 
-To improve tracking of who did what, we've borrowed the
-"sign-off" procedure from the Linux kernel project on patches
-that are being emailed around.  Although core Git is a lot
-smaller project it is a good discipline to follow it.
+To improve tracking of who did what, we ask you to certify that you
+wrote the patch or have the right to pass it on under the same license
+as ours, by "signing off" your patch.  Without sign-off, we cannot
+accept your patches.
 
-The sign-off is a simple line at the end of the explanation for
-the patch, which certifies that you wrote it or otherwise have
-the right to pass it on as an open-source patch.  The rules are
-pretty simple: if you can certify the below D-C-O:
+If you can certify the below D-C-O:
 
 [[dco]]
 .Developer's Certificate of Origin 1.1
@@ -338,23 +337,29 @@ d. I understand and agree that this project and the contribution
    this project or the open source license(s) involved.
 ____
 
-then you just add a line saying
+you add a "Signed-off-by" trailer to your commit, that looks like
+this:
 
 ....
        Signed-off-by: Random J Developer <random@developer.example.org>
 ....
 
-This line can be automatically added by Git if you run the git-commit
-command with the -s option.
+This line can be added by Git if you run the git-commit command with
+the -s option.
 
-Notice that you can place your own Signed-off-by: line when
+Notice that you can place your own `Signed-off-by` trailer when
 forwarding somebody else's patch with the above rules for
 D-C-O.  Indeed you are encouraged to do so.  Do not forget to
 place an in-body "From: " line at the beginning to properly attribute
 the change to its true author (see (2) above).
 
+This procedure originally came from the Linux kernel project, so our
+rule is quite similar to theirs, but what exactly it means to sign-off
+your patch differs from project to project, so it may be different
+from that of the project you are accustomed to.
+
 [[real-name]]
-Also notice that a real name is used in the Signed-off-by: line. Please
+Also notice that a real name is used in the `Signed-off-by` trailer. Please
 don't hide your real name.
 
 [[commit-trailers]]
index 88750af7ae19672dd1b44a6131b180acdc77ba16..dc3bceb6d1cad4f14bc00ace9618716dd459cb04 100644 (file)
 
 -L <start>,<end>::
 -L :<funcname>::
-       Annotate only the given line range. May be specified multiple times.
-       Overlapping ranges are allowed.
+       Annotate only the line range given by '<start>,<end>',
+       or by the function name regex '<funcname>'.
+       May be specified multiple times. Overlapping ranges are allowed.
 +
-<start> and <end> are optional. ``-L <start>'' or ``-L <start>,'' spans from
-<start> to end of file. ``-L ,<end>'' spans from start of file to <end>.
+'<start>' and '<end>' are optional. `-L <start>` or `-L <start>,` spans from
+'<start>' to end of file. `-L ,<end>` spans from start of file to '<end>'.
 +
 include::line-range-format.txt[]
 
index bf706b950e6615b955fa481853bfbe5b84d2486c..6ba50b1104aa798cc80c92a521da39a026d82955 100644 (file)
@@ -64,7 +64,7 @@ The variable names are case-insensitive, allow only alphanumeric characters
 and `-`, and must start with an alphabetic character.
 
 A line that defines a value can be continued to the next line by
-ending it with a `\`; the backquote and the end-of-line are
+ending it with a `\`; the backslash and the end-of-line are
 stripped.  Leading whitespaces after 'name =', the remainder of the
 line after the first comment character '#' or ';', and trailing
 whitespaces of the line are discarded unless they are enclosed in
@@ -265,7 +265,7 @@ color::
 The basic colors accepted are `normal`, `black`, `red`, `green`, `yellow`,
 `blue`, `magenta`, `cyan` and `white`.  The first color given is the
 foreground; the second is the background.  All the basic colors except
-`normal` have a bright variant that can be speficied by prefixing the
+`normal` have a bright variant that can be specified by prefixing the
 color with `bright`, like `brightred`.
 +
 Colors may also be given as numbers between 0 and 255; these use ANSI
@@ -334,6 +334,8 @@ include::config/checkout.txt[]
 
 include::config/clean.txt[]
 
+include::config/clone.txt[]
+
 include::config/color.txt[]
 
 include::config/column.txt[]
index bdd37c3eaa3203f504fdc07eeac358ad58887965..acbd0c09aa4fb0b2146ba11f264be55e61e73c77 100644 (file)
@@ -10,9 +10,8 @@ advice.*::
                that the check is disabled.
        pushUpdateRejected::
                Set this variable to 'false' if you want to disable
-               'pushNonFFCurrent',
-               'pushNonFFMatching', 'pushAlreadyExists',
-               'pushFetchFirst', and 'pushNeedsForce'
+               'pushNonFFCurrent', 'pushNonFFMatching', 'pushAlreadyExists',
+               'pushFetchFirst', 'pushNeedsForce', and 'pushRefNeedsUpdate'
                simultaneously.
        pushNonFFCurrent::
                Advice shown when linkgit:git-push[1] fails due to a
@@ -41,6 +40,10 @@ advice.*::
                we can still suggest that the user push to either
                refs/heads/* or refs/tags/* based on the type of the
                source object.
+       pushRefNeedsUpdate::
+               Shown when linkgit:git-push[1] rejects a forced update of
+               a branch when its remote-tracking ref has updates that we
+               do not have locally.
        statusAheadBehind::
                Shown when linkgit:git-status[1] computes the ahead/behind
                counts for a local ref compared to its remote tracking ref,
index 6b646813abadc95a969d5c20f6c4350a284bf129..2cddf7b4b40213155a09e85e6499508fc4a30c86 100644 (file)
@@ -1,18 +1,23 @@
 checkout.defaultRemote::
-       When you run 'git checkout <something>'
-       or 'git switch <something>' and only have one
+       When you run `git checkout <something>`
+       or `git switch <something>` and only have one
        remote, it may implicitly fall back on checking out and
-       tracking e.g. 'origin/<something>'. This stops working as soon
-       as you have more than one remote with a '<something>'
+       tracking e.g. `origin/<something>`. This stops working as soon
+       as you have more than one remote with a `<something>`
        reference. This setting allows for setting the name of a
        preferred remote that should always win when it comes to
        disambiguation. The typical use-case is to set this to
        `origin`.
 +
 Currently this is used by linkgit:git-switch[1] and
-linkgit:git-checkout[1] when 'git checkout <something>'
-or 'git switch <something>'
-will checkout the '<something>' branch on another remote,
-and by linkgit:git-worktree[1] when 'git worktree add' refers to a
+linkgit:git-checkout[1] when `git checkout <something>`
+or `git switch <something>`
+will checkout the `<something>` branch on another remote,
+and by linkgit:git-worktree[1] when `git worktree add` refers to a
 remote branch. This setting might be used for other checkout-like
 commands or functionality in the future.
+
+checkout.guess::
+       Provides the default value for the `--guess` or `--no-guess`
+       option in `git checkout` and `git switch`. See
+       linkgit:git-switch[1] and linkgit:git-checkout[1].
diff --git a/Documentation/config/clone.txt b/Documentation/config/clone.txt
new file mode 100644 (file)
index 0000000..47de36a
--- /dev/null
@@ -0,0 +1,4 @@
+clone.defaultRemoteName::
+       The name of the remote to create when cloning a repository.  Defaults to
+       `origin`, and can be overridden by passing the `--origin` command-line
+       option to linkgit:git-clone[1].
index 02002cf109e90ecfaf80aba698f235111bd4e05e..160aacad84bae60ff69ea73b9edbb63bee9c2b56 100644 (file)
@@ -606,8 +606,8 @@ core.useReplaceRefs::
 
 core.multiPackIndex::
        Use the multi-pack-index file to track multiple packfiles using a
-       single index. See link:technical/multi-pack-index.html[the
-       multi-pack-index design document].
+       single index. See linkgit:git-multi-pack-index[1] for more
+       information. Defaults to true.
 
 core.sparseCheckout::
        Enable "sparse checkout" feature. See linkgit:git-sparse-checkout[1]
index 9d01641c282aa9cf472dc782e13cd9c430b17e3a..512f31876e17ed6892ff7f1858a891f0f7938b29 100644 (file)
@@ -28,3 +28,9 @@ credential.<url>.*::
 
 credentialCache.ignoreSIGHUP::
        Tell git-credential-cache--daemon to ignore SIGHUP, instead of quitting.
+
+credentialStore.lockTimeoutMS::
+       The length of time, in milliseconds, for git-credential-store to retry
+       when trying to lock the credentials file. Value 0 means not to retry at
+       all; -1 means to try indefinitely. Default is 1000 (i.e., retry for
+       1s).
index c2efd8758a5841d40b41003edb7713089b0650a3..fdbc06a4d2a837f768a213fd5ffdf28ad5a48315 100644 (file)
@@ -79,7 +79,7 @@ format.thread::
 
 format.signOff::
        A boolean value which lets you enable the `-s/--signoff` option of
-       format-patch by default. *Note:* Adding the Signed-off-by: line to a
+       format-patch by default. *Note:* Adding the `Signed-off-by` trailer to a
        patch should be a conscious act and means that you certify you have
        the rights to submit this work under the same open source license.
        Please see the 'SubmittingPatches' document for further discussion.
@@ -94,6 +94,11 @@ format.outputDirectory::
        Set a custom directory to store the resulting files instead of the
        current working directory. All directory components will be created.
 
+format.filenameMaxLength::
+       The maximum length of the output filenames generated by the
+       `format-patch` command; defaults to 64.  Can be overridden
+       by the `--filename-max-length=<n>` command line option.
+
 format.useAutoBase::
        A boolean value which lets you enable the `--base=auto` option of
        format-patch by default. Can also be set to "whenAble" to allow
index 00ea0a678ee214f86cc91b27389572698d35bece..c834e07991fec00d976cc105760814694deb8f68 100644 (file)
@@ -44,9 +44,9 @@ gc.autoDetach::
 
 gc.bigPackThreshold::
        If non-zero, all packs larger than this limit are kept when
-       `git gc` is run. This is very similar to `--keep-base-pack`
+       `git gc` is run. This is very similar to `--keep-largest-pack`
        except that all packs that meet the threshold are kept, not
-       just the base pack. Defaults to zero. Common unit suffixes of
+       just the largest pack. Defaults to zero. Common unit suffixes of
        'k', 'm', or 'g' are supported.
 +
 Note that if the number of kept packs is more than gc.autoPackLimit,
@@ -57,7 +57,7 @@ gc.autoPackLimit and gc.bigPackThreshold should be respected again.
 If the amount of memory estimated for `git repack` to run smoothly is
 not available and `gc.bigPackThreshold` is not set, the largest pack
 will also be excluded (this is the equivalent of running `git gc` with
-`--keep-base-pack`).
+`--keep-largest-pack`).
 
 gc.writeCommitGraph::
        If true, then gc will rewrite the commit-graph file when
index 224bbf5a28a276d6072bf8e1b7ce55128fcf9f4b..783a90a0f935f0d453a5f9498147ea544e7f6e15 100644 (file)
@@ -8,13 +8,14 @@ help.format::
        the default. 'web' and 'html' are the same.
 
 help.autoCorrect::
-       Automatically correct and execute mistyped commands after
-       waiting for the given number of deciseconds (0.1 sec). If more
-       than one command can be deduced from the entered text, nothing
-       will be executed.  If the value of this option is negative,
-       the corrected command will be executed immediately. If the
-       value is 0 - the command will be just shown but not executed.
-       This is the default.
+       If git detects typos and can identify exactly one valid command similar
+       to the error, git will automatically run the intended command after
+       waiting a duration of time defined by this configuration value in
+       deciseconds (0.1 sec).  If this value is 0, the suggested corrections
+       will be shown, but not executed. If it is a negative integer, or
+       "immediate", the suggested command
+       is run immediately. If "never", suggestions are not shown at all. The
+       default value is zero.
 
 help.htmlPath::
        Specify the path where the HTML documentation resides. File system paths
index 7cc6700d574d3208178d7d36e00d62f71d5b10bf..a5ead09e4bc2d1ca8834b332322315bcc72f352c 100644 (file)
@@ -1,3 +1,23 @@
+maintenance.auto::
+       This boolean config option controls whether some commands run
+       `git maintenance run --auto` after doing their normal work. Defaults
+       to true.
+
+maintenance.strategy::
+       This string config option provides a way to specify one of a few
+       recommended schedules for background maintenance. This only affects
+       which tasks are run during `git maintenance run --schedule=X`
+       commands, provided no `--task=<task>` arguments are provided.
+       Further, if a `maintenance.<task>.schedule` config value is set,
+       then that value is used instead of the one provided by
+       `maintenance.strategy`. The possible strategy strings are:
++
+* `none`: This default setting implies no task are run at any schedule.
+* `incremental`: This setting optimizes for performing small maintenance
+  activities that do not delete any data. This does not schedule the `gc`
+  task, but runs the `prefetch` and `commit-graph` tasks hourly and the
+  `loose-objects` and `incremental-repack` tasks daily.
+
 maintenance.<task>.enabled::
        This boolean config option controls whether the maintenance task
        with name `<task>` is run when no `--task` option is specified to
@@ -5,6 +25,11 @@ maintenance.<task>.enabled::
        `--task` option exists. By default, only `maintenance.gc.enabled`
        is true.
 
+maintenance.<task>.schedule::
+       This config option controls whether or not the given `<task>` runs
+       during a `git maintenance run --schedule=<frequency>` command. The
+       value must be one of "hourly", "daily", or "weekly".
+
 maintenance.commit-graph.auto::
        This integer config option controls how often the `commit-graph` task
        should be run as part of `git maintenance run --auto`. If zero, then
@@ -14,3 +39,21 @@ maintenance.commit-graph.auto::
        reachable commits that are not in the commit-graph file is at least
        the value of `maintenance.commit-graph.auto`. The default value is
        100.
+
+maintenance.loose-objects.auto::
+       This integer config option controls how often the `loose-objects` task
+       should be run as part of `git maintenance run --auto`. If zero, then
+       the `loose-objects` task will not run with the `--auto` option. A
+       negative value will force the task to run every time. Otherwise, a
+       positive value implies the command should run when the number of
+       loose objects is at least the value of `maintenance.loose-objects.auto`.
+       The default value is 100.
+
+maintenance.incremental-repack.auto::
+       This integer config option controls how often the `incremental-repack`
+       task should be run as part of `git maintenance run --auto`. If zero,
+       then the `incremental-repack` task will not run with the `--auto`
+       option. A negative value will force the task to run every time.
+       Otherwise, a positive value implies the command should run when the
+       number of pack-files not in the multi-pack-index is at least the value
+       of `maintenance.incremental-repack.auto`. The default value is 10.
index f5e5b38c6889e92d5366e7be1140db57e8f708c4..21b256e0a4ec8af1dd1227ec2408ff924f988233 100644 (file)
@@ -114,3 +114,9 @@ push.recurseSubmodules::
        specifying '--recurse-submodules=check|on-demand|no'.
        If not set, 'no' is used by default, unless 'submodule.recurse' is
        set (in which case a 'true' value means 'on-demand').
+
+push.useForceIfIncludes::
+       If set to "true", it is equivalent to specifying
+       `--force-if-includes` as an option to linkgit:git-push[1]
+       in the command line. Adding `--no-force-if-includes` at the
+       time of push overrides this configuration setting.
index f5b6245270e0e8ddd029eb1f520b3e27210792f4..505126a7802319de3d31cf4426e2e75407b7baec 100644 (file)
@@ -69,3 +69,7 @@ transfer.unpackLimit::
        When `fetch.unpackLimit` or `receive.unpackLimit` are
        not set, the value of this variable is used instead.
        The default value is 100.
+
+transfer.advertiseSID::
+       Boolean. When true, client and server processes will advertise their
+       unique session IDs to their remote counterpart. Defaults to false.
index 573fb9bb71e2b7df1062258289a0af308c50bf5b..746b144c76ba15f48b58d77ad88b88379f83529e 100644 (file)
@@ -36,9 +36,9 @@ endif::git-format-patch[]
 -U<n>::
 --unified=<n>::
        Generate diffs with <n> lines of context instead of
-       the usual three. Implies `--patch`.
+       the usual three.
 ifndef::git-format-patch[]
-       Implies `-p`.
+       Implies `--patch`.
 endif::git-format-patch[]
 
 --output=<file>::
@@ -441,12 +441,16 @@ endif::git-format-patch[]
 
 --binary::
        In addition to `--full-index`, output a binary diff that
-       can be applied with `git-apply`. Implies `--patch`.
+       can be applied with `git-apply`.
+ifndef::git-format-patch[]
+       Implies `--patch`.
+endif::git-format-patch[]
 
 --abbrev[=<n>]::
        Instead of showing the full 40-byte hexadecimal object
        name in diff-raw format output and diff-tree header
-       lines, show only a partial prefix.
+       lines, show the shortest prefix that is at least '<n>'
+       hexdigits long that uniquely refers the object.
        In diff-patch output format, `--full-index` takes higher
        precedence, i.e. if `--full-index` is specified, full blob
        names will be shown regardless of `--abbrev`.
@@ -687,6 +691,11 @@ endif::git-format-patch[]
 --ignore-blank-lines::
        Ignore changes whose lines are all blank.
 
+-I<regex>::
+--ignore-matching-lines=<regex>::
+       Ignore changes whose all lines match <regex>.  This option may
+       be specified more than once.
+
 --inter-hunk-context=<lines>::
        Show the context between diff hunks, up to the specified number
        of lines, thereby fusing hunks that are close to each other.
@@ -695,7 +704,10 @@ endif::git-format-patch[]
 
 -W::
 --function-context::
-       Show whole surrounding functions of changes.
+       Show whole function as context lines for each change.
+       The function names are determined in the same way as
+       `git diff` works out patch hunk headers (see 'Defining a
+       custom hunk-header' in linkgit:gitattributes[5]).
 
 ifndef::git-format-patch[]
 ifndef::git-log[]
index 38c0852139c17077aacb6bc43fcf8102cc6570f4..06bc063542f3044cc9fe7ced6ecd4922d2e209e2 100644 (file)
@@ -33,7 +33,7 @@ OPTIONS
 
 -s::
 --signoff::
-       Add a `Signed-off-by:` line to the commit message, using
+       Add a `Signed-off-by` trailer to the commit message, using
        the committer identity of yourself.
        See the signoff option in linkgit:git-commit[1] for more information.
 
index 7e81541996359cf4b7a4abce35e8cae5c2ce29fb..34b496d4858134fb5c5e91bbd1537cd3ae076ccf 100644 (file)
@@ -87,7 +87,9 @@ include::blame-options.txt[]
 
 --abbrev=<n>::
        Instead of using the default 7+1 hexadecimal digits as the
-       abbreviated object name, use <n>+1 digits. Note that 1 column
+       abbreviated object name, use <m>+1 digits, where <m> is at
+       least <n> but ensures the commit object names are unique.
+       Note that 1 column
        is used for a caret to mark the boundary commit.
 
 
index ace4ad3da8874d7c38173f4badbc51b6a1b7fec5..adaa1782a8b26d4c5fb498ff3a1d33abb8e6ac19 100644 (file)
@@ -9,7 +9,7 @@ SYNOPSIS
 --------
 [verse]
 'git branch' [--color[=<when>] | --no-color] [--show-current]
-       [-v [--abbrev=<length> | --no-abbrev]]
+       [-v [--abbrev=<n> | --no-abbrev]]
        [--column[=<options>] | --no-column] [--sort=<key>]
        [--merged [<commit>]] [--no-merged [<commit>]]
        [--contains [<commit>]] [--no-contains [<commit>]]
@@ -194,8 +194,10 @@ This option is only applicable in non-verbose mode.
        Be more quiet when creating or deleting a branch, suppressing
        non-error messages.
 
---abbrev=<length>::
-       Alter the sha1's minimum display length in the output listing.
+--abbrev=<n>::
+       In the verbose listing that show the commit object name,
+       show the shortest prefix that is at least '<n>' hexdigits
+       long that uniquely refers the object.
        The default value is 7 and can be overridden by the `core.abbrev`
        config option.
 
index afa5c11fd3c4d58f978e5bb99a03517c642584c6..b1a6fe4499730690777de66558621446e1e58bac 100644 (file)
@@ -192,7 +192,10 @@ branches from there if `<branch>` is ambiguous but exists on the
 'origin' remote. See also `checkout.defaultRemote` in
 linkgit:git-config[1].
 +
-Use `--no-guess` to disable this.
+`--guess` is the default behavior. Use `--no-guess` to disable it.
++
+The default behavior can be set via the `checkout.guess` configuration
+variable.
 
 -l::
        Create the new branch's reflog; see linkgit:git-branch[1] for
@@ -351,6 +354,10 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 <tree-ish>::
        Tree to checkout from (when paths are given). If not specified,
        the index will be used.
++
+As a special case, you may use `"A...B"` as a shortcut for the
+merge base of `A` and `B` if there is exactly one merge base. You can
+leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 
 \--::
        Do not interpret any more arguments as options.
index 75feeef08a0e64ac3f6bfc35290e92984c1a1580..5d750314b299cc7157034b9bffd6a5aa3afe51d4 100644 (file)
@@ -104,7 +104,7 @@ effect to your index in a row.
 
 -s::
 --signoff::
-       Add Signed-off-by line at the end of the commit message.
+       Add a `Signed-off-by` trailer at the end of the commit message.
        See the signoff option in linkgit:git-commit[1] for more information.
 
 -S[<keyid>]::
index 097e6a86c5bdf31c9b30e277e9659bb3015081af..876aedcd472a4b04ee28f3cc524195a701222db5 100644 (file)
@@ -183,8 +183,9 @@ objects from the source repository into a pack in the cloned repository.
 
 -o <name>::
 --origin <name>::
-       Instead of using the remote name `origin` to keep track
-       of the upstream repository, use `<name>`.
+       Instead of using the remote name `origin` to keep track of the upstream
+       repository, use `<name>`.  Overrides `clone.defaultRemoteName` from the
+       config.
 
 -b <name>::
 --branch <name>::
index de6b6de230223c2e3fd37b55827ba85265c3f052..e1f48c95b3ca37e67af88e634a44db88dd1ca6a9 100644 (file)
@@ -39,7 +39,9 @@ COMMANDS
 --------
 'write'::
 
-Write a commit-graph file based on the commits found in packfiles.
+Write a commit-graph file based on the commits found in packfiles. If
+the config option `core.commitGraph` is disabled, then this command will
+output a warning, then return success without writing a commit-graph file.
 +
 With the `--stdin-packs` option, generate the new commit graph by
 walking objects only in the specified pack-indexes. (Cannot be combined
index a3baea32aedddfa00077adc5f2a2b36e38a5ea26..17150fa7eabe8092acf09f63220b515a0002a7b4 100644 (file)
@@ -59,6 +59,7 @@ commit by giving the same set of parameters (options and paths).
 If you make a commit and then find a mistake immediately after
 that, you can recover from it with 'git reset'.
 
+:git-commit: 1
 
 OPTIONS
 -------
@@ -163,14 +164,7 @@ The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`.
        message, the commit is aborted.  This has no effect when a message
        is given by other means, e.g. with the `-m` or `-F` options.
 
--s::
---signoff::
-       Add Signed-off-by line by the committer at the end of the commit
-       log message.  The meaning of a signoff depends on the project,
-       but it typically certifies that committer has
-       the rights to submit this work under the same license and
-       agrees to a Developer Certificate of Origin
-       (see http://developercertificate.org/ for more information).
+include::signoff-option.txt[]
 
 -n::
 --no-verify::
index 7573160f21539592ddeccb3e36cdde04ed0347e6..0e9351d3cb550542c84274395717e1a99cf3464a 100644 (file)
@@ -9,15 +9,15 @@ git-config - Get and set repository or global options
 SYNOPSIS
 --------
 [verse]
-'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] name [value [value_regex]]
+'git config' [<file-option>] [--type=<type>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] name [value [value-pattern]]
 'git config' [<file-option>] [--type=<type>] --add name value
-'git config' [<file-option>] [--type=<type>] --replace-all name value [value_regex]
-'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] --get name [value_regex]
-'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] --get-all name [value_regex]
-'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--name-only] --get-regexp name_regex [value_regex]
+'git config' [<file-option>] [--type=<type>] [--fixed-value] --replace-all name value [value-pattern]
+'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get name [value-pattern]
+'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get-all name [value-pattern]
+'git config' [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] [--name-only] --get-regexp name_regex [value-pattern]
 'git config' [<file-option>] [--type=<type>] [-z|--null] --get-urlmatch name URL
-'git config' [<file-option>] --unset name [value_regex]
-'git config' [<file-option>] --unset-all name [value_regex]
+'git config' [<file-option>] [--fixed-value] --unset name [value-pattern]
+'git config' [<file-option>] [--fixed-value] --unset-all name [value-pattern]
 'git config' [<file-option>] --rename-section old_name new_name
 'git config' [<file-option>] --remove-section name
 'git config' [<file-option>] [--show-origin] [--show-scope] [-z|--null] [--name-only] -l | --list
@@ -33,10 +33,13 @@ escaped.
 
 Multiple lines can be added to an option by using the `--add` option.
 If you want to update or unset an option which can occur on multiple
-lines, a POSIX regexp `value_regex` needs to be given.  Only the
-existing values that match the regexp are updated or unset.  If
-you want to handle the lines that do *not* match the regex, just
-prepend a single exclamation mark in front (see also <<EXAMPLES>>).
+lines, a `value-pattern` (which is an extended regular expression,
+unless the `--fixed-value` option is given) needs to be given.  Only the
+existing values that match the pattern are updated or unset.  If
+you want to handle the lines that do *not* match the pattern, just
+prepend a single exclamation mark in front (see also <<EXAMPLES>>),
+but note that this only works when the `--fixed-value` option is not
+in use.
 
 The `--type=<type>` option instructs 'git config' to ensure that incoming and
 outgoing values are canonicalize-able under the given <type>.  If no
@@ -73,11 +76,11 @@ OPTIONS
 
 --replace-all::
        Default behavior is to replace at most one line. This replaces
-       all lines matching the key (and optionally the value_regex).
+       all lines matching the key (and optionally the `value-pattern`).
 
 --add::
        Adds a new line to the option without altering any existing
-       values.  This is the same as providing '^$' as the value_regex
+       values.  This is the same as providing '^$' as the `value-pattern`
        in `--replace-all`.
 
 --get::
@@ -165,6 +168,12 @@ See also <<FILES>>.
 --list::
        List all variables set in config file, along with their values.
 
+--fixed-value::
+       When used with the `value-pattern` argument, treat `value-pattern` as
+       an exact string instead of a regular expression. This will restrict
+       the name/value pairs that are matched to only those where the value
+       is exactly equal to the `value-pattern`.
+
 --type <type>::
   'git config' will ensure that any input or output is valid under the given
   type constraint(s), and will canonicalize outgoing values in `<type>`'s
index f4bd8155c0a707308162e050d5d59b5dbd5ca7a6..27acb31cbf26f6d842a7445324950f6dfc2b2e68 100644 (file)
@@ -9,7 +9,7 @@ git-diff-index - Compare a tree to the working tree or index
 SYNOPSIS
 --------
 [verse]
-'git diff-index' [-m] [--cached] [<common diff options>] <tree-ish> [<path>...]
+'git diff-index' [-m] [--cached] [--merge-base] [<common diff options>] <tree-ish> [<path>...]
 
 DESCRIPTION
 -----------
@@ -27,7 +27,12 @@ include::diff-options.txt[]
        The id of a tree object to diff against.
 
 --cached::
-       do not consider the on-disk file at all
+       Do not consider the on-disk file at all.
+
+--merge-base::
+       Instead of comparing <tree-ish> directly, use the merge base
+       between <tree-ish> and HEAD instead.  <tree-ish> must be a
+       commit.
 
 -m::
        By default, files recorded in the index but not checked
index 5c8a2a5e9755db17be4063cdcb2edb8b48237436..2fc24c542f8cbd3e20af3575b09f52b6a4de5822 100644 (file)
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
-             [-t] [-r] [-c | --cc] [--combined-all-paths] [--root]
+             [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]
              [<common diff options>] <tree-ish> [<tree-ish>] [<path>...]
 
 DESCRIPTION
@@ -43,6 +43,11 @@ include::diff-options.txt[]
        When `--root` is specified the initial commit will be shown as a big
        creation event. This is equivalent to a diff against the NULL tree.
 
+--merge-base::
+       Instead of comparing the <tree-ish>s directly, use the merge
+       base between the two <tree-ish>s as the "before" side.  There
+       must be two <tree-ish>s given and they must both be commits.
+
 --stdin::
        When `--stdin` is specified, the command does not take
        <tree-ish> arguments from the command line.  Instead, it
index 727f24d16ec931e4bb23f33f4f44f5c341e497f0..7f4c8a8ce7fd54f87e2c3936a6a1cf1cc623c60d 100644 (file)
@@ -10,8 +10,8 @@ SYNOPSIS
 --------
 [verse]
 'git diff' [<options>] [<commit>] [--] [<path>...]
-'git diff' [<options>] --cached [<commit>] [--] [<path>...]
-'git diff' [<options>] <commit> [<commit>...] <commit> [--] [<path>...]
+'git diff' [<options>] --cached [--merge-base] [<commit>] [--] [<path>...]
+'git diff' [<options>] [--merge-base] <commit> [<commit>...] <commit> [--] [<path>...]
 'git diff' [<options>] <commit>...<commit> [--] [<path>...]
 'git diff' [<options>] <blob> <blob>
 'git diff' [<options>] --no-index [--] <path> <path>
@@ -40,7 +40,7 @@ files on disk.
        or when running the command outside a working tree
        controlled by Git. This form implies `--exit-code`.
 
-'git diff' [<options>] --cached [<commit>] [--] [<path>...]::
+'git diff' [<options>] --cached [--merge-base] [<commit>] [--] [<path>...]::
 
        This form is to view the changes you staged for the next
        commit relative to the named <commit>.  Typically you
@@ -49,6 +49,10 @@ files on disk.
        If HEAD does not exist (e.g. unborn branches) and
        <commit> is not given, it shows all staged changes.
        --staged is a synonym of --cached.
++
+If --merge-base is given, instead of using <commit>, use the merge base
+of <commit> and HEAD.  `git diff --merge-base A` is equivalent to
+`git diff $(git merge-base A HEAD)`.
 
 'git diff' [<options>] <commit> [--] [<path>...]::
 
@@ -58,23 +62,27 @@ files on disk.
        branch name to compare with the tip of a different
        branch.
 
-'git diff' [<options>] <commit> <commit> [--] [<path>...]::
+'git diff' [<options>] [--merge-base] <commit> <commit> [--] [<path>...]::
 
        This is to view the changes between two arbitrary
        <commit>.
++
+If --merge-base is given, use the merge base of the two commits for the
+"before" side.  `git diff --merge-base A B` is equivalent to
+`git diff $(git merge-base A B) B`.
 
 'git diff' [<options>] <commit> <commit>... <commit> [--] [<path>...]::
 
        This form is to view the results of a merge commit.  The first
        listed <commit> must be the merge itself; the remaining two or
        more commits should be its parents.  A convenient way to produce
-       the desired set of revisions is to use the {caret}@ suffix.
+       the desired set of revisions is to use the `^@` suffix.
        For instance, if `master` names a merge commit, `git diff master
        master^@` gives the same combined diff as `git show master`.
 
 'git diff' [<options>] <commit>..<commit> [--] [<path>...]::
 
-       This is synonymous to the earlier form (without the "..") for
+       This is synonymous to the earlier form (without the `..`) for
        viewing the changes between two arbitrary <commit>.  If <commit> on
        one side is omitted, it will have the same effect as
        using HEAD instead.
@@ -83,20 +91,20 @@ files on disk.
 
        This form is to view the changes on the branch containing
        and up to the second <commit>, starting at a common ancestor
-       of both <commit>.  "git diff A\...B" is equivalent to
-       "git diff $(git merge-base A B) B".  You can omit any one
+       of both <commit>.  `git diff A...B` is equivalent to
+       `git diff $(git merge-base A B) B`.  You can omit any one
        of <commit>, which has the same effect as using HEAD instead.
 
 Just in case you are doing something exotic, it should be
 noted that all of the <commit> in the above description, except
-in the last two forms that use ".." notations, can be any
-<tree>.
+in the `--merge-base` case and in the last two forms that use `..`
+notations, can be any <tree>.
 
 For a more complete list of ways to spell <commit>, see
 "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
 However, "diff" is about comparing two _endpoints_, not ranges,
-and the range notations ("<commit>..<commit>" and
-"<commit>\...<commit>") do not mean a range as defined in the
+and the range notations (`<commit>..<commit>` and
+`<commit>...<commit>`) do not mean a range as defined in the
 "SPECIFYING RANGES" section in linkgit:gitrevisions[7].
 
 'git diff' [<options>] <blob> <blob>::
@@ -144,9 +152,9 @@ $ git diff HEAD       <3>
 +
 <1> Changes in the working tree not yet staged for the next commit.
 <2> Changes between the index and your last commit; what you
-    would be committing if you run "git commit" without "-a" option.
+    would be committing if you run `git commit` without `-a` option.
 <3> Changes in the working tree since your last commit; what you
-    would be committing if you run "git commit -a"
+    would be committing if you run `git commit -a`
 
 Comparing with arbitrary commits::
 +
diff --git a/Documentation/git-for-each-repo.txt b/Documentation/git-for-each-repo.txt
new file mode 100644 (file)
index 0000000..94bd19d
--- /dev/null
@@ -0,0 +1,59 @@
+git-for-each-repo(1)
+====================
+
+NAME
+----
+git-for-each-repo - Run a Git command on a list of repositories
+
+
+SYNOPSIS
+--------
+[verse]
+'git for-each-repo' --config=<config> [--] <arguments>
+
+
+DESCRIPTION
+-----------
+Run a Git command on a list of repositories. The arguments after the
+known options or `--` indicator are used as the arguments for the Git
+subprocess.
+
+THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
+
+For example, we could run maintenance on each of a list of repositories
+stored in a `maintenance.repo` config variable using
+
+-------------
+git for-each-repo --config=maintenance.repo maintenance run
+-------------
+
+This will run `git -C <repo> maintenance run` for each value `<repo>`
+in the multi-valued config variable `maintenance.repo`.
+
+
+OPTIONS
+-------
+--config=<config>::
+       Use the given config variable as a multi-valued list storing
+       absolute path names. Iterate on that list of paths to run
+       the given arguments.
++
+These config values are loaded from system, global, and local Git config,
+as available. If `git for-each-repo` is run in a directory that is not a
+Git repository, then only the system and global config is used.
+
+
+SUBPROCESS BEHAVIOR
+-------------------
+
+If any `git -C <repo> <arguments>` subprocess returns a non-zero exit code,
+then the `git for-each-repo` process returns that exit code without running
+more subprocesses.
+
+Each `git -C <repo> <arguments>` subprocess inherits the standard file
+descriptors `stdin`, `stdout`, and `stderr`.
+
+
+GIT
+---
+Part of the linkgit:git[1] suite
index 0f81d0437bb65bd0ee68ef63edf7bb48d9ea87a6..3e49bf221087c06c7850e66cdc833b92d7dcb9bc 100644 (file)
@@ -28,6 +28,7 @@ SYNOPSIS
                   [--no-notes | --notes[=<ref>]]
                   [--interdiff=<previous>]
                   [--range-diff=<previous> [--creation-factor=<percent>]]
+                  [--filename-max-length=<n>]
                   [--progress]
                   [<common diff options>]
                   [ <since> | <revision range> ]
@@ -119,7 +120,7 @@ include::diff-options.txt[]
 
 -s::
 --signoff::
-       Add `Signed-off-by:` line to the commit message, using
+       Add a `Signed-off-by` trailer to the commit message, using
        the committer identity of yourself.
        See the signoff option in linkgit:git-commit[1] for more information.
 
@@ -200,6 +201,13 @@ populated with placeholder text.
        allows for useful naming of a patch series, and can be
        combined with the `--numbered` option.
 
+--filename-max-length=<n>::
+       Instead of the standard 64 bytes, chomp the generated output
+       filenames at around '<n>' bytes (too short a value will be
+       silently raised to a reasonable length).  Defaults to the
+       value of the `format.filenameMaxLength` configuration
+       variable, or 64 if unconfigured.
+
 --rfc::
        Alias for `--subject-prefix="RFC PATCH"`. RFC means "Request For
        Comments"; use this when sending an experimental patch for
index 6077ff01a4fce65a8f12c2ede83dce562bf0e1c3..4e0ba8234a0a8c2999c4a790cf0125438794d53d 100644 (file)
@@ -241,7 +241,7 @@ providing this option will cause it to die.
 --show-function::
        Show the preceding line that contains the function name of
        the match, unless the matching line is a function name itself.
-       The name is determined in the same way as 'git diff' works out
+       The name is determined in the same way as `git diff` works out
        patch hunk headers (see 'Defining a custom hunk-header' in
        linkgit:gitattributes[5]).
 
@@ -266,7 +266,9 @@ providing this option will cause it to die.
        Show the surrounding text from the previous line containing a
        function name up to the one before the next function name,
        effectively showing the whole function in which the match was
-       found.
+       found. The function names are determined in the same way as
+       `git diff` works out patch hunk headers (see 'Defining a
+       custom hunk-header' in linkgit:gitattributes[5]).
 
 --threads <num>::
        Number of grep worker threads to use.
index 59ecda6c17d0125716e3ed108fa5935a4327a3fc..b611d80697de479336697b5645a42815208baa5a 100644 (file)
@@ -20,8 +20,9 @@ DESCRIPTION
 
 This command creates an empty Git repository - basically a `.git`
 directory with subdirectories for `objects`, `refs/heads`,
-`refs/tags`, and template files.  An initial `HEAD` file that
-references the HEAD of the master branch is also created.
+`refs/tags`, and template files.  An initial branch without any
+commits will be created (see the `--initial-branch` option below
+for its name).
 
 If the `$GIT_DIR` environment variable is set then it specifies a path
 to use instead of `./.git` for the base of the repository.
@@ -73,8 +74,10 @@ If this is reinitialization, the repository will be moved to the specified path.
 -b <branch-name>::
 --initial-branch=<branch-name>::
 
-Use the specified name for the initial branch in the newly created repository.
-If not specified, fall back to the default name: `master`.
+Use the specified name for the initial branch in the newly created
+repository.  If not specified, fall back to the default name (currently
+`master`, but this is subject to change in the future; the name can be
+customized via the `init.defaultBranch` configuration variable).
 
 --shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
 
index 2b8ac5ff882ae84d52d08458c2439f314d2a0370..dd189a353a443e8d1b18ae95ece7d7d24cceee3d 100644 (file)
@@ -77,20 +77,7 @@ produced by `--stat`, etc.
        Intended to speed up tools that read log messages from `git log`
        output by allowing them to allocate space in advance.
 
--L <start>,<end>:<file>::
--L :<funcname>:<file>::
-       Trace the evolution of the line range given by "<start>,<end>"
-       (or the function name regex <funcname>) within the <file>.  You may
-       not give any pathspec limiters.  This is currently limited to
-       a walk starting from a single revision, i.e., you may only
-       give zero or one positive revision arguments, and
-       <start> and <end> (or <funcname>) must exist in the starting revision.
-       You can specify this option more than once. Implies `--patch`.
-       Patch output can be suppressed using `--no-patch`, but other diff formats
-       (namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,
-       `--name-only`, `--name-status`, `--check`) are not currently implemented.
-+
-include::line-range-format.txt[]
+include::line-range-options.txt[]
 
 <revision range>::
        Show only commits in the specified revision range.  When no
index 3cb2ebb4380e28e8e4b4e1bb5e3f4ae511960b7a..cbcf5263dd01b88537563a97bd1977bf52c3b88c 100644 (file)
@@ -19,7 +19,7 @@ SYNOPSIS
                [--exclude-standard]
                [--error-unmatch] [--with-tree=<tree-ish>]
                [--full-name] [--recurse-submodules]
-               [--abbrev] [--] [<file>...]
+               [--abbrev[=<n>]] [--] [<file>...]
 
 DESCRIPTION
 -----------
@@ -153,7 +153,8 @@ a space) at the start of each line:
 
 --abbrev[=<n>]::
        Instead of showing the full 40-byte hexadecimal object
-       lines, show only a partial prefix.
+       lines, show the shortest prefix that is at least '<n>'
+       hexdigits long that uniquely refers the object.
        Non default number of digits can be specified with --abbrev=<n>.
 
 --debug::
index a7515714da1aaa77dddf31272f2fb62a174ba95b..db02d6d79a9c2e092f6c0755300eb2a4579887c0 100644 (file)
@@ -62,7 +62,8 @@ OPTIONS
 
 --abbrev[=<n>]::
        Instead of showing the full 40-byte hexadecimal object
-       lines, show only a partial prefix.
+       lines, show the shortest prefix that is at least '<n>'
+       hexdigits long that uniquely refers the object.
        Non default number of digits can be specified with --abbrev=<n>.
 
 --full-name::
index 6abcb8255a2bfdc908ac03960aece0cd1835a8fd..6fec1eb8dc288757a2d0b4dbbf5faf18a8904df5 100644 (file)
@@ -29,6 +29,32 @@ Git repository.
 SUBCOMMANDS
 -----------
 
+register::
+       Initialize Git config values so any scheduled maintenance will
+       start running on this repository. This adds the repository to the
+       `maintenance.repo` config variable in the current user's global
+       config and enables some recommended configuration values for
+       `maintenance.<task>.schedule`. The tasks that are enabled are safe
+       for running in the background without disrupting foreground
+       processes.
++
+The `register` subcomand will also set the `maintenance.strategy` config
+value to `incremental`, if this value is not previously set. The
+`incremental` strategy uses the following schedule for each maintenance
+task:
++
+--
+* `gc`: disabled.
+* `commit-graph`: hourly.
+* `prefetch`: hourly.
+* `loose-objects`: daily.
+* `incremental-repack`: daily.
+--
++
+`git maintenance register` will also disable foreground maintenance by
+setting `maintenance.auto = false` in the current repository. This config
+setting will remain after a `git maintenance unregister` command.
+
 run::
        Run one or more maintenance tasks. If one or more `--task` options
        are specified, then those tasks are run in that order. Otherwise,
@@ -36,6 +62,22 @@ run::
        config options are true. By default, only `maintenance.gc.enabled`
        is true.
 
+start::
+       Start running maintenance on the current repository. This performs
+       the same config updates as the `register` subcommand, then updates
+       the background scheduler to run `git maintenance run --scheduled`
+       on an hourly basis.
+
+stop::
+       Halt the background maintenance schedule. The current repository
+       is not removed from the list of maintained repositories, in case
+       the background maintenance is restarted later.
+
+unregister::
+       Remove the current repository from background maintenance. This
+       only removes the repository from the configured list. It does not
+       stop the background maintenance processes from running.
+
 TASKS
 -----
 
@@ -47,6 +89,21 @@ commit-graph::
        `commit-graph-chain` file. They will be deleted by a later run based
        on the expiration delay.
 
+prefetch::
+       The `prefetch` task updates the object directory with the latest
+       objects from all registered remotes. For each remote, a `git fetch`
+       command is run. The refmap is custom to avoid updating local or remote
+       branches (those in `refs/heads` or `refs/remotes`). Instead, the
+       remote refs are stored in `refs/prefetch/<remote>/`. Also, tags are
+       not updated.
++
+This is done to avoid disrupting the remote-tracking branches. The end users
+expect these refs to stay unmoved unless they initiate a fetch.  With prefetch
+task, however, the objects necessary to complete a later real fetch would
+already be obtained, so the real fetch would go faster.  In the ideal case,
+it will just become an update to bunch of remote-tracking branches without
+any object transfer.
+
 gc::
        Clean up unnecessary files and optimize the local repository. "GC"
        stands for "garbage collection," but this task performs many
@@ -55,6 +112,39 @@ gc::
        be disruptive in some situations, as it deletes stale data. See
        linkgit:git-gc[1] for more details on garbage collection in Git.
 
+loose-objects::
+       The `loose-objects` job cleans up loose objects and places them into
+       pack-files. In order to prevent race conditions with concurrent Git
+       commands, it follows a two-step process. First, it deletes any loose
+       objects that already exist in a pack-file; concurrent Git processes
+       will examine the pack-file for the object data instead of the loose
+       object. Second, it creates a new pack-file (starting with "loose-")
+       containing a batch of loose objects. The batch size is limited to 50
+       thousand objects to prevent the job from taking too long on a
+       repository with many loose objects. The `gc` task writes unreachable
+       objects as loose objects to be cleaned up by a later step only if
+       they are not re-added to a pack-file; for this reason it is not
+       advisable to enable both the `loose-objects` and `gc` tasks at the
+       same time.
+
+incremental-repack::
+       The `incremental-repack` job repacks the object directory
+       using the `multi-pack-index` feature. In order to prevent race
+       conditions with concurrent Git commands, it follows a two-step
+       process. First, it calls `git multi-pack-index expire` to delete
+       pack-files unreferenced by the `multi-pack-index` file. Second, it
+       calls `git multi-pack-index repack` to select several small
+       pack-files and repack them into a bigger one, and then update the
+       `multi-pack-index` entries that refer to the small pack-files to
+       refer to the new pack-file. This prepares those small pack-files
+       for deletion upon the next run of `git multi-pack-index expire`.
+       The selection of the small pack-files is such that the expected
+       size of the big pack-file is at least the batch size; see the
+       `--batch-size` option for the `repack` subcommand in
+       linkgit:git-multi-pack-index[1]. The default batch-size is zero,
+       which is a special case that attempts to repack all pack-files
+       into a single pack-file.
+
 OPTIONS
 -------
 --auto::
@@ -62,7 +152,18 @@ OPTIONS
        only if certain thresholds are met. For example, the `gc` task
        runs when the number of loose objects exceeds the number stored
        in the `gc.auto` config setting, or when the number of pack-files
-       exceeds the `gc.autoPackLimit` config setting.
+       exceeds the `gc.autoPackLimit` config setting. Not compatible with
+       the `--schedule` option.
+
+--schedule::
+       When combined with the `run` subcommand, run maintenance tasks
+       only if certain time conditions are met, as specified by the
+       `maintenance.<task>.schedule` config value for each `<task>`.
+       This config value specifies a number of seconds since the last
+       time that task ran, according to the `maintenance.<task>.lastRun`
+       config value. The tasks that are tested are those provided by
+       the `--task=<task>` option(s) or those with
+       `maintenance.<task>.enabled` set to true.
 
 --quiet::
        Do not report progress or other information over `stderr`.
@@ -74,6 +175,50 @@ OPTIONS
        `maintenance.<task>.enabled` configured as `true` are considered.
        See the 'TASKS' section for the list of accepted `<task>` values.
 
+
+TROUBLESHOOTING
+---------------
+The `git maintenance` command is designed to simplify the repository
+maintenance patterns while minimizing user wait time during Git commands.
+A variety of configuration options are available to allow customizing this
+process. The default maintenance options focus on operations that complete
+quickly, even on large repositories.
+
+Users may find some cases where scheduled maintenance tasks do not run as
+frequently as intended. Each `git maintenance run` command takes a lock on
+the repository's object database, and this prevents other concurrent
+`git maintenance run` commands from running on the same repository. Without
+this safeguard, competing processes could leave the repository in an
+unpredictable state.
+
+The background maintenance schedule runs `git maintenance run` processes
+on an hourly basis. Each run executes the "hourly" tasks. At midnight,
+that process also executes the "daily" tasks. At midnight on the first day
+of the week, that process also executes the "weekly" tasks. A single
+process iterates over each registered repository, performing the scheduled
+tasks for that frequency. Depending on the number of registered
+repositories and their sizes, this process may take longer than an hour.
+In this case, multiple `git maintenance run` commands may run on the same
+repository at the same time, colliding on the object database lock. This
+results in one of the two tasks not running.
+
+If you find that some maintenance windows are taking longer than one hour
+to complete, then consider reducing the complexity of your maintenance
+tasks. For example, the `gc` task is much slower than the
+`incremental-repack` task. However, this comes at a cost of a slightly
+larger object database. Consider moving more expensive tasks to be run
+less frequently.
+
+Expert users may consider scheduling their own maintenance tasks using a
+different schedule than is available through `git maintenance start` and
+Git configuration options. These users should be aware of the object
+database lock and how concurrent `git maintenance run` commands behave.
+Further, the `git gc` command should not be combined with
+`git maintenance run` commands. `git gc` modifies the object database
+but does not take the lock in the same way as `git maintenance run`. If
+possible, use `git maintenance run --task=gc` instead of `git gc`.
+
+
 GIT
 ---
 Part of the linkgit:git[1] suite
index dab9609013fd5c4fb1947bc5f8cd9cd4e2b5063c..ec233ac0c1c1568a5516aa3bfe6a9c1fc4dcc0e4 100644 (file)
@@ -417,7 +417,7 @@ p4-post-changelist
 ~~~~~~~~~~~~~~~~~~
 
 The `p4-post-changelist` hook is invoked after the submit has
-successfully occured in P4. It takes no parameters and is meant
+successfully occurred in P4. It takes no parameters and is meant
 primarily for notification and cannot affect the outcome of the
 git p4 submit action.
 
diff --git a/Documentation/git-parse-remote.txt b/Documentation/git-parse-remote.txt
deleted file mode 100644 (file)
index a45ea1e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-git-parse-remote(1)
-===================
-
-NAME
-----
-git-parse-remote - Routines to help parsing remote repository access parameters
-
-
-SYNOPSIS
---------
-[verse]
-'. "$(git --exec-path)/git-parse-remote"'
-
-DESCRIPTION
------------
-This script is included in various scripts to supply
-routines to parse files under $GIT_DIR/remotes/ and
-$GIT_DIR/branches/ and configuration variables that are related
-to fetching, pulling and pushing.
-
-GIT
----
-Part of the linkgit:git[1] suite
index 3b8053447e204499f28ab1616ce74efa87524536..ab103c82cfdc38c37e7aa0e07c324ca31681ae22 100644 (file)
@@ -13,7 +13,7 @@ SYNOPSIS
           [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
           [-u | --set-upstream] [-o <string> | --push-option=<string>]
           [--[no-]signed|--signed=(true|false|if-asked)]
-          [--force-with-lease[=<refname>[:<expect>]]]
+          [--force-with-lease[=<refname>[:<expect>]] [--force-if-includes]]
           [--no-verify] [<repository> [<refspec>...]]
 
 DESCRIPTION
@@ -320,6 +320,14 @@ seen and are willing to overwrite, then rewrite history, and finally
 force push changes to `master` if the remote version is still at
 `base`, regardless of what your local `remotes/origin/master` has been
 updated to in the background.
++
+Alternatively, specifying `--force-if-includes` as an ancillary option
+along with `--force-with-lease[=<refname>]` (i.e., without saying what
+exact commit the ref on the remote side must be pointing at, or which
+refs on the remote side are being protected) at the time of "push" will
+verify if updates from the remote-tracking refs that may have been
+implicitly updated in the background are integrated locally before
+allowing a forced update.
 
 -f::
 --force::
@@ -341,6 +349,22 @@ one branch, use a `+` in front of the refspec to push (e.g `git push
 origin +master` to force a push to the `master` branch). See the
 `<refspec>...` section above for details.
 
+--[no-]force-if-includes::
+       Force an update only if the tip of the remote-tracking ref
+       has been integrated locally.
++
+This option enables a check that verifies if the tip of the
+remote-tracking ref is reachable from one of the "reflog" entries of
+the local branch based in it for a rewrite. The check ensures that any
+updates from the remote have been incorporated locally by rejecting the
+forced update if that is not the case.
++
+If the option is passed without specifying `--force-with-lease`, or
+specified along with `--force-with-lease=<refname>:<expect>`, it is
+a "no-op".
++
+Specifying `--no-force-if-includes` disables this behavior.
+
 --repo=<repository>::
        This option is equivalent to the <repository> argument. If both
        are specified, the command-line argument takes precedence.
index 38e15488f651718bf220453504a39fb8ef0800f7..a0487b5cc58816ac8c4ec700e56a5d116fd61824 100644 (file)
@@ -496,7 +496,7 @@ See also INCOMPATIBLE OPTIONS below.
 See also INCOMPATIBLE OPTIONS below.
 
 --signoff::
-       Add a Signed-off-by: trailer to all the rebased commits. Note
+       Add a `Signed-off-by` trailer to all the rebased commits. Note
        that if `--interactive` is given then only commits marked to be
        picked, edited or reworded will have the trailer added.
 +
index ea73386c811b5fd96ba44cc09e7f6992cbbd747e..31c29c9b31b202eeba1fbb2fe0d31054d46d4882 100644 (file)
@@ -203,6 +203,17 @@ The remote configuration is achieved using the `remote.origin.url` and
 `remote.origin.fetch` configuration variables.  (See
 linkgit:git-config[1]).
 
+EXIT STATUS
+-----------
+
+On success, the exit status is `0`.
+
+When subcommands such as 'add', 'rename', and 'remove' can't find the
+remote in question, the exit status is `2`. When the remote already
+exists, the exit status is `3`.
+
+On any other error, the exit status may be any other non-zero value.
+
 EXAMPLES
 --------
 
index 84c6c400109851ac34185a4f9004aada07aa79aa..55bde91ef9e54be6c9ecf928f6f72c775b45809a 100644 (file)
@@ -40,6 +40,10 @@ OPTIONS
 +
 If not specified, the contents are restored from `HEAD` if `--staged` is
 given, otherwise from the index.
++
+As a special case, you may use `"A...B"` as a shortcut for the
+merge base of `A` and `B` if there is exactly one merge base. You can
+leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 
 -p::
 --patch::
index 19b12b6d43ce5bfeb2dba36e30640ddaf0aca664..5013daa6efebdd92ea93138a751b5a1c61877a56 100644 (file)
@@ -109,6 +109,10 @@ names an existing object that is a commit-ish (i.e. a commit, or an
 annotated tag that points at a commit).  To make sure that `$VAR`
 names an existing object of any type, `git rev-parse "$VAR^{object}"`
 can be used.
++
+Note that if you are verifying a name from an untrusted source, it is
+wise to use `--end-of-options` so that the name argument is not mistaken
+for another option.
 
 -q::
 --quiet::
@@ -446,7 +450,7 @@ $ git rev-parse --verify HEAD
 * Print the commit object name from the revision in the $REV shell variable:
 +
 ------------
-$ git rev-parse --verify $REV^{commit}
+$ git rev-parse --verify --end-of-options $REV^{commit}
 ------------
 +
 This will error out if $REV is empty or not a valid revision.
@@ -454,7 +458,7 @@ This will error out if $REV is empty or not a valid revision.
 * Similar to above:
 +
 ------------
-$ git rev-parse --default master --verify $REV
+$ git rev-parse --default master --verify --end-of-options $REV
 ------------
 +
 but if $REV is empty, the commit object name from master will be printed.
index 044276e9da62af44af9a8d897df0dd536556610b..bb92a4a4516d2a93a6e85facb0831aabc1be126c 100644 (file)
@@ -99,7 +99,7 @@ effect to your index in a row.
 
 -s::
 --signoff::
-       Add Signed-off-by line at the end of the commit message.
+       Add a `Signed-off-by` trailer at the end of the commit message.
        See the signoff option in linkgit:git-commit[1] for more information.
 
 --strategy=<strategy>::
index 0a69810147e451d7cac290020f009631b1da9e46..b7bbbeadef6df43a9497cbbfad1f8cbf8213cd6f 100644 (file)
@@ -313,7 +313,7 @@ Automating
        the value of `sendemail.identity`.
 
 --[no-]signed-off-by-cc::
-       If this is set, add emails found in Signed-off-by: or Cc: lines to the
+       If this is set, add emails found in the `Signed-off-by` trailer or Cc: lines to the
        cc list. Default is the value of `sendemail.signedoffbycc` configuration
        value; if that is unspecified, default to --signed-off-by-cc.
 
@@ -340,7 +340,7 @@ Automating
   except for self (use 'self' for that).
 - 'bodycc' will avoid including anyone mentioned in Cc lines in the
   patch body (commit message) except for self (use 'self' for that).
-- 'sob' will avoid including anyone mentioned in Signed-off-by lines except
+- 'sob' will avoid including anyone mentioned in the Signed-off-by trailers except
   for self (use 'self' for that).
 - 'misc-by' will avoid including anyone mentioned in Acked-by,
   Reviewed-by, Tested-by and other "-by" lines in the patch body,
index 6624a14fbd70992a0bfbba99b73cc2110208c421..67b143cc81ea9534722a082fdfbc016081621411 100644 (file)
@@ -701,7 +701,7 @@ creating the branch or tag.
 
 --use-log-author::
        When retrieving svn commits into Git (as part of 'fetch', 'rebase', or
-       'dcommit' operations), look for the first `From:` or `Signed-off-by:` line
+       'dcommit' operations), look for the first `From:` line or `Signed-off-by` trailer
        in the log message and use that as the author string.
 +
 [verse]
@@ -710,7 +710,7 @@ config key: svn.useLogAuthor
 --add-author-from::
        When committing to svn from Git (as part of 'set-tree' or 'dcommit'
        operations), if the existing log message doesn't already have a
-       `From:` or `Signed-off-by:` line, append a `From:` line based on the
+       `From:` or `Signed-off-by` trailer, append a `From:` line based on the
        Git commit's author string.  If you use this, then `--use-log-author`
        will retrieve a valid author string for all commits.
 +
index 3759c3a265b5b9761a9df4d8e6b9d733d29aee04..5c438cd505875841763f0151dfe0a2c1454dfcc5 100644 (file)
@@ -103,6 +103,9 @@ ambiguous but exists on the 'origin' remote. See also
 `checkout.defaultRemote` in linkgit:git-config[1].
 +
 `--guess` is the default behavior. Use `--no-guess` to disable it.
++
+The default behavior can be set via the `checkout.guess` configuration
+variable.
 
 -f::
 --force::
index d401234b03ce85722ff9624acb16c125d3780b27..48b6683071e65be1abf29ece20dc90c5f0579ec3 100644 (file)
@@ -125,7 +125,8 @@ option::
 start::
        Start a transaction. In contrast to a non-transactional session, a
        transaction will automatically abort if the session ends without an
-       explicit commit.
+       explicit commit. This command may create a new empty transaction when
+       the current one has been committed or aborted already.
 
 prepare::
        Prepare to commit the transaction. This will create lock files for all
index 32e8440cdea5751e6f699fff62ba2d7675057cae..af06128cc9e656de17a3f2b9180ca14135f0418c 100644 (file)
@@ -96,8 +96,9 @@ list::
 
 List details of each working tree.  The main working tree is listed first,
 followed by each of the linked working trees.  The output details include
-whether the working tree is bare, the revision currently checked out, and the
-branch currently checked out (or "detached HEAD" if none).
+whether the working tree is bare, the revision currently checked out, the
+branch currently checked out (or "detached HEAD" if none), and "locked" if
+the worktree is locked.
 
 lock::
 
index 2d0a03715be65edfc4c8be6ca8f2a959ddde7540..e84e104f9325526bad7dca6043e897ad21b41906 100644 (file)
@@ -802,6 +802,9 @@ patterns are available:
 
 - `ada` suitable for source code in the Ada language.
 
+- `bash` suitable for source code in the Bourne-Again SHell language.
+  Covers a superset of POSIX shell function definitions.
+
 - `bibtex` suitable for files with BibTeX coded references.
 
 - `cpp` suitable for source code in the C and C++ languages.
index 6e461ace6e6434789cee58fb95542e4fc1653d78..ffccfc776080241e733b6675f02b2dca9c6c9341 100644 (file)
@@ -164,7 +164,7 @@ can also be used to refuse the commit after inspecting the message
 file.
 
 The default 'commit-msg' hook, when enabled, detects duplicate
-"Signed-off-by" lines, and aborts the commit if one is found.
+`Signed-off-by` trailers, and aborts the commit if one is found.
 
 post-commit
 ~~~~~~~~~~~
@@ -655,7 +655,7 @@ p4-post-changelist
 This hook is invoked by `git-p4 submit`.
 
 The `p4-post-changelist` hook is invoked after the submit has
-successfully occured in P4. It takes no parameters and is meant
+successfully occurred in P4. It takes no parameters and is meant
 primarily for notification and cannot affect the outcome of the
 git p4 submit action.
 
index c653ebb6a80c03bab1e593f13b488d742ff5cbce..d50e9ed10e04c688b6ee898b20e24a1cd796cc78 100644 (file)
@@ -98,25 +98,7 @@ linkgit:git-rev-list[1] for a complete list.
        (See "History simplification" in linkgit:git-log[1] for a more
        detailed explanation.)
 
--L<start>,<end>:<file>::
--L:<funcname>:<file>::
-
-       Trace the evolution of the line range given by "<start>,<end>"
-       (or the function name regex <funcname>) within the <file>.  You may
-       not give any pathspec limiters.  This is currently limited to
-       a walk starting from a single revision, i.e., you may only
-       give zero or one positive revision arguments, and
-       <start> and <end> (or <funcname>) must exist in the starting revision.
-       You can specify this option more than once. Implies `--patch`.
-       Patch output can be suppressed using `--no-patch`, but other diff formats
-       (namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,
-       `--name-only`, `--name-status`, `--check`) are not currently implemented.
-+
-*Note:* gitk (unlike linkgit:git-log[1]) currently only understands
-this option if you specify it "glued together" with its argument.  Do
-*not* put a space after `-L`.
-+
-include::line-range-format.txt[]
+include::line-range-options.txt[]
 
 <revision range>::
 
index 090c888335d3292331d012a5e9074f970035d83e..67c7a50b96a0b29bc3a98edf1e02f4b455969abf 100644 (file)
@@ -18,7 +18,7 @@
        Untyped <<def_object,object>>, e.g. the contents of a file.
 
 [[def_branch]]branch::
-       A "branch" is an active line of development.  The most recent
+       A "branch" is a line of development.  The most recent
        <<def_commit,commit>> on a branch is referred to as the tip of
        that branch.  The tip of the branch is referenced by a branch
        <<def_head,head>>, which moves forward as additional development
index 829676ff98335913ec037396a659f42f74e5a90d..9b51e9fb66143606e328a554186046f3fd1a0b28 100644 (file)
@@ -1,30 +1,32 @@
-<start> and <end> can take one of these forms:
+'<start>' and '<end>' can take one of these forms:
 
 - number
 +
-If <start> or <end> is a number, it specifies an
+If '<start>' or '<end>' is a number, it specifies an
 absolute line number (lines count from 1).
 +
 
-- /regex/
+- `/regex/`
 +
 This form will use the first line matching the given
-POSIX regex. If <start> is a regex, it will search from the end of
+POSIX regex. If '<start>' is a regex, it will search from the end of
 the previous `-L` range, if any, otherwise from the start of file.
-If <start> is ``^/regex/'', it will search from the start of file.
-If <end> is a regex, it will search
-starting at the line given by <start>.
+If '<start>' is `^/regex/`, it will search from the start of file.
+If '<end>' is a regex, it will search
+starting at the line given by '<start>'.
 +
 
 - +offset or -offset
 +
-This is only valid for <end> and will specify a number
-of lines before or after the line given by <start>.
+This is only valid for '<end>' and will specify a number
+of lines before or after the line given by '<start>'.
 
 +
-If ``:<funcname>'' is given in place of <start> and <end>, it is a
+If `:<funcname>` is given in place of '<start>' and '<end>', it is a
 regular expression that denotes the range from the first funcname line
-that matches <funcname>, up to the next funcname line. ``:<funcname>''
+that matches '<funcname>', up to the next funcname line. `:<funcname>`
 searches from the end of the previous `-L` range, if any, otherwise
-from the start of file. ``^:<funcname>'' searches from the start of
-file.
+from the start of file. `^:<funcname>` searches from the start of
+file. The function names are determined in the same way as `git diff`
+works out patch hunk headers (see 'Defining a custom hunk-header'
+in linkgit:gitattributes[5]).
diff --git a/Documentation/line-range-options.txt b/Documentation/line-range-options.txt
new file mode 100644 (file)
index 0000000..8e295a6
--- /dev/null
@@ -0,0 +1,15 @@
+-L<start>,<end>:<file>::
+-L:<funcname>:<file>::
+
+       Trace the evolution of the line range given by '<start>,<end>',
+       or by the function name regex '<funcname>', within the '<file>'. You may
+       not give any pathspec limiters.  This is currently limited to
+       a walk starting from a single revision, i.e., you may only
+       give zero or one positive revision arguments, and
+       '<start>' and '<end>' (or '<funcname>') must exist in the starting revision.
+       You can specify this option more than once. Implies `--patch`.
+       Patch output can be suppressed using `--no-patch`, but other diff formats
+       (namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,
+       `--name-only`, `--name-status`, `--check`) are not currently implemented.
++
+include::line-range-format.txt[]
index 80d4831662c5e5fee9cdcc37e14929ce94f9b81a..eb0aabd396ff924ea30dc6f81bc1382a061a0b3d 100644 (file)
@@ -77,16 +77,7 @@ When not possible, refuse to merge and exit with a non-zero status.
 With --no-log do not list one-line descriptions from the
 actual commits being merged.
 
---signoff::
---no-signoff::
-       Add Signed-off-by line by the committer at the end of the commit
-       log message.  The meaning of a signoff depends on the project,
-       but it typically certifies that committer has
-       the rights to submit this work under the same license and
-       agrees to a Developer Certificate of Origin
-       (see http://developercertificate.org/ for more information).
-+
-With --no-signoff do not add a Signed-off-by line.
+include::signoff-option.txt[]
 
 --stat::
 -n::
index 17c5aac4b71d5af126a0bd85d3ffef2e94468e3c..27ddaf84a195f46edc7b3f102eb1caf1adf68765 100644 (file)
@@ -16,9 +16,9 @@ configuration (see linkgit:git-config[1]).
 
 --abbrev-commit::
        Instead of showing the full 40-byte hexadecimal commit object
-       name, show only a partial prefix.  Non default number of
-       digits can be specified with "--abbrev=<n>" (which also modifies
-       diff output, if it is displayed).
+       name, show a prefix that names the object uniquely.
+       "--abbrev=<n>" (which also modifies diff output, if it is displayed)
+       option can be used to specify the minimum length of the prefix.
 +
 This should make "--pretty=oneline" a whole lot more readable for
 people using 80-column terminals.
diff --git a/Documentation/signoff-option.txt b/Documentation/signoff-option.txt
new file mode 100644 (file)
index 0000000..12aa233
--- /dev/null
@@ -0,0 +1,18 @@
+ifdef::git-commit[]
+-s::
+endif::git-commit[]
+--signoff::
+--no-signoff::
+       Add a `Signed-off-by` trailer by the committer at the end of the commit
+       log message.  The meaning of a signoff depends on the project
+       to which you're committing.  For example, it may certify that
+       the committer has the rights to submit the work under the
+       project's license or agrees to some contributor representation,
+       such as a Developer Certificate of Origin.
+       (See http://developercertificate.org for the one used by the
+       Linux kernel and Git projects.)  Consult the documentation or
+       leadership of the project to which you're contributing to
+       understand how the signoffs are used in that project.
++
+The --no-signoff option can be used to countermand an earlier --signoff
+option on the command line.
index 6b6085585d5659ea6427247c18c96c84fdef5ade..c65ffafc4854bb74cb2398910e6da30982b2e971 100644 (file)
@@ -466,7 +466,7 @@ completed.)
 
 `"error"`::
        This event is emitted when one of the `error()`, `die()`,
-       or `usage()` functions are called.
+       `warning()`, or `usage()` functions are called.
 +
 ------------
 {
index 844629c8c441e786734c42e749293f2a718ed288..49b83ef3cc4be5dfed9e80f3edc11fd10c64fda6 100644 (file)
@@ -18,7 +18,8 @@ It is perhaps easiest to start with an example:
 More interesting possibilities exist, though, such as:
 
   * one side of history renames x -> z, and the other renames some file to
-    x/e, causing the need for the merge to do a transitive rename.
+    x/e, causing the need for the merge to do a transitive rename so that
+    the rename ends up at z/e.
 
   * one side of history renames x -> z, but also renames all files within x.
     For example, x/a -> z/alpha, x/b -> z/bravo, etc.
@@ -35,7 +36,7 @@ More interesting possibilities exist, though, such as:
     directory itself contained inner directories that were renamed to yet
     other locations).
 
-  * combinations of the above; see t/t6043-merge-rename-directories.sh for
+  * combinations of the above; see t/t6423-merge-rename-directories.sh for
     various interesting cases.
 
 Limitations -- applicability of directory renames
@@ -62,19 +63,19 @@ directory rename detection applies:
 Limitations -- detailed rules and testcases
 -------------------------------------------
 
-t/t6043-merge-rename-directories.sh contains extensive tests and commentary
+t/t6423-merge-rename-directories.sh contains extensive tests and commentary
 which generate and explore the rules listed above.  It also lists a few
 additional rules:
 
   a) If renames split a directory into two or more others, the directory
      with the most renames, "wins".
 
-  b) Avoid directory-rename-detection for a path, if that path is the
-     source of a rename on either side of a merge.
-
-  c) Only apply implicit directory renames to directories if the other side
+  b) Only apply implicit directory renames to directories if the other side
      of history is the one doing the renaming.
 
+  c) Do not perform directory rename detection for directories which had no
+     new paths added to them.
+
 Limitations -- support in different commands
 --------------------------------------------
 
index f9a3644711b903336587333923a0203fa5fe9d86..69edf46c031683a7288ec5efd3aaf499fb8bda55 100644 (file)
@@ -306,12 +306,18 @@ The remaining data of each directory block is grouped by type:
 
   The extension starts with
 
-  - 32-bit version number: the current supported version is 1.
+  - 32-bit version number: the current supported versions are 1 and 2.
 
-  - 64-bit time: the extension data reflects all changes through the given
+  - (Version 1)
+    64-bit time: the extension data reflects all changes through the given
        time which is stored as the nanoseconds elapsed since midnight,
        January 1, 1970.
 
+  - (Version 2)
+    A null terminated string: an opaque token defined by the file system
+    monitor application.  The extension data reflects all changes relative
+    to that token.
+
   - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap.
 
   - An ewah bitmap, the n-th bit indicates whether the n-th index entry
index 4e7631437a589a6cfff86abe83978a8bdeabadb0..e8e377a59f0c19a56fb53ed6d96f10f6c211d087 100644 (file)
@@ -60,10 +60,6 @@ Design Details
 Future Work
 -----------
 
-- Add a 'verify' subcommand to the 'git midx' builtin to verify the
-  contents of the multi-pack-index file match the offsets listed in
-  the corresponding pack-indexes.
-
 - The multi-pack-index allows many packfiles, especially in a context
   where repacking is expensive (such as a very large repo), or
   unexpected maintenance time is unacceptable (such as a high-demand
index ba869a7d366aa1dc13291fb28a2b6bf93b5f5e54..9dfade930dafc471aa3f684b0b5c1dc6feba6e2c 100644 (file)
@@ -27,8 +27,8 @@ and 'push-cert' capabilities are sent and recognized by the receive-pack
 (push to server) process.
 
 The 'ofs-delta' and 'side-band-64k' capabilities are sent and recognized
-by both upload-pack and receive-pack protocols.  The 'agent' capability
-may optionally be sent in both protocols.
+by both upload-pack and receive-pack protocols.  The 'agent' and 'session-id'
+capabilities may optionally be sent in both protocols.
 
 All other capabilities are only recognized by the upload-pack (fetch
 from server) process.
@@ -365,3 +365,16 @@ If the upload-pack server advertises the 'filter' capability,
 fetch-pack may send "filter" commands to request a partial clone
 or partial fetch and request that the server omit various objects
 from the packfile.
+
+session-id=<session id>
+-----------------------
+
+The server may advertise a session ID that can be used to identify this process
+across multiple requests. The client may advertise its own session ID back to
+the server as well.
+
+Session IDs should be unique to a given process. They must fit within a
+packet-line, and must not contain non-printable or whitespace characters. The
+current implementation uses trace2 session IDs (see
+link:api-trace2.html[api-trace2] for details), but this may change and users of
+the session ID should not rely on this fact.
index e597b74da39d82b4b6bff621dda10b27d72da5d0..85daeb5d9e77f8d597cb7ce7d842598133b7b2a6 100644 (file)
@@ -492,3 +492,16 @@ form `object-format=X`) to notify the client that the server is able to deal
 with objects using hash algorithm X.  If not specified, the server is assumed to
 only handle SHA-1.  If the client would like to use a hash algorithm other than
 SHA-1, it should specify its object-format string.
+
+session-id=<session id>
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The server may advertise a session ID that can be used to identify this process
+across multiple requests. The client may advertise its own session ID back to
+the server as well.
+
+Session IDs should be unique to a given process. They must fit within a
+packet-line, and must not contain non-printable or whitespace characters. The
+current implementation uses trace2 session IDs (see
+link:api-trace2.html[api-trace2] for details), but this may change and users of
+the session ID should not rely on this fact.
index ca6ccb49866c595c80718d167e40cfad1ee7f376..c3bbcc9cfa0d661e91eb13be664a6f03f6e52122 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.29.2
+DEF_VER=v2.30.0-rc0
 
 LF='
 '
diff --git a/INSTALL b/INSTALL
index 9ba33e6a141a3906eb707dd11d1af4b0f8191a55..8474ad01bf9db87ec293bd6d5cd2ed7706c56914 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -165,8 +165,7 @@ Issues of note:
          use English. Under autoconf the configure script will do this
          automatically if it can't find libintl on the system.
 
-       - Python version 2.4 or later (but not 3.x, which is not
-         supported by Perforce) is needed to use the git-p4 interface
+       - Python version 2.7 or later is needed to use the git-p4 interface
          to Perforce.
 
  - Some platform specific issues are dealt with Makefile rules,
index 1fb0ec17059a069d092c255a04d304dc6923b68c..7b64106930a615c2e867a061f94cd6d3ea834641 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -303,7 +303,7 @@ all::
 # modules, instead of the fallbacks shipped with Git.
 #
 # Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python
-# but /usr/bin/python2.7 on some platforms).
+# but /usr/bin/python2.7 or /usr/bin/python3 on some platforms).
 #
 # Define NO_PYTHON if you do not want Python scripts or libraries at all.
 #
@@ -613,7 +613,6 @@ SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
 
 SCRIPT_LIB += git-mergetool--lib
-SCRIPT_LIB += git-parse-remote
 SCRIPT_LIB += git-rebase--preserve-merges
 SCRIPT_LIB += git-sh-i18n
 SCRIPT_LIB += git-sh-setup
@@ -694,6 +693,7 @@ TEST_BUILTINS_OBJS += test-advise.o
 TEST_BUILTINS_OBJS += test-bloom.o
 TEST_BUILTINS_OBJS += test-chmtime.o
 TEST_BUILTINS_OBJS += test-config.o
+TEST_BUILTINS_OBJS += test-crontab.o
 TEST_BUILTINS_OBJS += test-ctype.o
 TEST_BUILTINS_OBJS += test-date.o
 TEST_BUILTINS_OBJS += test-delta.o
@@ -704,6 +704,7 @@ TEST_BUILTINS_OBJS += test-dump-fsmonitor.o
 TEST_BUILTINS_OBJS += test-dump-split-index.o
 TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
 TEST_BUILTINS_OBJS += test-example-decorate.o
+TEST_BUILTINS_OBJS += test-fast-rebase.o
 TEST_BUILTINS_OBJS += test-genrandom.o
 TEST_BUILTINS_OBJS += test-genzeros.o
 TEST_BUILTINS_OBJS += test-hash-speed.o
@@ -767,6 +768,7 @@ BUILT_INS += git-cherry-pick$X
 BUILT_INS += git-format-patch$X
 BUILT_INS += git-fsck-objects$X
 BUILT_INS += git-init$X
+BUILT_INS += git-maintenance$X
 BUILT_INS += git-merge-subtree$X
 BUILT_INS += git-restore$X
 BUILT_INS += git-show$X
@@ -921,6 +923,8 @@ LIB_OBJS += mailmap.o
 LIB_OBJS += match-trees.o
 LIB_OBJS += mem-pool.o
 LIB_OBJS += merge-blobs.o
+LIB_OBJS += merge-ort.o
+LIB_OBJS += merge-ort-wrappers.o
 LIB_OBJS += merge-recursive.o
 LIB_OBJS += merge.o
 LIB_OBJS += mergesort.o
@@ -1000,6 +1004,7 @@ LIB_OBJS += stable-qsort.o
 LIB_OBJS += strbuf.o
 LIB_OBJS += streaming.o
 LIB_OBJS += string-list.o
+LIB_OBJS += strmap.o
 LIB_OBJS += strvec.o
 LIB_OBJS += sub-process.o
 LIB_OBJS += submodule-config.o
@@ -1089,6 +1094,7 @@ BUILTIN_OBJS += builtin/fetch-pack.o
 BUILTIN_OBJS += builtin/fetch.o
 BUILTIN_OBJS += builtin/fmt-merge-msg.o
 BUILTIN_OBJS += builtin/for-each-ref.o
+BUILTIN_OBJS += builtin/for-each-repo.o
 BUILTIN_OBJS += builtin/fsck.o
 BUILTIN_OBJS += builtin/gc.o
 BUILTIN_OBJS += builtin/get-tar-commit-id.o
@@ -2577,7 +2583,6 @@ XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
        --keyword=__ --keyword=N__ --keyword="__n:1,2"
 LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
 LOCALIZED_SH = $(SCRIPT_SH)
-LOCALIZED_SH += git-parse-remote.sh
 LOCALIZED_SH += git-rebase--preserve-merges.sh
 LOCALIZED_SH += git-sh-setup.sh
 LOCALIZED_PERL = $(SCRIPT_PERL)
@@ -2767,6 +2772,9 @@ ifdef GIT_INTEROP_MAKE_OPTS
 endif
 ifdef GIT_TEST_INDEX_VERSION
        @echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+
+endif
+ifdef GIT_TEST_PERL_FATAL_WARNINGS
+       @echo GIT_TEST_PERL_FATAL_WARNINGS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_PERL_FATAL_WARNINGS)))'\' >>$@+
 endif
        @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
 
@@ -3050,16 +3058,13 @@ quick-install-html:
 
 ### Maintainer's dist rules
 
-# Allow tweaking to hide local environment effects, like perm bits.
-# With GNU tar, "--mode=u+rwX,og+rX,og-w" would be a good idea, for example.
-TAR_DIST_EXTRA_OPTS =
 GIT_TARNAME = git-$(GIT_VERSION)
 GIT_ARCHIVE_EXTRA_FILES = \
        --prefix=$(GIT_TARNAME)/ \
        --add-file=configure \
-       --add-file=$(GIT_TARNAME)/version \
+       --add-file=.dist-tmp-dir/version \
        --prefix=$(GIT_TARNAME)/git-gui/ \
-       --add-file=$(GIT_TARNAME)/git-gui/version
+       --add-file=.dist-tmp-dir/git-gui/version
 ifdef DC_SHA1_SUBMODULE
 GIT_ARCHIVE_EXTRA_FILES += \
        --prefix=$(GIT_TARNAME)/sha1collisiondetection/ \
@@ -3071,13 +3076,14 @@ GIT_ARCHIVE_EXTRA_FILES += \
        --add-file=sha1collisiondetection/lib/ubc_check.h
 endif
 dist: git-archive$(X) configure
-       @mkdir -p $(GIT_TARNAME)
-       @echo $(GIT_VERSION) > $(GIT_TARNAME)/version
-       @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version
+       @$(RM) -r .dist-tmp-dir
+       @mkdir .dist-tmp-dir
+       @echo $(GIT_VERSION) > .dist-tmp-dir/version
+       @$(MAKE) -C git-gui TARDIR=../.dist-tmp-dir/git-gui dist-version
        ./git-archive --format=tar \
                $(GIT_ARCHIVE_EXTRA_FILES) \
                --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
-       @$(RM) -r $(GIT_TARNAME)
+       @$(RM) -r .dist-tmp-dir
        gzip -f -9 $(GIT_TARNAME).tar
 
 rpm::
@@ -3102,11 +3108,15 @@ artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \
 htmldocs = git-htmldocs-$(GIT_VERSION)
 manpages = git-manpages-$(GIT_VERSION)
 .PHONY: dist-doc distclean
-dist-doc:
+dist-doc: git$X
        $(RM) -r .doc-tmp-dir
        mkdir .doc-tmp-dir
        $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
-       cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar $(TAR_DIST_EXTRA_OPTS) .
+       ./git -C .doc-tmp-dir init
+       ./git -C .doc-tmp-dir add .
+       ./git -C .doc-tmp-dir commit -m htmldocs
+       ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
+               > $(htmldocs).tar
        gzip -n -9 -f $(htmldocs).tar
        :
        $(RM) -r .doc-tmp-dir
@@ -3116,7 +3126,11 @@ dist-doc:
                man5dir=../.doc-tmp-dir/man5 \
                man7dir=../.doc-tmp-dir/man7 \
                install
-       cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar $(TAR_DIST_EXTRA_OPTS) .
+       ./git -C .doc-tmp-dir init
+       ./git -C .doc-tmp-dir add .
+       ./git -C .doc-tmp-dir commit -m manpages
+       ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
+               > $(manpages).tar
        gzip -n -9 -f $(manpages).tar
        $(RM) -r .doc-tmp-dir
 
@@ -3146,8 +3160,8 @@ clean: profile-clean coverage-clean cocciclean
        $(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
        $(RM) -r po/build/
        $(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
-       $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
-       $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
+       $(RM) -r .dist-tmp-dir .doc-tmp-dir
+       $(RM) $(GIT_TARNAME).tar.gz
        $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
        $(MAKE) -C Documentation/ clean
        $(RM) Documentation/GIT-EXCLUDED-PROGRAMS
index 01daa17077ba056fa6760d074388e09bd6f49bbe..dc8c04b4f4aed68baeccc7a7bbafad37e52c8320 120000 (symlink)
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/2.29.2.txt
\ No newline at end of file
+Documentation/RelNotes/2.30.0.txt
\ No newline at end of file
index 555c4abf324f553b6bb70f6640554d407c12677a..9b8cdb4a31a6ab69e7bb4e698782b11764c094c7 100644 (file)
 #include "prompt.h"
 
 static void init_color(struct repository *r, struct add_i_state *s,
-                      const char *slot_name, char *dst,
+                      const char *section_and_slot, char *dst,
                       const char *default_color)
 {
-       char *key = xstrfmt("color.interactive.%s", slot_name);
+       char *key = xstrfmt("color.%s", section_and_slot);
        const char *value;
 
        if (!s->use_color)
@@ -40,20 +40,27 @@ void init_add_i_state(struct add_i_state *s, struct repository *r)
                        git_config_colorbool("color.interactive", value);
        s->use_color = want_color(s->use_color);
 
-       init_color(r, s, "header", s->header_color, GIT_COLOR_BOLD);
-       init_color(r, s, "help", s->help_color, GIT_COLOR_BOLD_RED);
-       init_color(r, s, "prompt", s->prompt_color, GIT_COLOR_BOLD_BLUE);
-       init_color(r, s, "error", s->error_color, GIT_COLOR_BOLD_RED);
-       init_color(r, s, "reset", s->reset_color, GIT_COLOR_RESET);
-       init_color(r, s, "fraginfo", s->fraginfo_color,
+       init_color(r, s, "interactive.header", s->header_color, GIT_COLOR_BOLD);
+       init_color(r, s, "interactive.help", s->help_color, GIT_COLOR_BOLD_RED);
+       init_color(r, s, "interactive.prompt", s->prompt_color,
+                  GIT_COLOR_BOLD_BLUE);
+       init_color(r, s, "interactive.error", s->error_color,
+                  GIT_COLOR_BOLD_RED);
+
+       init_color(r, s, "diff.frag", s->fraginfo_color,
                   diff_get_color(s->use_color, DIFF_FRAGINFO));
-       init_color(r, s, "context", s->context_color,
-               diff_get_color(s->use_color, DIFF_CONTEXT));
-       init_color(r, s, "old", s->file_old_color,
+       init_color(r, s, "diff.context", s->context_color, "fall back");
+       if (!strcmp(s->context_color, "fall back"))
+               init_color(r, s, "diff.plain", s->context_color,
+                          diff_get_color(s->use_color, DIFF_CONTEXT));
+       init_color(r, s, "diff.old", s->file_old_color,
                diff_get_color(s->use_color, DIFF_FILE_OLD));
-       init_color(r, s, "new", s->file_new_color,
+       init_color(r, s, "diff.new", s->file_new_color,
                diff_get_color(s->use_color, DIFF_FILE_NEW));
 
+       strlcpy(s->reset_color,
+               s->use_color ? GIT_COLOR_RESET : "", COLOR_MAXLEN);
+
        FREE_AND_NULL(s->interactive_diff_filter);
        git_config_get_string("interactive.difffilter",
                              &s->interactive_diff_filter);
@@ -194,7 +201,8 @@ static ssize_t find_unique(const char *string, struct prefix_item_list *list)
        else if (index + 1 < list->sorted.nr &&
                 starts_with(list->sorted.items[index + 1].string, string))
                return -1;
-       else if (index < list->sorted.nr)
+       else if (index < list->sorted.nr &&
+                starts_with(list->sorted.items[index].string, string))
                item = list->sorted.items[index].util;
        else
                return -1;
@@ -364,7 +372,7 @@ static ssize_t list_and_choose(struct add_i_state *s,
 
                        if (from < 0 || from >= items->items.nr ||
                            (singleton && from + 1 != to)) {
-                               color_fprintf_ln(stdout, s->error_color,
+                               color_fprintf_ln(stderr, s->error_color,
                                                 _("Huh (%s)?"), p);
                                break;
                        } else if (singleton) {
@@ -557,7 +565,7 @@ static int get_modified_files(struct repository *r,
                if (ps)
                        clear_pathspec(&rev.prune_data);
        }
-       hashmap_free_entries(&s.file_map, struct pathname_entry, ent);
+       hashmap_clear_and_free(&s.file_map, struct pathname_entry, ent);
        if (unmerged_count)
                *unmerged_count = s.unmerged_count;
        if (binary_count)
@@ -1131,7 +1139,7 @@ int run_add_i(struct repository *r, const struct pathspec *ps)
        print_file_item_data.color = data.color;
        print_file_item_data.reset = data.reset;
 
-       strbuf_addstr(&header, "      ");
+       strbuf_addstr(&header, "     ");
        strbuf_addf(&header, print_file_item_data.modified_fmt,
                    _("staged"), _("unstaged"), _("path"));
        opts.list_opts.header = header.buf;
index bd94bd3a7c9e86f4af6d9b887c824ff5be2db9a5..2fad92ca373292f328d5e5de4584638faa7bbd45 100644 (file)
@@ -661,13 +661,18 @@ static void render_hunk(struct add_p_state *s, struct hunk *hunk,
                else
                        new_offset += delta;
 
-               strbuf_addf(out, "@@ -%lu,%lu +%lu,%lu @@",
-                           old_offset, header->old_count,
-                           new_offset, header->new_count);
+               strbuf_addf(out, "@@ -%lu", old_offset);
+               if (header->old_count != 1)
+                       strbuf_addf(out, ",%lu", header->old_count);
+               strbuf_addf(out, " +%lu", new_offset);
+               if (header->new_count != 1)
+                       strbuf_addf(out, ",%lu", header->new_count);
+               strbuf_addstr(out, " @@");
+
                if (len)
                        strbuf_add(out, p, len);
                else if (colored)
-                       strbuf_addf(out, "%s\n", GIT_COLOR_RESET);
+                       strbuf_addf(out, "%s\n", s->s.reset_color);
                else
                        strbuf_addch(out, '\n');
        }
@@ -1060,7 +1065,7 @@ static void recolor_hunk(struct add_p_state *s, struct hunk *hunk)
                              s->s.file_new_color :
                              s->s.context_color);
                strbuf_add(&s->colored, plain + current, eol - current);
-               strbuf_addstr(&s->colored, GIT_COLOR_RESET);
+               strbuf_addstr(&s->colored, s->s.reset_color);
                if (next > eol)
                        strbuf_add(&s->colored, plain + eol, next - eol);
                current = next;
@@ -1456,15 +1461,15 @@ static int patch_update_file(struct add_p_state *s,
                else
                        prompt_mode_type = PROMPT_HUNK;
 
-               color_fprintf(stdout, s->s.prompt_color,
-                             "(%"PRIuMAX"/%"PRIuMAX") ",
+               printf("%s(%"PRIuMAX"/%"PRIuMAX") ", s->s.prompt_color,
                              (uintmax_t)hunk_index + 1,
                              (uintmax_t)(file_diff->hunk_nr
                                                ? file_diff->hunk_nr
                                                : 1));
-               color_fprintf(stdout, s->s.prompt_color,
-                             _(s->mode->prompt_mode[prompt_mode_type]),
-                             s->buf.buf);
+               printf(_(s->mode->prompt_mode[prompt_mode_type]),
+                      s->buf.buf);
+               if (*s->s.reset_color)
+                       fputs(s->s.reset_color, stdout);
                fflush(stdout);
                if (read_single_character(s) == EOF)
                        break;
@@ -1695,6 +1700,14 @@ int run_add_p(struct repository *r, enum add_p_mode mode,
        if (mode == ADD_P_STASH)
                s.mode = &patch_mode_stash;
        else if (mode == ADD_P_RESET) {
+               /*
+                * NEEDSWORK: Instead of comparing to the literal "HEAD",
+                * compare the commit objects instead so that other ways of
+                * saying the same thing (such as "@") are also handled
+                * appropriately.
+                *
+                * This applies to the cases below too.
+                */
                if (!revision || !strcmp(revision, "HEAD"))
                        s.mode = &patch_mode_reset_head;
                else
index f0a3d32d20687d1caadc1534aa15cf50543c27c0..164742305fd147c9f31fab6b127a10e1f8e0f636 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -11,6 +11,7 @@ int advice_push_already_exists = 1;
 int advice_push_fetch_first = 1;
 int advice_push_needs_force = 1;
 int advice_push_unqualified_ref_name = 1;
+int advice_push_ref_needs_update = 1;
 int advice_status_hints = 1;
 int advice_status_u_option = 1;
 int advice_status_ahead_behind_warning = 1;
@@ -72,6 +73,7 @@ static struct {
        { "pushFetchFirst", &advice_push_fetch_first },
        { "pushNeedsForce", &advice_push_needs_force },
        { "pushUnqualifiedRefName", &advice_push_unqualified_ref_name },
+       { "pushRefNeedsUpdate", &advice_push_ref_needs_update },
        { "statusHints", &advice_status_hints },
        { "statusUoption", &advice_status_u_option },
        { "statusAheadBehindWarning", &advice_status_ahead_behind_warning },
@@ -116,6 +118,7 @@ static struct {
        [ADVICE_PUSH_ALREADY_EXISTS]                    = { "pushAlreadyExists", 1 },
        [ADVICE_PUSH_FETCH_FIRST]                       = { "pushFetchFirst", 1 },
        [ADVICE_PUSH_NEEDS_FORCE]                       = { "pushNeedsForce", 1 },
+       [ADVICE_PUSH_REF_NEEDS_UPDATE]                  = { "pushRefNeedsUpdate", 1 },
 
        /* make this an alias for backward compatibility */
        [ADVICE_PUSH_UPDATE_REJECTED_ALIAS]             = { "pushNonFastForward", 1 },
index 16f2c11642a7e63c2b61e8cdba221f024d1069e5..bc2432980a83d570ea1179ebb5d25c93e94dc238 100644 (file)
--- a/advice.h
+++ b/advice.h
@@ -11,6 +11,7 @@ extern int advice_push_already_exists;
 extern int advice_push_fetch_first;
 extern int advice_push_needs_force;
 extern int advice_push_unqualified_ref_name;
+extern int advice_push_ref_needs_update;
 extern int advice_status_hints;
 extern int advice_status_u_option;
 extern int advice_status_ahead_behind_warning;
@@ -60,6 +61,7 @@ extern int advice_add_empty_pathspec;
        ADVICE_PUSH_UNQUALIFIED_REF_NAME,
        ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
        ADVICE_PUSH_UPDATE_REJECTED,
+       ADVICE_PUSH_REF_NEEDS_UPDATE,
        ADVICE_RESET_QUIET_WARNING,
        ADVICE_RESOLVE_CONFLICT,
        ADVICE_RM_HINTS,
diff --git a/apply.c b/apply.c
index 76dba93c974b3814117e3856d875e7e4381d2f62..668b16e9893d2f1e0501f2771716138db6e2efdd 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -3948,10 +3948,8 @@ static int check_patch(struct apply_state *state, struct patch *patch)
                        break; /* happy */
                case EXISTS_IN_INDEX:
                        return error(_("%s: already exists in index"), new_name);
-                       break;
                case EXISTS_IN_INDEX_AS_ITA:
                        return error(_("%s: does not match index"), new_name);
-                       break;
                case EXISTS_IN_WORKTREE:
                        return error(_("%s: already exists in working directory"),
                                     new_name);
@@ -4409,7 +4407,7 @@ static int create_one_file(struct apply_state *state,
                return 0;
 
        if (errno == ENOENT) {
-               if (safe_create_leading_directories(path))
+               if (safe_create_leading_directories_no_share(path))
                        return 0;
                res = try_create_file(state, path, mode, buf, size);
                if (res < 0)
@@ -4699,8 +4697,13 @@ static int apply_patch(struct apply_state *state,
                        reverse_patches(patch);
                if (use_patch(state, patch)) {
                        patch_stats(state, patch);
-                       *listp = patch;
-                       listp = &patch->next;
+                       if (!list || !state->apply_in_reverse) {
+                               *listp = patch;
+                               listp = &patch->next;
+                       } else {
+                               patch->next = list;
+                               list = patch;
+                       }
 
                        if ((patch->new_name &&
                             ends_with_path_components(patch->new_name,
index f1a1447ebda0a11b62cfead71a0f41a22439b392..a971fdc0f6326e0829225d4a2bfe87df48b82a42 100644 (file)
@@ -374,7 +374,8 @@ static int tar_filter_config(const char *var, const char *value, void *data)
                ar = xcalloc(1, sizeof(*ar));
                ar->name = xmemdupz(name, namelen);
                ar->write_archive = write_tar_filter_archive;
-               ar->flags = ARCHIVER_WANT_COMPRESSION_LEVELS;
+               ar->flags = ARCHIVER_WANT_COMPRESSION_LEVELS |
+                           ARCHIVER_HIGH_COMPRESSION_LEVELS;
                ALLOC_GROW(tar_filters, nr_tar_filters + 1, alloc_tar_filters);
                tar_filters[nr_tar_filters++] = ar;
        }
index 3c1541af9e2dfbb9189890beee745bc8574f82fe..5919d9e505088420802c1fd20bcfcaee62072c06 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -529,10 +529,12 @@ static int add_file_cb(const struct option *opt, const char *arg, int unset)
        return 0;
 }
 
-#define OPT__COMPR(s, v, h, p) \
-       OPT_SET_INT_F(s, NULL, v, h, p, PARSE_OPT_NONEG)
-#define OPT__COMPR_HIDDEN(s, v, p) \
-       OPT_SET_INT_F(s, NULL, v, "", p, PARSE_OPT_NONEG | PARSE_OPT_HIDDEN)
+static int number_callback(const struct option *opt, const char *arg, int unset)
+{
+       BUG_ON_OPT_NEG(unset);
+       *(int *)opt->value = strtol(arg, NULL, 10);
+       return 0;
+}
 
 static int parse_archive_args(int argc, const char **argv,
                const struct archiver **ar, struct archiver_args *args,
@@ -561,16 +563,8 @@ static int parse_archive_args(int argc, const char **argv,
                OPT_BOOL(0, "worktree-attributes", &worktree_attributes,
                        N_("read .gitattributes in working directory")),
                OPT__VERBOSE(&verbose, N_("report archived files on stderr")),
-               OPT__COMPR('0', &compression_level, N_("store only"), 0),
-               OPT__COMPR('1', &compression_level, N_("compress faster"), 1),
-               OPT__COMPR_HIDDEN('2', &compression_level, 2),
-               OPT__COMPR_HIDDEN('3', &compression_level, 3),
-               OPT__COMPR_HIDDEN('4', &compression_level, 4),
-               OPT__COMPR_HIDDEN('5', &compression_level, 5),
-               OPT__COMPR_HIDDEN('6', &compression_level, 6),
-               OPT__COMPR_HIDDEN('7', &compression_level, 7),
-               OPT__COMPR_HIDDEN('8', &compression_level, 8),
-               OPT__COMPR('9', &compression_level, N_("compress better"), 9),
+               OPT_NUMBER_CALLBACK(&compression_level,
+                       N_("set compression level"), number_callback),
                OPT_GROUP(""),
                OPT_BOOL('l', "list", &list,
                        N_("list supported archive formats")),
@@ -617,7 +611,9 @@ static int parse_archive_args(int argc, const char **argv,
 
        args->compression_level = Z_DEFAULT_COMPRESSION;
        if (compression_level != -1) {
-               if ((*ar)->flags & ARCHIVER_WANT_COMPRESSION_LEVELS)
+               int levels_ok = (*ar)->flags & ARCHIVER_WANT_COMPRESSION_LEVELS;
+               int high_ok = (*ar)->flags & ARCHIVER_HIGH_COMPRESSION_LEVELS;
+               if (levels_ok && (compression_level <= 9 || high_ok))
                        args->compression_level = compression_level;
                else {
                        die(_("Argument not supported for format '%s': -%d"),
@@ -662,6 +658,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
        rc = ar->write_archive(ar, &args);
 
        string_list_clear_func(&args.extra_files, extra_file_info_clear);
+       free(args.refname);
 
        return rc;
 }
index 82b226011abb60e017cba0bcda355f1a6af6aa5e..33551b7ee17be6adf9c16221ef1f605dbf8d477c 100644 (file)
--- a/archive.h
+++ b/archive.h
@@ -8,7 +8,7 @@ struct repository;
 
 struct archiver_args {
        struct repository *repo;
-       const char *refname;
+       char *refname;
        const char *prefix;
        const char *base;
        size_t baselen;
@@ -36,6 +36,7 @@ const char *archive_format_from_filename(const char *filename);
 
 #define ARCHIVER_WANT_COMPRESSION_LEVELS 1
 #define ARCHIVER_REMOTE 2
+#define ARCHIVER_HIGH_COMPRESSION_LEVELS 4
 struct archiver {
        const char *name;
        int (*write_archive)(const struct archiver *, struct archiver_args *);
diff --git a/attr.c b/attr.c
index a826b2ef1fabc8d4078d760fe3421d2a9cbbf2b2..4ef85d668b54960d692b6bae127920c10045c4ca 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -52,13 +52,6 @@ static inline void hashmap_unlock(struct attr_hashmap *map)
        pthread_mutex_unlock(&map->mutex);
 }
 
-/*
- * The global dictionary of all interned attributes.  This
- * is a singleton object which is shared between threads.
- * Access to this dictionary must be surrounded with a mutex.
- */
-static struct attr_hashmap g_attr_hashmap;
-
 /* The container for objects stored in "struct attr_hashmap" */
 struct attr_hash_entry {
        struct hashmap_entry ent;
@@ -80,11 +73,14 @@ static int attr_hash_entry_cmp(const void *unused_cmp_data,
        return (a->keylen != b->keylen) || strncmp(a->key, b->key, a->keylen);
 }
 
-/* Initialize an 'attr_hashmap' object */
-static void attr_hashmap_init(struct attr_hashmap *map)
-{
-       hashmap_init(&map->map, attr_hash_entry_cmp, NULL, 0);
-}
+/*
+ * The global dictionary of all interned attributes.  This
+ * is a singleton object which is shared between threads.
+ * Access to this dictionary must be surrounded with a mutex.
+ */
+static struct attr_hashmap g_attr_hashmap = {
+       HASHMAP_INIT(attr_hash_entry_cmp, NULL)
+};
 
 /*
  * Retrieve the 'value' stored in a hashmap given the provided 'key'.
@@ -96,9 +92,6 @@ static void *attr_hashmap_get(struct attr_hashmap *map,
        struct attr_hash_entry k;
        struct attr_hash_entry *e;
 
-       if (!map->map.tablesize)
-               attr_hashmap_init(map);
-
        hashmap_entry_init(&k.ent, memhash(key, keylen));
        k.key = key;
        k.keylen = keylen;
@@ -114,9 +107,6 @@ static void attr_hashmap_add(struct attr_hashmap *map,
 {
        struct attr_hash_entry *e;
 
-       if (!map->map.tablesize)
-               attr_hashmap_init(map);
-
        e = xmalloc(sizeof(struct attr_hash_entry));
        hashmap_entry_init(&e->ent, memhash(key, keylen));
        e->key = key;
index 60a18d44033b207025294a3084cbf7c7c6f20876..7ab4f2e49219bdb38e4fe4e5b85d5a0cc3765566 100644 (file)
--- a/banned.h
+++ b/banned.h
 #define vsprintf(buf,fmt,arg) BANNED(vsprintf)
 #endif
 
+#undef gmtime
+#define gmtime(t) BANNED(gmtime)
+#undef localtime
+#define localtime(t) BANNED(localtime)
+#undef ctime
+#define ctime(t) BANNED(ctime)
+#undef ctime_r
+#define ctime_r(t, buf) BANNED(ctime_r)
+#undef asctime
+#define asctime(t) BANNED(asctime)
+#undef asctime_r
+#define asctime_r(t, buf) BANNED(asctime_r)
+
 #endif /* BANNED_H */
index f5b13681288cc4a677e6531cc57ab0f3ee04b7ac..d8c2c8f7a78bf99e5f6d202ee7996ab9952b417f 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -103,8 +103,10 @@ static int count_interesting_parents(struct commit *commit, unsigned bisect_flag
        return count;
 }
 
-static inline int halfway(struct commit_list *p, int nr)
+static inline int approx_halfway(struct commit_list *p, int nr)
 {
+       int diff;
+
        /*
         * Don't short-cut something we are not going to return!
         */
@@ -113,13 +115,22 @@ static inline int halfway(struct commit_list *p, int nr)
        if (DEBUG_BISECT)
                return 0;
        /*
-        * 2 and 3 are halfway of 5.
+        * For small number of commits 2 and 3 are halfway of 5, and
         * 3 is halfway of 6 but 2 and 4 are not.
         */
-       switch (2 * weight(p) - nr) {
+       diff = 2 * weight(p) - nr;
+       switch (diff) {
        case -1: case 0: case 1:
                return 1;
        default:
+               /*
+                * For large number of commits we are not so strict, it's
+                * good enough if it's within ~0.1% of the halfway point,
+                * e.g. 5000 is exactly halfway of 10000, but we consider
+                * the values [4996, 5004] as halfway as well.
+                */
+               if (abs(diff) < nr / 1024)
+                       return 1;
                return 0;
        }
 }
@@ -321,8 +332,9 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
                weight_set(p, count_distance(p));
                clear_distance(list);
 
-               /* Does it happen to be at exactly half-way? */
-               if (!(bisect_flags & FIND_BISECTION_ALL) && halfway(p, nr))
+               /* Does it happen to be at half-way? */
+               if (!(bisect_flags & FIND_BISECTION_ALL) &&
+                     approx_halfway(p, nr))
                        return p;
                counted++;
        }
@@ -362,8 +374,9 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
                        else
                                weight_set(p, weight(q));
 
-                       /* Does it happen to be at exactly half-way? */
-                       if (!(bisect_flags & FIND_BISECTION_ALL) && halfway(p, nr))
+                       /* Does it happen to be at half-way? */
+                       if (!(bisect_flags & FIND_BISECTION_ALL) &&
+                             approx_halfway(p, nr))
                                return p;
                }
        }
@@ -1090,7 +1103,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
                  nr), nr, steps_msg);
        free(steps_msg);
        /* Clean up objects used, as they will be reused. */
-       clear_commit_marks_all(ALL_REV_FLAGS);
+       repo_clear_commit_marks(r, ALL_REV_FLAGS);
 
        return bisect_checkout(bisect_rev, no_checkout);
 }
diff --git a/blame.c b/blame.c
index 686845b2b43dffe35d9f9811b61c80a0e0536332..a5044fcfaa62644daa45103dd6ad17647bc6a811 100644 (file)
--- a/blame.c
+++ b/blame.c
@@ -435,7 +435,7 @@ static void get_fingerprint(struct fingerprint *result,
 
 static void free_fingerprint(struct fingerprint *f)
 {
-       hashmap_free(&f->map);
+       hashmap_clear(&f->map);
        free(f->entries);
 }
 
@@ -2670,7 +2670,7 @@ static struct commit *find_single_final(struct rev_info *revs,
                if (obj->flags & UNINTERESTING)
                        continue;
                obj = deref_tag(revs->repo, obj, NULL, 0);
-               if (obj->type != OBJ_COMMIT)
+               if (!obj || obj->type != OBJ_COMMIT)
                        die("Non commit %s?", revs->pending.objects[i].name);
                if (found)
                        die("More than one commit to dig from %s and %s?",
@@ -2701,7 +2701,7 @@ static struct commit *dwim_reverse_initial(struct rev_info *revs,
        /* Is that sole rev a committish? */
        obj = revs->pending.objects[0].item;
        obj = deref_tag(revs->repo, obj, NULL, 0);
-       if (obj->type != OBJ_COMMIT)
+       if (!obj || obj->type != OBJ_COMMIT)
                return NULL;
 
        /* Do we have HEAD? */
@@ -2737,7 +2737,7 @@ static struct commit *find_single_initial(struct rev_info *revs,
                if (!(obj->flags & UNINTERESTING))
                        continue;
                obj = deref_tag(revs->repo, obj, NULL, 0);
-               if (obj->type != OBJ_COMMIT)
+               if (!obj || obj->type != OBJ_COMMIT)
                        die("Non commit %s?", revs->pending.objects[i].name);
                if (found)
                        die("More than one commit to dig up from, %s and %s?",
@@ -2764,7 +2764,6 @@ void init_scoreboard(struct blame_scoreboard *sb)
 }
 
 void setup_scoreboard(struct blame_scoreboard *sb,
-                     const char *path,
                      struct blame_origin **orig)
 {
        const char *final_commit_name = NULL;
@@ -2803,7 +2802,7 @@ void setup_scoreboard(struct blame_scoreboard *sb,
                setup_work_tree();
                sb->final = fake_working_tree_commit(sb->repo,
                                                     &sb->revs->diffopt,
-                                                    path, sb->contents_from);
+                                                    sb->path, sb->contents_from);
                add_pending_object(sb->revs, &(sb->final->object), ":");
        }
 
@@ -2846,12 +2845,12 @@ void setup_scoreboard(struct blame_scoreboard *sb,
                sb->final_buf_size = o->file.size;
        }
        else {
-               o = get_origin(sb->final, path);
+               o = get_origin(sb->final, sb->path);
                if (fill_blob_sha1_and_mode(sb->repo, o))
-                       die(_("no such path %s in %s"), path, final_commit_name);
+                       die(_("no such path %s in %s"), sb->path, final_commit_name);
 
                if (sb->revs->diffopt.flags.allow_textconv &&
-                   textconv_object(sb->repo, path, o->mode, &o->blob_oid, 1, (char **) &sb->final_buf,
+                   textconv_object(sb->repo, sb->path, o->mode, &o->blob_oid, 1, (char **) &sb->final_buf,
                                    &sb->final_buf_size))
                        ;
                else
@@ -2861,7 +2860,7 @@ void setup_scoreboard(struct blame_scoreboard *sb,
                if (!sb->final_buf)
                        die(_("cannot read blob %s for path %s"),
                            oid_to_hex(&o->blob_oid),
-                           path);
+                           sb->path);
        }
        sb->num_read_blob++;
        prepare_lines(sb);
@@ -2888,8 +2887,7 @@ struct blame_entry *blame_entry_prepend(struct blame_entry *head,
        return new_head;
 }
 
-void setup_blame_bloom_data(struct blame_scoreboard *sb,
-                           const char *path)
+void setup_blame_bloom_data(struct blame_scoreboard *sb)
 {
        struct blame_bloom_data *bd;
        struct bloom_filter_settings *bs;
@@ -2909,7 +2907,7 @@ void setup_blame_bloom_data(struct blame_scoreboard *sb,
        bd->nr = 0;
        ALLOC_ARRAY(bd->keys, bd->alloc);
 
-       add_bloom_key(bd, path);
+       add_bloom_key(bd, sb->path);
 
        sb->bloom_data = bd;
 }
diff --git a/blame.h b/blame.h
index b6bbee4147288271094b3a6dad5a04d1fe597c16..38bde535b3d46461d0619bc68c852210693de571 100644 (file)
--- a/blame.h
+++ b/blame.h
@@ -181,10 +181,8 @@ const char *blame_nth_line(struct blame_scoreboard *sb, long lno);
 
 void init_scoreboard(struct blame_scoreboard *sb);
 void setup_scoreboard(struct blame_scoreboard *sb,
-                     const char *path,
                      struct blame_origin **orig);
-void setup_blame_bloom_data(struct blame_scoreboard *sb,
-                           const char *path);
+void setup_blame_bloom_data(struct blame_scoreboard *sb);
 void cleanup_scoreboard(struct blame_scoreboard *sb);
 
 struct blame_entry *blame_entry_prepend(struct blame_entry *head,
index 22b125cf8c122e3a1716f34778fa5595454fe76a..8681031402fb93c0e1d5a865041f6f9a924363c6 100644 (file)
@@ -203,7 +203,7 @@ void blk_SHA1_Init(blk_SHA_CTX *ctx)
        ctx->H[4] = 0xc3d2e1f0;
 }
 
-void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, unsigned long len)
+void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *data, size_t len)
 {
        unsigned int lenW = ctx->size & 63;
 
index 4df67477526a2891f7dcdac71ea7bffa75120a67..9fb0441b98849e14e589d7a1b436e3338ae4688d 100644 (file)
@@ -13,7 +13,7 @@ typedef struct {
 } blk_SHA_CTX;
 
 void blk_SHA1_Init(blk_SHA_CTX *ctx);
-void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, unsigned long len);
+void blk_SHA1_Update(blk_SHA_CTX *ctx, const void *dataIn, size_t len);
 void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx);
 
 #define platform_SHA_CTX       blk_SHA_CTX
diff --git a/bloom.c b/bloom.c
index 68c73200a54aa4fdad582d6031c59313c2c90d73..b176f28f531eccc412204faa5f4da9fa53164081 100644 (file)
--- a/bloom.c
+++ b/bloom.c
@@ -229,10 +229,9 @@ struct bloom_filter *get_or_compute_bloom_filter(struct repository *r,
        diffcore_std(&diffopt);
 
        if (diff_queued_diff.nr <= settings->max_changed_paths) {
-               struct hashmap pathmap;
+               struct hashmap pathmap = HASHMAP_INIT(pathmap_cmp, NULL);
                struct pathmap_hash_entry *e;
                struct hashmap_iter iter;
-               hashmap_init(&pathmap, pathmap_cmp, NULL, 0);
 
                for (i = 0; i < diff_queued_diff.nr; i++) {
                        const char *path = diff_queued_diff.queue[i]->two->path;
@@ -287,7 +286,7 @@ struct bloom_filter *get_or_compute_bloom_filter(struct repository *r,
                }
 
        cleanup:
-               hashmap_free_entries(&pathmap, struct pathmap_hash_entry, entry);
+               hashmap_clear_and_free(&pathmap, struct pathmap_hash_entry, entry);
        } else {
                for (i = 0; i < diff_queued_diff.nr; i++)
                        diff_free_filepair(diff_queued_diff.queue[i]);
index 53fb290963377b23d04d7e4b9a45f642984f82d3..b6ce981b73773558e0184be85fc2128048330d1c 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -155,6 +155,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix);
 int cmd_fetch_pack(int argc, const char **argv, const char *prefix);
 int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
 int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
+int cmd_for_each_repo(int argc, const char **argv, const char *prefix);
 int cmd_format_patch(int argc, const char **argv, const char *prefix);
 int cmd_fsck(int argc, const char **argv, const char *prefix);
 int cmd_gc(int argc, const char **argv, const char *prefix);
index 4949535a7f1f926cbe01be09b5679660126074aa..f22c73a05b0472dcf5ee1002282bd9f0c067b53b 100644 (file)
@@ -98,8 +98,6 @@ struct am_state {
        char *author_name;
        char *author_email;
        char *author_date;
-       char *committer_name;
-       char *committer_email;
        char *msg;
        size_t msg_len;
 
@@ -132,8 +130,6 @@ struct am_state {
  */
 static void am_state_init(struct am_state *state)
 {
-       const char *committer;
-       struct ident_split id;
        int gpgsign;
 
        memset(state, 0, sizeof(*state));
@@ -154,14 +150,6 @@ static void am_state_init(struct am_state *state)
 
        if (!git_config_get_bool("commit.gpgsign", &gpgsign))
                state->sign_commit = gpgsign ? "" : NULL;
-
-       committer = git_committer_info(IDENT_STRICT);
-       if (split_ident_line(&id, committer, strlen(committer)) < 0)
-               die(_("invalid committer: %s"), committer);
-       state->committer_name =
-               xmemdupz(id.name_begin, id.name_end - id.name_begin);
-       state->committer_email =
-               xmemdupz(id.mail_begin, id.mail_end - id.mail_begin);
 }
 
 /**
@@ -173,8 +161,6 @@ static void am_state_release(struct am_state *state)
        free(state->author_name);
        free(state->author_email);
        free(state->author_date);
-       free(state->committer_name);
-       free(state->committer_email);
        free(state->msg);
        strvec_clear(&state->git_apply_opts);
 }
@@ -1594,8 +1580,9 @@ static void do_commit(const struct am_state *state)
                        IDENT_STRICT);
 
        if (state->committer_date_is_author_date)
-               committer = fmt_ident(state->committer_name,
-                                     state->committer_email, WANT_COMMITTER_IDENT,
+               committer = fmt_ident(getenv("GIT_COMMITTER_NAME"),
+                                     getenv("GIT_COMMITTER_EMAIL"),
+                                     WANT_COMMITTER_IDENT,
                                      state->ignore_date ? NULL
                                                         : state->author_date,
                                      IDENT_STRICT);
@@ -2237,7 +2224,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
                        N_("allow fall back on 3way merging if needed")),
                OPT__QUIET(&state.quiet, N_("be quiet")),
                OPT_SET_INT('s', "signoff", &state.signoff,
-                       N_("add a Signed-off-by line to the commit message"),
+                       N_("add a Signed-off-by trailer to the commit message"),
                        SIGNOFF_EXPLICIT),
                OPT_BOOL('u', "utf8", &state.utf8,
                        N_("recode into utf8 (default)")),
index 7512b880f0d67fbe5dba8de93271324b8338d7d9..709eb713a3ba469f39ef5b4536583a84cc0c4a52 100644 (file)
@@ -20,9 +20,6 @@ static GIT_PATH_FUNC(git_path_bisect_names, "BISECT_NAMES")
 static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT")
 
 static const char * const git_bisect_helper_usage[] = {
-       N_("git bisect--helper --next-all"),
-       N_("git bisect--helper --write-terms <bad_term> <good_term>"),
-       N_("git bisect--helper --bisect-clean-state"),
        N_("git bisect--helper --bisect-reset [<commit>]"),
        N_("git bisect--helper --bisect-write [--no-log] <state> <revision> <good_term> <bad_term>"),
        N_("git bisect--helper --bisect-check-and-set-terms <command> <good_term> <bad_term>"),
@@ -32,7 +29,8 @@ static const char * const git_bisect_helper_usage[] = {
                                            " [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] [<paths>...]"),
        N_("git bisect--helper --bisect-next"),
        N_("git bisect--helper --bisect-auto-next"),
-       N_("git bisect--helper --bisect-autostart"),
+       N_("git bisect--helper --bisect-state (bad|new) [<rev>]"),
+       N_("git bisect--helper --bisect-state (good|old) [<rev>...]"),
        NULL
 };
 
@@ -85,6 +83,19 @@ static int one_of(const char *term, ...)
        return res;
 }
 
+/*
+ * return code BISECT_INTERNAL_SUCCESS_MERGE_BASE
+ * and BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND are codes
+ * that indicate special success.
+ */
+
+static int is_bisect_success(enum bisect_error res)
+{
+       return !res ||
+               res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND ||
+               res == BISECT_INTERNAL_SUCCESS_MERGE_BASE;
+}
+
 static int write_in_file(const char *path, const char *mode, const char *format, va_list args)
 {
        FILE *fp = NULL;
@@ -174,30 +185,6 @@ static int write_terms(const char *bad, const char *good)
        return res;
 }
 
-static int is_expected_rev(const char *expected_hex)
-{
-       struct strbuf actual_hex = STRBUF_INIT;
-       int res = 0;
-       if (strbuf_read_file(&actual_hex, git_path_bisect_expected_rev(), 0) >= 40) {
-               strbuf_trim(&actual_hex);
-               res = !strcmp(actual_hex.buf, expected_hex);
-       }
-       strbuf_release(&actual_hex);
-       return res;
-}
-
-static void check_expected_revs(const char **revs, int rev_nr)
-{
-       int i;
-
-       for (i = 0; i < rev_nr; i++) {
-               if (!is_expected_rev(revs[i])) {
-                       unlink_or_warn(git_path_bisect_ancestors_ok());
-                       unlink_or_warn(git_path_bisect_expected_rev());
-               }
-       }
-}
-
 static int bisect_reset(const char *commit)
 {
        struct strbuf branch = STRBUF_INIT;
@@ -609,12 +596,13 @@ static enum bisect_error bisect_auto_next(struct bisect_terms *terms, const char
        return bisect_next(terms, prefix);
 }
 
-static int bisect_start(struct bisect_terms *terms, const char **argv, int argc)
+static enum bisect_error bisect_start(struct bisect_terms *terms, const char **argv, int argc)
 {
        int no_checkout = 0;
        int first_parent_only = 0;
        int i, has_double_dash = 0, must_write_terms = 0, bad_seen = 0;
-       int flags, pathspec_pos, res = 0;
+       int flags, pathspec_pos;
+       enum bisect_error res = BISECT_OK;
        struct string_list revs = STRING_LIST_INIT_DUP;
        struct string_list states = STRING_LIST_INIT_DUP;
        struct strbuf start_head = STRBUF_INIT;
@@ -753,14 +741,7 @@ static int bisect_start(struct bisect_terms *terms, const char **argv, int argc)
         * Get rid of any old bisect state.
         */
        if (bisect_clean_state())
-               return -1;
-
-       /*
-        * In case of mistaken revs or checkout error, or signals received,
-        * "bisect_auto_next" below may exit or misbehave.
-        * We have to trap this to be able to clean up using
-        * "bisect_clean_state".
-        */
+               return BISECT_FAILED;
 
        /*
         * Write new start state
@@ -777,7 +758,7 @@ static int bisect_start(struct bisect_terms *terms, const char **argv, int argc)
                }
                if (update_ref(NULL, "BISECT_HEAD", &oid, NULL, 0,
                               UPDATE_REFS_MSG_ON_ERR)) {
-                       res = -1;
+                       res = BISECT_FAILED;
                        goto finish;
                }
        }
@@ -789,25 +770,31 @@ static int bisect_start(struct bisect_terms *terms, const char **argv, int argc)
        for (i = 0; i < states.nr; i++)
                if (bisect_write(states.items[i].string,
                                 revs.items[i].string, terms, 1)) {
-                       res = -1;
+                       res = BISECT_FAILED;
                        goto finish;
                }
 
        if (must_write_terms && write_terms(terms->term_bad,
                                            terms->term_good)) {
-               res = -1;
+               res = BISECT_FAILED;
                goto finish;
        }
 
        res = bisect_append_log_quoted(argv);
        if (res)
-               res = -1;
+               res = BISECT_FAILED;
 
 finish:
        string_list_clear(&revs, 0);
        string_list_clear(&states, 0);
        strbuf_release(&start_head);
        strbuf_release(&bisect_names);
+       if (res)
+               return res;
+
+       res = bisect_auto_next(terms, NULL);
+       if (!is_bisect_success(res))
+               bisect_clean_state();
        return res;
 }
 
@@ -843,14 +830,84 @@ static int bisect_autostart(struct bisect_terms *terms)
        return res;
 }
 
+static enum bisect_error bisect_state(struct bisect_terms *terms, const char **argv,
+                                     int argc)
+{
+       const char *state;
+       int i, verify_expected = 1;
+       struct object_id oid, expected;
+       struct strbuf buf = STRBUF_INIT;
+       struct oid_array revs = OID_ARRAY_INIT;
+
+       if (!argc)
+               return error(_("Please call `--bisect-state` with at least one argument"));
+
+       if (bisect_autostart(terms))
+               return BISECT_FAILED;
+
+       state = argv[0];
+       if (check_and_set_terms(terms, state) ||
+           !one_of(state, terms->term_good, terms->term_bad, "skip", NULL))
+               return BISECT_FAILED;
+
+       argv++;
+       argc--;
+       if (argc > 1 && !strcmp(state, terms->term_bad))
+               return error(_("'git bisect %s' can take only one argument."), terms->term_bad);
+
+       if (argc == 0) {
+               const char *head = "BISECT_HEAD";
+               enum get_oid_result res_head = get_oid(head, &oid);
+
+               if (res_head == MISSING_OBJECT) {
+                       head = "HEAD";
+                       res_head = get_oid(head, &oid);
+               }
+
+               if (res_head)
+                       error(_("Bad rev input: %s"), head);
+               oid_array_append(&revs, &oid);
+       }
+
+       /*
+        * All input revs must be checked before executing bisect_write()
+        * to discard junk revs.
+        */
+
+       for (; argc; argc--, argv++) {
+               if (get_oid(*argv, &oid)){
+                       error(_("Bad rev input: %s"), *argv);
+                       oid_array_clear(&revs);
+                       return BISECT_FAILED;
+               }
+               oid_array_append(&revs, &oid);
+       }
+
+       if (strbuf_read_file(&buf, git_path_bisect_expected_rev(), 0) < the_hash_algo->hexsz ||
+           get_oid_hex(buf.buf, &expected) < 0)
+               verify_expected = 0; /* Ignore invalid file contents */
+       strbuf_release(&buf);
+
+       for (i = 0; i < revs.nr; i++) {
+               if (bisect_write(state, oid_to_hex(&revs.oid[i]), terms, 0)) {
+                       oid_array_clear(&revs);
+                       return BISECT_FAILED;
+               }
+               if (verify_expected && !oideq(&revs.oid[i], &expected)) {
+                       unlink_or_warn(git_path_bisect_ancestors_ok());
+                       unlink_or_warn(git_path_bisect_expected_rev());
+                       verify_expected = 0;
+               }
+       }
+
+       oid_array_clear(&revs);
+       return bisect_auto_next(terms, NULL);
+}
+
 int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
 {
        enum {
-               NEXT_ALL = 1,
-               WRITE_TERMS,
-               BISECT_CLEAN_STATE,
-               CHECK_EXPECTED_REVS,
-               BISECT_RESET,
+               BISECT_RESET = 1,
                BISECT_WRITE,
                CHECK_AND_SET_TERMS,
                BISECT_NEXT_CHECK,
@@ -858,18 +915,11 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
                BISECT_START,
                BISECT_AUTOSTART,
                BISECT_NEXT,
-               BISECT_AUTO_NEXT
+               BISECT_AUTO_NEXT,
+               BISECT_STATE
        } cmdmode = 0;
        int res = 0, nolog = 0;
        struct option options[] = {
-               OPT_CMDMODE(0, "next-all", &cmdmode,
-                        N_("perform 'git bisect next'"), NEXT_ALL),
-               OPT_CMDMODE(0, "write-terms", &cmdmode,
-                        N_("write the terms to .git/BISECT_TERMS"), WRITE_TERMS),
-               OPT_CMDMODE(0, "bisect-clean-state", &cmdmode,
-                        N_("cleanup the bisection state"), BISECT_CLEAN_STATE),
-               OPT_CMDMODE(0, "check-expected-revs", &cmdmode,
-                        N_("check for expected revs"), CHECK_EXPECTED_REVS),
                OPT_CMDMODE(0, "bisect-reset", &cmdmode,
                         N_("reset the bisection state"), BISECT_RESET),
                OPT_CMDMODE(0, "bisect-write", &cmdmode,
@@ -886,8 +936,8 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
                         N_("find the next bisection commit"), BISECT_NEXT),
                OPT_CMDMODE(0, "bisect-auto-next", &cmdmode,
                         N_("verify the next bisection state then checkout the next bisection commit"), BISECT_AUTO_NEXT),
-               OPT_CMDMODE(0, "bisect-autostart", &cmdmode,
-                        N_("start the bisection if it has not yet been started"), BISECT_AUTOSTART),
+               OPT_CMDMODE(0, "bisect-state", &cmdmode,
+                        N_("mark the state of ref (or refs)"), BISECT_STATE),
                OPT_BOOL(0, "no-log", &nolog,
                         N_("no log for BISECT_WRITE")),
                OPT_END()
@@ -902,20 +952,6 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
                usage_with_options(git_bisect_helper_usage, options);
 
        switch (cmdmode) {
-       case NEXT_ALL:
-               res = bisect_next_all(the_repository, prefix);
-               break;
-       case WRITE_TERMS:
-               if (argc != 2)
-                       return error(_("--write-terms requires two arguments"));
-               return write_terms(argv[0], argv[1]);
-       case BISECT_CLEAN_STATE:
-               if (argc != 0)
-                       return error(_("--bisect-clean-state requires no arguments"));
-               return bisect_clean_state();
-       case CHECK_EXPECTED_REVS:
-               check_expected_revs(argv, argc);
-               return 0;
        case BISECT_RESET:
                if (argc > 1)
                        return error(_("--bisect-reset requires either no argument or a commit"));
@@ -959,11 +995,10 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
                get_terms(&terms);
                res = bisect_auto_next(&terms, prefix);
                break;
-       case BISECT_AUTOSTART:
-               if (argc)
-                       return error(_("--bisect-autostart does not accept arguments"));
+       case BISECT_STATE:
                set_terms(&terms, "bad", "good");
-               res = bisect_autostart(&terms);
+               get_terms(&terms);
+               res = bisect_state(&terms, argv, argc);
                break;
        default:
                BUG("unknown subcommand %d", cmdmode);
index bb0f29300e5ca4caf3a6b9fa8e4ae96ce38c34d1..6f7e32411a880d4cb3971ecf1c222a3a2b0da317 100644 (file)
@@ -820,6 +820,8 @@ static int peel_to_commit_oid(struct object_id *oid_ret, void *cbdata)
                if (kind != OBJ_TAG)
                        return -1;
                obj = deref_tag(r, parse_object(r, &oid), NULL, 0);
+               if (!obj)
+                       return -1;
                oidcpy(&oid, &obj->oid);
        }
 }
@@ -889,7 +891,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
                OPT_STRING(0, "contents", &contents_from, N_("file"), N_("Use <file>'s contents as the final image")),
                OPT_CALLBACK_F('C', NULL, &opt, N_("score"), N_("Find line copies within and across files"), PARSE_OPT_OPTARG, blame_copy_callback),
                OPT_CALLBACK_F('M', NULL, &opt, N_("score"), N_("Find line movements within and across files"), PARSE_OPT_OPTARG, blame_move_callback),
-               OPT_STRING_LIST('L', NULL, &range_list, N_("n,m"), N_("Process only line range n,m, counting from 1")),
+               OPT_STRING_LIST('L', NULL, &range_list, N_("range"),
+                               N_("Process only line range <start>,<end> or function :<funcname>")),
                OPT__ABBREV(&abbrev),
                OPT_END()
        };
@@ -1080,17 +1083,18 @@ parse_done:
        sb.contents_from = contents_from;
        sb.reverse = reverse;
        sb.repo = the_repository;
+       sb.path = path;
        build_ignorelist(&sb, &ignore_revs_file_list, &ignore_rev_list);
        string_list_clear(&ignore_revs_file_list, 0);
        string_list_clear(&ignore_rev_list, 0);
-       setup_scoreboard(&sb, path, &o);
+       setup_scoreboard(&sb, &o);
 
        /*
         * Changed-path Bloom filters are disabled when looking
         * for copies.
         */
        if (!(opt & PICKAXE_BLAME_COPY))
-               setup_blame_bloom_data(&sb, path);
+               setup_blame_bloom_data(&sb);
 
        lno = sb.num_lines;
 
@@ -1109,7 +1113,7 @@ parse_done:
                if ((!lno && (top || bottom)) || lno < bottom)
                        die(Q_("file %s has only %lu line",
                               "file %s has only %lu lines",
-                              lno), path, lno);
+                              lno), sb.path, lno);
                if (bottom < 1)
                        bottom = 1;
                if (top < 1 || lno < top)
@@ -1134,7 +1138,6 @@ parse_done:
        string_list_clear(&range_list, 0);
 
        sb.ent = NULL;
-       sb.path = path;
 
        if (blame_move_score)
                sb.move_score = blame_move_score;
index efb30b882069446e82b69256d6b768c4c795608e..9b68591addf077c359617d05e7a66445c0a1255e 100644 (file)
@@ -538,7 +538,9 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
                strbuf_addf(&logmsg, "Branch: renamed %s to %s",
                            oldref.buf, newref.buf);
 
-       if (!copy && rename_ref(oldref.buf, newref.buf, logmsg.buf))
+       if (!copy &&
+           (!head || strcmp(oldname, head) || !is_null_oid(&head_oid)) &&
+           rename_ref(oldref.buf, newref.buf, logmsg.buf))
                die(_("Branch rename failed"));
        if (copy && copy_existing_ref(oldref.buf, newref.buf, logmsg.buf))
                die(_("Branch copy failed"));
@@ -829,10 +831,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                        die(_("Branch '%s' has no upstream information"), branch->name);
 
                strbuf_addf(&buf, "branch.%s.remote", branch->name);
-               git_config_set_multivar(buf.buf, NULL, NULL, 1);
+               git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
                strbuf_reset(&buf);
                strbuf_addf(&buf, "branch.%s.merge", branch->name);
-               git_config_set_multivar(buf.buf, NULL, NULL, 1);
+               git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
                strbuf_release(&buf);
        } else if (argc > 0 && argc <= 2) {
                if (filter.kind != FILTER_REFS_BRANCHES)
index 3ad4b9b62e8498c51d550358bc63724b74eabbce..ad3cc9c02f62ca85ef3f9b1b891334b3791fadbb 100644 (file)
@@ -125,6 +125,7 @@ int cmd_bugreport(int argc, const char **argv, const char *prefix)
        struct strbuf report_path = STRBUF_INIT;
        int report = -1;
        time_t now = time(NULL);
+       struct tm tm;
        char *option_output = NULL;
        char *option_suffix = "%Y-%m-%d-%H%M";
        const char *user_relative_path = NULL;
@@ -147,7 +148,7 @@ int cmd_bugreport(int argc, const char **argv, const char *prefix)
        strbuf_complete(&report_path, '/');
 
        strbuf_addstr(&report_path, "git-bugreport-");
-       strbuf_addftime(&report_path, option_suffix, localtime(&now), 0, 0);
+       strbuf_addftime(&report_path, option_suffix, localtime_r(&now, &tm), 0, 0);
        strbuf_addstr(&report_path, ".txt");
 
        switch (safe_create_leading_directories(report_path.buf)) {
index a854fd16e779123f7d39f685fa3b7eb7c1ba930e..4bbfc92dce5a0e71e4389c16fd096f4a22fef4a1 100644 (file)
@@ -79,6 +79,14 @@ static int checkout_file(const char *name, const char *prefix)
                return errs > 0 ? -1 : 0;
        }
 
+       /*
+        * At this point we know we didn't try to check anything out. If it was
+        * because we did find an entry but it was stage 0, that's not an
+        * error.
+        */
+       if (has_same_name && checkout_stage == CHECKOUT_ALL)
+               return 0;
+
        if (!state.quiet) {
                fprintf(stderr, "git checkout-index: %s ", name);
                if (!has_same_name)
@@ -159,6 +167,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
        int prefix_length;
        int force = 0, quiet = 0, not_new = 0;
        int index_opt = 0;
+       int err = 0;
        struct option builtin_checkout_index_options[] = {
                OPT_BOOL('a', "all", &all,
                        N_("check out all files in the index")),
@@ -223,7 +232,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                if (read_from_stdin)
                        die("git checkout-index: don't mix '--stdin' and explicit filenames");
                p = prefix_path(prefix, prefix_length, arg);
-               checkout_file(p, prefix);
+               err |= checkout_file(p, prefix);
                free(p);
        }
 
@@ -245,13 +254,16 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                                strbuf_swap(&buf, &unquoted);
                        }
                        p = prefix_path(prefix, prefix_length, buf.buf);
-                       checkout_file(p, prefix);
+                       err |= checkout_file(p, prefix);
                        free(p);
                }
                strbuf_release(&unquoted);
                strbuf_release(&buf);
        }
 
+       if (err)
+               return 1;
+
        if (all)
                checkout_all(prefix, prefix_length);
 
index 0951f8fee5cc2a88ac9e08009a69eaf446b6fed4..9b82119129a2223a69bf6a638ff1bf923b82634d 100644 (file)
@@ -471,6 +471,19 @@ static int checkout_paths(const struct checkout_opts *opts,
 
        if (opts->patch_mode) {
                const char *patch_mode;
+               const char *rev = new_branch_info->name;
+               char rev_oid[GIT_MAX_HEXSZ + 1];
+
+               /*
+                * Since rev can be in the form of `<a>...<b>` (which is not
+                * recognized by diff-index), we will always replace the name
+                * with the hex of the commit (whether it's in `...` form or
+                * not) for the run_add_interactive() machinery to work
+                * properly. However, there is special logic for the HEAD case
+                * so we mustn't replace that.
+                */
+               if (rev && strcmp(rev, "HEAD"))
+                       rev = oid_to_hex_r(rev_oid, &new_branch_info->commit->object.oid);
 
                if (opts->checkout_index && opts->checkout_worktree)
                        patch_mode = "--patch=checkout";
@@ -481,7 +494,7 @@ static int checkout_paths(const struct checkout_opts *opts,
                else
                        BUG("either flag must have been set, worktree=%d, index=%d",
                            opts->checkout_worktree, opts->checkout_index);
-               return run_add_interactive(new_branch_info->name, patch_mode, &opts->pathspec);
+               return run_add_interactive(rev, patch_mode, &opts->pathspec);
        }
 
        repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
@@ -1029,7 +1042,7 @@ static void orphaned_commit_warning(struct commit *old_commit, struct commit *ne
                describe_detached_head(_("Previous HEAD position was"), old_commit);
 
        /* Clean up objects used, as they will be reused. */
-       clear_commit_marks_all(ALL_REV_FLAGS);
+       repo_clear_commit_marks(the_repository, ALL_REV_FLAGS);
 }
 
 static int switch_branches(const struct checkout_opts *opts,
@@ -1093,11 +1106,16 @@ static int switch_branches(const struct checkout_opts *opts,
 
 static int git_checkout_config(const char *var, const char *value, void *cb)
 {
+       struct checkout_opts *opts = cb;
+
        if (!strcmp(var, "diff.ignoresubmodules")) {
-               struct checkout_opts *opts = cb;
                handle_ignore_submodules_arg(&opts->diff_options, value);
                return 0;
        }
+       if (!strcmp(var, "checkout.guess")) {
+               opts->dwim_new_local_branch = git_config_bool(var, value);
+               return 0;
+       }
 
        if (starts_with(var, "submodule."))
                return git_default_submodule_config(var, value, NULL);
index 391aa41075ee75fe20a7b9a4d79e73cd90e10375..e335734b4cfd32560b5d0cfa8a60426fa5c9514c 100644 (file)
@@ -53,6 +53,7 @@ static int option_shallow_submodules;
 static int deepen;
 static char *option_template, *option_depth, *option_since;
 static char *option_origin = NULL;
+static char *remote_name = NULL;
 static char *option_branch = NULL;
 static struct string_list option_not = STRING_LIST_INIT_NODUP;
 static const char *real_git_dir;
@@ -721,7 +722,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
                if (!option_bare) {
                        update_ref(msg, "HEAD", &our->old_oid, NULL, 0,
                                   UPDATE_REFS_DIE_ON_ERR);
-                       install_branch_config(0, head, option_origin, our->name);
+                       install_branch_config(0, head, remote_name, our->name);
                }
        } else if (our) {
                struct commit *c = lookup_commit_reference(the_repository,
@@ -851,8 +852,26 @@ static int checkout(int submodule_progress)
        return err;
 }
 
+static int git_clone_config(const char *k, const char *v, void *cb)
+{
+       if (!strcmp(k, "clone.defaultremotename")) {
+               free(remote_name);
+               remote_name = xstrdup(v);
+       }
+       return git_default_config(k, v, cb);
+}
+
 static int write_one_config(const char *key, const char *value, void *data)
 {
+       /*
+        * give git_clone_config a chance to write config values back to the
+        * environment, since git_config_set_multivar_gently only deals with
+        * config-file writes
+        */
+       int apply_failed = git_clone_config(key, value, data);
+       if (apply_failed)
+               return apply_failed;
+
        return git_config_set_multivar_gently(key,
                                              value ? value : "true",
                                              CONFIG_REGEX_NONE, 0);
@@ -905,12 +924,12 @@ static void write_refspec_config(const char *src_ref_prefix,
                }
                /* Configure the remote */
                if (value.len) {
-                       strbuf_addf(&key, "remote.%s.fetch", option_origin);
+                       strbuf_addf(&key, "remote.%s.fetch", remote_name);
                        git_config_set_multivar(key.buf, value.buf, "^$", 0);
                        strbuf_reset(&key);
 
                        if (option_mirror) {
-                               strbuf_addf(&key, "remote.%s.mirror", option_origin);
+                               strbuf_addf(&key, "remote.%s.mirror", remote_name);
                                git_config_set(key.buf, "true");
                                strbuf_reset(&key);
                        }
@@ -963,6 +982,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        struct strvec ref_prefixes = STRVEC_INIT;
 
        packet_trace_identity("clone");
+
+       git_config(git_clone_config, NULL);
+
        argc = parse_options(argc, argv, prefix, builtin_clone_options,
                             builtin_clone_usage, 0);
 
@@ -991,9 +1013,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                option_no_checkout = 1;
        }
 
-       if (!option_origin)
-               option_origin = "origin";
-
        repo_name = argv[0];
 
        path = get_repo_path(repo_name, &is_bundle);
@@ -1124,9 +1143,30 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        if (real_git_dir)
                git_dir = real_git_dir;
 
+       /*
+        * additional config can be injected with -c, make sure it's included
+        * after init_db, which clears the entire config environment.
+        */
        write_config(&option_config);
 
-       git_config(git_default_config, NULL);
+       /*
+        * re-read config after init_db and write_config to pick up any config
+        * injected by --template and --config, respectively.
+        */
+       git_config(git_clone_config, NULL);
+
+       /*
+        * apply the remote name provided by --origin only after this second
+        * call to git_config, to ensure it overrides all config-based values.
+        */
+       if (option_origin != NULL)
+               remote_name = xstrdup(option_origin);
+
+       if (remote_name == NULL)
+               remote_name = xstrdup("origin");
+
+       if (!valid_remote_name(remote_name))
+               die(_("'%s' is not a valid remote name"), remote_name);
 
        if (option_bare) {
                if (option_mirror)
@@ -1135,15 +1175,15 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
                git_config_set("core.bare", "true");
        } else {
-               strbuf_addf(&branch_top, "refs/remotes/%s/", option_origin);
+               strbuf_addf(&branch_top, "refs/remotes/%s/", remote_name);
        }
 
-       strbuf_addf(&key, "remote.%s.url", option_origin);
+       strbuf_addf(&key, "remote.%s.url", remote_name);
        git_config_set(key.buf, repo);
        strbuf_reset(&key);
 
        if (option_no_tags) {
-               strbuf_addf(&key, "remote.%s.tagOpt", option_origin);
+               strbuf_addf(&key, "remote.%s.tagOpt", remote_name);
                git_config_set(key.buf, "--no-tags");
                strbuf_reset(&key);
        }
@@ -1154,7 +1194,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        if (option_sparse_checkout && git_sparse_checkout_init(dir))
                return 1;
 
-       remote = remote_get(option_origin);
+       remote = remote_get(remote_name);
 
        refspec_appendf(&remote->fetch, "+%s*:%s*", src_ref_prefix,
                        branch_top.buf);
@@ -1253,8 +1293,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                                break;
                        }
 
-               if (!is_local && !complete_refs_before_fetch)
-                       transport_fetch_refs(transport, mapped_refs);
+               if (!is_local && !complete_refs_before_fetch) {
+                       err = transport_fetch_refs(transport, mapped_refs);
+                       if (err)
+                               goto cleanup;
+               }
 
                remote_head = find_ref_by_name(refs, "HEAD");
                remote_head_points_at =
@@ -1266,7 +1309,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
                        if (!our_head_points_at)
                                die(_("Remote branch %s not found in upstream %s"),
-                                   option_branch, option_origin);
+                                   option_branch, remote_name);
                }
                else
                        our_head_points_at = remote_head_points_at;
@@ -1274,7 +1317,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        else {
                if (option_branch)
                        die(_("Remote branch %s not found in upstream %s"),
-                                       option_branch, option_origin);
+                                       option_branch, remote_name);
 
                warning(_("You appear to have cloned an empty repository."));
                mapped_refs = NULL;
@@ -1283,10 +1326,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                remote_head = NULL;
                option_no_checkout = 1;
                if (!option_bare) {
-                       const char *branch = git_default_branch_name();
+                       const char *branch = git_default_branch_name(0);
                        char *ref = xstrfmt("refs/heads/%s", branch);
 
-                       install_branch_config(0, branch, option_origin, ref);
+                       install_branch_config(0, branch, remote_name, ref);
                        free(ref);
                }
        }
@@ -1295,12 +1338,15 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                        remote_head_points_at, &branch_top);
 
        if (filter_options.choice)
-               partial_clone_register(option_origin, &filter_options);
+               partial_clone_register(remote_name, &filter_options);
 
        if (is_local)
                clone_local(path, git_dir);
-       else if (refs && complete_refs_before_fetch)
-               transport_fetch_refs(transport, mapped_refs);
+       else if (refs && complete_refs_before_fetch) {
+               err = transport_fetch_refs(transport, mapped_refs);
+               if (err)
+                       goto cleanup;
+       }
 
        update_remote_refs(refs, mapped_refs, remote_head_points_at,
                           branch_top.buf, reflog_msg.buf, transport,
@@ -1327,6 +1373,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        junk_mode = JUNK_LEAVE_REPO;
        err = checkout(submodule_progress);
 
+cleanup:
+       free(remote_name);
        strbuf_release(&reflog_msg);
        strbuf_release(&branch_top);
        strbuf_release(&key);
index 1dfd799ec5185928f327d2cdd3156b41d6c0199e..505fe60956db385d94aa7fd14e016a3dfeb9345c 100644 (file)
@@ -1507,7 +1507,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
                OPT_STRING(0, "fixup", &fixup_message, N_("commit"), N_("use autosquash formatted message to fixup specified commit")),
                OPT_STRING(0, "squash", &squash_message, N_("commit"), N_("use autosquash formatted message to squash specified commit")),
                OPT_BOOL(0, "reset-author", &renew_authorship, N_("the commit is authored by me now (used with -C/-c/--amend)")),
-               OPT_BOOL('s', "signoff", &signoff, N_("add Signed-off-by:")),
+               OPT_BOOL('s', "signoff", &signoff, N_("add a Signed-off-by trailer")),
                OPT_FILENAME('t', "template", &template_file, N_("use specified template file")),
                OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")),
                OPT_CLEANUP(&cleanup_arg),
index 963d65fd3fc13c9859b57a6008419469a7f63498..f71fa39b38eecd558f8d246b0a20cfa84fea00cc 100644 (file)
@@ -14,6 +14,7 @@ static const char *const builtin_config_usage[] = {
 
 static char *key;
 static regex_t *key_regexp;
+static const char *value_pattern;
 static regex_t *regexp;
 static int show_keys;
 static int omit_values;
@@ -34,6 +35,7 @@ static int respect_includes_opt = -1;
 static struct config_options config_options;
 static int show_origin;
 static int show_scope;
+static int fixed_value;
 
 #define ACTION_GET (1<<0)
 #define ACTION_GET_ALL (1<<1)
@@ -133,17 +135,18 @@ static struct option builtin_config_options[] = {
        OPT_STRING('f', "file", &given_config_source.file, N_("file"), N_("use given config file")),
        OPT_STRING(0, "blob", &given_config_source.blob, N_("blob-id"), N_("read config from given blob object")),
        OPT_GROUP(N_("Action")),
-       OPT_BIT(0, "get", &actions, N_("get value: name [value-regex]"), ACTION_GET),
-       OPT_BIT(0, "get-all", &actions, N_("get all values: key [value-regex]"), ACTION_GET_ALL),
-       OPT_BIT(0, "get-regexp", &actions, N_("get values for regexp: name-regex [value-regex]"), ACTION_GET_REGEXP),
+       OPT_BIT(0, "get", &actions, N_("get value: name [value-pattern]"), ACTION_GET),
+       OPT_BIT(0, "get-all", &actions, N_("get all values: key [value-pattern]"), ACTION_GET_ALL),
+       OPT_BIT(0, "get-regexp", &actions, N_("get values for regexp: name-regex [value-pattern]"), ACTION_GET_REGEXP),
        OPT_BIT(0, "get-urlmatch", &actions, N_("get value specific for the URL: section[.var] URL"), ACTION_GET_URLMATCH),
-       OPT_BIT(0, "replace-all", &actions, N_("replace all matching variables: name value [value_regex]"), ACTION_REPLACE_ALL),
+       OPT_BIT(0, "replace-all", &actions, N_("replace all matching variables: name value [value-pattern]"), ACTION_REPLACE_ALL),
        OPT_BIT(0, "add", &actions, N_("add a new variable: name value"), ACTION_ADD),
-       OPT_BIT(0, "unset", &actions, N_("remove a variable: name [value-regex]"), ACTION_UNSET),
-       OPT_BIT(0, "unset-all", &actions, N_("remove all matches: name [value-regex]"), ACTION_UNSET_ALL),
+       OPT_BIT(0, "unset", &actions, N_("remove a variable: name [value-pattern]"), ACTION_UNSET),
+       OPT_BIT(0, "unset-all", &actions, N_("remove all matches: name [value-pattern]"), ACTION_UNSET_ALL),
        OPT_BIT(0, "rename-section", &actions, N_("rename section: old-name new-name"), ACTION_RENAME_SECTION),
        OPT_BIT(0, "remove-section", &actions, N_("remove a section: name"), ACTION_REMOVE_SECTION),
        OPT_BIT('l', "list", &actions, N_("list all"), ACTION_LIST),
+       OPT_BOOL(0, "fixed-value", &fixed_value, N_("use string equality when comparing values to 'value-pattern'")),
        OPT_BIT('e', "edit", &actions, N_("open an editor"), ACTION_EDIT),
        OPT_BIT(0, "get-color", &actions, N_("find the color configured: slot [default]"), ACTION_GET_COLOR),
        OPT_BIT(0, "get-colorbool", &actions, N_("find the color setting: slot [stdout-is-tty]"), ACTION_GET_COLORBOOL),
@@ -296,6 +299,8 @@ static int collect_config(const char *key_, const char *value_, void *cb)
                return 0;
        if (use_key_regexp && regexec(key_regexp, key_, 0, NULL, 0))
                return 0;
+       if (fixed_value && strcmp(value_pattern, (value_?value_:"")))
+               return 0;
        if (regexp != NULL &&
            (do_not_match ^ !!regexec(regexp, (value_?value_:""), 0, NULL, 0)))
                return 0;
@@ -306,7 +311,7 @@ static int collect_config(const char *key_, const char *value_, void *cb)
        return format_config(&values->items[values->nr++], key_, value_);
 }
 
-static int get_value(const char *key_, const char *regex_)
+static int get_value(const char *key_, const char *regex_, unsigned flags)
 {
        int ret = CONFIG_GENERIC_ERROR;
        struct strbuf_list values = {NULL};
@@ -343,7 +348,9 @@ static int get_value(const char *key_, const char *regex_)
                }
        }
 
-       if (regex_) {
+       if (regex_ && (flags & CONFIG_FLAGS_FIXED_VALUE))
+               value_pattern = regex_;
+       else if (regex_) {
                if (regex_[0] == '!') {
                        do_not_match = 1;
                        regex_++;
@@ -631,6 +638,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 {
        int nongit = !startup_info->have_repository;
        char *value;
+       int flags = 0;
 
        given_config_source.file = xstrdup_or_null(getenv(CONFIG_ENVIRONMENT));
 
@@ -766,6 +774,42 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                usage_builtin_config();
        }
 
+       /* check usage of --fixed-value */
+       if (fixed_value) {
+               int allowed_usage = 0;
+
+               switch (actions) {
+               /* git config --get <name> <value-pattern> */
+               case ACTION_GET:
+               /* git config --get-all <name> <value-pattern> */
+               case ACTION_GET_ALL:
+               /* git config --get-regexp <name-pattern> <value-pattern> */
+               case ACTION_GET_REGEXP:
+               /* git config --unset <name> <value-pattern> */
+               case ACTION_UNSET:
+               /* git config --unset-all <name> <value-pattern> */
+               case ACTION_UNSET_ALL:
+                       allowed_usage = argc > 1 && !!argv[1];
+                       break;
+
+               /* git config <name> <value> <value-pattern> */
+               case ACTION_SET_ALL:
+               /* git config --replace-all <name> <value> <value-pattern> */
+               case ACTION_REPLACE_ALL:
+                       allowed_usage = argc > 2 && !!argv[2];
+                       break;
+
+               /* other options don't allow --fixed-value */
+               }
+
+               if (!allowed_usage) {
+                       error(_("--fixed-value only applies with 'value-pattern'"));
+                       usage_builtin_config();
+               }
+
+               flags |= CONFIG_FLAGS_FIXED_VALUE;
+       }
+
        if (actions & PAGING_ACTIONS)
                setup_auto_pager("config", 1);
 
@@ -827,7 +871,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                value = normalize_value(argv[0], argv[1]);
                UNLEAK(value);
                return git_config_set_multivar_in_file_gently(given_config_source.file,
-                                                             argv[0], value, argv[2], 0);
+                                                             argv[0], value, argv[2],
+                                                             flags);
        }
        else if (actions == ACTION_ADD) {
                check_write();
@@ -836,7 +881,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                UNLEAK(value);
                return git_config_set_multivar_in_file_gently(given_config_source.file,
                                                              argv[0], value,
-                                                             CONFIG_REGEX_NONE, 0);
+                                                             CONFIG_REGEX_NONE,
+                                                             flags);
        }
        else if (actions == ACTION_REPLACE_ALL) {
                check_write();
@@ -844,23 +890,24 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                value = normalize_value(argv[0], argv[1]);
                UNLEAK(value);
                return git_config_set_multivar_in_file_gently(given_config_source.file,
-                                                             argv[0], value, argv[2], 1);
+                                                             argv[0], value, argv[2],
+                                                             flags | CONFIG_FLAGS_MULTI_REPLACE);
        }
        else if (actions == ACTION_GET) {
                check_argc(argc, 1, 2);
-               return get_value(argv[0], argv[1]);
+               return get_value(argv[0], argv[1], flags);
        }
        else if (actions == ACTION_GET_ALL) {
                do_all = 1;
                check_argc(argc, 1, 2);
-               return get_value(argv[0], argv[1]);
+               return get_value(argv[0], argv[1], flags);
        }
        else if (actions == ACTION_GET_REGEXP) {
                show_keys = 1;
                use_key_regexp = 1;
                do_all = 1;
                check_argc(argc, 1, 2);
-               return get_value(argv[0], argv[1]);
+               return get_value(argv[0], argv[1], flags);
        }
        else if (actions == ACTION_GET_URLMATCH) {
                check_argc(argc, 2, 2);
@@ -871,7 +918,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                check_argc(argc, 1, 2);
                if (argc == 2)
                        return git_config_set_multivar_in_file_gently(given_config_source.file,
-                                                                     argv[0], NULL, argv[1], 0);
+                                                                     argv[0], NULL, argv[1],
+                                                                     flags);
                else
                        return git_config_set_in_file_gently(given_config_source.file,
                                                             argv[0], NULL);
@@ -880,7 +928,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                check_write();
                check_argc(argc, 1, 2);
                return git_config_set_multivar_in_file_gently(given_config_source.file,
-                                                             argv[0], NULL, argv[1], 1);
+                                                             argv[0], NULL, argv[1],
+                                                             flags | CONFIG_FLAGS_MULTI_REPLACE);
        }
        else if (actions == ACTION_RENAME_SECTION) {
                int ret;
index 5331ab151a6f6052dc532ab32875f864070e3b72..ae3c1ba75fe60306f8819b1038660e73749aa83b 100644 (file)
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "config.h"
 #include "lockfile.h"
 #include "credential.h"
 #include "string-list.h"
@@ -58,8 +59,11 @@ static void print_line(struct strbuf *buf)
 static void rewrite_credential_file(const char *fn, struct credential *c,
                                    struct strbuf *extra)
 {
-       if (hold_lock_file_for_update(&credential_lock, fn, 0) < 0)
-               die_errno("unable to get credential storage lock");
+       int timeout_ms = 1000;
+
+       git_config_get_int("credentialstore.locktimeoutms", &timeout_ms);
+       if (hold_lock_file_for_update_timeout(&credential_lock, fn, 0, timeout_ms) < 0)
+               die_errno(_("unable to get credential storage lock in %d ms"), timeout_ms);
        if (extra)
                print_line(extra);
        parse_credential_file(fn, c, NULL, print_line);
index 879acfbcda75141d3022e9b285e191977a06ba3d..d75dcdc64aa3c3da303b117ba505ba683c1afcde 100644 (file)
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "credential.h"
 #include "builtin.h"
+#include "config.h"
 
 static const char usage_msg[] =
        "git credential [fill|approve|reject]";
@@ -10,6 +11,8 @@ int cmd_credential(int argc, const char **argv, const char *prefix)
        const char *op;
        struct credential c = CREDENTIAL_INIT;
 
+       git_config(git_default_config, NULL);
+
        if (argc != 2 || !strcmp(argv[1], "-h"))
                usage(usage_msg);
        op = argv[1];
index 93ec6424234c65f486dcfca724c77a48e5e91f91..7f5281c46168ed72505fe9ee3cfa200c200b4cb1 100644 (file)
@@ -15,7 +15,7 @@ COMMON_DIFF_OPTIONS_HELP;
 int cmd_diff_index(int argc, const char **argv, const char *prefix)
 {
        struct rev_info rev;
-       int cached = 0;
+       unsigned int option = 0;
        int i;
        int result;
 
@@ -32,7 +32,9 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
                const char *arg = argv[i];
 
                if (!strcmp(arg, "--cached"))
-                       cached = 1;
+                       option |= DIFF_INDEX_CACHED;
+               else if (!strcmp(arg, "--merge-base"))
+                       option |= DIFF_INDEX_MERGE_BASE;
                else
                        usage(diff_cache_usage);
        }
@@ -46,7 +48,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
        if (rev.pending.nr != 1 ||
            rev.max_count != -1 || rev.min_age != -1 || rev.max_age != -1)
                usage(diff_cache_usage);
-       if (!cached) {
+       if (!(option & DIFF_INDEX_CACHED)) {
                setup_work_tree();
                if (read_cache_preload(&rev.diffopt.pathspec) < 0) {
                        perror("read_cache_preload");
@@ -56,7 +58,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
                perror("read_cache");
                return -1;
        }
-       result = run_diff_index(&rev, cached);
+       result = run_diff_index(&rev, option);
        UNLEAK(rev);
        return diff_result_code(&rev.diffopt, result);
 }
index 802363d0a2295f855828121a5b99184d6475b74f..9fc95e959f0e0dba69cc1f96597bb77f30997d1e 100644 (file)
@@ -111,6 +111,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
        struct setup_revision_opt s_r_opt;
        struct userformat_want w;
        int read_stdin = 0;
+       int merge_base = 0;
 
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage(diff_tree_usage);
@@ -143,9 +144,18 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
                        read_stdin = 1;
                        continue;
                }
+               if (!strcmp(arg, "--merge-base")) {
+                       merge_base = 1;
+                       continue;
+               }
                usage(diff_tree_usage);
        }
 
+       if (read_stdin && merge_base)
+               die(_("--stdin and --merge-base are mutually exclusive"));
+       if (merge_base && opt->pending.nr != 2)
+               die(_("--merge-base only works with two commits"));
+
        /*
         * NOTE!  We expect "a..b" to expand to "^a b" but it is
         * perfectly valid for revision range parser to yield "b ^a",
@@ -165,7 +175,12 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
        case 2:
                tree1 = opt->pending.objects[0].item;
                tree2 = opt->pending.objects[1].item;
-               if (tree2->flags & UNINTERESTING) {
+               if (merge_base) {
+                       struct object_id oid;
+
+                       diff_get_merge_base(opt, &oid);
+                       tree1 = lookup_object(the_repository, &oid);
+               } else if (tree2->flags & UNINTERESTING) {
                        SWAP(tree2, tree1);
                }
                diff_tree_oid(&tree1->oid, &tree2->oid, "", &opt->diffopt);
index cd4083fed96ecda432cf166ba12cfaf58b4b609b..780c33877f85b63c8ecf6bffbe6f7e2c5e91f5aa 100644 (file)
@@ -26,7 +26,7 @@
 static const char builtin_diff_usage[] =
 "git diff [<options>] [<commit>] [--] [<path>...]\n"
 "   or: git diff [<options>] --cached [<commit>] [--] [<path>...]\n"
-"   or: git diff [<options>] <commit> [<commit>...] <commit> [--] [<path>...]\n"
+"   or: git diff [<options>] <commit> [--merge-base] [<commit>...] <commit> [--] [<path>...]\n"
 "   or: git diff [<options>] <commit>...<commit>] [--] [<path>...]\n"
 "   or: git diff [<options>] <blob> <blob>]\n"
 "   or: git diff [<options>] --no-index [--] <path> <path>]\n"
@@ -134,11 +134,13 @@ static int builtin_diff_blobs(struct rev_info *revs,
 static int builtin_diff_index(struct rev_info *revs,
                              int argc, const char **argv)
 {
-       int cached = 0;
+       unsigned int option = 0;
        while (1 < argc) {
                const char *arg = argv[1];
                if (!strcmp(arg, "--cached") || !strcmp(arg, "--staged"))
-                       cached = 1;
+                       option |= DIFF_INDEX_CACHED;
+               else if (!strcmp(arg, "--merge-base"))
+                       option |= DIFF_INDEX_MERGE_BASE;
                else
                        usage(builtin_diff_usage);
                argv++; argc--;
@@ -151,7 +153,7 @@ static int builtin_diff_index(struct rev_info *revs,
            revs->max_count != -1 || revs->min_age != -1 ||
            revs->max_age != -1)
                usage(builtin_diff_usage);
-       if (!cached) {
+       if (!(option & DIFF_INDEX_CACHED)) {
                setup_work_tree();
                if (read_cache_preload(&revs->diffopt.pathspec) < 0) {
                        perror("read_cache_preload");
@@ -161,7 +163,7 @@ static int builtin_diff_index(struct rev_info *revs,
                perror("read_cache");
                return -1;
        }
-       return run_diff_index(revs, cached);
+       return run_diff_index(revs, option);
 }
 
 static int builtin_diff_tree(struct rev_info *revs,
@@ -170,19 +172,34 @@ static int builtin_diff_tree(struct rev_info *revs,
                             struct object_array_entry *ent1)
 {
        const struct object_id *(oid[2]);
-       int swap = 0;
+       struct object_id mb_oid;
+       int merge_base = 0;
 
-       if (argc > 1)
-               usage(builtin_diff_usage);
+       while (1 < argc) {
+               const char *arg = argv[1];
+               if (!strcmp(arg, "--merge-base"))
+                       merge_base = 1;
+               else
+                       usage(builtin_diff_usage);
+               argv++; argc--;
+       }
 
-       /*
-        * We saw two trees, ent0 and ent1.  If ent1 is uninteresting,
-        * swap them.
-        */
-       if (ent1->item->flags & UNINTERESTING)
-               swap = 1;
-       oid[swap] = &ent0->item->oid;
-       oid[1 - swap] = &ent1->item->oid;
+       if (merge_base) {
+               diff_get_merge_base(revs, &mb_oid);
+               oid[0] = &mb_oid;
+               oid[1] = &revs->pending.objects[1].item->oid;
+       } else {
+               int swap = 0;
+
+               /*
+                * We saw two trees, ent0 and ent1.  If ent1 is uninteresting,
+                * swap them.
+                */
+               if (ent1->item->flags & UNINTERESTING)
+                       swap = 1;
+               oid[swap] = &ent0->item->oid;
+               oid[1 - swap] = &ent1->item->oid;
+       }
        diff_tree_oid(oid[0], oid[1], "", &revs->diffopt);
        log_tree_diff_flush(revs);
        return 0;
index 7ac432b88193e7468048821a372dae8c2a81919a..6e18e623fddfbfb33a3de9f4df8cabbbc048ed51 100644 (file)
@@ -342,7 +342,10 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
        const char *workdir, *tmp;
        int ret = 0, i;
        FILE *fp;
-       struct hashmap working_tree_dups, submodules, symlinks2;
+       struct hashmap working_tree_dups = HASHMAP_INIT(working_tree_entry_cmp,
+                                                       NULL);
+       struct hashmap submodules = HASHMAP_INIT(pair_cmp, NULL);
+       struct hashmap symlinks2 = HASHMAP_INIT(pair_cmp, NULL);
        struct hashmap_iter iter;
        struct pair_entry *entry;
        struct index_state wtindex;
@@ -383,10 +386,6 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
        rdir_len = rdir.len;
        wtdir_len = wtdir.len;
 
-       hashmap_init(&working_tree_dups, working_tree_entry_cmp, NULL, 0);
-       hashmap_init(&submodules, pair_cmp, NULL, 0);
-       hashmap_init(&symlinks2, pair_cmp, NULL, 0);
-
        child.no_stdin = 1;
        child.git_cmd = 1;
        child.use_shell = 0;
index d2e33f500521bfb5f175ac407875b40a2ca22ee8..0a60356b06eea06c70ae6560769363264000fca3 100644 (file)
@@ -923,7 +923,6 @@ static struct commit *get_commit(struct rev_cmdline_entry *e, char *full_name)
                if (!tag)
                        die("Tag %s points nowhere?", e->name);
                return (struct commit *)tag;
-               break;
        }
        default:
                return NULL;
index 1bf50a73dc3597394ecf73e5a786fe217e7ef633..dd4d09cecebd57a6d89c3b8224a5435f26c5a5d2 100644 (file)
@@ -150,7 +150,7 @@ struct recent_command {
        char *buf;
 };
 
-typedef void (*mark_set_inserter_t)(struct mark_set *s, struct object_id *oid, uintmax_t mark);
+typedef void (*mark_set_inserter_t)(struct mark_set **s, struct object_id *oid, uintmax_t mark);
 typedef void (*each_mark_fn_t)(uintmax_t mark, void *obj, void *cbp);
 
 /* Configured limits on output */
@@ -526,13 +526,15 @@ static unsigned int hc_str(const char *s, size_t len)
        return r;
 }
 
-static void insert_mark(struct mark_set *s, uintmax_t idnum, struct object_entry *oe)
+static void insert_mark(struct mark_set **top, uintmax_t idnum, struct object_entry *oe)
 {
+       struct mark_set *s = *top;
+
        while ((idnum >> s->shift) >= 1024) {
                s = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct mark_set));
-               s->shift = marks->shift + 10;
-               s->data.sets[0] = marks;
-               marks = s;
+               s->shift = (*top)->shift + 10;
+               s->data.sets[0] = *top;
+               *top = s;
        }
        while (s->shift) {
                uintmax_t i = idnum >> s->shift;
@@ -944,7 +946,7 @@ static int store_object(
 
        e = insert_object(&oid);
        if (mark)
-               insert_mark(marks, mark, e);
+               insert_mark(&marks, mark, e);
        if (e->idx.offset) {
                duplicate_count_by_type[type]++;
                return 1;
@@ -1142,7 +1144,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
        e = insert_object(&oid);
 
        if (mark)
-               insert_mark(marks, mark, e);
+               insert_mark(&marks, mark, e);
 
        if (e->idx.offset) {
                duplicate_count_by_type[OBJ_BLOB]++;
@@ -1717,7 +1719,7 @@ static void dump_marks(void)
        }
 }
 
-static void insert_object_entry(struct mark_set *s, struct object_id *oid, uintmax_t mark)
+static void insert_object_entry(struct mark_set **s, struct object_id *oid, uintmax_t mark)
 {
        struct object_entry *e;
        e = find_object(oid);
@@ -1734,12 +1736,12 @@ static void insert_object_entry(struct mark_set *s, struct object_id *oid, uintm
        insert_mark(s, mark, e);
 }
 
-static void insert_oid_entry(struct mark_set *s, struct object_id *oid, uintmax_t mark)
+static void insert_oid_entry(struct mark_set **s, struct object_id *oid, uintmax_t mark)
 {
        insert_mark(s, mark, xmemdupz(oid, sizeof(*oid)));
 }
 
-static void read_mark_file(struct mark_set *s, FILE *f, mark_set_inserter_t inserter)
+static void read_mark_file(struct mark_set **s, FILE *f, mark_set_inserter_t inserter)
 {
        char line[512];
        while (fgets(line, sizeof(line), f)) {
@@ -1772,7 +1774,7 @@ static void read_marks(void)
                goto done; /* Marks file does not exist */
        else
                die_errno("cannot read '%s'", import_marks_file);
-       read_mark_file(marks, f, insert_object_entry);
+       read_mark_file(&marks, f, insert_object_entry);
        fclose(f);
 done:
        import_marks_file_done = 1;
@@ -3228,7 +3230,7 @@ static void parse_alias(void)
                die(_("Expected 'to' command, got %s"), command_buf.buf);
        e = find_object(&b.oid);
        assert(e);
-       insert_mark(marks, next_mark, e);
+       insert_mark(&marks, next_mark, e);
 }
 
 static char* make_fast_import_path(const char *path)
@@ -3321,13 +3323,14 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)
        *f = '\0';
        f++;
        ms = xcalloc(1, sizeof(*ms));
-       string_list_insert(list, s)->util = ms;
 
        fp = fopen(f, "r");
        if (!fp)
                die_errno("cannot read '%s'", f);
-       read_mark_file(ms, fp, insert_oid_entry);
+       read_mark_file(&ms, fp, insert_oid_entry);
        fclose(fp);
+
+       string_list_insert(list, s)->util = ms;
 }
 
 static int parse_one_option(const char *option)
@@ -3396,7 +3399,6 @@ static int parse_one_feature(const char *feature, int from_stream)
                option_rewrite_submodules(arg, &sub_marks_to);
        } else if (skip_prefix(feature, "rewrite-submodules-from=", &arg)) {
                option_rewrite_submodules(arg, &sub_marks_from);
-       } else if (skip_prefix(feature, "rewrite-submodules-from=", &arg)) {
        } else if (!strcmp(feature, "get-mark")) {
                ; /* Don't die - this feature is supported */
        } else if (!strcmp(feature, "cat-blob")) {
index f9c3c49f14d9cd508102405f99d6010c21691541..ecf8537605077a8485e59d6dbba6d4d447642910 100644 (file)
@@ -393,7 +393,7 @@ static void find_non_local_tags(const struct ref *refs,
                item = refname_hash_add(&remote_refs, ref->name, &ref->old_oid);
                string_list_insert(&remote_refs_list, ref->name);
        }
-       hashmap_free_entries(&existing_refs, struct refname_hash_entry, ent);
+       hashmap_clear_and_free(&existing_refs, struct refname_hash_entry, ent);
 
        /*
         * We may have a final lightweight tag that needs to be
@@ -428,7 +428,7 @@ static void find_non_local_tags(const struct ref *refs,
                **tail = rm;
                *tail = &rm->next;
        }
-       hashmap_free_entries(&remote_refs, struct refname_hash_entry, ent);
+       hashmap_clear_and_free(&remote_refs, struct refname_hash_entry, ent);
        string_list_clear(&remote_refs_list, 0);
        oidset_clear(&fetch_oids);
 }
@@ -573,7 +573,7 @@ static struct ref *get_ref_map(struct remote *remote,
                }
        }
        if (existing_refs_populated)
-               hashmap_free_entries(&existing_refs, struct refname_hash_entry, ent);
+               hashmap_clear_and_free(&existing_refs, struct refname_hash_entry, ent);
 
        return ref_map;
 }
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
new file mode 100644 (file)
index 0000000..5bba623
--- /dev/null
@@ -0,0 +1,58 @@
+#include "cache.h"
+#include "config.h"
+#include "builtin.h"
+#include "parse-options.h"
+#include "run-command.h"
+#include "string-list.h"
+
+static const char * const for_each_repo_usage[] = {
+       N_("git for-each-repo --config=<config> <command-args>"),
+       NULL
+};
+
+static int run_command_on_repo(const char *path,
+                              void *cbdata)
+{
+       int i;
+       struct child_process child = CHILD_PROCESS_INIT;
+       struct strvec *args = (struct strvec *)cbdata;
+
+       child.git_cmd = 1;
+       strvec_pushl(&child.args, "-C", path, NULL);
+
+       for (i = 0; i < args->nr; i++)
+               strvec_push(&child.args, args->v[i]);
+
+       return run_command(&child);
+}
+
+int cmd_for_each_repo(int argc, const char **argv, const char *prefix)
+{
+       static const char *config_key = NULL;
+       int i, result = 0;
+       const struct string_list *values;
+       struct strvec args = STRVEC_INIT;
+
+       const struct option options[] = {
+               OPT_STRING(0, "config", &config_key, N_("config"),
+                          N_("config key storing a list of repository paths")),
+               OPT_END()
+       };
+
+       argc = parse_options(argc, argv, prefix, options, for_each_repo_usage,
+                            PARSE_OPT_STOP_AT_NON_OPTION);
+
+       if (!config_key)
+               die(_("missing --config=<config>"));
+
+       for (i = 0; i < argc; i++)
+               strvec_push(&args, argv[i]);
+
+       values = repo_config_get_value_multi(the_repository,
+                                            config_key);
+
+       for (i = 0; !result && i < values->nr; i++)
+               result = run_command_on_repo(values->items[i].string, &args);
+
+       return result;
+}
index 090959350e06c0821889cab4d3a217ef814e5618..b57fda49240ecae6beb9889711169e5a6590e3af 100644 (file)
@@ -29,6 +29,9 @@
 #include "tree.h"
 #include "promisor-remote.h"
 #include "refs.h"
+#include "remote.h"
+#include "object-store.h"
+#include "exec-cmd.h"
 
 #define FAILED_RUN "failed to run %s"
 
@@ -531,7 +534,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        const char *name;
        pid_t pid;
        int daemonized = 0;
-       int keep_base_pack = -1;
+       int keep_largest_pack = -1;
        timestamp_t dummy;
 
        struct option builtin_gc_options[] = {
@@ -545,7 +548,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
                OPT_BOOL_F(0, "force", &force,
                           N_("force running gc even if there may be another gc running"),
                           PARSE_OPT_NOCOMPLETE),
-               OPT_BOOL(0, "keep-largest-pack", &keep_base_pack,
+               OPT_BOOL(0, "keep-largest-pack", &keep_largest_pack,
                         N_("repack all other packs except the largest pack")),
                OPT_END()
        };
@@ -622,8 +625,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        } else {
                struct string_list keep_pack = STRING_LIST_INIT_NODUP;
 
-               if (keep_base_pack != -1) {
-                       if (keep_base_pack)
+               if (keep_largest_pack != -1) {
+                       if (keep_largest_pack)
                                find_base_packs(&keep_pack, 0);
                } else if (big_pack_threshold) {
                        find_base_packs(&keep_pack, big_pack_threshold);
@@ -701,14 +704,51 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        return 0;
 }
 
-static const char * const builtin_maintenance_run_usage[] = {
-       N_("git maintenance run [--auto] [--[no-]quiet] [--task=<task>]"),
+static const char *const builtin_maintenance_run_usage[] = {
+       N_("git maintenance run [--auto] [--[no-]quiet] [--task=<task>] [--schedule]"),
        NULL
 };
 
+enum schedule_priority {
+       SCHEDULE_NONE = 0,
+       SCHEDULE_WEEKLY = 1,
+       SCHEDULE_DAILY = 2,
+       SCHEDULE_HOURLY = 3,
+};
+
+static enum schedule_priority parse_schedule(const char *value)
+{
+       if (!value)
+               return SCHEDULE_NONE;
+       if (!strcasecmp(value, "hourly"))
+               return SCHEDULE_HOURLY;
+       if (!strcasecmp(value, "daily"))
+               return SCHEDULE_DAILY;
+       if (!strcasecmp(value, "weekly"))
+               return SCHEDULE_WEEKLY;
+       return SCHEDULE_NONE;
+}
+
+static int maintenance_opt_schedule(const struct option *opt, const char *arg,
+                                   int unset)
+{
+       enum schedule_priority *priority = opt->value;
+
+       if (unset)
+               die(_("--no-schedule is not allowed"));
+
+       *priority = parse_schedule(arg);
+
+       if (!*priority)
+               die(_("unrecognized --schedule argument '%s'"), arg);
+
+       return 0;
+}
+
 struct maintenance_run_opts {
        int auto_flag;
        int quiet;
+       enum schedule_priority schedule;
 };
 
 /* Remember to update object flag allocation in object.h */
@@ -737,9 +777,15 @@ static int dfs_on_ref(const char *refname,
        commit = lookup_commit(the_repository, oid);
        if (!commit)
                return 0;
-       if (parse_commit(commit))
+       if (parse_commit(commit) ||
+           commit_graph_position(commit) != COMMIT_NOT_FROM_GRAPH)
                return 0;
 
+       data->num_not_in_graph++;
+
+       if (data->num_not_in_graph >= data->limit)
+               return 1;
+
        commit_list_append(commit, &stack);
 
        while (!result && stack) {
@@ -786,7 +832,7 @@ static int should_write_commit_graph(void)
 
        result = for_each_ref(dfs_on_ref, &data);
 
-       clear_commit_marks_all(SEEN);
+       repo_clear_commit_marks(the_repository, SEEN);
 
        return result;
 }
@@ -807,6 +853,10 @@ static int run_write_commit_graph(struct maintenance_run_opts *opts)
 
 static int maintenance_task_commit_graph(struct maintenance_run_opts *opts)
 {
+       prepare_repo_settings(the_repository);
+       if (!the_repository->settings.core_commit_graph)
+               return 0;
+
        close_object_store(the_repository->objects);
        if (run_write_commit_graph(opts)) {
                error(_("failed to write commit-graph"));
@@ -816,6 +866,51 @@ static int maintenance_task_commit_graph(struct maintenance_run_opts *opts)
        return 0;
 }
 
+static int fetch_remote(const char *remote, struct maintenance_run_opts *opts)
+{
+       struct child_process child = CHILD_PROCESS_INIT;
+
+       child.git_cmd = 1;
+       strvec_pushl(&child.args, "fetch", remote, "--prune", "--no-tags",
+                    "--no-write-fetch-head", "--recurse-submodules=no",
+                    "--refmap=", NULL);
+
+       if (opts->quiet)
+               strvec_push(&child.args, "--quiet");
+
+       strvec_pushf(&child.args, "+refs/heads/*:refs/prefetch/%s/*", remote);
+
+       return !!run_command(&child);
+}
+
+static int append_remote(struct remote *remote, void *cbdata)
+{
+       struct string_list *remotes = (struct string_list *)cbdata;
+
+       string_list_append(remotes, remote->name);
+       return 0;
+}
+
+static int maintenance_task_prefetch(struct maintenance_run_opts *opts)
+{
+       int result = 0;
+       struct string_list_item *item;
+       struct string_list remotes = STRING_LIST_INIT_DUP;
+
+       if (for_each_remote(append_remote, &remotes)) {
+               error(_("failed to fill remotes"));
+               result = 1;
+               goto cleanup;
+       }
+
+       for_each_string_list_item(item, &remotes)
+               result |= fetch_remote(item->string, opts);
+
+cleanup:
+       string_list_clear(&remotes, 0);
+       return result;
+}
+
 static int maintenance_task_gc(struct maintenance_run_opts *opts)
 {
        struct child_process child = CHILD_PROCESS_INIT;
@@ -834,6 +929,268 @@ static int maintenance_task_gc(struct maintenance_run_opts *opts)
        return run_command(&child);
 }
 
+static int prune_packed(struct maintenance_run_opts *opts)
+{
+       struct child_process child = CHILD_PROCESS_INIT;
+
+       child.git_cmd = 1;
+       strvec_push(&child.args, "prune-packed");
+
+       if (opts->quiet)
+               strvec_push(&child.args, "--quiet");
+
+       return !!run_command(&child);
+}
+
+struct write_loose_object_data {
+       FILE *in;
+       int count;
+       int batch_size;
+};
+
+static int loose_object_auto_limit = 100;
+
+static int loose_object_count(const struct object_id *oid,
+                              const char *path,
+                              void *data)
+{
+       int *count = (int*)data;
+       if (++(*count) >= loose_object_auto_limit)
+               return 1;
+       return 0;
+}
+
+static int loose_object_auto_condition(void)
+{
+       int count = 0;
+
+       git_config_get_int("maintenance.loose-objects.auto",
+                          &loose_object_auto_limit);
+
+       if (!loose_object_auto_limit)
+               return 0;
+       if (loose_object_auto_limit < 0)
+               return 1;
+
+       return for_each_loose_file_in_objdir(the_repository->objects->odb->path,
+                                            loose_object_count,
+                                            NULL, NULL, &count);
+}
+
+static int bail_on_loose(const struct object_id *oid,
+                        const char *path,
+                        void *data)
+{
+       return 1;
+}
+
+static int write_loose_object_to_stdin(const struct object_id *oid,
+                                      const char *path,
+                                      void *data)
+{
+       struct write_loose_object_data *d = (struct write_loose_object_data *)data;
+
+       fprintf(d->in, "%s\n", oid_to_hex(oid));
+
+       return ++(d->count) > d->batch_size;
+}
+
+static int pack_loose(struct maintenance_run_opts *opts)
+{
+       struct repository *r = the_repository;
+       int result = 0;
+       struct write_loose_object_data data;
+       struct child_process pack_proc = CHILD_PROCESS_INIT;
+
+       /*
+        * Do not start pack-objects process
+        * if there are no loose objects.
+        */
+       if (!for_each_loose_file_in_objdir(r->objects->odb->path,
+                                          bail_on_loose,
+                                          NULL, NULL, NULL))
+               return 0;
+
+       pack_proc.git_cmd = 1;
+
+       strvec_push(&pack_proc.args, "pack-objects");
+       if (opts->quiet)
+               strvec_push(&pack_proc.args, "--quiet");
+       strvec_pushf(&pack_proc.args, "%s/pack/loose", r->objects->odb->path);
+
+       pack_proc.in = -1;
+
+       if (start_command(&pack_proc)) {
+               error(_("failed to start 'git pack-objects' process"));
+               return 1;
+       }
+
+       data.in = xfdopen(pack_proc.in, "w");
+       data.count = 0;
+       data.batch_size = 50000;
+
+       for_each_loose_file_in_objdir(r->objects->odb->path,
+                                     write_loose_object_to_stdin,
+                                     NULL,
+                                     NULL,
+                                     &data);
+
+       fclose(data.in);
+
+       if (finish_command(&pack_proc)) {
+               error(_("failed to finish 'git pack-objects' process"));
+               result = 1;
+       }
+
+       return result;
+}
+
+static int maintenance_task_loose_objects(struct maintenance_run_opts *opts)
+{
+       return prune_packed(opts) || pack_loose(opts);
+}
+
+static int incremental_repack_auto_condition(void)
+{
+       struct packed_git *p;
+       int enabled;
+       int incremental_repack_auto_limit = 10;
+       int count = 0;
+
+       if (git_config_get_bool("core.multiPackIndex", &enabled) ||
+           !enabled)
+               return 0;
+
+       git_config_get_int("maintenance.incremental-repack.auto",
+                          &incremental_repack_auto_limit);
+
+       if (!incremental_repack_auto_limit)
+               return 0;
+       if (incremental_repack_auto_limit < 0)
+               return 1;
+
+       for (p = get_packed_git(the_repository);
+            count < incremental_repack_auto_limit && p;
+            p = p->next) {
+               if (!p->multi_pack_index)
+                       count++;
+       }
+
+       return count >= incremental_repack_auto_limit;
+}
+
+static int multi_pack_index_write(struct maintenance_run_opts *opts)
+{
+       struct child_process child = CHILD_PROCESS_INIT;
+
+       child.git_cmd = 1;
+       strvec_pushl(&child.args, "multi-pack-index", "write", NULL);
+
+       if (opts->quiet)
+               strvec_push(&child.args, "--no-progress");
+
+       if (run_command(&child))
+               return error(_("failed to write multi-pack-index"));
+
+       return 0;
+}
+
+static int multi_pack_index_expire(struct maintenance_run_opts *opts)
+{
+       struct child_process child = CHILD_PROCESS_INIT;
+
+       child.git_cmd = 1;
+       strvec_pushl(&child.args, "multi-pack-index", "expire", NULL);
+
+       if (opts->quiet)
+               strvec_push(&child.args, "--no-progress");
+
+       close_object_store(the_repository->objects);
+
+       if (run_command(&child))
+               return error(_("'git multi-pack-index expire' failed"));
+
+       return 0;
+}
+
+#define TWO_GIGABYTES (INT32_MAX)
+
+static off_t get_auto_pack_size(void)
+{
+       /*
+        * The "auto" value is special: we optimize for
+        * one large pack-file (i.e. from a clone) and
+        * expect the rest to be small and they can be
+        * repacked quickly.
+        *
+        * The strategy we select here is to select a
+        * size that is one more than the second largest
+        * pack-file. This ensures that we will repack
+        * at least two packs if there are three or more
+        * packs.
+        */
+       off_t max_size = 0;
+       off_t second_largest_size = 0;
+       off_t result_size;
+       struct packed_git *p;
+       struct repository *r = the_repository;
+
+       reprepare_packed_git(r);
+       for (p = get_all_packs(r); p; p = p->next) {
+               if (p->pack_size > max_size) {
+                       second_largest_size = max_size;
+                       max_size = p->pack_size;
+               } else if (p->pack_size > second_largest_size)
+                       second_largest_size = p->pack_size;
+       }
+
+       result_size = second_largest_size + 1;
+
+       /* But limit ourselves to a batch size of 2g */
+       if (result_size > TWO_GIGABYTES)
+               result_size = TWO_GIGABYTES;
+
+       return result_size;
+}
+
+static int multi_pack_index_repack(struct maintenance_run_opts *opts)
+{
+       struct child_process child = CHILD_PROCESS_INIT;
+
+       child.git_cmd = 1;
+       strvec_pushl(&child.args, "multi-pack-index", "repack", NULL);
+
+       if (opts->quiet)
+               strvec_push(&child.args, "--no-progress");
+
+       strvec_pushf(&child.args, "--batch-size=%"PRIuMAX,
+                                 (uintmax_t)get_auto_pack_size());
+
+       close_object_store(the_repository->objects);
+
+       if (run_command(&child))
+               return error(_("'git multi-pack-index repack' failed"));
+
+       return 0;
+}
+
+static int maintenance_task_incremental_repack(struct maintenance_run_opts *opts)
+{
+       prepare_repo_settings(the_repository);
+       if (!the_repository->settings.core_multi_pack_index) {
+               warning(_("skipping incremental-repack task because core.multiPackIndex is disabled"));
+               return 0;
+       }
+
+       if (multi_pack_index_write(opts))
+               return 1;
+       if (multi_pack_index_expire(opts))
+               return 1;
+       if (multi_pack_index_repack(opts))
+               return 1;
+       return 0;
+}
+
 typedef int maintenance_task_fn(struct maintenance_run_opts *opts);
 
 /*
@@ -849,11 +1206,16 @@ struct maintenance_task {
        maintenance_auto_fn *auto_condition;
        unsigned enabled:1;
 
+       enum schedule_priority schedule;
+
        /* -1 if not selected. */
        int selected_order;
 };
 
 enum maintenance_task_label {
+       TASK_PREFETCH,
+       TASK_LOOSE_OBJECTS,
+       TASK_INCREMENTAL_REPACK,
        TASK_GC,
        TASK_COMMIT_GRAPH,
 
@@ -862,6 +1224,20 @@ enum maintenance_task_label {
 };
 
 static struct maintenance_task tasks[] = {
+       [TASK_PREFETCH] = {
+               "prefetch",
+               maintenance_task_prefetch,
+       },
+       [TASK_LOOSE_OBJECTS] = {
+               "loose-objects",
+               maintenance_task_loose_objects,
+               loose_object_auto_condition,
+       },
+       [TASK_INCREMENTAL_REPACK] = {
+               "incremental-repack",
+               maintenance_task_incremental_repack,
+               incremental_repack_auto_condition,
+       },
        [TASK_GC] = {
                "gc",
                maintenance_task_gc,
@@ -877,10 +1253,8 @@ static struct maintenance_task tasks[] = {
 
 static int compare_tasks_by_selection(const void *a_, const void *b_)
 {
-       const struct maintenance_task *a, *b;
-
-       a = (const struct maintenance_task *)&a_;
-       b = (const struct maintenance_task *)&b_;
+       const struct maintenance_task *a = a_;
+       const struct maintenance_task *b = b_;
 
        return b->selected_order - a->selected_order;
 }
@@ -927,6 +1301,9 @@ static int maintenance_run_tasks(struct maintenance_run_opts *opts)
                     !tasks[i].auto_condition()))
                        continue;
 
+               if (opts->schedule && tasks[i].schedule < opts->schedule)
+                       continue;
+
                trace2_region_enter("maintenance", tasks[i].name, r);
                if (tasks[i].fn(opts)) {
                        error(_("task '%s' failed"), tasks[i].name);
@@ -939,21 +1316,54 @@ static int maintenance_run_tasks(struct maintenance_run_opts *opts)
        return result;
 }
 
-static void initialize_task_config(void)
+static void initialize_maintenance_strategy(void)
+{
+       char *config_str;
+
+       if (git_config_get_string("maintenance.strategy", &config_str))
+               return;
+
+       if (!strcasecmp(config_str, "incremental")) {
+               tasks[TASK_GC].schedule = SCHEDULE_NONE;
+               tasks[TASK_COMMIT_GRAPH].enabled = 1;
+               tasks[TASK_COMMIT_GRAPH].schedule = SCHEDULE_HOURLY;
+               tasks[TASK_PREFETCH].enabled = 1;
+               tasks[TASK_PREFETCH].schedule = SCHEDULE_HOURLY;
+               tasks[TASK_INCREMENTAL_REPACK].enabled = 1;
+               tasks[TASK_INCREMENTAL_REPACK].schedule = SCHEDULE_DAILY;
+               tasks[TASK_LOOSE_OBJECTS].enabled = 1;
+               tasks[TASK_LOOSE_OBJECTS].schedule = SCHEDULE_DAILY;
+       }
+}
+
+static void initialize_task_config(int schedule)
 {
        int i;
        struct strbuf config_name = STRBUF_INIT;
        gc_config();
 
+       if (schedule)
+               initialize_maintenance_strategy();
+
        for (i = 0; i < TASK__COUNT; i++) {
                int config_value;
+               char *config_str;
 
-               strbuf_setlen(&config_name, 0);
+               strbuf_reset(&config_name);
                strbuf_addf(&config_name, "maintenance.%s.enabled",
                            tasks[i].name);
 
                if (!git_config_get_bool(config_name.buf, &config_value))
                        tasks[i].enabled = config_value;
+
+               strbuf_reset(&config_name);
+               strbuf_addf(&config_name, "maintenance.%s.schedule",
+                           tasks[i].name);
+
+               if (!git_config_get_string(config_name.buf, &config_str)) {
+                       tasks[i].schedule = parse_schedule(config_str);
+                       free(config_str);
+               }
        }
 
        strbuf_release(&config_name);
@@ -997,6 +1407,9 @@ static int maintenance_run(int argc, const char **argv, const char *prefix)
        struct option builtin_maintenance_run_options[] = {
                OPT_BOOL(0, "auto", &opts.auto_flag,
                         N_("run tasks based on the state of the repository")),
+               OPT_CALLBACK(0, "schedule", &opts.schedule, N_("frequency"),
+                            N_("run tasks based on frequency"),
+                            maintenance_opt_schedule),
                OPT_BOOL(0, "quiet", &opts.quiet,
                         N_("do not report progress or other information over stderr")),
                OPT_CALLBACK_F(0, "task", NULL, N_("task"),
@@ -1007,7 +1420,6 @@ static int maintenance_run(int argc, const char **argv, const char *prefix)
        memset(&opts, 0, sizeof(opts));
 
        opts.quiet = !isatty(2);
-       initialize_task_config();
 
        for (i = 0; i < TASK__COUNT; i++)
                tasks[i].selected_order = -1;
@@ -1017,13 +1429,190 @@ static int maintenance_run(int argc, const char **argv, const char *prefix)
                             builtin_maintenance_run_usage,
                             PARSE_OPT_STOP_AT_NON_OPTION);
 
+       if (opts.auto_flag && opts.schedule)
+               die(_("use at most one of --auto and --schedule=<frequency>"));
+
+       initialize_task_config(opts.schedule);
+
        if (argc != 0)
                usage_with_options(builtin_maintenance_run_usage,
                                   builtin_maintenance_run_options);
        return maintenance_run_tasks(&opts);
 }
 
-static const char builtin_maintenance_usage[] = N_("git maintenance run [<options>]");
+static int maintenance_register(void)
+{
+       char *config_value;
+       struct child_process config_set = CHILD_PROCESS_INIT;
+       struct child_process config_get = CHILD_PROCESS_INIT;
+
+       /* Disable foreground maintenance */
+       git_config_set("maintenance.auto", "false");
+
+       /* Set maintenance strategy, if unset */
+       if (!git_config_get_string("maintenance.strategy", &config_value))
+               free(config_value);
+       else
+               git_config_set("maintenance.strategy", "incremental");
+
+       config_get.git_cmd = 1;
+       strvec_pushl(&config_get.args, "config", "--global", "--get",
+                    "--fixed-value", "maintenance.repo",
+                    the_repository->worktree ? the_repository->worktree
+                                             : the_repository->gitdir,
+                        NULL);
+       config_get.out = -1;
+
+       if (start_command(&config_get))
+               return error(_("failed to run 'git config'"));
+
+       /* We already have this value in our config! */
+       if (!finish_command(&config_get))
+               return 0;
+
+       config_set.git_cmd = 1;
+       strvec_pushl(&config_set.args, "config", "--add", "--global", "maintenance.repo",
+                    the_repository->worktree ? the_repository->worktree
+                                             : the_repository->gitdir,
+                    NULL);
+
+       return run_command(&config_set);
+}
+
+static int maintenance_unregister(void)
+{
+       struct child_process config_unset = CHILD_PROCESS_INIT;
+
+       config_unset.git_cmd = 1;
+       strvec_pushl(&config_unset.args, "config", "--global", "--unset",
+                    "--fixed-value", "maintenance.repo",
+                    the_repository->worktree ? the_repository->worktree
+                                             : the_repository->gitdir,
+                    NULL);
+
+       return run_command(&config_unset);
+}
+
+#define BEGIN_LINE "# BEGIN GIT MAINTENANCE SCHEDULE"
+#define END_LINE "# END GIT MAINTENANCE SCHEDULE"
+
+static int update_background_schedule(int run_maintenance)
+{
+       int result = 0;
+       int in_old_region = 0;
+       struct child_process crontab_list = CHILD_PROCESS_INIT;
+       struct child_process crontab_edit = CHILD_PROCESS_INIT;
+       FILE *cron_list, *cron_in;
+       const char *crontab_name;
+       struct strbuf line = STRBUF_INIT;
+       struct lock_file lk;
+       char *lock_path = xstrfmt("%s/schedule", the_repository->objects->odb->path);
+
+       if (hold_lock_file_for_update(&lk, lock_path, LOCK_NO_DEREF) < 0)
+               return error(_("another process is scheduling background maintenance"));
+
+       crontab_name = getenv("GIT_TEST_CRONTAB");
+       if (!crontab_name)
+               crontab_name = "crontab";
+
+       strvec_split(&crontab_list.args, crontab_name);
+       strvec_push(&crontab_list.args, "-l");
+       crontab_list.in = -1;
+       crontab_list.out = dup(lk.tempfile->fd);
+       crontab_list.git_cmd = 0;
+
+       if (start_command(&crontab_list)) {
+               result = error(_("failed to run 'crontab -l'; your system might not support 'cron'"));
+               goto cleanup;
+       }
+
+       /* Ignore exit code, as an empty crontab will return error. */
+       finish_command(&crontab_list);
+
+       /*
+        * Read from the .lock file, filtering out the old
+        * schedule while appending the new schedule.
+        */
+       cron_list = fdopen(lk.tempfile->fd, "r");
+       rewind(cron_list);
+
+       strvec_split(&crontab_edit.args, crontab_name);
+       crontab_edit.in = -1;
+       crontab_edit.git_cmd = 0;
+
+       if (start_command(&crontab_edit)) {
+               result = error(_("failed to run 'crontab'; your system might not support 'cron'"));
+               goto cleanup;
+       }
+
+       cron_in = fdopen(crontab_edit.in, "w");
+       if (!cron_in) {
+               result = error(_("failed to open stdin of 'crontab'"));
+               goto done_editing;
+       }
+
+       while (!strbuf_getline_lf(&line, cron_list)) {
+               if (!in_old_region && !strcmp(line.buf, BEGIN_LINE))
+                       in_old_region = 1;
+               if (in_old_region)
+                       continue;
+               fprintf(cron_in, "%s\n", line.buf);
+               if (in_old_region && !strcmp(line.buf, END_LINE))
+                       in_old_region = 0;
+       }
+
+       if (run_maintenance) {
+               struct strbuf line_format = STRBUF_INIT;
+               const char *exec_path = git_exec_path();
+
+               fprintf(cron_in, "%s\n", BEGIN_LINE);
+               fprintf(cron_in,
+                       "# The following schedule was created by Git\n");
+               fprintf(cron_in, "# Any edits made in this region might be\n");
+               fprintf(cron_in,
+                       "# replaced in the future by a Git command.\n\n");
+
+               strbuf_addf(&line_format,
+                           "%%s %%s * * %%s \"%s/git\" --exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%%s\n",
+                           exec_path, exec_path);
+               fprintf(cron_in, line_format.buf, "0", "1-23", "*", "hourly");
+               fprintf(cron_in, line_format.buf, "0", "0", "1-6", "daily");
+               fprintf(cron_in, line_format.buf, "0", "0", "0", "weekly");
+               strbuf_release(&line_format);
+
+               fprintf(cron_in, "\n%s\n", END_LINE);
+       }
+
+       fflush(cron_in);
+       fclose(cron_in);
+       close(crontab_edit.in);
+
+done_editing:
+       if (finish_command(&crontab_edit)) {
+               result = error(_("'crontab' died"));
+               goto cleanup;
+       }
+       fclose(cron_list);
+
+cleanup:
+       rollback_lock_file(&lk);
+       return result;
+}
+
+static int maintenance_start(void)
+{
+       if (maintenance_register())
+               warning(_("failed to add repo to global config"));
+
+       return update_background_schedule(1);
+}
+
+static int maintenance_stop(void)
+{
+       return update_background_schedule(0);
+}
+
+static const char builtin_maintenance_usage[] =        N_("git maintenance <subcommand> [<options>]");
 
 int cmd_maintenance(int argc, const char **argv, const char *prefix)
 {
@@ -1033,6 +1622,14 @@ int cmd_maintenance(int argc, const char **argv, const char *prefix)
 
        if (!strcmp(argv[1], "run"))
                return maintenance_run(argc - 1, argv + 1, prefix);
+       if (!strcmp(argv[1], "start"))
+               return maintenance_start();
+       if (!strcmp(argv[1], "stop"))
+               return maintenance_stop();
+       if (!strcmp(argv[1], "register"))
+               return maintenance_register();
+       if (!strcmp(argv[1], "unregister"))
+               return maintenance_unregister();
 
        die(_("invalid subcommand: %s"), argv[1]);
 }
index c8037388c6e7fd4c62d1a019b1c7b17f020370df..ca259af44163184d409ddfaa6f5b9a2d4567d8f8 100644 (file)
@@ -670,6 +670,17 @@ static int grep_objects(struct grep_opt *opt, const struct pathspec *pathspec,
                                     NULL, 0);
                obj_read_unlock();
 
+               if (!real_obj) {
+                       char hex[GIT_MAX_HEXSZ + 1];
+                       const char *name = list->objects[i].name;
+
+                       if (!name) {
+                               oid_to_hex_r(hex, &list->objects[i].item->oid);
+                               name = hex;
+                       }
+                       die(_("invalid object '%s' given."), name);
+               }
+
                /* load the gitmodules file for this rev */
                if (recurse_submodules) {
                        submodule_free(opt->repo);
@@ -939,7 +950,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
-       init_grep_defaults(the_repository);
        git_config(grep_cmd_config, NULL);
        grep_init(&opt, the_repository, prefix);
 
index 0d03cb442df3fab5a59489a04f3b345aa14a74e4..4b8d86e0adeda0d823b06c7dfebd1909dd514052 100644 (file)
@@ -1597,7 +1597,7 @@ static void read_v2_anomalous_offsets(struct packed_git *p,
 
        /* The address of the 4-byte offset table */
        idx1 = (((const uint32_t *)((const uint8_t *)p->index_data + p->crc_offset))
-               + p->num_objects /* CRC32 table */
+               + (size_t)p->num_objects /* CRC32 table */
                );
 
        /* The address of the 8-byte offset table */
index 01bc648d416fa0167da43897f826209019948d61..dcc45bef5148117c4b0c3180fcbd94d9f099a1cc 100644 (file)
@@ -202,7 +202,8 @@ void initialize_repository_version(int hash_algo, int reinit)
 static int create_default_files(const char *template_path,
                                const char *original_git_dir,
                                const char *initial_branch,
-                               const struct repository_format *fmt)
+                               const struct repository_format *fmt,
+                               int quiet)
 {
        struct stat st1;
        struct strbuf buf = STRBUF_INIT;
@@ -267,7 +268,7 @@ static int create_default_files(const char *template_path,
                char *ref;
 
                if (!initial_branch)
-                       initial_branch = git_default_branch_name();
+                       initial_branch = git_default_branch_name(quiet);
 
                ref = xstrfmt("refs/heads/%s", initial_branch);
                if (check_refname_format(ref, 0) < 0)
@@ -438,7 +439,8 @@ int init_db(const char *git_dir, const char *real_git_dir,
        validate_hash_algorithm(&repo_fmt, hash);
 
        reinit = create_default_files(template_dir, original_git_dir,
-                                     initial_branch, &repo_fmt);
+                                     initial_branch, &repo_fmt,
+                                     flags & INIT_DB_QUIET);
        if (reinit && initial_branch)
                warning(_("re-init: ignored --initial-branch=%s"),
                        initial_branch);
index 0a7ed4bef92b91e75bd8c580544bdd81caea9102..bd6ff4f9f9565adb7a6fca5d93ce23d5c5636ccc 100644 (file)
@@ -37,6 +37,7 @@
 
 #define MAIL_DEFAULT_WRAP 72
 #define COVER_FROM_AUTO_MAX_SUBJECT_LEN 100
+#define FORMAT_PATCH_NAME_MAX_DEFAULT 64
 
 /* Set a default date-time format for git log ("log.date" config variable) */
 static const char *default_date_mode = NULL;
@@ -50,6 +51,7 @@ static int decoration_style;
 static int decoration_given;
 static int use_mailmap_config = 1;
 static const char *fmt_patch_subject_prefix = "PATCH";
+static int fmt_patch_name_max = FORMAT_PATCH_NAME_MAX_DEFAULT;
 static const char *fmt_pretty;
 
 static const char * const builtin_log_usage[] = {
@@ -131,7 +133,6 @@ static int log_line_range_callback(const struct option *option, const char *arg,
 
 static void init_log_defaults(void)
 {
-       init_grep_defaults(the_repository);
        init_diff_ui_defaults();
 
        decoration_style = auto_decoration_style();
@@ -150,6 +151,7 @@ static void cmd_log_init_defaults(struct rev_info *rev)
        rev->abbrev_commit = default_abbrev_commit;
        rev->show_root_diff = default_show_root;
        rev->subject_prefix = fmt_patch_subject_prefix;
+       rev->patch_name_max = fmt_patch_name_max;
        rev->show_signature = default_show_signature;
        rev->encode_email_headers = default_encode_email_headers;
        rev->diffopt.flags.allow_textconv = 1;
@@ -183,8 +185,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
                                N_("pattern"), N_("do not decorate refs that match <pattern>")),
                OPT_CALLBACK_F(0, "decorate", NULL, NULL, N_("decorate options"),
                               PARSE_OPT_OPTARG, decorate_callback),
-               OPT_CALLBACK('L', NULL, &line_cb, "n,m:file",
-                            N_("Process line range n,m in file, counting from 1"),
+               OPT_CALLBACK('L', NULL, &line_cb, "range:file",
+                            N_("Trace the evolution of line range <start>,<end> or function :<funcname> in <file>"),
                             log_line_range_callback),
                OPT_END()
        };
@@ -206,6 +208,9 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
        if (argc > 1)
                die(_("unrecognized argument: %s"), argv[1]);
 
+       if (rev->line_level_traverse && rev->prune_data.nr)
+               die(_("-L<range>:<file> cannot be used with pathspec"));
+
        memset(&w, 0, sizeof(w));
        userformat_find_requirements(NULL, &w);
 
@@ -454,6 +459,10 @@ static int git_log_config(const char *var, const char *value, void *cb)
                return git_config_string(&fmt_pretty, var, value);
        if (!strcmp(var, "format.subjectprefix"))
                return git_config_string(&fmt_patch_subject_prefix, var, value);
+       if (!strcmp(var, "format.filenamemaxlength")) {
+               fmt_patch_name_max = git_config_int(var, value);
+               return 0;
+       }
        if (!strcmp(var, "format.encodeemailheaders")) {
                default_encode_email_headers = git_config_bool(var, value);
                return 0;
@@ -955,15 +964,9 @@ static int open_next_file(struct commit *commit, const char *subject,
                         struct rev_info *rev, int quiet)
 {
        struct strbuf filename = STRBUF_INIT;
-       int suffix_len = strlen(rev->patch_suffix) + 1;
 
        if (output_directory) {
                strbuf_addstr(&filename, output_directory);
-               if (filename.len >=
-                   PATH_MAX - FORMAT_PATCH_NAME_MAX - suffix_len) {
-                       strbuf_release(&filename);
-                       return error(_("name of output directory is too long"));
-               }
                strbuf_complete(&filename, '/');
        }
 
@@ -1153,7 +1156,7 @@ static void get_notes_args(struct strvec *arg, struct rev_info *rev)
        }
 }
 
-static void make_cover_letter(struct rev_info *rev, int use_stdout,
+static void make_cover_letter(struct rev_info *rev, int use_separate_file,
                              struct commit *origin,
                              int nr, struct commit **list,
                              const char *branch_name,
@@ -1173,7 +1176,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 
        committer = git_committer_info(0);
 
-       if (!use_stdout &&
+       if (use_separate_file &&
            open_next_file(NULL, rev->numbered_files ? NULL : "cover-letter", rev, quiet))
                die(_("failed to create cover-letter file"));
 
@@ -1738,7 +1741,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                OPT_CALLBACK_F('N', "no-numbered", &numbered, NULL,
                            N_("use [PATCH] even with multiple patches"),
                            PARSE_OPT_NOARG | PARSE_OPT_NONEG, no_numbered_callback),
-               OPT_BOOL('s', "signoff", &do_signoff, N_("add Signed-off-by:")),
+               OPT_BOOL('s', "signoff", &do_signoff, N_("add a Signed-off-by trailer")),
                OPT_BOOL(0, "stdout", &use_stdout,
                            N_("print patches to standard out")),
                OPT_BOOL(0, "cover-letter", &cover_letter,
@@ -1751,6 +1754,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                            N_("start numbering patches at <n> instead of 1")),
                OPT_INTEGER('v', "reroll-count", &reroll_count,
                            N_("mark the series as Nth re-roll")),
+               OPT_INTEGER(0, "filename-max-length", &fmt_patch_name_max,
+                           N_("max length of output filename")),
                OPT_CALLBACK_F(0, "rfc", &rev, NULL,
                            N_("Use [RFC PATCH] instead of [PATCH]"),
                            PARSE_OPT_NOARG | PARSE_OPT_NONEG, rfc_callback),
@@ -1851,6 +1856,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                             PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
                             PARSE_OPT_KEEP_DASHDASH);
 
+       /* Make sure "0000-$sub.patch" gives non-negative length for $sub */
+       if (fmt_patch_name_max <= strlen("0000-") + strlen(fmt_patch_suffix))
+               fmt_patch_name_max = strlen("0000-") + strlen(fmt_patch_suffix);
+
        if (cover_from_description_arg)
                cover_from_description_mode = parse_cover_from_description(cover_from_description_arg);
 
@@ -1935,6 +1944,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
        rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
 
        rev.zero_commit = zero_commit;
+       rev.patch_name_max = fmt_patch_name_max;
 
        if (!rev.diffopt.flags.text && !no_binary_diff)
                rev.diffopt.flags.binary = 1;
@@ -1942,20 +1952,27 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
        if (rev.show_notes)
                load_display_notes(&rev.notes_opt);
 
-       if (!output_directory && !use_stdout)
-               output_directory = config_output_directory;
+       if (use_stdout + rev.diffopt.close_file + !!output_directory > 1)
+               die(_("--stdout, --output, and --output-directory are mutually exclusive"));
 
-       if (!use_stdout)
-               output_directory = set_outdir(prefix, output_directory);
-       else
+       if (use_stdout) {
                setup_pager();
-
-       if (output_directory) {
+       } else if (rev.diffopt.close_file) {
+               /*
+                * The diff code parsed --output; it has already opened the
+                * file, but but we must instruct it not to close after each
+                * diff.
+                */
+               rev.diffopt.close_file = 0;
+       } else {
                int saved;
+
+               if (!output_directory)
+                       output_directory = config_output_directory;
+               output_directory = set_outdir(prefix, output_directory);
+
                if (rev.diffopt.use_color != GIT_COLOR_ALWAYS)
                        rev.diffopt.use_color = GIT_COLOR_NEVER;
-               if (use_stdout)
-                       die(_("standard output, or directory, which one?"));
                /*
                 * We consider <outdir> as 'outside of gitdir', therefore avoid
                 * applying adjust_shared_perm in s-c-l-d.
@@ -2117,7 +2134,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
        if (cover_letter) {
                if (thread)
                        gen_message_id(&rev, "cover");
-               make_cover_letter(&rev, use_stdout,
+               make_cover_letter(&rev, !!output_directory,
                                  origin, nr, list, branch_name, quiet);
                print_bases(&bases, rev.diffopt.file);
                print_signature(rev.diffopt.file);
@@ -2172,7 +2189,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                        gen_message_id(&rev, oid_to_hex(&commit->object.oid));
                }
 
-               if (!use_stdout &&
+               if (output_directory &&
                    open_next_file(rev.numbered_files ? NULL : commit, NULL, &rev, quiet))
                        die(_("failed to create output files"));
                shown = log_tree_commit(&rev, commit);
@@ -2185,7 +2202,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                 * the log; when using one file per patch, we do
                 * not want the extra blank line.
                 */
-               if (!use_stdout)
+               if (output_directory)
                        rev.shown_one = 0;
                if (shown) {
                        print_bases(&bases, rev.diffopt.file);
@@ -2196,7 +2213,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                        else
                                print_signature(rev.diffopt.file);
                }
-               if (!use_stdout)
+               if (output_directory)
                        fclose(rev.diffopt.file);
        }
        stop_progress(&progress);
index e72714a5a87d02540f07fbbc65a86f66ed122cd8..de8520778d2ecdaa01dc23b513e24d187ef89d08 100644 (file)
@@ -109,6 +109,7 @@ static void show_diff(struct merge_list *entry)
        xdemitconf_t xecfg;
        xdemitcb_t ecb;
 
+       memset(&xpp, 0, sizeof(xpp));
        xpp.flags = 0;
        memset(&xecfg, 0, sizeof(xecfg));
        xecfg.ctxlen = 3;
index 9d5359edc2f72799e1bf517db5f26c5f29aff81f..1cff730715394fa5874c12323bba653ffe5b8abe 100644 (file)
@@ -28,6 +28,7 @@
 #include "rerere.h"
 #include "help.h"
 #include "merge-recursive.h"
+#include "merge-ort-wrappers.h"
 #include "resolve-undo.h"
 #include "remote.h"
 #include "fmt-merge-msg.h"
@@ -88,6 +89,7 @@ static int no_verify;
 static struct strategy all_strategy[] = {
        { "recursive",  DEFAULT_TWOHEAD | NO_TRIVIAL },
        { "octopus",    DEFAULT_OCTOPUS },
+       { "ort",        NO_TRIVIAL },
        { "resolve",    0 },
        { "ours",       NO_FAST_FORWARD | NO_TRIVIAL },
        { "subtree",    NO_FAST_FORWARD | NO_TRIVIAL },
@@ -159,10 +161,17 @@ static struct strategy *get_strategy(const char *name)
        struct strategy *ret;
        static struct cmdnames main_cmds, other_cmds;
        static int loaded;
+       char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
 
        if (!name)
                return NULL;
 
+       if (default_strategy &&
+           !strcmp(default_strategy, "ort") &&
+           !strcmp(name, "recursive")) {
+               name = "ort";
+       }
+
        for (i = 0; i < ARRAY_SIZE(all_strategy); i++)
                if (!strcmp(name, all_strategy[i].name))
                        return &all_strategy[i];
@@ -289,7 +298,7 @@ static struct option builtin_merge_options[] = {
          N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
        OPT_AUTOSTASH(&autostash),
        OPT_BOOL(0, "overwrite-ignore", &overwrite_ignore, N_("update ignored files (default)")),
-       OPT_BOOL(0, "signoff", &signoff, N_("add Signed-off-by:")),
+       OPT_BOOL(0, "signoff", &signoff, N_("add a Signed-off-by trailer")),
        OPT_BOOL(0, "no-verify", &no_verify, N_("bypass pre-merge-commit and commit-msg hooks")),
        OPT_END()
 };
@@ -701,7 +710,8 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
        if (refresh_and_write_cache(REFRESH_QUIET, SKIP_IF_UNCHANGED, 0) < 0)
                return error(_("Unable to write index."));
 
-       if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree")) {
+       if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree") ||
+           !strcmp(strategy, "ort")) {
                struct lock_file lock = LOCK_INIT;
                int clean, x;
                struct commit *result;
@@ -732,8 +742,12 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
                        commit_list_insert(j->item, &reversed);
 
                hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
-               clean = merge_recursive(&o, head,
-                               remoteheads->item, reversed, &result);
+               if (!strcmp(strategy, "ort"))
+                       clean = merge_ort_recursive(&o, head, remoteheads->item,
+                                                   reversed, &result);
+               else
+                       clean = merge_recursive(&o, head, remoteheads->item,
+                                               reversed, &result);
                if (clean < 0)
                        exit(128);
                if (write_locked_index(&the_index, &lock,
@@ -1264,6 +1278,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
        if (branch)
                skip_prefix(branch, "refs/heads/", &branch);
 
+       if (!pull_twohead) {
+               char *default_strategy = getenv("GIT_TEST_MERGE_ALGORITHM");
+               if (default_strategy && !strcmp(default_strategy, "ort"))
+                       pull_twohead = "ort";
+       }
+
        init_diff_ui_defaults();
        git_config(git_merge_config, NULL);
 
index 178e3409b7f8e0477e1a41e3575bcf886c6d664b..3e70f2a4c1f0fe370bd8a1b4d1e5deba31284a48 100644 (file)
@@ -236,7 +236,7 @@ static struct pack_list * pack_list_difference(const struct pack_list *A,
 
 static void cmp_two_packs(struct pack_list *p1, struct pack_list *p2)
 {
-       unsigned long p1_off = 0, p2_off = 0, p1_step, p2_step;
+       size_t p1_off = 0, p2_off = 0, p1_step, p2_step;
        const unsigned char *p1_base, *p2_base;
        struct llist_item *p1_hint = NULL, *p2_hint = NULL;
        const unsigned int hashsz = the_hash_algo->rawsz;
@@ -280,7 +280,7 @@ static void cmp_two_packs(struct pack_list *p1, struct pack_list *p2)
 static size_t sizeof_union(struct packed_git *p1, struct packed_git *p2)
 {
        size_t ret = 0;
-       unsigned long p1_off = 0, p2_off = 0, p1_step, p2_step;
+       size_t p1_off = 0, p2_off = 0, p1_step, p2_step;
        const unsigned char *p1_base, *p2_base;
        const unsigned int hashsz = the_hash_algo->rawsz;
 
@@ -499,7 +499,7 @@ static void scan_alt_odb_packs(void)
 static struct pack_list * add_pack(struct packed_git *p)
 {
        struct pack_list l;
-       unsigned long off = 0, step;
+       size_t off = 0, step;
        const unsigned char *base;
 
        if (!p->pack_local && !(alt_odb || verbose))
index 425950f46973d3949e24cbc1cf8cf74e97eeb417..aa56ebcdd0dce08f61fcaa5d1762d4efb8876adc 100644 (file)
@@ -142,7 +142,7 @@ static struct option pull_options[] = {
                N_("add (at most <n>) entries from shortlog to merge commit message"),
                PARSE_OPT_OPTARG),
        OPT_PASSTHRU(0, "signoff", &opt_signoff, NULL,
-               N_("add Signed-off-by:"),
+               N_("add a Signed-off-by trailer"),
                PARSE_OPT_OPTARG),
        OPT_PASSTHRU(0, "squash", &opt_squash, NULL,
                N_("create a single commit instead of doing a merge"),
@@ -345,18 +345,18 @@ static enum rebase_type config_get_rebase(void)
                return parse_config_rebase("pull.rebase", value, 1);
 
        if (opt_verbosity >= 0 && !opt_ff) {
-               warning(_("Pulling without specifying how to reconcile divergent branches is\n"
-                       "discouraged. You can squelch this message by running one of the following\n"
-                       "commands sometime before your next pull:\n"
-                       "\n"
-                       "  git config pull.rebase false  # merge (the default strategy)\n"
-                       "  git config pull.rebase true   # rebase\n"
-                       "  git config pull.ff only       # fast-forward only\n"
-                       "\n"
-                       "You can replace \"git config\" with \"git config --global\" to set a default\n"
-                       "preference for all repositories. You can also pass --rebase, --no-rebase,\n"
-                       "or --ff-only on the command line to override the configured default per\n"
-                       "invocation.\n"));
+               advise(_("Pulling without specifying how to reconcile divergent branches is\n"
+                        "discouraged. You can squelch this message by running one of the following\n"
+                        "commands sometime before your next pull:\n"
+                        "\n"
+                        "  git config pull.rebase false  # merge (the default strategy)\n"
+                        "  git config pull.rebase true   # rebase\n"
+                        "  git config pull.ff only       # fast-forward only\n"
+                        "\n"
+                        "You can replace \"git config\" with \"git config --global\" to set a default\n"
+                        "preference for all repositories. You can also pass --rebase, --no-rebase,\n"
+                        "or --ff-only on the command line to override the configured default per\n"
+                        "invocation.\n"));
        }
 
        return REBASE_FALSE;
@@ -852,21 +852,42 @@ static int get_octopus_merge_base(struct object_id *merge_base,
 
 /**
  * Given the current HEAD oid, the merge head returned from git-fetch and the
- * fork point calculated by get_rebase_fork_point(), runs git-rebase with the
- * appropriate arguments and returns its exit status.
+ * fork point calculated by get_rebase_fork_point(), compute the <newbase> and
+ * <upstream> arguments to use for the upcoming git-rebase invocation.
  */
-static int run_rebase(const struct object_id *curr_head,
+static int get_rebase_newbase_and_upstream(struct object_id *newbase,
+               struct object_id *upstream,
+               const struct object_id *curr_head,
                const struct object_id *merge_head,
                const struct object_id *fork_point)
 {
-       int ret;
        struct object_id oct_merge_base;
-       struct strvec args = STRVEC_INIT;
 
        if (!get_octopus_merge_base(&oct_merge_base, curr_head, merge_head, fork_point))
                if (!is_null_oid(fork_point) && oideq(&oct_merge_base, fork_point))
                        fork_point = NULL;
 
+       if (fork_point && !is_null_oid(fork_point))
+               oidcpy(upstream, fork_point);
+       else
+               oidcpy(upstream, merge_head);
+
+       oidcpy(newbase, merge_head);
+
+       return 0;
+}
+
+/**
+ * Given the <newbase> and <upstream> calculated by
+ * get_rebase_newbase_and_upstream(), runs git-rebase with the
+ * appropriate arguments and returns its exit status.
+ */
+static int run_rebase(const struct object_id *newbase,
+               const struct object_id *upstream)
+{
+       int ret;
+       struct strvec args = STRVEC_INIT;
+
        strvec_push(&args, "rebase");
 
        /* Shared options */
@@ -894,12 +915,9 @@ static int run_rebase(const struct object_id *curr_head,
                warning(_("ignoring --verify-signatures for rebase"));
 
        strvec_push(&args, "--onto");
-       strvec_push(&args, oid_to_hex(merge_head));
+       strvec_push(&args, oid_to_hex(newbase));
 
-       if (fork_point && !is_null_oid(fork_point))
-               strvec_push(&args, oid_to_hex(fork_point));
-       else
-               strvec_push(&args, oid_to_hex(merge_head));
+       strvec_push(&args, oid_to_hex(upstream));
 
        ret = run_command_v_opt(args.v, RUN_GIT_CMD);
        strvec_clear(&args);
@@ -1011,9 +1029,15 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
        if (opt_rebase) {
                int ret = 0;
                int ran_ff = 0;
+
+               struct object_id newbase;
+               struct object_id upstream;
+               get_rebase_newbase_and_upstream(&newbase, &upstream, &curr_head,
+                                               merge_heads.oid, &rebase_fork_point);
+
                if ((recurse_submodules == RECURSE_SUBMODULES_ON ||
                     recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) &&
-                   submodule_touches_in_range(the_repository, &rebase_fork_point, &curr_head))
+                   submodule_touches_in_range(the_repository, &upstream, &curr_head))
                        die(_("cannot rebase with locally recorded submodule modifications"));
                if (!autostash) {
                        struct commit_list *list = NULL;
@@ -1034,7 +1058,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
                        free_commit_list(list);
                }
                if (!ran_ff)
-                       ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point);
+                       ret = run_rebase(&newbase, &upstream);
 
                if (!ret && (recurse_submodules == RECURSE_SUBMODULES_ON ||
                             recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND))
index 6da3a8e5d30af38530d29c245d15a747dc9f4eed..03adb58602971d8fa754da44d077fd36968b1636 100644 (file)
@@ -290,6 +290,12 @@ static const char message_advice_ref_needs_force[] =
           "or update a remote ref to make it point at a non-commit object,\n"
           "without using the '--force' option.\n");
 
+static const char message_advice_ref_needs_update[] =
+       N_("Updates were rejected because the tip of the remote-tracking\n"
+          "branch has been updated since the last checkout. You may want\n"
+          "to integrate those changes locally (e.g., 'git pull ...')\n"
+          "before forcing an update.\n");
+
 static void advise_pull_before_push(void)
 {
        if (!advice_push_non_ff_current || !advice_push_update_rejected)
@@ -325,6 +331,13 @@ static void advise_ref_needs_force(void)
        advise(_(message_advice_ref_needs_force));
 }
 
+static void advise_ref_needs_update(void)
+{
+       if (!advice_push_ref_needs_update || !advice_push_update_rejected)
+               return;
+       advise(_(message_advice_ref_needs_update));
+}
+
 static int push_with_options(struct transport *transport, struct refspec *rs,
                             int flags)
 {
@@ -374,6 +387,8 @@ static int push_with_options(struct transport *transport, struct refspec *rs,
                advise_ref_fetch_first();
        } else if (reject_reasons & REJECT_NEEDS_FORCE) {
                advise_ref_needs_force();
+       } else if (reject_reasons & REJECT_REF_NEEDS_UPDATE) {
+               advise_ref_needs_update();
        }
 
        return 1;
@@ -510,6 +525,12 @@ static int git_push_config(const char *k, const char *v, void *cb)
                if (!v)
                        return config_error_nonbool(k);
                return color_parse(v, push_colors[slot]);
+       } else if (!strcmp(k, "push.useforceifincludes")) {
+               if (git_config_bool(k, v))
+                       *flags |= TRANSPORT_PUSH_FORCE_IF_INCLUDES;
+               else
+                       *flags &= ~TRANSPORT_PUSH_FORCE_IF_INCLUDES;
+               return 0;
        }
 
        return git_default_config(k, v, NULL);
@@ -541,6 +562,9 @@ int cmd_push(int argc, const char **argv, const char *prefix)
                OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
                               N_("require old value of ref to be at this value"),
                               PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option),
+               OPT_BIT(0, TRANS_OPT_FORCE_IF_INCLUDES, &flags,
+                       N_("require remote updates to be integrated locally"),
+                       TRANSPORT_PUSH_FORCE_IF_INCLUDES),
                OPT_CALLBACK(0, "recurse-submodules", &recurse_submodules, "(check|on-demand|no)",
                             N_("control recursive pushing of submodules"), option_parse_recurse_submodules),
                OPT_BOOL_F( 0 , "thin", &thin, N_("use thin pack"), PARSE_OPT_NOCOMPLETE),
@@ -625,6 +649,9 @@ int cmd_push(int argc, const char **argv, const char *prefix)
        if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR))
                die(_("--all and --mirror are incompatible"));
 
+       if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES))
+               cas.use_force_if_includes = 1;
+
        for_each_string_list_item(item, push_options)
                if (strchr(item->string, '\n'))
                        die(_("push options must not have new line characters"));
index eeca53382f793356e5f4a0114de062fb3926e236..19c7b377aa3fc603c63ad0abedd0ed643bce146f 100644 (file)
@@ -119,6 +119,7 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
        struct replay_opts replay = REPLAY_OPTS_INIT;
 
        replay.action = REPLAY_INTERACTIVE_REBASE;
+       replay.strategy = NULL;
        sequencer_init_config(&replay);
 
        replay.signoff = opts->signoff;
@@ -136,7 +137,12 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts)
                                        opts->committer_date_is_author_date;
        replay.ignore_date = opts->ignore_date;
        replay.gpg_sign = xstrdup_or_null(opts->gpg_sign_opt);
-       replay.strategy = opts->strategy;
+       if (opts->strategy)
+               replay.strategy = opts->strategy;
+       else if (!replay.strategy && replay.default_strategy) {
+               replay.strategy = replay.default_strategy;
+               replay.default_strategy = NULL;
+       }
 
        if (opts->strategy_opts)
                parse_strategy_opts(&replay, opts->strategy_opts);
@@ -270,15 +276,14 @@ static int edit_todo_file(unsigned flags)
 }
 
 static int get_revision_ranges(struct commit *upstream, struct commit *onto,
-                              struct object_id *orig_head, const char **head_hash,
-                              char **revisions, char **shortrevisions)
+                              struct object_id *orig_head, char **revisions,
+                              char **shortrevisions)
 {
        struct commit *base_rev = upstream ? upstream : onto;
        const char *shorthead;
 
-       *head_hash = find_unique_abbrev(orig_head, GIT_MAX_HEXSZ);
        *revisions = xstrfmt("%s...%s", oid_to_hex(&base_rev->object.oid),
-                                                  *head_hash);
+                            oid_to_hex(orig_head));
 
        shorthead = find_unique_abbrev(orig_head, DEFAULT_ABBREV);
 
@@ -296,7 +301,8 @@ static int get_revision_ranges(struct commit *upstream, struct commit *onto,
 }
 
 static int init_basic_state(struct replay_opts *opts, const char *head_name,
-                           struct commit *onto, const char *orig_head)
+                           struct commit *onto,
+                           const struct object_id *orig_head)
 {
        FILE *interactive;
 
@@ -327,7 +333,6 @@ static void split_exec_commands(const char *cmd, struct string_list *commands)
 static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
 {
        int ret;
-       const char *head_hash = NULL;
        char *revisions = NULL, *shortrevisions = NULL;
        struct strvec make_script_args = STRVEC_INIT;
        struct todo_list todo_list = TODO_LIST_INIT;
@@ -335,12 +340,12 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
        struct string_list commands = STRING_LIST_INIT_DUP;
 
        if (get_revision_ranges(opts->upstream, opts->onto, &opts->orig_head,
-                               &head_hash, &revisions, &shortrevisions))
+                               &revisions, &shortrevisions))
                return -1;
 
        if (init_basic_state(&replay,
                             opts->head_name ? opts->head_name : "detached HEAD",
-                            opts->onto, head_hash)) {
+                            opts->onto, &opts->orig_head)) {
                free(revisions);
                free(shortrevisions);
 
@@ -370,8 +375,9 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
 
                split_exec_commands(opts->cmd, &commands);
                ret = complete_action(the_repository, &replay, flags,
-                       shortrevisions, opts->onto_name, opts->onto, head_hash,
-                       &commands, opts->autosquash, &todo_list);
+                       shortrevisions, opts->onto_name, opts->onto,
+                       &opts->orig_head, &commands, opts->autosquash,
+                       &todo_list);
        }
 
        string_list_clear(&commands, 0);
@@ -1324,7 +1330,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                        N_("do not show diffstat of what changed upstream"),
                        PARSE_OPT_NOARG, NULL, REBASE_DIFFSTAT },
                OPT_BOOL(0, "signoff", &options.signoff,
-                        N_("add a Signed-off-by: line to each commit")),
+                        N_("add a Signed-off-by trailer to each commit")),
                OPT_BOOL(0, "committer-date-is-author-date",
                         &options.committer_date_is_author_date,
                         N_("make committer date match author date")),
@@ -1771,6 +1777,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                            options.default_backend);
        }
 
+       if (options.type == REBASE_MERGE &&
+           !options.strategy &&
+           getenv("GIT_TEST_MERGE_ALGORITHM"))
+               options.strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
+
        switch (options.type) {
        case REBASE_MERGE:
        case REBASE_PRESERVE_MERGES:
index bb9909c52e4e01e0ab37dbd020138ba254d44b51..d49d050e6e57c0dd8f795a36d6f1a64aa7c8ddee 100644 (file)
@@ -54,6 +54,7 @@ static int receive_unpack_limit = -1;
 static int transfer_unpack_limit = -1;
 static int advertise_atomic_push = 1;
 static int advertise_push_options;
+static int advertise_sid;
 static int unpack_limit = 100;
 static off_t max_input_size;
 static int report_status;
@@ -248,6 +249,11 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
+       if (strcmp(var, "transfer.advertisesid") == 0) {
+               advertise_sid = git_config_bool(var, value);
+               return 0;
+       }
+
        return git_default_config(var, value, cb);
 }
 
@@ -268,6 +274,8 @@ static void show_ref(const char *path, const struct object_id *oid)
                        strbuf_addf(&cap, " push-cert=%s", push_cert_nonce);
                if (advertise_push_options)
                        strbuf_addstr(&cap, " push-options");
+               if (advertise_sid)
+                       strbuf_addf(&cap, " session-id=%s", trace2_session_id());
                strbuf_addf(&cap, " object-format=%s", the_hash_algo->name);
                strbuf_addf(&cap, " agent=%s", git_user_agent_sanitized());
                packet_write_fmt(1, "%s %s%c%s\n",
@@ -977,15 +985,25 @@ static int read_proc_receive_report(struct packet_reader *reader,
        int new_report = 0;
        int code = 0;
        int once = 0;
+       int response = 0;
 
        for (;;) {
                struct object_id old_oid, new_oid;
                const char *head;
                const char *refname;
                char *p;
-
-               if (packet_reader_read(reader) != PACKET_READ_NORMAL)
+               enum packet_read_status status;
+
+               status = packet_reader_read(reader);
+               if (status != PACKET_READ_NORMAL) {
+                       /* Check whether proc-receive exited abnormally */
+                       if (status == PACKET_READ_EOF && !response) {
+                               strbuf_addstr(errmsg, "proc-receive exited abnormally");
+                               return -1;
+                       }
                        break;
+               }
+               response++;
 
                head = reader->line;
                p = strchr(head, ' ');
@@ -1145,31 +1163,49 @@ static int run_proc_receive_hook(struct command *commands,
        if (use_push_options)
                strbuf_addstr(&cap, " push-options");
        if (cap.len) {
-               packet_write_fmt(proc.in, "version=1%c%s\n", '\0', cap.buf + 1);
+               code = packet_write_fmt_gently(proc.in, "version=1%c%s\n", '\0', cap.buf + 1);
                strbuf_release(&cap);
        } else {
-               packet_write_fmt(proc.in, "version=1\n");
+               code = packet_write_fmt_gently(proc.in, "version=1\n");
        }
-       packet_flush(proc.in);
+       if (!code)
+               code = packet_flush_gently(proc.in);
 
-       for (;;) {
-               int linelen;
+       if (!code)
+               for (;;) {
+                       int linelen;
+                       enum packet_read_status status;
 
-               if (packet_reader_read(&reader) != PACKET_READ_NORMAL)
-                       break;
+                       status = packet_reader_read(&reader);
+                       if (status != PACKET_READ_NORMAL) {
+                               /* Check whether proc-receive exited abnormally */
+                               if (status == PACKET_READ_EOF)
+                                       code = -1;
+                               break;
+                       }
 
-               if (reader.pktlen > 8 && starts_with(reader.line, "version=")) {
-                       version = atoi(reader.line + 8);
-                       linelen = strlen(reader.line);
-                       if (linelen < reader.pktlen) {
-                               const char *feature_list = reader.line + linelen + 1;
-                               if (parse_feature_request(feature_list, "push-options"))
-                                       hook_use_push_options = 1;
+                       if (reader.pktlen > 8 && starts_with(reader.line, "version=")) {
+                               version = atoi(reader.line + 8);
+                               linelen = strlen(reader.line);
+                               if (linelen < reader.pktlen) {
+                                       const char *feature_list = reader.line + linelen + 1;
+                                       if (parse_feature_request(feature_list, "push-options"))
+                                               hook_use_push_options = 1;
+                               }
                        }
                }
+
+       if (code) {
+               strbuf_addstr(&errmsg, "fail to negotiate version with proc-receive hook");
+               goto cleanup;
        }
 
-       if (version != 1) {
+       switch (version) {
+       case 0:
+               /* fallthrough */
+       case 1:
+               break;
+       default:
                strbuf_addf(&errmsg, "proc-receive version '%d' is not supported",
                            version);
                code = -1;
@@ -1180,20 +1216,36 @@ static int run_proc_receive_hook(struct command *commands,
        for (cmd = commands; cmd; cmd = cmd->next) {
                if (!cmd->run_proc_receive || cmd->skip_update || cmd->error_string)
                        continue;
-               packet_write_fmt(proc.in, "%s %s %s",
-                                oid_to_hex(&cmd->old_oid),
-                                oid_to_hex(&cmd->new_oid),
-                                cmd->ref_name);
+               code = packet_write_fmt_gently(proc.in, "%s %s %s",
+                                              oid_to_hex(&cmd->old_oid),
+                                              oid_to_hex(&cmd->new_oid),
+                                              cmd->ref_name);
+               if (code)
+                       break;
+       }
+       if (!code)
+               code = packet_flush_gently(proc.in);
+       if (code) {
+               strbuf_addstr(&errmsg, "fail to write commands to proc-receive hook");
+               goto cleanup;
        }
-       packet_flush(proc.in);
 
        /* Send push options */
        if (hook_use_push_options) {
                struct string_list_item *item;
 
-               for_each_string_list_item(item, push_options)
-                       packet_write_fmt(proc.in, "%s", item->string);
-               packet_flush(proc.in);
+               for_each_string_list_item(item, push_options) {
+                       code = packet_write_fmt_gently(proc.in, "%s", item->string);
+                       if (code)
+                               break;
+               }
+               if (!code)
+                       code = packet_flush_gently(proc.in);
+               if (code) {
+                       strbuf_addstr(&errmsg,
+                                     "fail to write push-options to proc-receive hook");
+                       goto cleanup;
+               }
        }
 
        /* Read result from proc-receive */
@@ -2031,6 +2083,7 @@ static struct command *read_head_info(struct packet_reader *reader,
                if (linelen < reader->pktlen) {
                        const char *feature_list = reader->line + linelen + 1;
                        const char *hash = NULL;
+                       const char *client_sid;
                        int len = 0;
                        if (parse_feature_request(feature_list, "report-status"))
                                report_status = 1;
@@ -2053,6 +2106,12 @@ static struct command *read_head_info(struct packet_reader *reader,
                        }
                        if (xstrncmpz(the_hash_algo->name, hash, len))
                                die("error: unsupported object format '%s'", hash);
+                       client_sid = parse_feature_value(feature_list, "session-id", &len, NULL);
+                       if (client_sid) {
+                               char *sid = xstrndup(client_sid, len);
+                               trace2_data_string("transfer", NULL, "client-sid", client_sid);
+                               free(sid);
+                       }
                }
 
                if (!strcmp(reader->line, "push-cert")) {
index 64b4b551eb0259d7972486bfe15c65e91f051073..d11a5589e49dcc9ea06663c422154855f9ad529b 100644 (file)
@@ -191,11 +191,12 @@ static int add(int argc, const char **argv)
        url = argv[1];
 
        remote = remote_get(name);
-       if (remote_is_configured(remote, 1))
-               die(_("remote %s already exists."), name);
+       if (remote_is_configured(remote, 1)) {
+               error(_("remote %s already exists."), name);
+               exit(3);
+       }
 
-       strbuf_addf(&buf2, "refs/heads/test:refs/remotes/%s/test", name);
-       if (!valid_fetch_refspec(buf2.buf))
+       if (!valid_remote_name(name))
                die(_("'%s' is not a valid remote name"), name);
 
        strbuf_addf(&buf, "remote.%s.url", name);
@@ -686,21 +687,23 @@ static int mv(int argc, const char **argv)
        rename.remote_branches = &remote_branches;
 
        oldremote = remote_get(rename.old_name);
-       if (!remote_is_configured(oldremote, 1))
-               die(_("No such remote: '%s'"), rename.old_name);
+       if (!remote_is_configured(oldremote, 1)) {
+               error(_("No such remote: '%s'"), rename.old_name);
+               exit(2);
+       }
 
        if (!strcmp(rename.old_name, rename.new_name) && oldremote->origin != REMOTE_CONFIG)
                return migrate_file(oldremote);
 
        newremote = remote_get(rename.new_name);
-       if (remote_is_configured(newremote, 1))
-               die(_("remote %s already exists."), rename.new_name);
+       if (remote_is_configured(newremote, 1)) {
+               error(_("remote %s already exists."), rename.new_name);
+               exit(3);
+       }
 
-       strbuf_addf(&buf, "refs/heads/test:refs/remotes/%s/test", rename.new_name);
-       if (!valid_fetch_refspec(buf.buf))
+       if (!valid_remote_name(rename.new_name))
                die(_("'%s' is not a valid remote name"), rename.new_name);
 
-       strbuf_reset(&buf);
        strbuf_addf(&buf, "remote.%s", rename.old_name);
        strbuf_addf(&buf2, "remote.%s", rename.new_name);
        if (git_config_rename_section(buf.buf, buf2.buf) < 1)
@@ -709,7 +712,7 @@ static int mv(int argc, const char **argv)
 
        strbuf_reset(&buf);
        strbuf_addf(&buf, "remote.%s.fetch", rename.new_name);
-       git_config_set_multivar(buf.buf, NULL, NULL, 1);
+       git_config_set_multivar(buf.buf, NULL, NULL, CONFIG_FLAGS_MULTI_REPLACE);
        strbuf_addf(&old_remote_context, ":refs/remotes/%s/", rename.old_name);
        for (i = 0; i < oldremote->fetch.raw_nr; i++) {
                char *ptr;
@@ -829,8 +832,10 @@ static int rm(int argc, const char **argv)
                usage_with_options(builtin_remote_rm_usage, options);
 
        remote = remote_get(argv[1]);
-       if (!remote_is_configured(remote, 1))
-               die(_("No such remote: '%s'"), argv[1]);
+       if (!remote_is_configured(remote, 1)) {
+               error(_("No such remote: '%s'"), argv[1]);
+               exit(2);
+       }
 
        known_remotes.to_delete = remote;
        for_each_remote(add_known_remote, &known_remotes);
@@ -1486,7 +1491,8 @@ static int update(int argc, const char **argv)
 
 static int remove_all_fetch_refspecs(const char *key)
 {
-       return git_config_set_multivar_gently(key, NULL, NULL, 1);
+       return git_config_set_multivar_gently(key, NULL, NULL,
+                                             CONFIG_FLAGS_MULTI_REPLACE);
 }
 
 static void add_branches(struct remote *remote, const char **branches,
@@ -1511,8 +1517,10 @@ static int set_remote_branches(const char *remotename, const char **branches,
        strbuf_addf(&key, "remote.%s.fetch", remotename);
 
        remote = remote_get(remotename);
-       if (!remote_is_configured(remote, 1))
-               die(_("No such remote '%s'"), remotename);
+       if (!remote_is_configured(remote, 1)) {
+               error(_("No such remote '%s'"), remotename);
+               exit(2);
+       }
 
        if (!add_mode && remove_all_fetch_refspecs(key.buf)) {
                strbuf_release(&key);
@@ -1565,8 +1573,10 @@ static int get_url(int argc, const char **argv)
        remotename = argv[0];
 
        remote = remote_get(remotename);
-       if (!remote_is_configured(remote, 1))
-               die(_("No such remote '%s'"), remotename);
+       if (!remote_is_configured(remote, 1)) {
+               error(_("No such remote '%s'"), remotename);
+               exit(2);
+       }
 
        url_nr = 0;
        if (push_mode) {
@@ -1633,8 +1643,10 @@ static int set_url(int argc, const char **argv)
                oldurl = newurl;
 
        remote = remote_get(remotename);
-       if (!remote_is_configured(remote, 1))
-               die(_("No such remote '%s'"), remotename);
+       if (!remote_is_configured(remote, 1)) {
+               error(_("No such remote '%s'"), remotename);
+               exit(2);
+       }
 
        if (push_mode) {
                strbuf_addf(&name_buf, "remote.%s.pushurl", remotename);
@@ -1675,7 +1687,8 @@ static int set_url(int argc, const char **argv)
        if (!delete_mode)
                git_config_set_multivar(name_buf.buf, newurl, oldurl, 0);
        else
-               git_config_set_multivar(name_buf.buf, NULL, oldurl, 1);
+               git_config_set_multivar(name_buf.buf, NULL, oldurl,
+                                       CONFIG_FLAGS_MULTI_REPLACE);
 out:
        strbuf_release(&name_buf);
        return 0;
index 01e7767c792866086ca889d7ea9d0310238c7c84..279be11a164af7b0f00b2b2f2841b59693a3afd7 100644 (file)
@@ -202,6 +202,37 @@ static int write_oid(const struct object_id *oid, struct packed_git *pack,
        return 0;
 }
 
+static struct {
+       const char *name;
+       unsigned optional:1;
+} exts[] = {
+       {".pack"},
+       {".idx"},
+       {".bitmap", 1},
+       {".promisor", 1},
+};
+
+static unsigned populate_pack_exts(char *name)
+{
+       struct stat statbuf;
+       struct strbuf path = STRBUF_INIT;
+       unsigned ret = 0;
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(exts); i++) {
+               strbuf_reset(&path);
+               strbuf_addf(&path, "%s-%s%s", packtmp, name, exts[i].name);
+
+               if (stat(path.buf, &statbuf))
+                       continue;
+
+               ret |= (1 << i);
+       }
+
+       strbuf_release(&path);
+       return ret;
+}
+
 static void repack_promisor_objects(const struct pack_objects_args *args,
                                    struct string_list *names)
 {
@@ -230,11 +261,12 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
 
        out = xfdopen(cmd.out, "r");
        while (strbuf_getline_lf(&line, out) != EOF) {
+               struct string_list_item *item;
                char *promisor_name;
                int fd;
                if (line.len != the_hash_algo->hexsz)
                        die(_("repack: Expecting full hex object ID lines only from pack-objects."));
-               string_list_append(names, line.buf);
+               item = string_list_append(names, line.buf);
 
                /*
                 * pack-objects creates the .pack and .idx files, but not the
@@ -253,6 +285,9 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
                if (fd < 0)
                        die_errno(_("unable to create '%s'"), promisor_name);
                close(fd);
+
+               item->util = (void *)(uintptr_t)populate_pack_exts(item->string);
+
                free(promisor_name);
        }
        fclose(out);
@@ -265,22 +300,13 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
 
 int cmd_repack(int argc, const char **argv, const char *prefix)
 {
-       struct {
-               const char *name;
-               unsigned optional:1;
-       } exts[] = {
-               {".pack"},
-               {".idx"},
-               {".bitmap", 1},
-               {".promisor", 1},
-       };
        struct child_process cmd = CHILD_PROCESS_INIT;
        struct string_list_item *item;
        struct string_list names = STRING_LIST_INIT_DUP;
        struct string_list rollback = STRING_LIST_INIT_NODUP;
        struct string_list existing_packs = STRING_LIST_INIT_DUP;
        struct strbuf line = STRBUF_INIT;
-       int i, ext, ret, failed;
+       int i, ext, ret;
        FILE *out;
 
        /* variables to be filled by option parsing */
@@ -429,113 +455,42 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        if (!names.nr && !po_args.quiet)
                printf_ln(_("Nothing new to pack."));
 
+       for_each_string_list_item(item, &names) {
+               item->util = (void *)(uintptr_t)populate_pack_exts(item->string);
+       }
+
        close_object_store(the_repository->objects);
 
        /*
         * Ok we have prepared all new packfiles.
-        * First see if there are packs of the same name and if so
-        * if we can move them out of the way (this can happen if we
-        * repacked immediately after packing fully.
         */
-       failed = 0;
        for_each_string_list_item(item, &names) {
                for (ext = 0; ext < ARRAY_SIZE(exts); ext++) {
                        char *fname, *fname_old;
 
-                       fname = mkpathdup("%s/pack-%s%s", packdir,
-                                               item->string, exts[ext].name);
-                       if (!file_exists(fname)) {
-                               free(fname);
-                               continue;
-                       }
-
-                       fname_old = mkpathdup("%s/old-%s%s", packdir,
-                                               item->string, exts[ext].name);
-                       if (file_exists(fname_old))
-                               if (unlink(fname_old))
-                                       failed = 1;
-
-                       if (!failed && rename(fname, fname_old)) {
-                               free(fname);
-                               free(fname_old);
-                               failed = 1;
-                               break;
-                       } else {
-                               string_list_append(&rollback, fname);
-                               free(fname_old);
-                       }
-               }
-               if (failed)
-                       break;
-       }
-       if (failed) {
-               struct string_list rollback_failure = STRING_LIST_INIT_DUP;
-               for_each_string_list_item(item, &rollback) {
-                       char *fname, *fname_old;
-                       fname = mkpathdup("%s/%s", packdir, item->string);
-                       fname_old = mkpathdup("%s/old-%s", packdir, item->string);
-                       if (rename(fname_old, fname))
-                               string_list_append(&rollback_failure, fname);
-                       free(fname);
-                       free(fname_old);
-               }
-
-               if (rollback_failure.nr) {
-                       int i;
-                       fprintf(stderr,
-                               _("WARNING: Some packs in use have been renamed by\n"
-                                 "WARNING: prefixing old- to their name, in order to\n"
-                                 "WARNING: replace them with the new version of the\n"
-                                 "WARNING: file.  But the operation failed, and the\n"
-                                 "WARNING: attempt to rename them back to their\n"
-                                 "WARNING: original names also failed.\n"
-                                 "WARNING: Please rename them in %s manually:\n"), packdir);
-                       for (i = 0; i < rollback_failure.nr; i++)
-                               fprintf(stderr, "WARNING:   old-%s -> %s\n",
-                                       rollback_failure.items[i].string,
-                                       rollback_failure.items[i].string);
-               }
-               exit(1);
-       }
-
-       /* Now the ones with the same name are out of the way... */
-       for_each_string_list_item(item, &names) {
-               for (ext = 0; ext < ARRAY_SIZE(exts); ext++) {
-                       char *fname, *fname_old;
-                       struct stat statbuffer;
-                       int exists = 0;
                        fname = mkpathdup("%s/pack-%s%s",
                                        packdir, item->string, exts[ext].name);
                        fname_old = mkpathdup("%s-%s%s",
                                        packtmp, item->string, exts[ext].name);
-                       if (!stat(fname_old, &statbuffer)) {
-                               statbuffer.st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
-                               chmod(fname_old, statbuffer.st_mode);
-                               exists = 1;
-                       }
-                       if (exists || !exts[ext].optional) {
+
+                       if (((uintptr_t)item->util) & (1 << ext)) {
+                               struct stat statbuffer;
+                               if (!stat(fname_old, &statbuffer)) {
+                                       statbuffer.st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
+                                       chmod(fname_old, statbuffer.st_mode);
+                               }
+
                                if (rename(fname_old, fname))
                                        die_errno(_("renaming '%s' failed"), fname_old);
-                       }
-                       free(fname);
-                       free(fname_old);
-               }
-       }
+                       } else if (!exts[ext].optional)
+                               die(_("missing required file: %s"), fname_old);
+                       else if (unlink(fname) < 0 && errno != ENOENT)
+                               die_errno(_("could not unlink: %s"), fname);
 
-       /* Remove the "old-" files */
-       for_each_string_list_item(item, &names) {
-               for (ext = 0; ext < ARRAY_SIZE(exts); ext++) {
-                       char *fname;
-                       fname = mkpathdup("%s/old-%s%s",
-                                         packdir,
-                                         item->string,
-                                         exts[ext].name);
-                       if (remove_path(fname))
-                               warning(_("failed to remove '%s'"), fname);
                        free(fname);
+                       free(fname_old);
                }
        }
-
        /* End of pack replacement. */
 
        reprepare_packed_git(the_repository);
index ed200c8af1285ed4ac45a50aaa6275a739585836..69ba7326cf823a774d3d673a283cfe08a0fce3fc 100644 (file)
@@ -595,6 +595,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
        struct object_context unused;
        struct strbuf buf = STRBUF_INIT;
        const int hexsz = the_hash_algo->hexsz;
+       int seen_end_of_options = 0;
 
        if (argc > 1 && !strcmp("--parseopt", argv[1]))
                return cmd_parseopt(argc - 1, argv + 1, prefix);
@@ -622,21 +623,29 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
        for (i = 1; i < argc; i++) {
                const char *arg = argv[i];
 
-               if (!strcmp(arg, "--local-env-vars")) {
-                       int i;
-                       for (i = 0; local_repo_env[i]; i++)
-                               printf("%s\n", local_repo_env[i]);
+               if (as_is) {
+                       if (show_file(arg, output_prefix) && as_is < 2)
+                               verify_filename(prefix, arg, 0);
                        continue;
                }
-               if (!strcmp(arg, "--resolve-git-dir")) {
-                       const char *gitdir = argv[++i];
-                       if (!gitdir)
-                               die("--resolve-git-dir requires an argument");
-                       gitdir = resolve_gitdir(gitdir);
-                       if (!gitdir)
-                               die("not a gitdir '%s'", argv[i]);
-                       puts(gitdir);
-                       continue;
+
+               if (!seen_end_of_options) {
+                       if (!strcmp(arg, "--local-env-vars")) {
+                               int i;
+                               for (i = 0; local_repo_env[i]; i++)
+                                       printf("%s\n", local_repo_env[i]);
+                               continue;
+                       }
+                       if (!strcmp(arg, "--resolve-git-dir")) {
+                               const char *gitdir = argv[++i];
+                               if (!gitdir)
+                                       die("--resolve-git-dir requires an argument");
+                               gitdir = resolve_gitdir(gitdir);
+                               if (!gitdir)
+                                       die("not a gitdir '%s'", argv[i]);
+                               puts(gitdir);
+                               continue;
+                       }
                }
 
                /* The rest of the options require a git repository. */
@@ -646,41 +655,36 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                        did_repo_setup = 1;
                }
 
-               if (!strcmp(arg, "--git-path")) {
-                       if (!argv[i + 1])
-                               die("--git-path requires an argument");
-                       strbuf_reset(&buf);
-                       puts(relative_path(git_path("%s", argv[i + 1]),
-                                          prefix, &buf));
-                       i++;
-                       continue;
-               }
-               if (as_is) {
-                       if (show_file(arg, output_prefix) && as_is < 2)
-                               verify_filename(prefix, arg, 0);
-                       continue;
-               }
-               if (!strcmp(arg,"-n")) {
-                       if (++i >= argc)
-                               die("-n requires an argument");
-                       if ((filter & DO_FLAGS) && (filter & DO_REVS)) {
-                               show(arg);
-                               show(argv[i]);
-                       }
-                       continue;
-               }
-               if (starts_with(arg, "-n")) {
-                       if ((filter & DO_FLAGS) && (filter & DO_REVS))
-                               show(arg);
+               if (!strcmp(arg, "--")) {
+                       as_is = 2;
+                       /* Pass on the "--" if we show anything but files.. */
+                       if (filter & (DO_FLAGS | DO_REVS))
+                               show_file(arg, 0);
                        continue;
                }
 
-               if (*arg == '-') {
-                       if (!strcmp(arg, "--")) {
-                               as_is = 2;
-                               /* Pass on the "--" if we show anything but files.. */
-                               if (filter & (DO_FLAGS | DO_REVS))
-                                       show_file(arg, 0);
+               if (!seen_end_of_options && *arg == '-') {
+                       if (!strcmp(arg, "--git-path")) {
+                               if (!argv[i + 1])
+                                       die("--git-path requires an argument");
+                               strbuf_reset(&buf);
+                               puts(relative_path(git_path("%s", argv[i + 1]),
+                                                  prefix, &buf));
+                               i++;
+                               continue;
+                       }
+                       if (!strcmp(arg,"-n")) {
+                               if (++i >= argc)
+                                       die("-n requires an argument");
+                               if ((filter & DO_FLAGS) && (filter & DO_REVS)) {
+                                       show(arg);
+                                       show(argv[i]);
+                               }
+                               continue;
+                       }
+                       if (starts_with(arg, "-n")) {
+                               if ((filter & DO_FLAGS) && (filter & DO_REVS))
+                                       show(arg);
                                continue;
                        }
                        if (!strcmp(arg, "--default")) {
@@ -937,6 +941,12 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                                puts(the_hash_algo->name);
                                continue;
                        }
+                       if (!strcmp(arg, "--end-of-options")) {
+                               seen_end_of_options = 1;
+                               if (filter & (DO_FLAGS | DO_REVS))
+                                       show_file(arg, 0);
+                               continue;
+                       }
                        if (show_flag(arg) && verify)
                                die_no_single_rev(quiet);
                        continue;
index f61cc5d82cf2697583b5851893ba4076f96643a5..314a86c5621bd26b7ddcd35cab1a21702453a2ca 100644 (file)
@@ -107,7 +107,7 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
                OPT_BOOL('n', "no-commit", &opts->no_commit, N_("don't automatically commit")),
                OPT_BOOL('e', "edit", &opts->edit, N_("edit the commit message")),
                OPT_NOOP_NOARG('r', NULL),
-               OPT_BOOL('s', "signoff", &opts->signoff, N_("add Signed-off-by:")),
+               OPT_BOOL('s', "signoff", &opts->signoff, N_("add a Signed-off-by trailer")),
                OPT_CALLBACK('m', "mainline", opts, N_("parent-number"),
                             N_("select mainline parent"), option_parse_m),
                OPT_RERERE_AUTOUPDATE(&opts->allow_rerere_auto),
@@ -172,6 +172,11 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
                                NULL);
        }
 
+       if (!opts->strategy && opts->default_strategy) {
+               opts->strategy = opts->default_strategy;
+               opts->default_strategy = NULL;
+       }
+
        if (opts->allow_ff)
                verify_opt_compatible(me, "--ff",
                                "--signoff", opts->signoff,
@@ -202,6 +207,8 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
        /* These option values will be free()d */
        opts->gpg_sign = xstrdup_or_null(opts->gpg_sign);
        opts->strategy = xstrdup_or_null(opts->strategy);
+       if (!opts->strategy && getenv("GIT_TEST_MERGE_ALGORITHM"))
+               opts->strategy = xstrdup(getenv("GIT_TEST_MERGE_ALGORITHM"));
 
        if (cmd == 'q') {
                int ret = sequencer_remove_state(opts);
index 7af148d7332fc640f895ff0ff6c387a72680924c..a7e01667b089feed68a8219ae44e721bbcf8ae0b 100644 (file)
@@ -71,6 +71,11 @@ static void print_helper_status(struct ref *ref)
                        msg = "stale info";
                        break;
 
+               case REF_STATUS_REJECT_REMOTE_UPDATED:
+                       res = "error";
+                       msg = "remote ref updated since checkout";
+                       break;
+
                case REF_STATUS_REJECT_ALREADY_EXISTS:
                        res = "error";
                        msg = "already exists";
@@ -173,6 +178,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
        int progress = -1;
        int from_stdin = 0;
        struct push_cas_option cas = {0};
+       int force_if_includes = 0;
        struct packet_reader reader;
 
        struct option options[] = {
@@ -198,6 +204,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
                OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
                  N_("require old value of ref to be at this value"),
                  PARSE_OPT_OPTARG, parseopt_push_cas_option),
+               OPT_BOOL(0, TRANS_OPT_FORCE_IF_INCLUDES, &force_if_includes,
+                        N_("require remote updates to be integrated locally")),
                OPT_END()
        };
 
@@ -299,6 +307,9 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
        if (!is_empty_cas(&cas))
                apply_push_cas(&cas, remote, remote_refs);
 
+       if (!is_empty_cas(&cas) && force_if_includes)
+               cas.use_force_if_includes = 1;
+
        set_ref_status_for_push(remote_refs, args.send_mirror,
                args.force_update);
 
index 0a5c4968f64e1655b5cf16e3555209d52dae065c..c52e4ccd19a224fd14817c640a7b740a31954479 100644 (file)
@@ -10,6 +10,7 @@
 #include "shortlog.h"
 #include "parse-options.h"
 #include "trailer.h"
+#include "strmap.h"
 
 static char const * const shortlog_usage[] = {
        N_("git shortlog [<options>] [<revision-range>] [[--] <path>...]"),
@@ -169,60 +170,6 @@ static void read_from_stdin(struct shortlog *log)
        strbuf_release(&oneline);
 }
 
-struct strset_item {
-       struct hashmap_entry ent;
-       char value[FLEX_ARRAY];
-};
-
-struct strset {
-       struct hashmap map;
-};
-
-#define STRSET_INIT { { NULL } }
-
-static int strset_item_hashcmp(const void *hash_data,
-                              const struct hashmap_entry *entry,
-                              const struct hashmap_entry *entry_or_key,
-                              const void *keydata)
-{
-       const struct strset_item *a, *b;
-
-       a = container_of(entry, const struct strset_item, ent);
-       if (keydata)
-               return strcmp(a->value, keydata);
-
-       b = container_of(entry_or_key, const struct strset_item, ent);
-       return strcmp(a->value, b->value);
-}
-
-/*
- * Adds "str" to the set if it was not already present; returns true if it was
- * already there.
- */
-static int strset_check_and_add(struct strset *ss, const char *str)
-{
-       unsigned int hash = strhash(str);
-       struct strset_item *item;
-
-       if (!ss->map.table)
-               hashmap_init(&ss->map, strset_item_hashcmp, NULL, 0);
-
-       if (hashmap_get_from_hash(&ss->map, hash, str))
-               return 1;
-
-       FLEX_ALLOC_STR(item, value, str);
-       hashmap_entry_init(&item->ent, hash);
-       hashmap_add(&ss->map, &item->ent);
-       return 0;
-}
-
-static void strset_clear(struct strset *ss)
-{
-       if (!ss->map.table)
-               return;
-       hashmap_free_entries(&ss->map, struct strset_item, ent);
-}
-
 static void insert_records_from_trailers(struct shortlog *log,
                                         struct strset *dups,
                                         struct commit *commit,
@@ -253,7 +200,7 @@ static void insert_records_from_trailers(struct shortlog *log,
                if (!parse_ident(log, &ident, value))
                        value = ident.buf;
 
-               if (strset_check_and_add(dups, value))
+               if (!strset_add(dups, value))
                        continue;
                insert_one_record(log, value, oneline);
        }
@@ -291,7 +238,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
                                      log->email ? "%aN <%aE>" : "%aN",
                                      &ident, &ctx);
                if (!HAS_MULTI_BITS(log->groups) ||
-                   !strset_check_and_add(&dups, ident.buf))
+                   strset_add(&dups, ident.buf))
                        insert_one_record(log, ident.buf, oneline_str);
        }
        if (log->groups & SHORTLOG_GROUP_COMMITTER) {
@@ -300,7 +247,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
                                      log->email ? "%cN <%cE>" : "%cN",
                                      &ident, &ctx);
                if (!HAS_MULTI_BITS(log->groups) ||
-                   !strset_check_and_add(&dups, ident.buf))
+                   strset_add(&dups, ident.buf))
                        insert_one_record(log, ident.buf, oneline_str);
        }
        if (log->groups & SHORTLOG_GROUP_TRAILER) {
index 3f811f30506ab799f9bb4d1f37599c74175916d0..e1f8235fdd399977033296b75a0676cf7f109c4a 100644 (file)
@@ -419,7 +419,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
                        ret = apply_cached(&out);
                        strbuf_release(&out);
                        if (ret)
-                               return error(_("conflicts in index."
+                               return error(_("conflicts in index. "
                                               "Try without --index."));
 
                        discard_cache();
@@ -534,11 +534,22 @@ static int apply_stash(int argc, const char **argv, const char *prefix)
        return ret;
 }
 
+static int reject_reflog_ent(struct object_id *ooid, struct object_id *noid,
+                            const char *email, timestamp_t timestamp, int tz,
+                            const char *message, void *cb_data)
+{
+       return 1;
+}
+
+static int reflog_is_empty(const char *refname)
+{
+       return !for_each_reflog_ent(refname, reject_reflog_ent, NULL);
+}
+
 static int do_drop_stash(struct stash_info *info, int quiet)
 {
        int ret;
        struct child_process cp_reflog = CHILD_PROCESS_INIT;
-       struct child_process cp = CHILD_PROCESS_INIT;
 
        /*
         * reflog does not provide a simple function for deleting refs. One will
@@ -559,19 +570,7 @@ static int do_drop_stash(struct stash_info *info, int quiet)
                             info->revision.buf);
        }
 
-       /*
-        * This could easily be replaced by get_oid, but currently it will throw
-        * a fatal error when a reflog is empty, which we can not recover from.
-        */
-       cp.git_cmd = 1;
-       /* Even though --quiet is specified, rev-parse still outputs the hash */
-       cp.no_stdout = 1;
-       strvec_pushl(&cp.args, "rev-parse", "--verify", "--quiet", NULL);
-       strvec_pushf(&cp.args, "%s@{0}", ref_stash);
-       ret = run_command(&cp);
-
-       /* do_clear_stash if we just dropped the last stash entry */
-       if (ret)
+       if (reflog_is_empty(ref_stash))
                do_clear_stash();
 
        return 0;
index 8a2df4459c66389d0fc24fed93dc4e0c1f87efe1..6029a80544e560ccc97e77163782f7c432099296 100644 (file)
@@ -436,6 +436,8 @@ static void update_refs_stdin(void)
                switch (state) {
                case UPDATE_REFS_OPEN:
                case UPDATE_REFS_STARTED:
+                       if (state == UPDATE_REFS_STARTED && cmd->state == UPDATE_REFS_STARTED)
+                               die("cannot restart ongoing transaction");
                        /* Do not downgrade a transaction to a non-transaction. */
                        if (cmd->state >= state)
                                state = cmd->state;
@@ -446,7 +448,18 @@ static void update_refs_stdin(void)
                        state = cmd->state;
                        break;
                case UPDATE_REFS_CLOSED:
-                       die("transaction is closed");
+                       if (cmd->state != UPDATE_REFS_STARTED)
+                               die("transaction is closed");
+
+                       /*
+                        * Open a new transaction if we're currently closed and
+                        * get a "start".
+                        */
+                       state = cmd->state;
+                       transaction = ref_transaction_begin(&err);
+                       if (!transaction)
+                               die("%s", err.buf);
+
                        break;
                }
 
index 99abaeec6c6edcb5a16e0d5e7439981f81561319..197fd24a555f010126b81813d5d98cc40a4cf1e2 100644 (file)
@@ -304,9 +304,9 @@ static void check_candidate_path(const char *path,
        }
 
        if (locked)
-               die(_("'%s' is a missing but locked worktree;\nuse '%s -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"), cmd, path);
+               die(_("'%s' is a missing but locked worktree;\nuse '%s -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"), path, cmd);
        else
-               die(_("'%s' is a missing but already registered worktree;\nuse '%s -f' to override, or 'prune' or 'remove' to clear"), cmd, path);
+               die(_("'%s' is a missing but already registered worktree;\nuse '%s -f' to override, or 'prune' or 'remove' to clear"), path, cmd);
 }
 
 static int add_worktree(const char *path, const char *refname,
@@ -676,8 +676,11 @@ static void show_worktree(struct worktree *wt, int path_maxlen, int abbrev_len)
                } else
                        strbuf_addstr(&sb, "(error)");
        }
-       printf("%s\n", sb.buf);
 
+       if (!is_main_worktree(wt) && worktree_lock_reason(wt))
+               strbuf_addstr(&sb, " locked");
+
+       printf("%s\n", sb.buf);
        strbuf_release(&sb);
 }
 
diff --git a/cache.h b/cache.h
index c0072d43b1a78101f92df1283f9f34712f4c0265..71097657489362059c225ed084ec5141aefe9384 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1123,100 +1123,6 @@ const char *repo_find_unique_abbrev(struct repository *r, const struct object_id
 int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
 #define find_unique_abbrev_r(hex, oid, len) repo_find_unique_abbrev_r(the_repository, hex, oid, len)
 
-extern const struct object_id null_oid;
-
-static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
-{
-       /*
-        * Teach the compiler that there are only two possibilities of hash size
-        * here, so that it can optimize for this case as much as possible.
-        */
-       if (the_hash_algo->rawsz == GIT_MAX_RAWSZ)
-               return memcmp(sha1, sha2, GIT_MAX_RAWSZ);
-       return memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
-}
-
-static inline int oidcmp(const struct object_id *oid1, const struct object_id *oid2)
-{
-       return hashcmp(oid1->hash, oid2->hash);
-}
-
-static inline int hasheq(const unsigned char *sha1, const unsigned char *sha2)
-{
-       /*
-        * We write this here instead of deferring to hashcmp so that the
-        * compiler can properly inline it and avoid calling memcmp.
-        */
-       if (the_hash_algo->rawsz == GIT_MAX_RAWSZ)
-               return !memcmp(sha1, sha2, GIT_MAX_RAWSZ);
-       return !memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
-}
-
-static inline int oideq(const struct object_id *oid1, const struct object_id *oid2)
-{
-       return hasheq(oid1->hash, oid2->hash);
-}
-
-static inline int is_null_oid(const struct object_id *oid)
-{
-       return oideq(oid, &null_oid);
-}
-
-static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src)
-{
-       memcpy(sha_dst, sha_src, the_hash_algo->rawsz);
-}
-
-static inline void oidcpy(struct object_id *dst, const struct object_id *src)
-{
-       memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
-}
-
-static inline struct object_id *oiddup(const struct object_id *src)
-{
-       struct object_id *dst = xmalloc(sizeof(struct object_id));
-       oidcpy(dst, src);
-       return dst;
-}
-
-static inline void hashclr(unsigned char *hash)
-{
-       memset(hash, 0, the_hash_algo->rawsz);
-}
-
-static inline void oidclr(struct object_id *oid)
-{
-       memset(oid->hash, 0, GIT_MAX_RAWSZ);
-}
-
-static inline void oidread(struct object_id *oid, const unsigned char *hash)
-{
-       memcpy(oid->hash, hash, the_hash_algo->rawsz);
-}
-
-static inline int is_empty_blob_sha1(const unsigned char *sha1)
-{
-       return hasheq(sha1, the_hash_algo->empty_blob->hash);
-}
-
-static inline int is_empty_blob_oid(const struct object_id *oid)
-{
-       return oideq(oid, the_hash_algo->empty_blob);
-}
-
-static inline int is_empty_tree_sha1(const unsigned char *sha1)
-{
-       return hasheq(sha1, the_hash_algo->empty_tree->hash);
-}
-
-static inline int is_empty_tree_oid(const struct object_id *oid)
-{
-       return oideq(oid, the_hash_algo->empty_tree);
-}
-
-const char *empty_tree_oid_hex(void);
-const char *empty_blob_oid_hex(void);
-
 /* set default permissions by passing mode arguments to open(2) */
 int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
 int git_mkstemp_mode(char *pattern, int mode);
@@ -1255,7 +1161,11 @@ int adjust_shared_perm(const char *path);
  * safe_create_leading_directories() temporarily changes path while it
  * is working but restores it before returning.
  * safe_create_leading_directories_const() doesn't modify path, even
- * temporarily.
+ * temporarily. Both these variants adjust the permissions of the
+ * created directories to honor core.sharedRepository, so they are best
+ * suited for files inside the git dir. For working tree files, use
+ * safe_create_leading_directories_no_share() instead, as it ignores
+ * the core.sharedRepository setting.
  */
 enum scld_error {
        SCLD_OK = 0,
@@ -1266,6 +1176,7 @@ enum scld_error {
 };
 enum scld_error safe_create_leading_directories(char *path);
 enum scld_error safe_create_leading_directories_const(const char *path);
+enum scld_error safe_create_leading_directories_no_share(char *path);
 
 /*
  * Callback function for raceproof_create_file(). This function is
@@ -1960,7 +1871,6 @@ int stat_validity_check(struct stat_validity *sv, const char *path);
 void stat_validity_update(struct stat_validity *sv, int fd);
 
 int versioncmp(const char *s1, const char *s2);
-void sleep_millisec(int millisec);
 
 /*
  * Create a directory and (if share is nonzero) adjust its permissions
index 92a983a265c246da0865fbd9f82ae5c15bb99322..c70d6cdbf243db05f9e5718070895abd837d617a 100755 (executable)
@@ -48,7 +48,7 @@ do
                        ;;
                github-actions)
                        mkdir -p failed-test-artifacts
-                       echo "::set-env name=FAILED_TEST_ARTIFACTS::t/failed-test-artifacts"
+                       echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
                        cp "${TEST_EXIT%.exit}.out" failed-test-artifacts/
                        tar czf failed-test-artifacts/"$test_name".trash.tar.gz "$trash_dir"
                        continue
index 0e3204e7d1a08a15e5b7661fd35fd3048a7472ba..9379b02e5e90e8b91071550d3ee6da8a11b5a123 100644 (file)
@@ -94,6 +94,7 @@ git-fetch-pack                          synchingrepositories
 git-filter-branch                       ancillarymanipulators
 git-fmt-merge-msg                       purehelpers
 git-for-each-ref                        plumbinginterrogators
+git-for-each-repo                       plumbinginterrogators
 git-format-patch                        mainporcelain
 git-fsck                                ancillaryinterrogators          complete
 git-gc                                  mainporcelain
@@ -135,7 +136,6 @@ git-p4                                  foreignscminterface
 git-pack-objects                        plumbingmanipulators
 git-pack-redundant                      plumbinginterrogators
 git-pack-refs                           ancillarymanipulators
-git-parse-remote                        synchelpers
 git-patch-id                            purehelpers
 git-prune                               ancillarymanipulators   complete
 git-prune-packed                        plumbingmanipulators
index cb042bdba8c83288cfc1e42853447d5bc06f47fe..06f8dc1d8966f1ec59f58460a41df67b63180b24 100644 (file)
@@ -932,21 +932,15 @@ struct tree *get_commit_tree_in_graph(struct repository *r, const struct commit
 
 struct packed_commit_list {
        struct commit **list;
-       int nr;
-       int alloc;
-};
-
-struct packed_oid_list {
-       struct object_id *list;
-       int nr;
-       int alloc;
+       size_t nr;
+       size_t alloc;
 };
 
 struct write_commit_graph_context {
        struct repository *r;
        struct object_directory *odb;
        char *graph_name;
-       struct packed_oid_list oids;
+       struct oid_array oids;
        struct packed_commit_list commits;
        int num_extra_edges;
        unsigned long approx_nr_objects;
@@ -1240,13 +1234,6 @@ static int write_graph_chunk_bloom_data(struct hashfile *f,
        return 0;
 }
 
-static int oid_compare(const void *_a, const void *_b)
-{
-       const struct object_id *a = (const struct object_id *)_a;
-       const struct object_id *b = (const struct object_id *)_b;
-       return oidcmp(a, b);
-}
-
 static int add_packed_commits(const struct object_id *oid,
                              struct packed_git *pack,
                              uint32_t pos,
@@ -1267,10 +1254,7 @@ static int add_packed_commits(const struct object_id *oid,
        if (type != OBJ_COMMIT)
                return 0;
 
-       ALLOC_GROW(ctx->oids.list, ctx->oids.nr + 1, ctx->oids.alloc);
-       oidcpy(&(ctx->oids.list[ctx->oids.nr]), oid);
-       ctx->oids.nr++;
-
+       oid_array_append(&ctx->oids, oid);
        set_commit_pos(ctx->r, oid);
 
        return 0;
@@ -1281,9 +1265,7 @@ static void add_missing_parents(struct write_commit_graph_context *ctx, struct c
        struct commit_list *parent;
        for (parent = commit->parents; parent; parent = parent->next) {
                if (!(parent->item->object.flags & REACHABLE)) {
-                       ALLOC_GROW(ctx->oids.list, ctx->oids.nr + 1, ctx->oids.alloc);
-                       oidcpy(&ctx->oids.list[ctx->oids.nr], &(parent->item->object.oid));
-                       ctx->oids.nr++;
+                       oid_array_append(&ctx->oids, &parent->item->object.oid);
                        parent->item->object.flags |= REACHABLE;
                }
        }
@@ -1302,7 +1284,7 @@ static void close_reachable(struct write_commit_graph_context *ctx)
                                        ctx->oids.nr);
        for (i = 0; i < ctx->oids.nr; i++) {
                display_progress(ctx->progress, i + 1);
-               commit = lookup_commit(ctx->r, &ctx->oids.list[i]);
+               commit = lookup_commit(ctx->r, &ctx->oids.oid[i]);
                if (commit)
                        commit->object.flags |= REACHABLE;
        }
@@ -1319,7 +1301,7 @@ static void close_reachable(struct write_commit_graph_context *ctx)
                                        0);
        for (i = 0; i < ctx->oids.nr; i++) {
                display_progress(ctx->progress, i + 1);
-               commit = lookup_commit(ctx->r, &ctx->oids.list[i]);
+               commit = lookup_commit(ctx->r, &ctx->oids.oid[i]);
 
                if (!commit)
                        continue;
@@ -1339,7 +1321,7 @@ static void close_reachable(struct write_commit_graph_context *ctx)
                                        ctx->oids.nr);
        for (i = 0; i < ctx->oids.nr; i++) {
                display_progress(ctx->progress, i + 1);
-               commit = lookup_commit(ctx->r, &ctx->oids.list[i]);
+               commit = lookup_commit(ctx->r, &ctx->oids.oid[i]);
 
                if (commit)
                        commit->object.flags &= ~REACHABLE;
@@ -1567,9 +1549,7 @@ static int fill_oids_from_commits(struct write_commit_graph_context *ctx,
 
        oidset_iter_init(commits, &iter);
        while ((oid = oidset_iter_next(&iter))) {
-               ALLOC_GROW(ctx->oids.list, ctx->oids.nr + 1, ctx->oids.alloc);
-               oidcpy(&ctx->oids.list[ctx->oids.nr], oid);
-               ctx->oids.nr++;
+               oid_array_append(&ctx->oids, oid);
        }
 
        return 0;
@@ -1588,35 +1568,6 @@ static void fill_oids_from_all_packs(struct write_commit_graph_context *ctx)
        stop_progress(&ctx->progress);
 }
 
-static uint32_t count_distinct_commits(struct write_commit_graph_context *ctx)
-{
-       uint32_t i, count_distinct = 1;
-
-       if (ctx->report_progress)
-               ctx->progress = start_delayed_progress(
-                       _("Counting distinct commits in commit graph"),
-                       ctx->oids.nr);
-       display_progress(ctx->progress, 0); /* TODO: Measure QSORT() progress */
-       QSORT(ctx->oids.list, ctx->oids.nr, oid_compare);
-
-       for (i = 1; i < ctx->oids.nr; i++) {
-               display_progress(ctx->progress, i + 1);
-               if (!oideq(&ctx->oids.list[i - 1], &ctx->oids.list[i])) {
-                       if (ctx->split) {
-                               struct commit *c = lookup_commit(ctx->r, &ctx->oids.list[i]);
-
-                               if (!c || commit_graph_position(c) != COMMIT_NOT_FROM_GRAPH)
-                                       continue;
-                       }
-
-                       count_distinct++;
-               }
-       }
-       stop_progress(&ctx->progress);
-
-       return count_distinct;
-}
-
 static void copy_oids_to_commits(struct write_commit_graph_context *ctx)
 {
        uint32_t i;
@@ -1628,15 +1579,14 @@ static void copy_oids_to_commits(struct write_commit_graph_context *ctx)
                ctx->progress = start_delayed_progress(
                        _("Finding extra edges in commit graph"),
                        ctx->oids.nr);
-       for (i = 0; i < ctx->oids.nr; i++) {
+       oid_array_sort(&ctx->oids);
+       for (i = 0; i < ctx->oids.nr; i = oid_array_next_unique(&ctx->oids, i)) {
                unsigned int num_parents;
 
                display_progress(ctx->progress, i + 1);
-               if (i > 0 && oideq(&ctx->oids.list[i - 1], &ctx->oids.list[i]))
-                       continue;
 
                ALLOC_GROW(ctx->commits.list, ctx->commits.nr + 1, ctx->commits.alloc);
-               ctx->commits.list[ctx->commits.nr] = lookup_commit(ctx->r, &ctx->oids.list[i]);
+               ctx->commits.list[ctx->commits.nr] = lookup_commit(ctx->r, &ctx->oids.oid[i]);
 
                if (ctx->split && flags != COMMIT_GRAPH_SPLIT_REPLACE &&
                    commit_graph_position(ctx->commits.list[ctx->commits.nr]) != COMMIT_NOT_FROM_GRAPH)
@@ -2008,7 +1958,7 @@ static int commit_compare(const void *_a, const void *_b)
 
 static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
 {
-       uint32_t i;
+       uint32_t i, dedup_i = 0;
 
        if (ctx->report_progress)
                ctx->progress = start_delayed_progress(
@@ -2023,17 +1973,27 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
 
                if (i && oideq(&ctx->commits.list[i - 1]->object.oid,
                          &ctx->commits.list[i]->object.oid)) {
-                       die(_("unexpected duplicate commit id %s"),
-                           oid_to_hex(&ctx->commits.list[i]->object.oid));
+                       /*
+                        * Silently ignore duplicates. These were likely
+                        * created due to a commit appearing in multiple
+                        * layers of the chain, which is unexpected but
+                        * not invalid. We should make sure there is a
+                        * unique copy in the new layer.
+                        */
                } else {
                        unsigned int num_parents;
 
+                       ctx->commits.list[dedup_i] = ctx->commits.list[i];
+                       dedup_i++;
+
                        num_parents = commit_list_count(ctx->commits.list[i]->parents);
                        if (num_parents > 2)
                                ctx->num_extra_edges += num_parents - 1;
                }
        }
 
+       ctx->commits.nr = dedup_i;
+
        stop_progress(&ctx->progress);
 }
 
@@ -2145,11 +2105,16 @@ int write_commit_graph(struct object_directory *odb,
                       const struct commit_graph_opts *opts)
 {
        struct write_commit_graph_context *ctx;
-       uint32_t i, count_distinct = 0;
+       uint32_t i;
        int res = 0;
        int replace = 0;
        struct bloom_filter_settings bloom_settings = DEFAULT_BLOOM_FILTER_SETTINGS;
 
+       prepare_repo_settings(the_repository);
+       if (!the_repository->settings.core_commit_graph) {
+               warning(_("attempting to write a commit-graph, but 'core.commitGraph' is disabled"));
+               return 0;
+       }
        if (!commit_graph_compatible(the_repository))
                return 0;
 
@@ -2212,26 +2177,16 @@ int write_commit_graph(struct object_directory *odb,
        }
 
        ctx->approx_nr_objects = approximate_object_count();
-       ctx->oids.alloc = ctx->approx_nr_objects / 32;
 
-       if (ctx->split && opts && ctx->oids.alloc > opts->max_commits)
-               ctx->oids.alloc = opts->max_commits;
-
-       if (ctx->append) {
+       if (ctx->append)
                prepare_commit_graph_one(ctx->r, ctx->odb);
-               if (ctx->r->objects->commit_graph)
-                       ctx->oids.alloc += ctx->r->objects->commit_graph->num_commits;
-       }
-
-       if (ctx->oids.alloc < 1024)
-               ctx->oids.alloc = 1024;
-       ALLOC_ARRAY(ctx->oids.list, ctx->oids.alloc);
 
        if (ctx->append && ctx->r->objects->commit_graph) {
                struct commit_graph *g = ctx->r->objects->commit_graph;
                for (i = 0; i < g->num_commits; i++) {
-                       const unsigned char *hash = g->chunk_oid_lookup + g->hash_len * i;
-                       hashcpy(ctx->oids.list[ctx->oids.nr++].hash, hash);
+                       struct object_id oid;
+                       hashcpy(oid.hash, g->chunk_oid_lookup + g->hash_len * i);
+                       oid_array_append(&ctx->oids, &oid);
                }
        }
 
@@ -2253,17 +2208,6 @@ int write_commit_graph(struct object_directory *odb,
 
        close_reachable(ctx);
 
-       count_distinct = count_distinct_commits(ctx);
-
-       if (count_distinct >= GRAPH_EDGE_LAST_MASK) {
-               error(_("the commit graph format cannot write %d commits"), count_distinct);
-               res = -1;
-               goto cleanup;
-       }
-
-       ctx->commits.alloc = count_distinct;
-       ALLOC_ARRAY(ctx->commits.list, ctx->commits.alloc);
-
        copy_oids_to_commits(ctx);
 
        if (ctx->commits.nr >= GRAPH_EDGE_LAST_MASK) {
@@ -2298,7 +2242,7 @@ int write_commit_graph(struct object_directory *odb,
 cleanup:
        free(ctx->graph_name);
        free(ctx->commits.list);
-       free(ctx->oids.list);
+       oid_array_clear(&ctx->oids);
 
        if (ctx->commit_graph_filenames_after) {
                for (i = 0; i < ctx->num_commit_graphs_after; i++) {
index f53429c0ac34d933a06f6051cd6b5e519408e4be..fe1fa3dc41fe787883752671e5954b75616fe9ac 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1586,7 +1586,7 @@ const char *find_commit_header(const char *msg, const char *key, size_t *out_len
 
 /*
  * Inspect the given string and determine the true "end" of the log message, in
- * order to find where to put a new Signed-off-by: line.  Ignored are
+ * order to find where to put a new Signed-off-by trailer.  Ignored are
  * trailing comment lines and blank lines.  To support "git commit -s
  * --amend" on an existing commit, we also ignore "Conflicts:".  To
  * support "git commit -v", we truncate at cut lines.
index c0bb744adcd239ebaf1cb02b63bc5ebdb24544b0..512f6f4b9937c8a97904b8ef3a7e21d644695989 100644 (file)
@@ -74,7 +74,7 @@ static inline uint64_t git_bswap64(uint64_t x)
 }
 #endif
 
-#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
+#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64))
 
 #include <stdlib.h>
 
index df167d1e1a542d37c794f0ed307dfdaac89092e3..3bd824154be3816bc51f31921bb87f10df82e30d 100755 (executable)
@@ -45,7 +45,7 @@ while (@ARGV) {
                push(@args, "zlib.lib");
            }
        } elsif ("$arg" eq "-liconv") {
-               push(@args, "libiconv.lib");
+               push(@args, "iconv.lib");
        } elsif ("$arg" eq "-lcrypto") {
                push(@args, "libcrypto.lib");
        } elsif ("$arg" eq "-lssl") {
index 2bdff4457be7d5b1e1fd5f6acb558ac41b946a8c..1137bd73aff07c77e9b73a0b4c1d193cd38d88de 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1963,7 +1963,7 @@ void git_configset_clear(struct config_set *cs)
                free(entry->key);
                string_list_clear(&entry->value_list, 1);
        }
-       hashmap_free_entries(&cs->config_hash, struct config_set_element, ent);
+       hashmap_clear_and_free(&cs->config_hash, struct config_set_element, ent);
        cs->hash_initialized = 0;
        free(cs->list.items);
        cs->list.nr = 0;
@@ -2415,7 +2415,8 @@ struct config_store_data {
        size_t baselen;
        char *key;
        int do_not_match;
-       regex_t *value_regex;
+       const char *fixed_value;
+       regex_t *value_pattern;
        int multi_replace;
        struct {
                size_t begin, end;
@@ -2429,10 +2430,10 @@ struct config_store_data {
 static void config_store_data_clear(struct config_store_data *store)
 {
        free(store->key);
-       if (store->value_regex != NULL &&
-           store->value_regex != CONFIG_REGEX_NONE) {
-               regfree(store->value_regex);
-               free(store->value_regex);
+       if (store->value_pattern != NULL &&
+           store->value_pattern != CONFIG_REGEX_NONE) {
+               regfree(store->value_pattern);
+               free(store->value_pattern);
        }
        free(store->parsed);
        free(store->seen);
@@ -2444,13 +2445,15 @@ static int matches(const char *key, const char *value,
 {
        if (strcmp(key, store->key))
                return 0; /* not ours */
-       if (!store->value_regex)
+       if (store->fixed_value)
+               return !strcmp(store->fixed_value, value);
+       if (!store->value_pattern)
                return 1; /* always matches */
-       if (store->value_regex == CONFIG_REGEX_NONE)
+       if (store->value_pattern == CONFIG_REGEX_NONE)
                return 0; /* never matches */
 
        return store->do_not_match ^
-               (value && !regexec(store->value_regex, value, 0, NULL, 0));
+               (value && !regexec(store->value_pattern, value, 0, NULL, 0));
 }
 
 static int store_aux_event(enum config_event_t type,
@@ -2726,12 +2729,12 @@ void git_config_set(const char *key, const char *value)
 
 /*
  * If value==NULL, unset in (remove from) config,
- * if value_regex!=NULL, disregard key/value pairs where value does not match.
- * if value_regex==CONFIG_REGEX_NONE, do not match any existing values
+ * if value_pattern!=NULL, disregard key/value pairs where value does not match.
+ * if value_pattern==CONFIG_REGEX_NONE, do not match any existing values
  *     (only add a new one)
- * if multi_replace==0, nothing, or only one matching key/value is replaced,
- *     else all matching key/values (regardless how many) are removed,
- *     before the new pair is written.
+ * if flags contains the CONFIG_FLAGS_MULTI_REPLACE flag, all matching
+ *     key/values are removed before a single new pair is written. If the
+ *     flag is not present, then replace only the first match.
  *
  * Returns 0 on success.
  *
@@ -2751,8 +2754,8 @@ void git_config_set(const char *key, const char *value)
  */
 int git_config_set_multivar_in_file_gently(const char *config_filename,
                                           const char *key, const char *value,
-                                          const char *value_regex,
-                                          int multi_replace)
+                                          const char *value_pattern,
+                                          unsigned flags)
 {
        int fd = -1, in_fd = -1;
        int ret;
@@ -2769,7 +2772,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
        if (ret)
                goto out_free;
 
-       store.multi_replace = multi_replace;
+       store.multi_replace = (flags & CONFIG_FLAGS_MULTI_REPLACE) != 0;
 
        if (!config_filename)
                config_filename = filename_buf = git_pathdup("config");
@@ -2812,22 +2815,24 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
                int i, new_line = 0;
                struct config_options opts;
 
-               if (value_regex == NULL)
-                       store.value_regex = NULL;
-               else if (value_regex == CONFIG_REGEX_NONE)
-                       store.value_regex = CONFIG_REGEX_NONE;
+               if (value_pattern == NULL)
+                       store.value_pattern = NULL;
+               else if (value_pattern == CONFIG_REGEX_NONE)
+                       store.value_pattern = CONFIG_REGEX_NONE;
+               else if (flags & CONFIG_FLAGS_FIXED_VALUE)
+                       store.fixed_value = value_pattern;
                else {
-                       if (value_regex[0] == '!') {
+                       if (value_pattern[0] == '!') {
                                store.do_not_match = 1;
-                               value_regex++;
+                               value_pattern++;
                        } else
                                store.do_not_match = 0;
 
-                       store.value_regex = (regex_t*)xmalloc(sizeof(regex_t));
-                       if (regcomp(store.value_regex, value_regex,
+                       store.value_pattern = (regex_t*)xmalloc(sizeof(regex_t));
+                       if (regcomp(store.value_pattern, value_pattern,
                                        REG_EXTENDED)) {
-                               error(_("invalid pattern: %s"), value_regex);
-                               FREE_AND_NULL(store.value_regex);
+                               error(_("invalid pattern: %s"), value_pattern);
+                               FREE_AND_NULL(store.value_pattern);
                                ret = CONFIG_INVALID_PATTERN;
                                goto out_free;
                        }
@@ -2858,7 +2863,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
 
                /* if nothing to unset, or too many matches, error out */
                if ((store.seen_nr == 0 && value == NULL) ||
-                   (store.seen_nr > 1 && multi_replace == 0)) {
+                   (store.seen_nr > 1 && !store.multi_replace)) {
                        ret = CONFIG_NOTHING_SET;
                        goto out_free;
                }
@@ -2997,10 +3002,10 @@ write_err_out:
 
 void git_config_set_multivar_in_file(const char *config_filename,
                                     const char *key, const char *value,
-                                    const char *value_regex, int multi_replace)
+                                    const char *value_pattern, unsigned flags)
 {
        if (!git_config_set_multivar_in_file_gently(config_filename, key, value,
-                                                   value_regex, multi_replace))
+                                                   value_pattern, flags))
                return;
        if (value)
                die(_("could not set '%s' to '%s'"), key, value);
@@ -3009,17 +3014,17 @@ void git_config_set_multivar_in_file(const char *config_filename,
 }
 
 int git_config_set_multivar_gently(const char *key, const char *value,
-                                  const char *value_regex, int multi_replace)
+                                  const char *value_pattern, unsigned flags)
 {
-       return git_config_set_multivar_in_file_gently(NULL, key, value, value_regex,
-                                                     multi_replace);
+       return git_config_set_multivar_in_file_gently(NULL, key, value, value_pattern,
+                                                     flags);
 }
 
 void git_config_set_multivar(const char *key, const char *value,
-                            const char *value_regex, int multi_replace)
+                            const char *value_pattern, unsigned flags)
 {
-       git_config_set_multivar_in_file(NULL, key, value, value_regex,
-                                       multi_replace);
+       git_config_set_multivar_in_file(NULL, key, value, value_pattern,
+                                       flags);
 }
 
 static int section_name_match (const char *buf, const char *name)
index 91cdfbfb414fdcc7835a3a467ea680b5780a74c8..c1449bb790b81e9a45c0dad90db0fe072c456a6a 100644 (file)
--- a/config.h
+++ b/config.h
@@ -256,9 +256,29 @@ void git_config_set(const char *, const char *);
 
 int git_config_parse_key(const char *, char **, size_t *);
 int git_config_key_is_valid(const char *key);
-int git_config_set_multivar_gently(const char *, const char *, const char *, int);
-void git_config_set_multivar(const char *, const char *, const char *, int);
-int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, int);
+
+/*
+ * The following macros specify flag bits that alter the behavior
+ * of the git_config_set_multivar*() methods.
+ */
+
+/*
+ * When CONFIG_FLAGS_MULTI_REPLACE is specified, all matching key/values
+ * are removed before a single new pair is written. If the flag is not
+ * present, then set operations replace only the first match.
+ */
+#define CONFIG_FLAGS_MULTI_REPLACE (1 << 0)
+
+/*
+ * When CONFIG_FLAGS_FIXED_VALUE is specified, match key/value pairs
+ * by string comparison (not regex match) to the provided value_pattern
+ * parameter.
+ */
+#define CONFIG_FLAGS_FIXED_VALUE (1 << 1)
+
+int git_config_set_multivar_gently(const char *, const char *, const char *, unsigned);
+void git_config_set_multivar(const char *, const char *, const char *, unsigned);
+int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, unsigned);
 
 /**
  * takes four parameters:
@@ -276,13 +296,15 @@ int git_config_set_multivar_in_file_gently(const char *, const char *, const cha
  * - the value regex, as a string. It will disregard key/value pairs where value
  *   does not match.
  *
- * - a multi_replace value, as an int. If value is equal to zero, nothing or only
- *   one matching key/value is replaced, else all matching key/values (regardless
- *   how many) are removed, before the new pair is written.
+ * - a flags value with bits corresponding to the CONFIG_FLAG_* macros.
  *
  * It returns 0 on success.
  */
-void git_config_set_multivar_in_file(const char *, const char *, const char *, const char *, int);
+void git_config_set_multivar_in_file(const char *config_filename,
+                                    const char *key,
+                                    const char *value,
+                                    const char *value_pattern,
+                                    unsigned flags);
 
 /**
  * rename or remove sections in the config file
index 89b218d11a5313f327492795964793bec8670160..022fb58218029a0196609e143073c559811089de 100644 (file)
@@ -1,5 +1,6 @@
 ifeq ($(filter no-error,$(DEVOPTS)),)
 DEVELOPER_CFLAGS += -Werror
+SPARSE_FLAGS += -Wsparse-error
 endif
 ifneq ($(filter pedantic,$(DEVOPTS)),)
 DEVELOPER_CFLAGS += -pedantic
@@ -15,6 +16,7 @@ DEVELOPER_CFLAGS += -Wpointer-arith
 DEVELOPER_CFLAGS += -Wstrict-prototypes
 DEVELOPER_CFLAGS += -Wunused
 DEVELOPER_CFLAGS += -Wvla
+DEVELOPER_CFLAGS += -fno-common
 
 ifndef COMPILER_FEATURES
 COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
@@ -45,3 +47,5 @@ ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
 DEVELOPER_CFLAGS += -Wno-uninitialized
 endif
 endif
+
+GIT_TEST_PERL_FATAL_WARNINGS = YesPlease
index c7eba69e54e669c61dd8b7333d97fb587964b68c..198ab1e58f837d38392f892217cbedf03623f21c 100644 (file)
@@ -541,11 +541,6 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
        # removing the directory at OS releases J06.21 and L17.02.
        # Default to the older rm until those two releases are deprecated.
        RM = /bin/rm -f
-       # As detected by './configure'.
-       # Missdetected, hence commented out, see below.
-       #NO_CURL = YesPlease
-       # Added manually, see above.
-       NEEDS_SSL_WITH_CURL = YesPlease
        NEEDS_CRYPTO_WITH_SSL = YesPlease
        HAVE_DEV_TTY = YesPlease
        HAVE_LIBCHARSET_H = YesPlease
@@ -579,10 +574,6 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
        NO_MMAP = YesPlease
        NO_POLL = YesPlease
        NO_INTPTR_T = UnfortunatelyYes
-       # Bug report 10-120822-4477 submitted to HP NonStop development.
-       MKDIR_WO_TRAILING_SLASH = YesPlease
-       # RFE 10-120912-4693 submitted to HP NonStop development.
-       NO_SETITIMER = UnfortunatelyYes
        SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin
        SHELL_PATH = /usr/coreutils/bin/bash
 endif
@@ -636,7 +627,6 @@ ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
        prefix =
        INSTALL = /bin/install
        EXTLIBS += /mingw/lib/libz.a
-       NO_R_TO_GCC_LINKER = YesPlease
        INTERNAL_QSORT = YesPlease
        HAVE_LIBCHARSET_H = YesPlease
        NO_GETTEXT = YesPlease
@@ -669,7 +659,6 @@ else
                        -fstack-protector-strong
                EXTLIBS += -lntdll
                INSTALL = /bin/install
-               NO_R_TO_GCC_LINKER = YesPlease
                INTERNAL_QSORT = YesPlease
                HAVE_LIBCHARSET_H = YesPlease
                NO_GETTEXT =
@@ -695,7 +684,6 @@ ifeq ($(uname_S),QNX)
        NO_MKDTEMP = YesPlease
        NO_NSEC = YesPlease
        NO_PTHREADS = YesPlease
-       NO_R_TO_GCC_LINKER = YesPlease
        NO_STRCASESTR = YesPlease
        NO_STRLCPY = YesPlease
 endif
index df539a44fa0a1b5c4516d1766dfe24e8ee30204e..c151dd7257f31c0641160404e93b71abee7e315e 100644 (file)
@@ -114,6 +114,16 @@ macro(parse_makefile_for_scripts list_var regex lang)
        endif()
 endmacro()
 
+macro(parse_makefile_for_executables list_var regex)
+       file(STRINGS ${CMAKE_SOURCE_DIR}/Makefile ${list_var} REGEX "^${regex} \\+= git-(.*)")
+       string(REPLACE "${regex} +=" "" ${list_var} ${${list_var}})
+       string(STRIP ${${list_var}} ${list_var}) #remove trailing/leading whitespaces
+       string(REPLACE "git-" "" ${list_var} ${${list_var}}) #strip `git-` prefix
+       string(REPLACE "\$X" ";" ${list_var} ${${list_var}}) #strip $X, ; is for converting the string into a list
+       list(TRANSFORM ${list_var} STRIP) #remove trailing/leading whitespaces for each element in list
+       list(REMOVE_ITEM ${list_var} "") #remove empty list elements
+endmacro()
+
 include(CheckTypeSize)
 include(CheckCSourceRuns)
 include(CheckCSourceCompiles)
@@ -673,10 +683,7 @@ if(CURL_FOUND)
        endif()
 endif()
 
-set(git_builtin_extra
-       cherry cherry-pick format-patch fsck-objects
-       init merge-subtree restore show
-       stage status switch whatchanged)
+parse_makefile_for_executables(git_builtin_extra "BUILT_INS")
 
 #Creating hardlinks
 foreach(s ${git_SOURCES} ${git_builtin_extra})
index 2ff96204596445345e4566f37427c5ca49111419..ed6c45988a38b0f45a2b67a15cb18a221ad911c7 100755 (executable)
@@ -351,7 +351,7 @@ sub handleLinkLine
         } elsif ("$part" eq "-lexpat") {
             push(@libs, "libexpat.lib");
         } elsif ("$part" eq "-liconv") {
-            push(@libs, "libiconv.lib");
+            push(@libs, "iconv.lib");
         } elsif ($part =~ /^[-\/]/) {
             push(@lflags, $part);
         } elsif ($part =~ /\.(a|lib)$/) {
index 0a96ad87e7b6d8723175d3b97c18921ddc737d7b..463a3124da0a98715e074bf057dac1b67f79b3be 100644 (file)
@@ -416,14 +416,13 @@ __gitcomp_builtin ()
        local options
        eval "options=\${$var-}"
 
-       local completion_helper
-       if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then
-               completion_helper="--git-completion-helper-all"
-       else
-               completion_helper="--git-completion-helper"
-       fi
-
        if [ -z "$options" ]; then
+               local completion_helper
+               if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then
+                       completion_helper="--git-completion-helper-all"
+               else
+                       completion_helper="--git-completion-helper"
+               fi
                # leading and trailing spaces are significant to make
                # option removal work correctly.
                options=" $incl $(__git ${cmd/_/ } $completion_helper) " || return
@@ -1121,26 +1120,44 @@ __git_pretty_aliases ()
 # __git_aliased_command requires 1 argument
 __git_aliased_command ()
 {
-       local word cmdline=$(__git config --get "alias.$1")
-       for word in $cmdline; do
-               case "$word" in
-               \!gitk|gitk)
-                       echo "gitk"
-                       return
-                       ;;
-               \!*)    : shell command alias ;;
-               -*)     : option ;;
-               *=*)    : setting env ;;
-               git)    : git itself ;;
-               \(\))   : skip parens of shell function definition ;;
-               {)      : skip start of shell helper function ;;
-               :)      : skip null command ;;
-               \'*)    : skip opening quote after sh -c ;;
-               *)
-                       echo "$word"
+       local cur=$1 last list word cmdline
+
+       while [[ -n "$cur" ]]; do
+               if [[ "$list" == *" $cur "* ]]; then
+                       # loop detected
                        return
-               esac
+               fi
+
+               cmdline=$(__git config --get "alias.$cur")
+               list=" $cur $list"
+               last=$cur
+               cur=
+
+               for word in $cmdline; do
+                       case "$word" in
+                       \!gitk|gitk)
+                               cur="gitk"
+                               break
+                               ;;
+                       \!*)    : shell command alias ;;
+                       -*)     : option ;;
+                       *=*)    : setting env ;;
+                       git)    : git itself ;;
+                       \(\))   : skip parens of shell function definition ;;
+                       {)      : skip start of shell helper function ;;
+                       :)      : skip null command ;;
+                       \'*)    : skip opening quote after sh -c ;;
+                       *)
+                               cur="$word"
+                               break
+                       esac
+               done
        done
+
+       cur=$last
+       if [[ "$cur" != "$1" ]]; then
+               echo "$cur"
+       fi
 }
 
 # Check whether one of the given words is present on the command line,
@@ -1467,14 +1484,15 @@ _git_bundle ()
 # Helper function to decide whether or not we should enable DWIM logic for
 # git-switch and git-checkout.
 #
-# To decide between the following rules in priority order
-# 1) the last provided of "--guess" or "--no-guess" explicitly enable or
-#    disable completion of DWIM logic respectively.
-# 2) If the --no-track option is provided, take this as a hint to disable the
-#    DWIM completion logic
-# 3) If GIT_COMPLETION_CHECKOUT_NO_GUESS is set, disable the DWIM completion
-#    logic, as requested by the user.
-# 4) Enable DWIM logic otherwise.
+# To decide between the following rules in decreasing priority order:
+# - the last provided of "--guess" or "--no-guess" explicitly enable or
+#   disable completion of DWIM logic respectively.
+# - If checkout.guess is false, disable completion of DWIM logic.
+# - If the --no-track option is provided, take this as a hint to disable the
+#   DWIM completion logic
+# - If GIT_COMPLETION_CHECKOUT_NO_GUESS is set, disable the DWIM completion
+#   logic, as requested by the user.
+# - Enable DWIM logic otherwise.
 #
 __git_checkout_default_dwim_mode ()
 {
@@ -1485,11 +1503,17 @@ __git_checkout_default_dwim_mode ()
        fi
 
        # --no-track disables DWIM, but with lower priority than
-       # --guess/--no-guess
+       # --guess/--no-guess/checkout.guess
        if [ -n "$(__git_find_on_cmdline "--no-track")" ]; then
                dwim_opt=""
        fi
 
+       # checkout.guess = false disables DWIM, but with lower priority than
+       # --guess/--no-guess
+       if [ "$(__git config --type=bool checkout.guess)" = "false" ]; then
+               dwim_opt=""
+       fi
+
        # Find the last provided --guess or --no-guess
        last_option="$(__git_find_last_on_cmdline "--guess --no-guess")"
        case "$last_option" in
@@ -1688,8 +1712,13 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
                        --submodule --submodule= --ignore-submodules
                        --indent-heuristic --no-indent-heuristic
                        --textconv --no-textconv
+                       --patch --no-patch
 "
 
+__git_diff_difftool_options="--cached --staged --pickaxe-all --pickaxe-regex
+                       --base --ours --theirs --no-index --relative --merge-base
+                       $__git_diff_common_options"
+
 _git_diff ()
 {
        __git_has_doubledash && return
@@ -1712,10 +1741,7 @@ _git_diff ()
                return
                ;;
        --*)
-               __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
-                       --base --ours --theirs --no-index
-                       $__git_diff_common_options
-                       "
+               __gitcomp "$__git_diff_difftool_options"
                return
                ;;
        esac
@@ -1737,11 +1763,7 @@ _git_difftool ()
                return
                ;;
        --*)
-               __gitcomp_builtin difftool "$__git_diff_common_options
-                                       --base --cached --ours --theirs
-                                       --pickaxe-all --pickaxe-regex
-                                       --relative --staged
-                                       "
+               __gitcomp_builtin difftool "$__git_diff_difftool_options"
                return
                ;;
        esac
@@ -1807,7 +1829,7 @@ _git_fsck ()
 
 _git_gitk ()
 {
-       _gitk
+       __gitk_main
 }
 
 # Lists matching symbol names from a tag (as in ctags) file.
@@ -2031,11 +2053,9 @@ _git_log ()
                        --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
-                       --patch --no-patch
                        "
                return
                ;;
@@ -2938,7 +2958,7 @@ _git_show ()
                ;;
        --*)
                __gitcomp "--pretty= --format= --abbrev-commit --no-abbrev-commit
-                       --oneline --show-signature --patch
+                       --oneline --show-signature
                        --expand-tabs --expand-tabs= --no-expand-tabs
                        $__git_diff_common_options
                        "
@@ -3021,7 +3041,10 @@ _git_stash ()
                list,--*)
                        __gitcomp "--name-status --oneline --patch-with-stat"
                        ;;
-               show,--*|branch,--*)
+               show,--*)
+                       __gitcomp "$__git_diff_common_options"
+                       ;;
+               branch,--*)
                        ;;
                branch,*)
                        if [ $cword -eq 3 ]; then
@@ -3458,88 +3481,8 @@ __gitk_main ()
        __git_complete_revlist
 }
 
-if [[ -n ${ZSH_VERSION-} ]] &&
-   # Don't define these functions when sourced from 'git-completion.zsh',
-   # it has its own implementations.
-   [[ -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then
-       echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
-
-       autoload -U +X compinit && compinit
-
-       __gitcomp ()
-       {
-               emulate -L zsh
-
-               local cur_="${3-$cur}"
-
-               case "$cur_" in
-               --*=)
-                       ;;
-               *)
-                       local c IFS=$' \t\n'
-                       local -a array
-                       for c in ${=1}; do
-                               c="$c${4-}"
-                               case $c in
-                               --*=*|*.) ;;
-                               *) c="$c " ;;
-                               esac
-                               array[${#array[@]}+1]="$c"
-                       done
-                       compset -P '*[=:]'
-                       compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
-                       ;;
-               esac
-       }
-
-       __gitcomp_direct ()
-       {
-               emulate -L zsh
-
-               local IFS=$'\n'
-               compset -P '*[=:]'
-               compadd -Q -- ${=1} && _ret=0
-       }
-
-       __gitcomp_nl ()
-       {
-               emulate -L zsh
-
-               local IFS=$'\n'
-               compset -P '*[=:]'
-               compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
-       }
-
-       __gitcomp_file_direct ()
-       {
-               emulate -L zsh
-
-               local IFS=$'\n'
-               compset -P '*[=:]'
-               compadd -f -- ${=1} && _ret=0
-       }
-
-       __gitcomp_file ()
-       {
-               emulate -L zsh
-
-               local IFS=$'\n'
-               compset -P '*[=:]'
-               compadd -p "${2-}" -f -- ${=1} && _ret=0
-       }
-
-       _git ()
-       {
-               local _ret=1 cur cword prev
-               cur=${words[CURRENT]}
-               prev=${words[CURRENT-1]}
-               let cword=CURRENT-1
-               emulate ksh -c __${service}_main
-               let _ret && _default && _ret=0
-               return _ret
-       }
-
-       compdef _git git gitk
+if [[ -n ${ZSH_VERSION-} && -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then
+       echo "ERROR: this script is obsolete, please see git-completion.zsh" 1>&2
        return
 fi
 
@@ -3561,18 +3504,6 @@ __git_complete ()
                || complete -o default -o nospace -F $wrapper $1
 }
 
-# wrapper for backwards compatibility
-_git ()
-{
-       __git_wrap__git_main
-}
-
-# wrapper for backwards compatibility
-_gitk ()
-{
-       __git_wrap__gitk_main
-}
-
 __git_complete git __git_main
 __git_complete gitk __gitk_main
 
@@ -3580,6 +3511,6 @@ __git_complete gitk __gitk_main
 # when the user has tab-completed the executable name and consequently
 # included the '.exe' suffix.
 #
-if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
-__git_complete git.exe __git_main
+if [ "$OSTYPE" = cygwin ]; then
+       __git_complete git.exe __git_main
 fi
index ce47e86b60c04c7a398c20ded985f4187e5d3533..6c56296997f939cf6c46719c4efbc2305211e9ee 100644 (file)
@@ -2,26 +2,24 @@
 
 # zsh completion wrapper for git
 #
-# Copyright (c) 2012-2013 Felipe Contreras <felipe.contreras@gmail.com>
+# Copyright (c) 2012-2020 Felipe Contreras <felipe.contreras@gmail.com>
 #
-# You need git's bash completion script installed somewhere, by default it
-# would be the location bash-completion uses.
+# The recommended way to install this script is to make a copy of it as a
+# file named '_git' inside any directory in your fpath.
 #
-# If your script is somewhere else, you can configure it on your ~/.zshrc:
+# For example, create a directory '~/.zsh/', copy this file to '~/.zsh/_git',
+# and then add the following to your ~/.zshrc file:
 #
-#  zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh
+#  fpath=(~/.zsh $fpath)
 #
-# 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:
+# You need git's bash completion script installed. By default bash-completion's
+# location will be used (e.g. pkg-config --variable=completionsdir bash-completion).
+#
+# If your bash completion script is somewhere else, you can specify the
+# location in your ~/.zshrc:
+#
+#  zstyle ':completion:*:*:git:*' script ~/.git-completion.bash
 #
-#  fpath=(~/.zsh $fpath)
-
-complete ()
-{
-       # do nothing
-       return 0
-}
 
 zstyle -T ':completion:*:*:git:*' tag-order && \
        zstyle ':completion:*:*:git:*' tag-order 'common-commands'
@@ -29,18 +27,26 @@ zstyle -T ':completion:*:*:git:*' tag-order && \
 zstyle -s ":completion:*:*:git:*" script script
 if [ -z "$script" ]; then
        local -a locations
-       local e
+       local e bash_completion
+
+       bash_completion=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null) ||
+               bash_completion='/usr/share/bash-completion/completions/'
+
        locations=(
-               $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
-               '/etc/bash_completion.d/git' # fedora, old debian
-               '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
-               '/usr/share/bash-completion/git' # gentoo
+               "$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
+               "$HOME/.local/share/bash-completion/completions/git"
+               "$bash_completion/git"
+               '/etc/bash_completion.d/git' # old debian
                )
        for e in $locations; do
                test -f $e && script="$e" && break
        done
 fi
+
+local old_complete="$functions[complete]"
+functions[complete]=:
 GIT_SOURCING_ZSH_COMPLETION=y . "$script"
+functions[complete]="$old_complete"
 
 __gitcomp ()
 {
@@ -51,13 +57,35 @@ __gitcomp ()
        case "$cur_" in
        --*=)
                ;;
+       --no-*)
+               local c IFS=$' \t\n'
+               local -a array
+               for c in ${=1}; do
+                       if [[ $c == "--" ]]; then
+                               continue
+                       fi
+                       c="$c${4-}"
+                       case $c in
+                       --*=|*.) ;;
+                       *) c="$c " ;;
+                       esac
+                       array+=("$c")
+               done
+               compset -P '*[=:]'
+               compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
+               ;;
        *)
                local c IFS=$' \t\n'
                local -a array
                for c in ${=1}; do
+                       if [[ $c == "--" ]]; then
+                               c="--no-...${4-}"
+                               array+=("$c ")
+                               break
+                       fi
                        c="$c${4-}"
                        case $c in
-                       --*=*|*.) ;;
+                       --*=|*.) ;;
                        *) c="$c " ;;
                        esac
                        array+=("$c")
@@ -72,44 +100,58 @@ __gitcomp_direct ()
 {
        emulate -L zsh
 
-       local IFS=$'\n'
        compset -P '*[=:]'
-       compadd -Q -- ${=1} && _ret=0
+       compadd -Q -S '' -- ${(f)1} && _ret=0
 }
 
 __gitcomp_nl ()
 {
        emulate -L zsh
 
-       local IFS=$'\n'
        compset -P '*[=:]'
-       compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
+       compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0
 }
 
-__gitcomp_nl_append ()
+__gitcomp_file ()
 {
        emulate -L zsh
 
-       local IFS=$'\n'
-       compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
+       compset -P '*[=:]'
+       compadd -f -p "${2-}" -- ${(f)1} && _ret=0
+}
+
+__gitcomp_direct_append ()
+{
+       __gitcomp_direct "$@"
+}
+
+__gitcomp_nl_append ()
+{
+       __gitcomp_nl "$@"
 }
 
 __gitcomp_file_direct ()
 {
-       emulate -L zsh
+       __gitcomp_file "$1" ""
+}
 
-       local IFS=$'\n'
-       compset -P '*[=:]'
-       compadd -f -- ${=1} && _ret=0
+_git_zsh ()
+{
+       __gitcomp "v1.1"
 }
 
-__gitcomp_file ()
+__git_complete_command ()
 {
        emulate -L zsh
 
-       local IFS=$'\n'
-       compset -P '*[=:]'
-       compadd -p "${2-}" -f -- ${=1} && _ret=0
+       local command="$1"
+       local completion_func="_git_${command//-/_}"
+       if (( $+functions[$completion_func] )); then
+               emulate ksh -c $completion_func
+               return 0
+       else
+               return 1
+       fi
 }
 
 __git_zsh_bash_func ()
@@ -118,14 +160,12 @@ __git_zsh_bash_func ()
 
        local command=$1
 
-       local completion_func="_git_${command//-/_}"
-       declare -f $completion_func >/dev/null && $completion_func && return
+       __git_complete_command "$command" && return
 
        local expansion=$(__git_aliased_command "$command")
        if [ -n "$expansion" ]; then
                words[1]=$expansion
-               completion_func="_git_${expansion//-/_}"
-               declare -f $completion_func >/dev/null && $completion_func
+               __git_complete_command "$expansion"
        fi
 }
 
@@ -162,8 +202,9 @@ __git_zsh_cmd_common ()
 __git_zsh_cmd_alias ()
 {
        local -a list
-       list=(${${${(0)"$(git config -z --get-regexp '^alias\.')"}#alias.}%$'\n'*})
-       _describe -t alias-commands 'aliases' list $* && _ret=0
+       list=(${${(0)"$(git config -z --get-regexp '^alias\.*')"}#alias.})
+       list=(${(f)"$(printf "%s:alias for '%s'\n" ${(f@)list})"})
+       _describe -t alias-commands 'aliases' list && _ret=0
 }
 
 __git_zsh_cmd_all ()
@@ -201,10 +242,13 @@ __git_zsh_main ()
 
        case $state in
        (command)
-               _alternative \
-                         'alias-commands:alias:__git_zsh_cmd_alias' \
-                         'common-commands:common:__git_zsh_cmd_common' \
-                         'all-commands:all:__git_zsh_cmd_all' && _ret=0
+               _tags common-commands alias-commands all-commands
+               while _tags; do
+                       _requested common-commands && __git_zsh_cmd_common
+                       _requested alias-commands && __git_zsh_cmd_alias
+                       _requested all-commands && __git_zsh_cmd_all
+                       let _ret || break
+               done
                ;;
        (arg)
                local command="${words[1]}" __git_dir
@@ -235,8 +279,12 @@ _git ()
 
        if (( $+functions[__${service}_zsh_main] )); then
                __${service}_zsh_main
-       else
+       elif (( $+functions[__${service}_main] )); then
                emulate ksh -c __${service}_main
+       elif (( $+functions[_${service}] )); then
+               emulate ksh -c _${service}
+       elif (( $+functions[_${service//-/_}] )); then
+               emulate ksh -c _${service//-/_}
        fi
 
        let _ret && _default && _ret=0
index 16260bab73346ba79d8e96eda03628d7dbd4b75b..4640a1535d15968c0a16ce265d028282d43b0962 100644 (file)
@@ -97,7 +97,8 @@
 # If you would like a colored hint about the current dirty state, set
 # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
 # the colored output of "git status -sb" and are available only when
-# using __git_ps1 for PROMPT_COMMAND or precmd.
+# using __git_ps1 for PROMPT_COMMAND or precmd in Bash,
+# but always available in Zsh.
 #
 # If you would like __git_ps1 to do nothing in the case when the current
 # directory is set up to be ignored by git, then set
@@ -137,6 +138,7 @@ __git_ps1_show_upstream ()
        done <<< "$output"
 
        # parse configuration values
+       local option
        for option in ${GIT_PS1_SHOWUPSTREAM}; do
                case "$option" in
                git|svn) upstream="$option" ;;
@@ -553,9 +555,11 @@ __git_ps1 ()
 
        local z="${GIT_PS1_STATESEPARATOR-" "}"
 
-       # NO color option unless in PROMPT_COMMAND mode
-       if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
-               __git_ps1_colorize_gitstring
+       # NO color option unless in PROMPT_COMMAND mode or it's Zsh
+       if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
+               if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then
+                       __git_ps1_colorize_gitstring
+               fi
        fi
 
        b=${b##refs/heads/}
index 8c171dd959f69501706c565218665ef474252d43..d843df3afd0ec490102860c57621a6bc7295abdc 100755 (executable)
@@ -27,7 +27,7 @@ n,dry-run            don't recreate the branch"
 
 search_reflog () {
        sed -ne 's~^\([^ ]*\) .*        checkout: moving from '"$1"' .*~\1~p' \
-                < "$GIT_DIR"/logs/HEAD
+               < "$GIT_DIR"/logs/HEAD
 }
 
 search_reflog_merges () {
@@ -37,19 +37,18 @@ search_reflog_merges () {
        )
 }
 
-_x40="[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
+oid_pattern=$(git hash-object --stdin </dev/null | sed -e 's/./[0-9a-f]/g')
 
 search_merges () {
-        git rev-list --all --grep="Merge branch '$1'" \
-                --pretty=tformat:"%P %s" |
-        sed -ne "/^$_x40 \($_x40\) Merge .*/ {s//\1/p;$early_exit}"
+       git rev-list --all --grep="Merge branch '$1'" \
+               --pretty=tformat:"%P %s" |
+       sed -ne "/^$oid_pattern \($oid_pattern\) Merge .*/ {s//\1/p;$early_exit}"
 }
 
 search_merge_targets () {
        git rev-list --all --grep="Merge branch '[^']*' into $branch\$" \
                --pretty=tformat:"%H %s" --all |
-       sed -ne "/^\($_x40\) Merge .*/ {s//\1/p;$early_exit} "
+       sed -ne "/^\($oid_pattern\) Merge .*/ {s//\1/p;$early_exit} "
 }
 
 dry_run=
index f9cbd317fbbce89547a405783fb5cc69e7815efa..e54d53d1d0b3537b4fb4b0f22f9699cf38a2c3cf 100644 (file)
@@ -62,4 +62,11 @@ static inline void hashwrite_be32(struct hashfile *f, uint32_t data)
        hashwrite(f, &data, sizeof(data));
 }
 
+static inline size_t hashwrite_be64(struct hashfile *f, uint64_t data)
+{
+       data = htonll(data);
+       hashwrite(f, &data, sizeof(data));
+       return sizeof(data);
+}
+
 #endif
index f95c6de75fc843fd19f683b6217c5fe87f341cd1..b73cc1859a49eb8b7f3cf7321680dfda4d96c705 100644 (file)
@@ -13,6 +13,7 @@
 #include "submodule.h"
 #include "dir.h"
 #include "fsmonitor.h"
+#include "commit-reach.h"
 
 /*
  * diff-files
@@ -97,6 +98,8 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
 
        diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/");
 
+       refresh_fsmonitor(istate);
+
        if (diff_unmerged_stage < 0)
                diff_unmerged_stage = 2;
        entries = istate->cache_nr;
@@ -197,8 +200,17 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
                if (ce_uptodate(ce) || ce_skip_worktree(ce))
                        continue;
 
-               /* If CE_VALID is set, don't look at workdir for file removal */
-               if (ce->ce_flags & CE_VALID) {
+               /*
+                * When CE_VALID is set (via "update-index --assume-unchanged"
+                * or via adding paths while core.ignorestat is set to true),
+                * the user has promised that the working tree file for that
+                * path will not be modified.  When CE_FSMONITOR_VALID is true,
+                * the fsmonitor knows that the path hasn't been modified since
+                * we refreshed the cached stat information.  In either case,
+                * we do not have to stat to see if the path has been removed
+                * or modified.
+                */
+               if (ce->ce_flags & (CE_VALID | CE_FSMONITOR_VALID)) {
                        changed = 0;
                        newmode = ce->ce_mode;
                } else {
@@ -510,16 +522,74 @@ static int diff_cache(struct rev_info *revs,
        return unpack_trees(1, &t, &opts);
 }
 
-int run_diff_index(struct rev_info *revs, int cached)
+void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb)
+{
+       int i;
+       struct commit *mb_child[2] = {0};
+       struct commit_list *merge_bases;
+
+       for (i = 0; i < revs->pending.nr; i++) {
+               struct object *obj = revs->pending.objects[i].item;
+               if (obj->flags)
+                       die(_("--merge-base does not work with ranges"));
+               if (obj->type != OBJ_COMMIT)
+                       die(_("--merge-base only works with commits"));
+       }
+
+       /*
+        * This check must go after the for loop above because A...B
+        * ranges produce three pending commits, resulting in a
+        * misleading error message.
+        */
+       if (revs->pending.nr < 1 || revs->pending.nr > 2)
+               BUG("unexpected revs->pending.nr: %d", revs->pending.nr);
+
+       for (i = 0; i < revs->pending.nr; i++)
+               mb_child[i] = lookup_commit_reference(the_repository, &revs->pending.objects[i].item->oid);
+       if (revs->pending.nr == 1) {
+               struct object_id oid;
+
+               if (get_oid("HEAD", &oid))
+                       die(_("unable to get HEAD"));
+
+               mb_child[1] = lookup_commit_reference(the_repository, &oid);
+       }
+
+       merge_bases = repo_get_merge_bases(the_repository, mb_child[0], mb_child[1]);
+       if (!merge_bases)
+               die(_("no merge base found"));
+       if (merge_bases->next)
+               die(_("multiple merge bases found"));
+
+       oidcpy(mb, &merge_bases->item->object.oid);
+
+       free_commit_list(merge_bases);
+}
+
+int run_diff_index(struct rev_info *revs, unsigned int option)
 {
        struct object_array_entry *ent;
+       int cached = !!(option & DIFF_INDEX_CACHED);
+       int merge_base = !!(option & DIFF_INDEX_MERGE_BASE);
+       struct object_id oid;
+       const char *name;
+       char merge_base_hex[GIT_MAX_HEXSZ + 1];
 
        if (revs->pending.nr != 1)
                BUG("run_diff_index must be passed exactly one tree");
 
        trace_performance_enter();
        ent = revs->pending.objects;
-       if (diff_cache(revs, &ent->item->oid, ent->name, cached))
+
+       if (merge_base) {
+               diff_get_merge_base(revs, &oid);
+               name = oid_to_hex_r(merge_base_hex, &oid);
+       } else {
+               oidcpy(&oid, &ent->item->oid);
+               name = ent->name;
+       }
+
+       if (diff_cache(revs, &oid, name, cached))
                exit(128);
 
        diff_set_mnemonic_prefix(&revs->diffopt, "c/", cached ? "i/" : "w/");
@@ -536,10 +606,12 @@ int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
 
        repo_init_revisions(opt->repo, &revs, NULL);
        copy_pathspec(&revs.prune_data, &opt->pathspec);
+       diff_setup_done(&revs.diffopt);
        revs.diffopt = *opt;
 
        if (diff_cache(&revs, tree_oid, NULL, 1))
                exit(128);
+       clear_pathspec(&revs.prune_data);
        return 0;
 }
 
diff --git a/diff.c b/diff.c
index 2bb2f8f57e8b7ce5a6d861b7a1d598a7fbaf68e9..643f4f3f6d02583ba74b81a5454ec89a79784161 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -3587,6 +3587,8 @@ static void builtin_diff(const char *name_a,
                if (header.len && !o->flags.suppress_diff_headers)
                        ecbdata.header = &header;
                xpp.flags = o->xdl_opts;
+               xpp.ignore_regex = o->ignore_regex;
+               xpp.ignore_regex_nr = o->ignore_regex_nr;
                xpp.anchors = o->anchors;
                xpp.anchors_nr = o->anchors_nr;
                xecfg.ctxlen = o->context;
@@ -3716,6 +3718,8 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
                memset(&xpp, 0, sizeof(xpp));
                memset(&xecfg, 0, sizeof(xecfg));
                xpp.flags = o->xdl_opts;
+               xpp.ignore_regex = o->ignore_regex;
+               xpp.ignore_regex_nr = o->ignore_regex_nr;
                xpp.anchors = o->anchors;
                xpp.anchors_nr = o->anchors_nr;
                xecfg.ctxlen = o->context;
@@ -4111,6 +4115,9 @@ void diff_free_filespec_blob(struct diff_filespec *s)
 
 void diff_free_filespec_data(struct diff_filespec *s)
 {
+       if (!s)
+               return;
+
        diff_free_filespec_blob(s);
        FREE_AND_NULL(s->cnt_data);
 }
@@ -5203,6 +5210,22 @@ static int diff_opt_patience(const struct option *opt,
        return 0;
 }
 
+static int diff_opt_ignore_regex(const struct option *opt,
+                                const char *arg, int unset)
+{
+       struct diff_options *options = opt->value;
+       regex_t *regex;
+
+       BUG_ON_OPT_NEG(unset);
+       regex = xmalloc(sizeof(*regex));
+       if (regcomp(regex, arg, REG_EXTENDED | REG_NEWLINE))
+               return error(_("invalid regex given to -I: '%s'"), arg);
+       ALLOC_GROW(options->ignore_regex, options->ignore_regex_nr + 1,
+                  options->ignore_regex_alloc);
+       options->ignore_regex[options->ignore_regex_nr++] = regex;
+       return 0;
+}
+
 static int diff_opt_pickaxe_regex(const struct option *opt,
                                  const char *arg, int unset)
 {
@@ -5491,6 +5514,9 @@ static void prep_parse_options(struct diff_options *options)
                OPT_BIT_F(0, "ignore-blank-lines", &options->xdl_opts,
                          N_("ignore changes whose lines are all blank"),
                          XDF_IGNORE_BLANK_LINES, PARSE_OPT_NONEG),
+               OPT_CALLBACK_F('I', "ignore-matching-lines", options, N_("<regex>"),
+                              N_("ignore changes whose all lines match <regex>"),
+                              0, diff_opt_ignore_regex),
                OPT_BIT(0, "indent-heuristic", &options->xdl_opts,
                        N_("heuristic to shift diff hunk boundaries for easy reading"),
                        XDF_INDENT_HEURISTIC),
@@ -6289,9 +6315,9 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)
                        if (o->color_moved == COLOR_MOVED_ZEBRA_DIM)
                                dim_moved_lines(o);
 
-                       hashmap_free_entries(&add_lines, struct moved_entry,
+                       hashmap_clear_and_free(&add_lines, struct moved_entry,
                                                ent);
-                       hashmap_free_entries(&del_lines, struct moved_entry,
+                       hashmap_clear_and_free(&del_lines, struct moved_entry,
                                                ent);
                }
 
diff --git a/diff.h b/diff.h
index 11de52e9e9b0cc67704b56d6579970c95bc28cd7..9665e220063cd9543528c64b17f57dc761bad028 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -234,6 +234,10 @@ struct diff_options {
         */
        const char *pickaxe;
 
+       /* -I<regex> */
+       regex_t **ignore_regex;
+       size_t ignore_regex_nr, ignore_regex_alloc;
+
        const char *single_follow;
        const char *a_prefix, *b_prefix;
        const char *line_prefix;
@@ -578,12 +582,17 @@ void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc);
  */
 const char *diff_aligned_abbrev(const struct object_id *sha1, int);
 
+void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb);
+
 /* do not report anything on removed paths */
 #define DIFF_SILENT_ON_REMOVED 01
 /* report racily-clean paths as modified */
 #define DIFF_RACY_IS_MODIFIED 02
 int run_diff_files(struct rev_info *revs, unsigned int option);
-int run_diff_index(struct rev_info *revs, int cached);
+
+#define DIFF_INDEX_CACHED 01
+#define DIFF_INDEX_MERGE_BASE 02
+int run_diff_index(struct rev_info *revs, unsigned int option);
 
 int do_diff_cache(const struct object_id *, struct diff_options *);
 int diff_flush_patch_id(struct diff_options *, struct object_id *, int, int);
index 99e63e90f89afaf55ef16bb3c11c1546c4d76c2a..d367a6d24434727fd822754436db50d3fc277764 100644 (file)
@@ -407,7 +407,7 @@ static int find_exact_renames(struct diff_options *options)
                renames += find_identical_files(&file_table, i, options);
 
        /* Free the hash data structure and entries */
-       hashmap_free_entries(&file_table, struct file_similarity, entry);
+       hashmap_clear_and_free(&file_table, struct file_similarity, entry);
 
        return renames;
 }
diff --git a/dir.c b/dir.c
index 78387110e609e16d769b4c42bcba1d1effb731e0..d637461da5cb9a03f86fe06d7524b756045755ac 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -817,8 +817,8 @@ static void add_pattern_to_hashsets(struct pattern_list *pl, struct path_pattern
 
 clear_hashmaps:
        warning(_("disabling cone pattern matching"));
-       hashmap_free_entries(&pl->parent_hashmap, struct pattern_entry, ent);
-       hashmap_free_entries(&pl->recursive_hashmap, struct pattern_entry, ent);
+       hashmap_clear_and_free(&pl->parent_hashmap, struct pattern_entry, ent);
+       hashmap_clear_and_free(&pl->recursive_hashmap, struct pattern_entry, ent);
        pl->use_cone_patterns = 0;
 }
 
@@ -921,8 +921,8 @@ void clear_pattern_list(struct pattern_list *pl)
                free(pl->patterns[i]);
        free(pl->patterns);
        free(pl->filebuf);
-       hashmap_free_entries(&pl->recursive_hashmap, struct pattern_entry, ent);
-       hashmap_free_entries(&pl->parent_hashmap, struct pattern_entry, ent);
+       hashmap_clear_and_free(&pl->recursive_hashmap, struct pattern_entry, ent);
+       hashmap_clear_and_free(&pl->parent_hashmap, struct pattern_entry, ent);
 
        memset(pl, 0, sizeof(*pl));
 }
@@ -1040,9 +1040,9 @@ static int add_patterns_from_buffer(char *buf, size_t size,
  * an index if 'istate' is non-null), parse it and store the
  * exclude rules in "pl".
  *
- * If "ss" is not NULL, compute SHA-1 of the exclude file and fill
+ * If "oid_stat" is not NULL, compute oid of the exclude file and fill
  * stat data from disk (only valid if add_patterns returns zero). If
- * ss_valid is non-zero, "ss" must contain good value as input.
+ * oid_stat.valid is non-zero, "oid_stat" must contain good value as input.
  */
 static int add_patterns(const char *fname, const char *base, int baselen,
                        struct pattern_list *pl, struct index_state *istate,
@@ -1090,7 +1090,7 @@ static int add_patterns(const char *fname, const char *base, int baselen,
                        int pos;
                        if (oid_stat->valid &&
                            !match_stat_data_racy(istate, &oid_stat->stat, &st))
-                               ; /* no content change, ss->sha1 still good */
+                               ; /* no content change, oid_stat->oid still good */
                        else if (istate &&
                                 (pos = index_name_pos(istate, fname, strlen(fname))) >= 0 &&
                                 !ce_stage(istate->cache[pos]) &&
index b10c4323155b77f2ef271564cef862147a880596..876f90c759a09334bb4a47575c236d27f2887b98 100644 (file)
@@ -35,6 +35,7 @@ static int fetch_fsck_objects = -1;
 static int transfer_fsck_objects = -1;
 static int agent_supported;
 static int server_supports_filtering;
+static int advertise_sid;
 static struct shallow_lock shallow_lock;
 static const char *alternate_shallow_file;
 static struct strbuf fsck_msg_types = STRBUF_INIT;
@@ -326,6 +327,8 @@ static int find_common(struct fetch_negotiator *negotiator,
                        if (deepen_not_ok)      strbuf_addstr(&c, " deepen-not");
                        if (agent_supported)    strbuf_addf(&c, " agent=%s",
                                                            git_user_agent_sanitized());
+                       if (advertise_sid)
+                               strbuf_addf(&c, " session-id=%s", trace2_session_id());
                        if (args->filter_options.choice)
                                strbuf_addstr(&c, " filter");
                        packet_buf_write(&req_buf, "want %s%s\n", remote_hex, c.buf);
@@ -915,8 +918,9 @@ static int get_pack(struct fetch_pack_args *args,
        if (start_command(&cmd))
                die(_("fetch-pack: unable to fork off %s"), cmd_name);
        if (do_keep && pack_lockfiles) {
-               string_list_append_nodup(pack_lockfiles,
-                                        index_pack_lockfile(cmd.out));
+               char *pack_lockfile = index_pack_lockfile(cmd.out);
+               if (pack_lockfile)
+                       string_list_append_nodup(pack_lockfiles, pack_lockfile);
                close(cmd.out);
        }
 
@@ -979,6 +983,9 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
                                      agent_len, agent_feature);
        }
 
+       if (!server_supports("session-id"))
+               advertise_sid = 0;
+
        if (server_supports("shallow"))
                print_verbose(args, _("Server supports %s"), "shallow");
        else if (args->depth > 0 || is_repository_shallow(r))
@@ -1191,6 +1198,8 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,
                packet_buf_write(&req_buf, "command=fetch");
        if (server_supports_v2("agent", 0))
                packet_buf_write(&req_buf, "agent=%s", git_user_agent_sanitized());
+       if (advertise_sid && server_supports_v2("session-id", 0))
+               packet_buf_write(&req_buf, "session-id=%s", trace2_session_id());
        if (args->server_options && args->server_options->nr &&
            server_supports_v2("server-option", 1)) {
                int i;
@@ -1711,6 +1720,7 @@ static void fetch_pack_config(void)
        git_config_get_bool("repack.usedeltabaseoffset", &prefer_ofs_delta);
        git_config_get_bool("fetch.fsckobjects", &fetch_fsck_objects);
        git_config_get_bool("transfer.fsckobjects", &transfer_fsck_objects);
+       git_config_get_bool("transfer.advertisesid", &advertise_sid);
        if (!uri_protocols.nr) {
                char *str;
 
index bd22e1ea8865c086dd5e0c7fa32229036c1d83f3..9a664a4a5832daba2a69e1d91d996eddb1f8bb56 100644 (file)
@@ -626,8 +626,10 @@ int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
        void *current_branch_to_free;
        struct merge_parents merge_parents;
 
-       if (!suppress_dest_pattern_seen)
+       if (!suppress_dest_pattern_seen) {
+               string_list_append(&suppress_dest_patterns, "main");
                string_list_append(&suppress_dest_patterns, "master");
+       }
 
        memset(&merge_parents, 0, sizeof(merge_parents));
 
index 8a720187125798e7e18d145a68210f0d9e6780f7..bc3a1e8effa321bd40bb83170646b98ca7f2e968 100755 (executable)
@@ -30,9 +30,9 @@ my ($fraginfo_color) =
        $diff_use_color ? (
                $repo->get_color('color.diff.frag', 'cyan'),
        ) : ();
-my ($diff_plain_color) =
+my ($diff_context_color) =
        $diff_use_color ? (
-               $repo->get_color('color.diff.plain', ''),
+               $repo->get_color($repo->config('color.diff.context') ? 'color.diff.context' : 'color.diff.plain', ''),
        ) : ();
 my ($diff_old_color) =
        $diff_use_color ? (
@@ -483,10 +483,8 @@ sub list_and_choose {
                my $last_lf = 0;
 
                if ($opts->{HEADER}) {
-                       if (!$opts->{LIST_FLAT}) {
-                               print "     ";
-                       }
-                       print colored $header_color, "$opts->{HEADER}\n";
+                       my $indent = $opts->{LIST_FLAT} ? "" : "     ";
+                       print colored $header_color, "$indent$opts->{HEADER}\n";
                }
                for ($i = 0; $i < @stuff; $i++) {
                        my $chosen = $chosen[$i] ? '*' : ' ';
@@ -1048,7 +1046,7 @@ sub color_diff {
                colored((/^@/  ? $fraginfo_color :
                         /^\+/ ? $diff_new_color :
                         /^-/  ? $diff_old_color :
-                        $diff_plain_color),
+                        $diff_context_color),
                        $_);
        } @_;
 }
@@ -1830,6 +1828,13 @@ sub process_args {
                                $arg = shift @ARGV or die __("missing --");
                                if ($arg ne '--') {
                                        $patch_mode_revision = $arg;
+
+                                       # NEEDSWORK: Instead of comparing to the literal "HEAD",
+                                       # compare the commit objects instead so that other ways of
+                                       # saying the same thing (such as "@") are also handled
+                                       # appropriately.
+                                       #
+                                       # This applies to the cases below too.
                                        $patch_mode = ($arg eq 'HEAD' ?
                                                       'reset_head' : 'reset_nothead');
                                        $arg = shift @ARGV or die __("missing --");
index ea7e684ebb55481b8118adaab6dd2324cf7bf3e8..1f3f6e9fc5684d3e9dd2a0ac0260556955c9fa4b 100755 (executable)
@@ -39,37 +39,6 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
 TERM_BAD=bad
 TERM_GOOD=good
 
-bisect_head()
-{
-       if git rev-parse --verify -q BISECT_HEAD > /dev/null
-       then
-               echo BISECT_HEAD
-       else
-               echo HEAD
-       fi
-}
-
-bisect_start() {
-       git bisect--helper --bisect-start $@ || exit
-
-       #
-       # Change state.
-       # In case of mistaken revs or checkout error, or signals received,
-       # "bisect_auto_next" below may exit or misbehave.
-       # We have to trap this to be able to clean up using
-       # "bisect_clean_state".
-       #
-       trap 'git bisect--helper --bisect-clean-state' 0
-       trap 'exit 255' 1 2 3 15
-
-       #
-       # Check if we can proceed to the next bisect state.
-       #
-       git bisect--helper --bisect-auto-next || exit
-
-       trap '-' 0
-}
-
 bisect_skip() {
        all=''
        for arg in "$@"
@@ -82,43 +51,7 @@ bisect_skip() {
                esac
                all="$all $revs"
        done
-       eval bisect_state 'skip' $all
-}
-
-bisect_state() {
-       git bisect--helper --bisect-autostart || exit
-       state=$1
-       git bisect--helper --check-and-set-terms $state $TERM_GOOD $TERM_BAD || exit
-       get_terms
-       case "$#,$state" in
-       0,*)
-               die "Please call 'bisect_state' with at least one argument." ;;
-       1,"$TERM_BAD"|1,"$TERM_GOOD"|1,skip)
-               bisected_head=$(bisect_head)
-               rev=$(git rev-parse --verify "$bisected_head") ||
-                       die "$(eval_gettext "Bad rev input: \$bisected_head")"
-               git bisect--helper --bisect-write "$state" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit
-               git bisect--helper --check-expected-revs "$rev" ;;
-       2,"$TERM_BAD"|*,"$TERM_GOOD"|*,skip)
-               shift
-               hash_list=''
-               for rev in "$@"
-               do
-                       sha=$(git rev-parse --verify "$rev^{commit}") ||
-                               die "$(eval_gettext "Bad rev input: \$rev")"
-                       hash_list="$hash_list $sha"
-               done
-               for rev in $hash_list
-               do
-                       git bisect--helper --bisect-write "$state" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit
-               done
-               git bisect--helper --check-expected-revs $hash_list ;;
-       *,"$TERM_BAD")
-               die "$(eval_gettext "'git bisect \$TERM_BAD' can take only one argument.")" ;;
-       *)
-               usage ;;
-       esac
-       git bisect--helper --bisect-auto-next
+       eval git bisect--helper --bisect-state 'skip' $all
 }
 
 bisect_visualize() {
@@ -163,8 +96,7 @@ bisect_replay () {
                get_terms
                case "$command" in
                start)
-                       cmd="bisect_start $rev $tail"
-                       eval "$cmd" ;;
+                       eval "git bisect--helper --bisect-start $rev $tail" ;;
                "$TERM_GOOD"|"$TERM_BAD"|skip)
                        git bisect--helper --bisect-write "$command" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit;;
                terms)
@@ -209,8 +141,7 @@ exit code \$res from '\$command' is < 0 or >= 128" >&2
                        state="$TERM_GOOD"
                fi
 
-               # We have to use a subshell because "bisect_state" can exit.
-               ( bisect_state $state >"$GIT_DIR/BISECT_RUN" )
+               git bisect--helper --bisect-state $state >"$GIT_DIR/BISECT_RUN"
                res=$?
 
                cat "$GIT_DIR/BISECT_RUN"
@@ -225,7 +156,7 @@ exit code \$res from '\$command' is < 0 or >= 128" >&2
                if [ $res -ne 0 ]
                then
                        eval_gettextln "bisect run failed:
-'bisect_state \$state' exited with error code \$res" >&2
+'bisect-state \$state' exited with error code \$res" >&2
                        exit $res
                fi
 
@@ -264,9 +195,9 @@ case "$#" in
        help)
                git bisect -h ;;
        start)
-               bisect_start "$@" ;;
+               git bisect--helper --bisect-start "$@" ;;
        bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
-               bisect_state "$cmd" "$@" ;;
+               git bisect--helper --bisect-state "$cmd" "$@" ;;
        skip)
                bisect_skip "$@" ;;
        next)
index 7a0fb7a04597a4b6fa7ea48194aa334852104eb9..104993b97550c8df8f3834929e945dee43af2742 100644 (file)
@@ -273,7 +273,7 @@ struct itimerval {
 
 #ifdef NO_SETITIMER
 static inline int setitimer(int which, const struct itimerval *value, struct itimerval *newvalue) {
-       ; /* nothing */
+       return 0; /* pretend success */
 }
 #endif
 
@@ -489,11 +489,13 @@ static inline int const_error(void)
 #define error_errno(...) (error_errno(__VA_ARGS__), const_error())
 #endif
 
-void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
-void set_error_routine(void (*routine)(const char *err, va_list params));
-extern void (*get_error_routine(void))(const char *err, va_list params);
-void set_warn_routine(void (*routine)(const char *warn, va_list params));
-extern void (*get_warn_routine(void))(const char *warn, va_list params);
+typedef void (*report_fn)(const char *, va_list params);
+
+void set_die_routine(NORETURN_PTR report_fn routine);
+void set_error_routine(report_fn routine);
+report_fn get_error_routine(void);
+void set_warn_routine(report_fn routine);
+report_fn get_warn_routine(void);
 void set_die_is_recursing_routine(int (*routine)(void));
 
 int starts_with(const char *str, const char *prefix);
@@ -1352,4 +1354,6 @@ static inline void *container_of_or_null_offset(void *ptr, size_t offset)
        ((uintptr_t)&(ptr)->member - (uintptr_t)(ptr))
 #endif /* !__GNUC__ */
 
+void sleep_millisec(int millisec);
+
 #endif
index f10caedaa7a3970628148258ed8dc9f6a5e8c827..56c85a85c1e4930ae1cef3b51be4b4e5bf283773 100644 (file)
@@ -9,7 +9,9 @@ all::
 
 GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
+ifneq ($(MAKECMDGOALS),clean)
 -include GIT-VERSION-FILE
+endif
 
 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
 uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
index 1c99ee8ca20d43f45bb733ca1f9516aa6c9c9e97..71a536d232d32253639b163f0122d52f944e55e0 100755 (executable)
@@ -26,8 +26,21 @@ pack .m -side top -fill x -padx 20 -pady 20 -expand 1
 entry .e -textvariable answer -width 50
 pack .e -side top -fill x -padx 10 -pady 10
 
+proc on_show_input_changed {args} {
+       global show_input
+       if {$show_input} {
+               .e configure -show ""
+       } else {
+               .e configure -show "*"
+       }
+}
+trace add variable show_input write "on_show_input_changed"
+
+set show_input 0
+
 if {!$yesno} {
-       .e configure -show "*"
+       checkbutton .cb_show -text "Show input" -variable show_input
+       pack .cb_show -side top -anchor nw
 }
 
 frame .b
index 867b8cea4618360b98b78125b2507ed4bd9e1872..201524c34edac053f908c927a00270a7b1fdc09a 100755 (executable)
@@ -720,9 +720,6 @@ proc rmsel_tag {text} {
                -background [$text cget -background] \
                -foreground [$text cget -foreground] \
                -borderwidth 0
-       $text tag conf in_sel\
-               -background $color::select_bg \
-               -foreground $color::select_fg
        bind $text <Motion> break
        return $text
 }
@@ -1482,6 +1479,7 @@ proc rescan {after {honor_trustmtime 1}} {
                } elseif {[run_prepare_commit_msg_hook]} {
                } elseif {[load_message MERGE_MSG]} {
                } elseif {[load_message SQUASH_MSG]} {
+               } elseif {[load_message [get_config commit.template]]} {
                }
                $ui_comm edit reset
                $ui_comm edit modified false
@@ -1616,6 +1614,12 @@ proc run_prepare_commit_msg_hook {} {
                fconfigure $fd_sm -encoding utf-8
                puts -nonewline $fd_pcm [read $fd_sm]
                close $fd_sm
+       } elseif {[file isfile [get_config commit.template]]} {
+               set pcm_source "template"
+               set fd_sm [open [get_config commit.template] r]
+               fconfigure $fd_sm -encoding utf-8
+               puts -nonewline $fd_pcm [read $fd_sm]
+               close $fd_sm
        } else {
                set pcm_source ""
        }
@@ -2305,11 +2309,10 @@ proc do_quit {{rc {1}}} {
                if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {
                        file rename -force [gitdir GITGUI_BCK] $save
                        set GITGUI_BCK_exists 0
-               } else {
+               } elseif {[$ui_comm edit modified]} {
                        set msg [string trim [$ui_comm get 0.0 end]]
                        regsub -all -line {[ \r\t]+$} $msg {} msg
-                       if {(![string match amend* $commit_type]
-                               || [$ui_comm edit modified])
+                       if {![string match amend* $commit_type]
                                && $msg ne {}} {
                                catch {
                                        set fd [open $save w]
@@ -3322,11 +3325,20 @@ if {!$use_ttk} {
        .vpane.files paneconfigure .vpane.files.index -sticky news
 }
 
+proc set_selection_colors {w has_focus} {
+       foreach tag [list in_diff in_sel] {
+               $w tag conf $tag \
+                       -background [expr {$has_focus ? $color::select_bg : $color::inactive_select_bg}] \
+                       -foreground [expr {$has_focus ? $color::select_fg : $color::inactive_select_fg}]
+       }
+}
+
 foreach i [list $ui_index $ui_workdir] {
        rmsel_tag $i
-       $i tag conf in_diff \
-               -background $color::select_bg \
-               -foreground $color::select_fg
+
+       set_selection_colors $i 0
+       bind $i <FocusIn>       { set_selection_colors %W 1 }
+       bind $i <FocusOut>      { set_selection_colors %W 0 }
 }
 unset i
 
index b516aa29906911a6984f2e9ea539c2e25d23ae66..11379f8ad355e2ea2a7cf1645bc31543508731ab 100644 (file)
@@ -456,6 +456,7 @@ A rescan will be automatically started now.
        }
 
        $ui_comm delete 0.0 end
+       load_message [get_config commit.template]
        $ui_comm edit reset
        $ui_comm edit modified false
        if {$::GITGUI_BCK_exists} {
index 83e3ac795f3842b2ca615e91ba33ef53ad05cf25..f43d84e54fba18b5e2ebf5f9dbf28f3f8db8593d 100644 (file)
@@ -6,19 +6,25 @@ namespace eval color {
        # Variable colors
        # Preffered way to set widget colors is using add_option.
        # In some cases, like with tags in_diff/in_sel, we use these colors.
-       variable select_bg              lightgray
-       variable select_fg              black
+       variable select_bg                              lightgray
+       variable select_fg                              black
+       variable inactive_select_bg             lightgray
+       variable inactive_select_fg             black
 
        proc sync_with_theme {} {
-               set base_bg             [ttk::style lookup . -background]
-               set base_fg             [ttk::style lookup . -foreground]
-               set text_bg             [ttk::style lookup Treeview -background]
-               set text_fg             [ttk::style lookup Treeview -foreground]
-               set select_bg   [ttk::style lookup Default -selectbackground]
-               set select_fg   [ttk::style lookup Default -selectforeground]
+               set base_bg                             [ttk::style lookup . -background]
+               set base_fg                             [ttk::style lookup . -foreground]
+               set text_bg                             [ttk::style lookup Treeview -background]
+               set text_fg                             [ttk::style lookup Treeview -foreground]
+               set select_bg                   [ttk::style lookup Default -selectbackground]
+               set select_fg                   [ttk::style lookup Default -selectforeground]
+               set inactive_select_bg  [convert_rgb_to_gray $select_bg]
+               set inactive_select_fg  $select_fg
 
                set color::select_bg $select_bg
                set color::select_fg $select_fg
+               set color::inactive_select_bg $inactive_select_bg
+               set color::inactive_select_fg $inactive_select_fg
 
                proc add_option {key val} {
                        option add $key $val widgetDefault
@@ -34,11 +40,22 @@ namespace eval color {
                }
                add_option *Text.Background $text_bg
                add_option *Text.Foreground $text_fg
-               add_option *Text.HighlightBackground $base_bg
-               add_option *Text.HighlightColor $select_bg
+               add_option *Text.selectBackground $select_bg
+               add_option *Text.selectForeground $select_fg
+               add_option *Text.inactiveSelectBackground $inactive_select_bg
+               add_option *Text.inactiveSelectForeground $inactive_select_fg
        }
 }
 
+proc convert_rgb_to_gray {rgb} {
+       # Simply take the average of red, green and blue. This wouldn't be good
+       # enough for, say, converting a photo to grayscale, but for this simple
+       # purpose of approximating the brightness of a color it's good enough.
+       lassign [winfo rgb . $rgb] r g b
+       set gray [expr {($r / 256 + $g / 256 + $b / 256) / 3}]
+       return [format "#%2.2X%2.2X%2.2X" $gray $gray $gray]
+}
+
 proc ttk_get_current_theme {} {
        # Handle either current Tk or older versions of 8.5
        if {[catch {set theme [ttk::style theme use]}]} {
@@ -174,7 +191,7 @@ proc InitEntryFrame {} {
 
 proc gold_frame {w args} {
        global use_ttk
-       if {$use_ttk} {
+       if {$use_ttk && ![is_MacOSX]} {
                eval [linsert $args 0 ttk::frame $w -style Gold.TFrame]
        } else {
                eval [linsert $args 0 frame $w -background gold]
@@ -183,7 +200,7 @@ proc gold_frame {w args} {
 
 proc tlabel {w args} {
        global use_ttk
-       if {$use_ttk} {
+       if {$use_ttk && ![is_MacOSX]} {
                set cmd [list ttk::label $w -style Color.TLabel]
                foreach {k v} $args {
                        switch -glob -- $k {
index 9f5305c43eeb75c0e1b672efebe6a5aedca1a6ca..161ee1ac8cb06abe067a5b8390543e3123e3af00 100644 (file)
@@ -2,14 +2,14 @@
 # Copyright (C) 2007 Shawn Pearce
 # This file is distributed under the same license as the git-gui package.
 # Translators:
-# Dimitriy Ryazantcev <DJm00n@mail.ru>, 2015-2016
+# Dimitriy Ryazantcev <DJm00n@mail.ru>, 2015-2016,2020
 # Irina Riesen <irina.riesen@gmail.com>, 2007
 msgid ""
 msgstr ""
 "Project-Id-Version: Git Russian Localization Project\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-01-26 15:47-0800\n"
-"PO-Revision-Date: 2016-06-30 12:39+0000\n"
+"POT-Creation-Date: 2020-02-08 22:54+0100\n"
+"PO-Revision-Date: 2020-11-05 11:20+0000\n"
 "Last-Translator: Dimitriy Ryazantcev <DJm00n@mail.ru>\n"
 "Language-Team: Russian (http://www.transifex.com/djm00n/git-po-ru/language/ru/)\n"
 "MIME-Version: 1.0\n"
@@ -18,33 +18,33 @@ msgstr ""
 "Language: ru\n"
 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
 
-#: git-gui.sh:41 git-gui.sh:793 git-gui.sh:807 git-gui.sh:820 git-gui.sh:903
-#: git-gui.sh:922
-msgid "git-gui: fatal error"
-msgstr "git-gui: критическая ошибка"
-
-#: git-gui.sh:743
+#: git-gui.sh:847
 #, tcl-format
 msgid "Invalid font specified in %s:"
 msgstr "В %s установлен неверный шрифт:"
 
-#: git-gui.sh:779
+#: git-gui.sh:901
 msgid "Main Font"
 msgstr "Шрифт интерфейса"
 
-#: git-gui.sh:780
+#: git-gui.sh:902
 msgid "Diff/Console Font"
 msgstr "Шрифт консоли и изменений (diff)"
 
-#: git-gui.sh:794
+#: git-gui.sh:917 git-gui.sh:931 git-gui.sh:944 git-gui.sh:1034
+#: git-gui.sh:1053 git-gui.sh:3212
+msgid "git-gui: fatal error"
+msgstr "git-gui: критическая ошибка"
+
+#: git-gui.sh:918
 msgid "Cannot find git in PATH."
 msgstr "git не найден в PATH."
 
-#: git-gui.sh:821
+#: git-gui.sh:945
 msgid "Cannot parse Git version string:"
 msgstr "Невозможно распознать строку версии Git: "
 
-#: git-gui.sh:839
+#: git-gui.sh:970
 #, tcl-format
 msgid ""
 "Git version cannot be determined.\n"
@@ -56,473 +56,519 @@ msgid ""
 "Assume '%s' is version 1.5.0?\n"
 msgstr "Невозможно определить версию Git\n\n%s указывает на версию «%s».\n\nдля %s требуется версия Git, начиная с 1.5.0\n\nПредположить, что «%s» и есть версия 1.5.0?\n"
 
-#: git-gui.sh:1128
+#: git-gui.sh:1267
 msgid "Git directory not found:"
 msgstr "Каталог Git не найден:"
 
-#: git-gui.sh:1146
+#: git-gui.sh:1301
 msgid "Cannot move to top of working directory:"
 msgstr "Невозможно перейти к корню рабочего каталога репозитория: "
 
-#: git-gui.sh:1154
+#: git-gui.sh:1309
 msgid "Cannot use bare repository:"
 msgstr "Невозможно использование репозитория без рабочего каталога:"
 
-#: git-gui.sh:1162
+#: git-gui.sh:1317
 msgid "No working directory"
 msgstr "Отсутствует рабочий каталог"
 
-#: git-gui.sh:1334 lib/checkout_op.tcl:306
+#: git-gui.sh:1491 lib/checkout_op.tcl:306
 msgid "Refreshing file status..."
 msgstr "Обновление информации о состоянии файлов…"
 
-#: git-gui.sh:1390
+#: git-gui.sh:1551
 msgid "Scanning for modified files ..."
 msgstr "Поиск измененных файлов…"
 
-#: git-gui.sh:1454
+#: git-gui.sh:1629
 msgid "Calling prepare-commit-msg hook..."
 msgstr "Вызов перехватчика prepare-commit-msg…"
 
-#: git-gui.sh:1471
+#: git-gui.sh:1646
 msgid "Commit declined by prepare-commit-msg hook."
 msgstr "Коммит прерван перехватчиком prepare-commit-msg."
 
-#: git-gui.sh:1629 lib/browser.tcl:246
+#: git-gui.sh:1804 lib/browser.tcl:252
 msgid "Ready."
 msgstr "Готово."
 
-#: git-gui.sh:1787
+#: git-gui.sh:1968
 #, tcl-format
-msgid "Displaying only %s of %s files."
-msgstr "Показано %s из %s файлов."
+msgid ""
+"Display limit (gui.maxfilesdisplayed = %s) reached, not showing all %s "
+"files."
+msgstr "Лимит отображаемых файлов достигнут (gui.maxfilesdisplayed = %s), не все %s файлы показаны."
 
-#: git-gui.sh:1913
+#: git-gui.sh:2091
 msgid "Unmodified"
 msgstr "Не изменено"
 
-#: git-gui.sh:1915
+#: git-gui.sh:2093
 msgid "Modified, not staged"
 msgstr "Изменено, не в индексе"
 
-#: git-gui.sh:1916 git-gui.sh:1924
+#: git-gui.sh:2094 git-gui.sh:2106
 msgid "Staged for commit"
 msgstr "В индексе для коммита"
 
-#: git-gui.sh:1917 git-gui.sh:1925
+#: git-gui.sh:2095 git-gui.sh:2107
 msgid "Portions staged for commit"
 msgstr "Части, в индексе для коммита"
 
-#: git-gui.sh:1918 git-gui.sh:1926
+#: git-gui.sh:2096 git-gui.sh:2108
 msgid "Staged for commit, missing"
 msgstr "В индексе для коммита, отсутствует"
 
-#: git-gui.sh:1920
+#: git-gui.sh:2098
 msgid "File type changed, not staged"
 msgstr "Тип файла изменён, не в индексе"
 
-#: git-gui.sh:1921
+#: git-gui.sh:2099 git-gui.sh:2100
+msgid "File type changed, old type staged for commit"
+msgstr "Тип файла изменён, старый тип файла в индексе"
+
+#: git-gui.sh:2101
 msgid "File type changed, staged"
 msgstr "Тип файла изменён, в индексе"
 
-#: git-gui.sh:1923
+#: git-gui.sh:2102
+msgid "File type change staged, modification not staged"
+msgstr "Изменение типа файла в индексе, изменение не в индексе"
+
+#: git-gui.sh:2103
+msgid "File type change staged, file missing"
+msgstr "Изменение типа файла в индексе, файл не найден"
+
+#: git-gui.sh:2105
 msgid "Untracked, not staged"
 msgstr "Не отслеживается, не в индексе"
 
-#: git-gui.sh:1928
+#: git-gui.sh:2110
 msgid "Missing"
 msgstr "Отсутствует"
 
-#: git-gui.sh:1929
+#: git-gui.sh:2111
 msgid "Staged for removal"
 msgstr "В индексе для удаления"
 
-#: git-gui.sh:1930
+#: git-gui.sh:2112
 msgid "Staged for removal, still present"
 msgstr "В индексе для удаления, еще не удалено"
 
-#: git-gui.sh:1932 git-gui.sh:1933 git-gui.sh:1934 git-gui.sh:1935
-#: git-gui.sh:1936 git-gui.sh:1937
+#: git-gui.sh:2114 git-gui.sh:2115 git-gui.sh:2116 git-gui.sh:2117
+#: git-gui.sh:2118 git-gui.sh:2119
 msgid "Requires merge resolution"
 msgstr "Требуется разрешение конфликта при слиянии"
 
-#: git-gui.sh:1972
-msgid "Starting gitk... please wait..."
-msgstr "Запускается gitk… Подождите, пожалуйста…"
-
-#: git-gui.sh:1984
+#: git-gui.sh:2164
 msgid "Couldn't find gitk in PATH"
 msgstr "gitk не найден в PATH."
 
-#: git-gui.sh:2043
+#: git-gui.sh:2210 git-gui.sh:2245
+#, tcl-format
+msgid "Starting %s... please wait..."
+msgstr "Запускается %s… Подождите, пожалуйста…"
+
+#: git-gui.sh:2224
 msgid "Couldn't find git gui in PATH"
 msgstr "git gui не найден в PATH."
 
-#: git-gui.sh:2455 lib/choose_repository.tcl:36
+#: git-gui.sh:2726 lib/choose_repository.tcl:53
 msgid "Repository"
 msgstr "Репозиторий"
 
-#: git-gui.sh:2456
+#: git-gui.sh:2727
 msgid "Edit"
-msgstr "РедакÑ\82иÑ\80оваÑ\82Ñ\8c"
+msgstr "Ð\9fÑ\80авка"
 
-#: git-gui.sh:2458 lib/choose_rev.tcl:561
+#: git-gui.sh:2729 lib/choose_rev.tcl:567
 msgid "Branch"
 msgstr "Ветка"
 
-#: git-gui.sh:2461 lib/choose_rev.tcl:548
+#: git-gui.sh:2732 lib/choose_rev.tcl:554
 msgid "Commit@@noun"
 msgstr "Коммит"
 
-#: git-gui.sh:2464 lib/merge.tcl:121 lib/merge.tcl:150 lib/merge.tcl:168
+#: git-gui.sh:2735 lib/merge.tcl:127 lib/merge.tcl:174
 msgid "Merge"
 msgstr "Слияние"
 
-#: git-gui.sh:2465 lib/choose_rev.tcl:557
+#: git-gui.sh:2736 lib/choose_rev.tcl:563
 msgid "Remote"
 msgstr "Внешние репозитории"
 
-#: git-gui.sh:2468
+#: git-gui.sh:2739
 msgid "Tools"
 msgstr "Вспомогательные операции"
 
-#: git-gui.sh:2477
+#: git-gui.sh:2748
 msgid "Explore Working Copy"
 msgstr "Просмотр рабочего каталога"
 
-#: git-gui.sh:2483
+#: git-gui.sh:2763
+msgid "Git Bash"
+msgstr "Git Bash"
+
+#: git-gui.sh:2772
 msgid "Browse Current Branch's Files"
 msgstr "Просмотреть файлы текущей ветки"
 
-#: git-gui.sh:2487
+#: git-gui.sh:2776
 msgid "Browse Branch Files..."
 msgstr "Показать файлы ветки…"
 
-#: git-gui.sh:2492
+#: git-gui.sh:2781
 msgid "Visualize Current Branch's History"
 msgstr "Показать историю текущей ветки"
 
-#: git-gui.sh:2496
+#: git-gui.sh:2785
 msgid "Visualize All Branch History"
 msgstr "Показать историю всех веток"
 
-#: git-gui.sh:2503
+#: git-gui.sh:2792
 #, tcl-format
 msgid "Browse %s's Files"
 msgstr "Показать файлы ветки %s"
 
-#: git-gui.sh:2505
+#: git-gui.sh:2794
 #, tcl-format
 msgid "Visualize %s's History"
 msgstr "Показать историю ветки %s"
 
-#: git-gui.sh:2510 lib/database.tcl:27 lib/database.tcl:67
+#: git-gui.sh:2799 lib/database.tcl:40
 msgid "Database Statistics"
 msgstr "Статистика базы данных"
 
-#: git-gui.sh:2513 lib/database.tcl:34
+#: git-gui.sh:2802 lib/database.tcl:33
 msgid "Compress Database"
 msgstr "Сжать базу данных"
 
-#: git-gui.sh:2516
+#: git-gui.sh:2805
 msgid "Verify Database"
 msgstr "Проверить базу данных"
 
-#: git-gui.sh:2523 git-gui.sh:2527 git-gui.sh:2531 lib/shortcut.tcl:8
-#: lib/shortcut.tcl:40 lib/shortcut.tcl:72
+#: git-gui.sh:2812 git-gui.sh:2816 git-gui.sh:2820
 msgid "Create Desktop Icon"
 msgstr "Создать ярлык на рабочем столе"
 
-#: git-gui.sh:2539 lib/choose_repository.tcl:183 lib/choose_repository.tcl:191
+#: git-gui.sh:2828 lib/choose_repository.tcl:209 lib/choose_repository.tcl:217
 msgid "Quit"
 msgstr "Выход"
 
-#: git-gui.sh:2547
+#: git-gui.sh:2836
 msgid "Undo"
 msgstr "Отменить"
 
-#: git-gui.sh:2550
+#: git-gui.sh:2839
 msgid "Redo"
 msgstr "Повторить"
 
-#: git-gui.sh:2554 git-gui.sh:3109
+#: git-gui.sh:2843 git-gui.sh:3461
 msgid "Cut"
 msgstr "Вырезать"
 
-#: git-gui.sh:2557 git-gui.sh:3112 git-gui.sh:3186 git-gui.sh:3259
+#: git-gui.sh:2846 git-gui.sh:3464 git-gui.sh:3540 git-gui.sh:3633
 #: lib/console.tcl:69
 msgid "Copy"
 msgstr "Копировать"
 
-#: git-gui.sh:2560 git-gui.sh:3115
+#: git-gui.sh:2849 git-gui.sh:3467
 msgid "Paste"
 msgstr "Вставить"
 
-#: git-gui.sh:2563 git-gui.sh:3118 lib/branch_delete.tcl:26
-#: lib/remote_branch_delete.tcl:38
+#: git-gui.sh:2852 git-gui.sh:3470 lib/remote_branch_delete.tcl:39
+#: lib/branch_delete.tcl:28
 msgid "Delete"
 msgstr "Удалить"
 
-#: git-gui.sh:2567 git-gui.sh:3122 git-gui.sh:3263 lib/console.tcl:71
+#: git-gui.sh:2856 git-gui.sh:3474 git-gui.sh:3637 lib/console.tcl:71
 msgid "Select All"
-msgstr "Выделить все"
+msgstr "Выделить всё"
 
-#: git-gui.sh:2576
+#: git-gui.sh:2865
 msgid "Create..."
 msgstr "Создать…"
 
-#: git-gui.sh:2582
+#: git-gui.sh:2871
 msgid "Checkout..."
 msgstr "Перейти…"
 
-#: git-gui.sh:2588
+#: git-gui.sh:2877
 msgid "Rename..."
 msgstr "Переименовать…"
 
-#: git-gui.sh:2593
+#: git-gui.sh:2882
 msgid "Delete..."
 msgstr "Удалить…"
 
-#: git-gui.sh:2598
+#: git-gui.sh:2887
 msgid "Reset..."
 msgstr "Сбросить…"
 
-#: git-gui.sh:2608
+#: git-gui.sh:2897
 msgid "Done"
 msgstr "Завершено"
 
-#: git-gui.sh:2610
+#: git-gui.sh:2899
 msgid "Commit@@verb"
 msgstr "Закоммитить"
 
-#: git-gui.sh:2619 git-gui.sh:3050
-msgid "New Commit"
-msgstr "Новый коммит"
-
-#: git-gui.sh:2627 git-gui.sh:3057
+#: git-gui.sh:2908 git-gui.sh:3400
 msgid "Amend Last Commit"
 msgstr "Исправить последний коммит"
 
-#: git-gui.sh:2637 git-gui.sh:3011 lib/remote_branch_delete.tcl:99
+#: git-gui.sh:2918 git-gui.sh:3361 lib/remote_branch_delete.tcl:101
 msgid "Rescan"
 msgstr "Перечитать"
 
-#: git-gui.sh:2643
+#: git-gui.sh:2924
 msgid "Stage To Commit"
 msgstr "Добавить в индекс"
 
-#: git-gui.sh:2649
+#: git-gui.sh:2930
 msgid "Stage Changed Files To Commit"
 msgstr "Добавить изменённые файлы в индекс"
 
-#: git-gui.sh:2655
+#: git-gui.sh:2936
 msgid "Unstage From Commit"
 msgstr "Убрать из издекса"
 
-#: git-gui.sh:2661 lib/index.tcl:412
+#: git-gui.sh:2942 lib/index.tcl:521
 msgid "Revert Changes"
 msgstr "Обратить изменения"
 
-#: git-gui.sh:2669 git-gui.sh:3310 git-gui.sh:3341
+#: git-gui.sh:2950 git-gui.sh:3700 git-gui.sh:3731
 msgid "Show Less Context"
 msgstr "Меньше контекста"
 
-#: git-gui.sh:2673 git-gui.sh:3314 git-gui.sh:3345
+#: git-gui.sh:2954 git-gui.sh:3704 git-gui.sh:3735
 msgid "Show More Context"
 msgstr "Больше контекста"
 
-#: git-gui.sh:2680 git-gui.sh:3024 git-gui.sh:3133
+#: git-gui.sh:2961 git-gui.sh:3374 git-gui.sh:3485
 msgid "Sign Off"
 msgstr "Вставить Signed-off-by"
 
-#: git-gui.sh:2696
+#: git-gui.sh:2977
 msgid "Local Merge..."
 msgstr "Локальное слияние…"
 
-#: git-gui.sh:2701
+#: git-gui.sh:2982
 msgid "Abort Merge..."
 msgstr "Прервать слияние…"
 
-#: git-gui.sh:2713 git-gui.sh:2741
+#: git-gui.sh:2994 git-gui.sh:3022
 msgid "Add..."
 msgstr "Добавить…"
 
-#: git-gui.sh:2717
+#: git-gui.sh:2998
 msgid "Push..."
 msgstr "Отправить…"
 
-#: git-gui.sh:2721
+#: git-gui.sh:3002
 msgid "Delete Branch..."
 msgstr "Удалить ветку…"
 
-#: git-gui.sh:2731 git-gui.sh:3292
+#: git-gui.sh:3012 git-gui.sh:3666
 msgid "Options..."
 msgstr "Настройки…"
 
-#: git-gui.sh:2742
+#: git-gui.sh:3023
 msgid "Remove..."
 msgstr "Удалить…"
 
-#: git-gui.sh:2751 lib/choose_repository.tcl:50
+#: git-gui.sh:3032 lib/choose_repository.tcl:67
 msgid "Help"
-msgstr "Ð\9fомоÑ\89Ñ\8c"
+msgstr "СпÑ\80авка"
 
-#: git-gui.sh:2755 git-gui.sh:2759 lib/about.tcl:14
-#: lib/choose_repository.tcl:44 lib/choose_repository.tcl:53
+#: git-gui.sh:3036 git-gui.sh:3040 lib/choose_repository.tcl:61
+#: lib/choose_repository.tcl:70 lib/about.tcl:14
 #, tcl-format
 msgid "About %s"
 msgstr "О %s"
 
-#: git-gui.sh:2783
+#: git-gui.sh:3064
 msgid "Online Documentation"
 msgstr "Документация в интернете"
 
-#: git-gui.sh:2786 lib/choose_repository.tcl:47 lib/choose_repository.tcl:56
+#: git-gui.sh:3067 lib/choose_repository.tcl:64 lib/choose_repository.tcl:73
 msgid "Show SSH Key"
 msgstr "Показать ключ SSH"
 
-#: git-gui.sh:2893
+#: git-gui.sh:3097 git-gui.sh:3229
+msgid "usage:"
+msgstr "использование:"
+
+#: git-gui.sh:3101 git-gui.sh:3233
+msgid "Usage"
+msgstr "Использование"
+
+#: git-gui.sh:3182 lib/blame.tcl:575
+msgid "Error"
+msgstr "Ошибка"
+
+#: git-gui.sh:3213
 #, tcl-format
 msgid "fatal: cannot stat path %s: No such file or directory"
 msgstr "критическая ошибка: %s: нет такого файла или каталога"
 
-#: git-gui.sh:2926
+#: git-gui.sh:3246
 msgid "Current Branch:"
 msgstr "Текущая ветка:"
 
-#: git-gui.sh:2947
-msgid "Staged Changes (Will Commit)"
-msgstr "Изменения в индексе (будут закоммичены)"
-
-#: git-gui.sh:2967
+#: git-gui.sh:3271
 msgid "Unstaged Changes"
 msgstr "Изменено (не будет сохранено)"
 
-#: git-gui.sh:3017
+#: git-gui.sh:3293
+msgid "Staged Changes (Will Commit)"
+msgstr "Изменения в индексе (будут закоммичены)"
+
+#: git-gui.sh:3367
 msgid "Stage Changed"
 msgstr "Индексировать всё"
 
-#: git-gui.sh:3036 lib/transport.tcl:104 lib/transport.tcl:193
+#: git-gui.sh:3386 lib/transport.tcl:137
 msgid "Push"
 msgstr "Отправить"
 
-#: git-gui.sh:3071
+#: git-gui.sh:3413
 msgid "Initial Commit Message:"
 msgstr "Сообщение первого коммита:"
 
-#: git-gui.sh:3072
+#: git-gui.sh:3414
 msgid "Amended Commit Message:"
 msgstr "Сообщение исправленного коммита:"
 
-#: git-gui.sh:3073
+#: git-gui.sh:3415
 msgid "Amended Initial Commit Message:"
 msgstr "Сообщение исправленного первого коммита:"
 
-#: git-gui.sh:3074
+#: git-gui.sh:3416
 msgid "Amended Merge Commit Message:"
 msgstr "Сообщение исправленного слияния:"
 
-#: git-gui.sh:3075
+#: git-gui.sh:3417
 msgid "Merge Commit Message:"
 msgstr "Сообщение слияния:"
 
-#: git-gui.sh:3076
+#: git-gui.sh:3418
 msgid "Commit Message:"
 msgstr "Сообщение коммита:"
 
-#: git-gui.sh:3125 git-gui.sh:3267 lib/console.tcl:73
+#: git-gui.sh:3477 git-gui.sh:3641 lib/console.tcl:73
 msgid "Copy All"
 msgstr "Копировать все"
 
-#: git-gui.sh:3149 lib/blame.tcl:104
+#: git-gui.sh:3501 lib/blame.tcl:106
 msgid "File:"
 msgstr "Файл:"
 
-#: git-gui.sh:3255
+#: git-gui.sh:3549 lib/choose_repository.tcl:1100
+msgid "Open"
+msgstr "Открыть"
+
+#: git-gui.sh:3629
 msgid "Refresh"
 msgstr "Обновить"
 
-#: git-gui.sh:3276
+#: git-gui.sh:3650
 msgid "Decrease Font Size"
 msgstr "Уменьшить размер шрифта"
 
-#: git-gui.sh:3280
+#: git-gui.sh:3654
 msgid "Increase Font Size"
 msgstr "Увеличить размер шрифта"
 
-#: git-gui.sh:3288 lib/blame.tcl:281
+#: git-gui.sh:3662 lib/blame.tcl:296
 msgid "Encoding"
 msgstr "Кодировка"
 
-#: git-gui.sh:3299
+#: git-gui.sh:3673
 msgid "Apply/Reverse Hunk"
 msgstr "Применить/Убрать изменение"
 
-#: git-gui.sh:3304
+#: git-gui.sh:3678
 msgid "Apply/Reverse Line"
 msgstr "Применить/Убрать строку"
 
-#: git-gui.sh:3323
+#: git-gui.sh:3684 git-gui.sh:3794 git-gui.sh:3805
+msgid "Revert Hunk"
+msgstr "Обратить изменения блока"
+
+#: git-gui.sh:3689 git-gui.sh:3801 git-gui.sh:3812
+msgid "Revert Line"
+msgstr "Обратить изменения строки"
+
+#: git-gui.sh:3694 git-gui.sh:3791
+msgid "Undo Last Revert"
+msgstr "Отменить последнее обращение изменений"
+
+#: git-gui.sh:3713
 msgid "Run Merge Tool"
 msgstr "Запустить программу слияния"
 
-#: git-gui.sh:3328
+#: git-gui.sh:3718
 msgid "Use Remote Version"
 msgstr "Взять внешнюю версию"
 
-#: git-gui.sh:3332
+#: git-gui.sh:3722
 msgid "Use Local Version"
 msgstr "Взять локальную версию"
 
-#: git-gui.sh:3336
+#: git-gui.sh:3726
 msgid "Revert To Base"
 msgstr "Обратить изменения"
 
-#: git-gui.sh:3354
+#: git-gui.sh:3744
 msgid "Visualize These Changes In The Submodule"
 msgstr "Показать эти изменения подмодуля"
 
-#: git-gui.sh:3358
+#: git-gui.sh:3748
 msgid "Visualize Current Branch History In The Submodule"
 msgstr "Показать историю текущей ветки подмодуля"
 
-#: git-gui.sh:3362
+#: git-gui.sh:3752
 msgid "Visualize All Branch History In The Submodule"
 msgstr "Показать историю всех веток подмодуля"
 
-#: git-gui.sh:3367
+#: git-gui.sh:3757
 msgid "Start git gui In The Submodule"
 msgstr "Запустить git gui в подмодуле"
 
-#: git-gui.sh:3389
+#: git-gui.sh:3793
 msgid "Unstage Hunk From Commit"
 msgstr "Убрать блок из индекса"
 
-#: git-gui.sh:3391
+#: git-gui.sh:3797
 msgid "Unstage Lines From Commit"
 msgstr "Убрать строки из индекса"
 
-#: git-gui.sh:3393
+#: git-gui.sh:3798 git-gui.sh:3809
+msgid "Revert Lines"
+msgstr "Обратить изменения строк"
+
+#: git-gui.sh:3800
 msgid "Unstage Line From Commit"
 msgstr "Убрать строку из индекса"
 
-#: git-gui.sh:3396
+#: git-gui.sh:3804
 msgid "Stage Hunk For Commit"
 msgstr "Добавить блок в индекс"
 
-#: git-gui.sh:3398
+#: git-gui.sh:3808
 msgid "Stage Lines For Commit"
 msgstr "Добавить строки в индекс"
 
-#: git-gui.sh:3400
+#: git-gui.sh:3811
 msgid "Stage Line For Commit"
 msgstr "Добавить строку в индекс"
 
-#: git-gui.sh:3424
+#: git-gui.sh:3861
 msgid "Initializing..."
 msgstr "Инициализация…"
 
-#: git-gui.sh:3541
+#: git-gui.sh:4017
 #, tcl-format
 msgid ""
 "Possible environment issues exist.\n"
@@ -533,14 +579,14 @@ msgid ""
 "\n"
 msgstr "Возможны ошибки в переменных окружения.\n\nПеременные окружения, которые возможно\nбудут проигнорированы командами Git,\nзапущенными из %s\n\n"
 
-#: git-gui.sh:3570
+#: git-gui.sh:4046
 msgid ""
 "\n"
 "This is due to a known issue with the\n"
 "Tcl binary distributed by Cygwin."
 msgstr "\nЭто известная проблема с Tcl,\nраспространяемым Cygwin."
 
-#: git-gui.sh:3575
+#: git-gui.sh:4051
 #, tcl-format
 msgid ""
 "\n"
@@ -551,357 +597,201 @@ msgid ""
 "~/.gitconfig file.\n"
 msgstr "\n\nВместо использования %s можно\nсохранить значения user.name и\nuser.email в Вашем персональном\nфайле ~/.gitconfig.\n"
 
-#: lib/about.tcl:26
-msgid "git-gui - a graphical user interface for Git."
-msgstr "git-gui - графический пользовательский интерфейс к Git."
-
-#: lib/blame.tcl:72
-msgid "File Viewer"
-msgstr "Просмотр файла"
-
-#: lib/blame.tcl:78
-msgid "Commit:"
-msgstr "Коммит:"
-
-#: lib/blame.tcl:271
-msgid "Copy Commit"
-msgstr "Копировать SHA-1"
-
-#: lib/blame.tcl:275
-msgid "Find Text..."
-msgstr "Найти текст…"
-
-#: lib/blame.tcl:284
-msgid "Do Full Copy Detection"
-msgstr "Провести полный поиск копий"
+#: lib/spellcheck.tcl:57
+msgid "Unsupported spell checker"
+msgstr "Неподдерживаемая программа проверки правописания"
 
-#: lib/blame.tcl:288
-msgid "Show History Context"
-msgstr "Показать исторический контекст"
+#: lib/spellcheck.tcl:65
+msgid "Spell checking is unavailable"
+msgstr "Проверка правописания не доступна"
 
-#: lib/blame.tcl:291
-msgid "Blame Parent Commit"
-msgstr "Ð\90вÑ\82оÑ\80Ñ\8b Ñ\80одиÑ\82елÑ\8cÑ\81кого ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82а"
+#: lib/spellcheck.tcl:68
+msgid "Invalid spell checking configuration"
+msgstr "Ð\9dепÑ\80авилÑ\8cнаÑ\8f ÐºÐ¾Ð½Ñ\84игÑ\83Ñ\80аÑ\86иÑ\8f Ð¿Ñ\80огÑ\80аммÑ\8b Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f"
 
-#: lib/blame.tcl:450
+#: lib/spellcheck.tcl:70
 #, tcl-format
-msgid "Reading %s..."
-msgstr "Чтение %s…"
-
-#: lib/blame.tcl:557
-msgid "Loading copy/move tracking annotations..."
-msgstr "Загрузка аннотации копирований/переименований…"
-
-#: lib/blame.tcl:577
-msgid "lines annotated"
-msgstr "строк прокомментировано"
+msgid "Reverting dictionary to %s."
+msgstr "Словарь вернут к %s."
 
-#: lib/blame.tcl:769
-msgid "Loading original location annotations..."
-msgstr "Ð\97агÑ\80Ñ\83зка Ð°Ð½Ð½Ð¾Ñ\82аÑ\86ий Ð¿ÐµÑ\80вонаÑ\87алÑ\8cного Ð¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ\8f Ð¾Ð±Ñ\8aекÑ\82аâ\80¦"
+#: lib/spellcheck.tcl:73
+msgid "Spell checker silently failed on startup"
+msgstr "Ð\9fÑ\80огÑ\80амма Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f Ð½Ðµ Ñ\81могла Ð·Ð°Ð¿Ñ\83Ñ\81Ñ\82иÑ\82Ñ\8cÑ\81Ñ\8f"
 
-#: lib/blame.tcl:772
-msgid "Annotation complete."
-msgstr "Ð\90нноÑ\82аÑ\86иÑ\8f Ð·Ð°Ð²ÐµÑ\80Ñ\88ена."
+#: lib/spellcheck.tcl:80
+msgid "Unrecognized spell checker"
+msgstr "Ð\9dеÑ\80аÑ\81познаннаÑ\8f Ð¿Ñ\80огÑ\80амма Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f"
 
-#: lib/blame.tcl:802
-msgid "Busy"
-msgstr "Ð\97анÑ\8fÑ\82"
+#: lib/spellcheck.tcl:186
+msgid "No Suggestions"
+msgstr "Ð\98Ñ\81пÑ\80авлений Ð½Ðµ Ð½Ð°Ð¹Ð´ÐµÐ½Ð¾"
 
-#: lib/blame.tcl:803
-msgid "Annotation process is already running."
-msgstr "Ð\90нноÑ\82аÑ\86иÑ\8f Ñ\83же Ð·Ð°Ð¿Ñ\83Ñ\89ена"
+#: lib/spellcheck.tcl:388
+msgid "Unexpected EOF from spell checker"
+msgstr "Ð\9fÑ\80огÑ\80амма Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f Ð¿Ñ\80еÑ\80вала Ð¿ÐµÑ\80едаÑ\87Ñ\83 Ð´Ð°Ð½Ð½Ñ\8bÑ\85"
 
-#: lib/blame.tcl:842
-msgid "Running thorough copy detection..."
-msgstr "Ð\92Ñ\8bполнение Ð¿Ð¾Ð»Ð½Ð¾Ð³Ð¾ Ð¿Ð¾Ð¸Ñ\81ка ÐºÐ¾Ð¿Ð¸Ð¹â\80¦"
+#: lib/spellcheck.tcl:392
+msgid "Spell Checker Failed"
+msgstr "Ð\9eÑ\88ибка Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f"
 
-#: lib/blame.tcl:910
-msgid "Loading annotation..."
-msgstr "Загрузка аннотации…"
+#: lib/transport.tcl:6 lib/remote_add.tcl:132
+#, tcl-format
+msgid "fetch %s"
+msgstr "извлечение %s"
 
-#: lib/blame.tcl:963
-msgid "Author:"
-msgstr "Автор:"
+#: lib/transport.tcl:7
+#, tcl-format
+msgid "Fetching new changes from %s"
+msgstr "Извлечение изменений из %s "
 
-#: lib/blame.tcl:967
-msgid "Committer:"
-msgstr "Коммитер:"
+#: lib/transport.tcl:18
+#, tcl-format
+msgid "remote prune %s"
+msgstr "чистка внешнего %s"
 
-#: lib/blame.tcl:972
-msgid "Original File:"
-msgstr "Исходный файл:"
+#: lib/transport.tcl:19
+#, tcl-format
+msgid "Pruning tracking branches deleted from %s"
+msgstr "Чистка отслеживаемых веток, удалённых из %s"
 
-#: lib/blame.tcl:1020
-msgid "Cannot find HEAD commit:"
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð½Ð°Ð¹Ñ\82и Ñ\82екÑ\83Ñ\89ее Ñ\81оÑ\81Ñ\82оÑ\8fние:"
+#: lib/transport.tcl:25
+msgid "fetch all remotes"
+msgstr "извлеÑ\87Ñ\8c Ñ\81о Ð²Ñ\81еÑ\85 Ð²Ð½ÐµÑ\88ниÑ\85 Ñ\80епозиÑ\82оÑ\80иев"
 
-#: lib/blame.tcl:1075
-msgid "Cannot find parent commit:"
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð½Ð°Ð¹Ñ\82и Ñ\80одиÑ\82елÑ\8cÑ\81кое Ñ\81оÑ\81Ñ\82оÑ\8fние:"
+#: lib/transport.tcl:26
+msgid "Fetching new changes from all remotes"
+msgstr "Ð\9fолÑ\83Ñ\87ение Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹ Ñ\81о Ð²Ñ\81еÑ\85 Ð²Ð½ÐµÑ\88ниÑ\85 Ñ\80епозиÑ\82оÑ\80иев"
 
-#: lib/blame.tcl:1090
-msgid "Unable to display parent"
-msgstr "Не могу показать предка"
+#: lib/transport.tcl:40
+msgid "remote prune all remotes"
+msgstr "чистка всех внешних репозиториев"
 
-#: lib/blame.tcl:1091 lib/diff.tcl:320
-msgid "Error loading diff:"
-msgstr "Ð\9eÑ\88ибка Ð·Ð°Ð³Ñ\80Ñ\83зки Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹:"
+#: lib/transport.tcl:41
+msgid "Pruning tracking branches deleted from all remotes"
+msgstr "ЧиÑ\81Ñ\82ка Ð¾Ñ\82Ñ\81леживаемÑ\8bÑ\85 Ð²ÐµÑ\82ок, Ñ\83далÑ\91ннÑ\8bÑ\85 Ñ\81о Ð²Ñ\81еÑ\85 Ð²Ð½ÐµÑ\88ниÑ\85 Ñ\80епозиÑ\82оÑ\80иев"
 
-#: lib/blame.tcl:1231
-msgid "Originally By:"
-msgstr "Источник:"
+#: lib/transport.tcl:54 lib/transport.tcl:92 lib/transport.tcl:110
+#: lib/remote_add.tcl:162
+#, tcl-format
+msgid "push %s"
+msgstr "отправить %s"
 
-#: lib/blame.tcl:1237
-msgid "In File:"
-msgstr "Файл:"
+#: lib/transport.tcl:55
+#, tcl-format
+msgid "Pushing changes to %s"
+msgstr "Отправка изменений в %s "
 
-#: lib/blame.tcl:1242
-msgid "Copied Or Moved Here By:"
-msgstr "Скопировано/перемещено в:"
+#: lib/transport.tcl:93
+#, tcl-format
+msgid "Mirroring to %s"
+msgstr "Точное копирование в %s"
 
-#: lib/branch_checkout.tcl:14 lib/branch_checkout.tcl:19
-msgid "Checkout Branch"
-msgstr "Перейти на ветку"
+#: lib/transport.tcl:111
+#, tcl-format
+msgid "Pushing %s %s to %s"
+msgstr "Отправка %s %s в %s"
 
-#: lib/branch_checkout.tcl:23
-msgid "Checkout"
-msgstr "Ð\9fеÑ\80ейÑ\82и"
+#: lib/transport.tcl:132
+msgid "Push Branches"
+msgstr "Ð\9eÑ\82пÑ\80авиÑ\82Ñ\8c Ð²ÐµÑ\82ки"
 
-#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35
-#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:282
-#: lib/checkout_op.tcl:579 lib/choose_font.tcl:43 lib/merge.tcl:172
-#: lib/option.tcl:125 lib/remote_add.tcl:32 lib/remote_branch_delete.tcl:42
-#: lib/tools_dlg.tcl:40 lib/tools_dlg.tcl:204 lib/tools_dlg.tcl:352
-#: lib/transport.tcl:108
+#: lib/transport.tcl:141 lib/checkout_op.tcl:580 lib/remote_add.tcl:34
+#: lib/browser.tcl:292 lib/branch_checkout.tcl:30 lib/branch_rename.tcl:32
+#: lib/choose_font.tcl:45 lib/option.tcl:127 lib/tools_dlg.tcl:41
+#: lib/tools_dlg.tcl:202 lib/tools_dlg.tcl:345 lib/remote_branch_delete.tcl:43
+#: lib/branch_create.tcl:37 lib/branch_delete.tcl:34 lib/merge.tcl:178
 msgid "Cancel"
 msgstr "Отмена"
 
-#: lib/branch_checkout.tcl:32 lib/browser.tcl:287 lib/tools_dlg.tcl:328
-msgid "Revision"
-msgstr "Версия"
-
-#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:280
-msgid "Options"
-msgstr "Настройки"
-
-#: lib/branch_checkout.tcl:39 lib/branch_create.tcl:92
-msgid "Fetch Tracking Branch"
-msgstr "Извлечь изменения из внешней ветки"
+#: lib/transport.tcl:147
+msgid "Source Branches"
+msgstr "Исходные ветки"
 
-#: lib/branch_checkout.tcl:44
-msgid "Detach From Local Branch"
-msgstr "Ð\9eÑ\82Ñ\81оединиÑ\82Ñ\8c Ð¾Ñ\82 Ð»Ð¾ÐºÐ°Ð»Ñ\8cной Ð²ÐµÑ\82ки"
+#: lib/transport.tcl:162
+msgid "Destination Repository"
+msgstr "РепозиÑ\82оÑ\80ий Ð½Ð°Ð·Ð½Ð°Ñ\87ениÑ\8f"
 
-#: lib/branch_create.tcl:22
-msgid "Create Branch"
-msgstr "СоздаÑ\82Ñ\8c Ð²ÐµÑ\82кÑ\83"
+#: lib/transport.tcl:165 lib/remote_branch_delete.tcl:51
+msgid "Remote:"
+msgstr "внеÑ\88ний:"
 
-#: lib/branch_create.tcl:27
-msgid "Create New Branch"
-msgstr "СоздаÑ\82Ñ\8c Ð½Ð¾Ð²Ñ\83Ñ\8e Ð²ÐµÑ\82кÑ\83"
+#: lib/transport.tcl:187 lib/remote_branch_delete.tcl:72
+msgid "Arbitrary Location:"
+msgstr "Указанное Ð¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ðµ:"
 
-#: lib/branch_create.tcl:31 lib/choose_repository.tcl:381
-msgid "Create"
-msgstr "СоздаÑ\82Ñ\8c"
+#: lib/transport.tcl:205
+msgid "Transfer Options"
+msgstr "Ð\9dаÑ\81Ñ\82Ñ\80ойки Ð¾Ñ\82пÑ\80авки"
 
-#: lib/branch_create.tcl:40
-msgid "Branch Name"
-msgstr "Ð\98мÑ\8f Ð²ÐµÑ\82ки"
+#: lib/transport.tcl:207
+msgid "Force overwrite existing branch (may discard changes)"
+msgstr "Ð\9fÑ\80инÑ\83диÑ\82елÑ\8cно Ð¿ÐµÑ\80езапиÑ\81аÑ\82Ñ\8c Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83Ñ\8eÑ\89Ñ\83Ñ\8e Ð²ÐµÑ\82кÑ\83 (возможна Ð¿Ð¾Ñ\82еÑ\80Ñ\8f Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹)"
 
-#: lib/branch_create.tcl:43 lib/remote_add.tcl:39 lib/tools_dlg.tcl:50
-msgid "Name:"
-msgstr "Ð\9dазвание:"
+#: lib/transport.tcl:211
+msgid "Use thin pack (for slow network connections)"
+msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c thin pack (длÑ\8f Ð¼ÐµÐ´Ð»ÐµÐ½Ð½Ñ\8bÑ\85 Ñ\81еÑ\82евÑ\8bÑ\85 Ð¿Ð¾Ð´ÐºÐ»Ñ\8eÑ\87ений)"
 
-#: lib/branch_create.tcl:58
-msgid "Match Tracking Branch Name"
-msgstr "СооÑ\82веÑ\82Ñ\81Ñ\82воваÑ\82Ñ\8c Ð¸Ð¼ÐµÐ½Ð¸ Ð¾Ñ\82Ñ\81леживаемой Ð²етки"
+#: lib/transport.tcl:215
+msgid "Include tags"
+msgstr "Ð\9fеÑ\80едаÑ\82Ñ\8c Ð¼етки"
 
-#: lib/branch_create.tcl:66
-msgid "Starting Revision"
-msgstr "Начальная версия"
+#: lib/transport.tcl:229
+#, tcl-format
+msgid "%s (%s): Push"
+msgstr "%s (%s): Отправка"
 
-#: lib/branch_create.tcl:72
-msgid "Update Existing Branch:"
-msgstr "Обновить имеющуюся ветку:"
+#: lib/checkout_op.tcl:85
+#, tcl-format
+msgid "Fetching %s from %s"
+msgstr "Извлечение %s из %s "
 
-#: lib/branch_create.tcl:75
-msgid "No"
-msgstr "Нет"
+#: lib/checkout_op.tcl:133
+#, tcl-format
+msgid "fatal: Cannot resolve %s"
+msgstr "критическая ошибка: невозможно разрешить %s"
 
-#: lib/branch_create.tcl:80
-msgid "Fast Forward Only"
-msgstr "Только Fast Forward"
+#: lib/checkout_op.tcl:146 lib/sshkey.tcl:58 lib/console.tcl:81
+#: lib/database.tcl:30
+msgid "Close"
+msgstr "Закрыть"
 
-#: lib/branch_create.tcl:85 lib/checkout_op.tcl:571
-msgid "Reset"
-msgstr "Сброс"
+#: lib/checkout_op.tcl:175
+#, tcl-format
+msgid "Branch '%s' does not exist."
+msgstr "Ветка «%s» не существует."
 
-#: lib/branch_create.tcl:97
-msgid "Checkout After Creation"
-msgstr "После создания сделать текущей"
+#: lib/checkout_op.tcl:194
+#, tcl-format
+msgid "Failed to configure simplified git-pull for '%s'."
+msgstr "Ошибка создания упрощённой конфигурации git pull для «%s»."
 
-#: lib/branch_create.tcl:131
-msgid "Please select a tracking branch."
-msgstr "Укажите отлеживаемую ветку."
+#: lib/checkout_op.tcl:202 lib/branch_rename.tcl:102
+#, tcl-format
+msgid "Branch '%s' already exists."
+msgstr "Ветка «%s» уже существует."
 
-#: lib/branch_create.tcl:140
+#: lib/checkout_op.tcl:229
 #, tcl-format
-msgid "Tracking branch %s is not a branch in the remote repository."
-msgstr "Отслеживаемая ветка %s не является веткой на внешнем репозитории."
+msgid ""
+"Branch '%s' already exists.\n"
+"\n"
+"It cannot fast-forward to %s.\n"
+"A merge is required."
+msgstr "Ветка «%s» уже существует.\n\nОна не может быть перемотана вперед к %s.\nТребуется слияние."
 
-#: lib/branch_create.tcl:153 lib/branch_rename.tcl:86
-msgid "Please supply a branch name."
-msgstr "Укажите имя ветки."
+#: lib/checkout_op.tcl:243
+#, tcl-format
+msgid "Merge strategy '%s' not supported."
+msgstr "Неизвестная стратегия слияния «%s»."
 
-#: lib/branch_create.tcl:164 lib/branch_rename.tcl:106
+#: lib/checkout_op.tcl:262
 #, tcl-format
-msgid "'%s' is not an acceptable branch name."
-msgstr "Недопустимое имя ветки «%s»."
+msgid "Failed to update '%s'."
+msgstr "Не удалось обновить «%s»."
 
-#: lib/branch_delete.tcl:15
-msgid "Delete Branch"
-msgstr "Удаление ветки"
-
-#: lib/branch_delete.tcl:20
-msgid "Delete Local Branch"
-msgstr "Удалить локальную ветку"
-
-#: lib/branch_delete.tcl:37
-msgid "Local Branches"
-msgstr "Локальные ветки"
-
-#: lib/branch_delete.tcl:52
-msgid "Delete Only If Merged Into"
-msgstr "Удалить только в случае, если было слияние с"
-
-#: lib/branch_delete.tcl:54 lib/remote_branch_delete.tcl:119
-msgid "Always (Do not perform merge checks)"
-msgstr "Всегда (не выполнять проверку на слияние)"
-
-#: lib/branch_delete.tcl:103
-#, tcl-format
-msgid "The following branches are not completely merged into %s:"
-msgstr "Ветки, которые не полностью сливаются с %s:"
-
-#: lib/branch_delete.tcl:115 lib/remote_branch_delete.tcl:217
-msgid ""
-"Recovering deleted branches is difficult.\n"
-"\n"
-"Delete the selected branches?"
-msgstr "Восстановить удаленные ветки сложно.\n\nПродолжить?"
-
-#: lib/branch_delete.tcl:141
-#, tcl-format
-msgid ""
-"Failed to delete branches:\n"
-"%s"
-msgstr "Не удалось удалить ветки:\n%s"
-
-#: lib/branch_rename.tcl:14 lib/branch_rename.tcl:22
-msgid "Rename Branch"
-msgstr "Переименование ветки"
-
-#: lib/branch_rename.tcl:26
-msgid "Rename"
-msgstr "Переименовать"
-
-#: lib/branch_rename.tcl:36
-msgid "Branch:"
-msgstr "Ветка:"
-
-#: lib/branch_rename.tcl:39
-msgid "New Name:"
-msgstr "Новое название:"
-
-#: lib/branch_rename.tcl:75
-msgid "Please select a branch to rename."
-msgstr "Укажите ветку для переименования."
-
-#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:202
-#, tcl-format
-msgid "Branch '%s' already exists."
-msgstr "Ветка «%s» уже существует."
-
-#: lib/branch_rename.tcl:117
-#, tcl-format
-msgid "Failed to rename '%s'."
-msgstr "Не удалось переименовать «%s». "
-
-#: lib/browser.tcl:17
-msgid "Starting..."
-msgstr "Запуск…"
-
-#: lib/browser.tcl:26
-msgid "File Browser"
-msgstr "Просмотр списка файлов"
-
-#: lib/browser.tcl:126 lib/browser.tcl:143
-#, tcl-format
-msgid "Loading %s..."
-msgstr "Загрузка %s…"
-
-#: lib/browser.tcl:187
-msgid "[Up To Parent]"
-msgstr "[На уровень выше]"
-
-#: lib/browser.tcl:267 lib/browser.tcl:273
-msgid "Browse Branch Files"
-msgstr "Показать файлы ветки"
-
-#: lib/browser.tcl:278 lib/choose_repository.tcl:398
-#: lib/choose_repository.tcl:486 lib/choose_repository.tcl:497
-#: lib/choose_repository.tcl:1028
-msgid "Browse"
-msgstr "Показать"
-
-#: lib/checkout_op.tcl:85
-#, tcl-format
-msgid "Fetching %s from %s"
-msgstr "Извлечение %s из %s "
-
-#: lib/checkout_op.tcl:133
-#, tcl-format
-msgid "fatal: Cannot resolve %s"
-msgstr "критическая ошибка: невозможно разрешить %s"
-
-#: lib/checkout_op.tcl:146 lib/console.tcl:81 lib/database.tcl:31
-#: lib/sshkey.tcl:53
-msgid "Close"
-msgstr "Закрыть"
-
-#: lib/checkout_op.tcl:175
-#, tcl-format
-msgid "Branch '%s' does not exist."
-msgstr "Ветка «%s» не существует."
-
-#: lib/checkout_op.tcl:194
-#, tcl-format
-msgid "Failed to configure simplified git-pull for '%s'."
-msgstr "Ошибка создания упрощённой конфигурации git pull для «%s»."
-
-#: lib/checkout_op.tcl:229
-#, tcl-format
-msgid ""
-"Branch '%s' already exists.\n"
-"\n"
-"It cannot fast-forward to %s.\n"
-"A merge is required."
-msgstr "Ветка «%s» уже существует.\n\nОна не может быть перемотана вперед к %s.\nТребуется слияние."
-
-#: lib/checkout_op.tcl:243
-#, tcl-format
-msgid "Merge strategy '%s' not supported."
-msgstr "Неизвестная стратегия слияния «%s»."
-
-#: lib/checkout_op.tcl:262
-#, tcl-format
-msgid "Failed to update '%s'."
-msgstr "Не удалось обновить «%s»."
-
-#: lib/checkout_op.tcl:274
-msgid "Staging area (index) is already locked."
-msgstr "Рабочая область заблокирована другим процессом."
+#: lib/checkout_op.tcl:274
+msgid "Staging area (index) is already locked."
+msgstr "Рабочая область заблокирована другим процессом."
 
 #: lib/checkout_op.tcl:289
 msgid ""
@@ -921,51 +811,55 @@ msgstr "Обновление рабочего каталога из «%s»…"
 msgid "files checked out"
 msgstr "файлы извлечены"
 
-#: lib/checkout_op.tcl:376
+#: lib/checkout_op.tcl:377
 #, tcl-format
 msgid "Aborted checkout of '%s' (file level merging is required)."
 msgstr "Прерван переход на «%s» (требуется слияние содержимого файлов)"
 
-#: lib/checkout_op.tcl:377
+#: lib/checkout_op.tcl:378
 msgid "File level merge required."
 msgstr "Требуется слияние содержания файлов."
 
-#: lib/checkout_op.tcl:381
+#: lib/checkout_op.tcl:382
 #, tcl-format
 msgid "Staying on branch '%s'."
 msgstr "Ветка «%s» остаётся текущей."
 
-#: lib/checkout_op.tcl:452
+#: lib/checkout_op.tcl:453
 msgid ""
 "You are no longer on a local branch.\n"
 "\n"
 "If you wanted to be on a branch, create one now starting from 'This Detached Checkout'."
 msgstr "Вы более не находитесь на локальной ветке.\n\nЕсли вы хотите снова вернуться к какой-нибудь ветке, создайте её сейчас, начиная с «Текущего отсоединенного состояния»."
 
-#: lib/checkout_op.tcl:503 lib/checkout_op.tcl:507
+#: lib/checkout_op.tcl:504 lib/checkout_op.tcl:508
 #, tcl-format
 msgid "Checked out '%s'."
 msgstr "Выполнен переход на «%s»."
 
-#: lib/checkout_op.tcl:535
+#: lib/checkout_op.tcl:536
 #, tcl-format
 msgid "Resetting '%s' to '%s' will lose the following commits:"
 msgstr "Сброс «%s»  на «%s» приведет к потере следующих коммитов:"
 
-#: lib/checkout_op.tcl:557
+#: lib/checkout_op.tcl:558
 msgid "Recovering lost commits may not be easy."
 msgstr "Восстановить потерянные коммиты будет сложно."
 
-#: lib/checkout_op.tcl:562
+#: lib/checkout_op.tcl:563
 #, tcl-format
 msgid "Reset '%s'?"
 msgstr "Сбросить «%s»?"
 
-#: lib/checkout_op.tcl:567 lib/merge.tcl:164 lib/tools_dlg.tcl:343
+#: lib/checkout_op.tcl:568 lib/tools_dlg.tcl:336 lib/merge.tcl:170
 msgid "Visualize"
 msgstr "Наглядно"
 
-#: lib/checkout_op.tcl:635
+#: lib/checkout_op.tcl:572 lib/branch_create.tcl:85
+msgid "Reset"
+msgstr "Сброс"
+
+#: lib/checkout_op.tcl:636
 #, tcl-format
 msgid ""
 "Failed to set current branch.\n"
@@ -975,576 +869,498 @@ msgid ""
 "This should not have occurred.  %s will now close and give up."
 msgstr "Не удалось установить текущую ветку.\n\nВаш рабочий каталог обновлён только частично. Были обновлены все файлы кроме служебных файлов Git. \n\nЭтого не должно было произойти. %s завершается."
 
-#: lib/choose_font.tcl:39
-msgid "Select"
-msgstr "Выбрать"
+#: lib/remote_add.tcl:20
+#, tcl-format
+msgid "%s (%s): Add Remote"
+msgstr "%s (%s): Добавление внешнего репозитория"
 
-#: lib/choose_font.tcl:53
-msgid "Font Family"
-msgstr "ШÑ\80иÑ\84Ñ\82"
+#: lib/remote_add.tcl:25
+msgid "Add New Remote"
+msgstr "Ð\94обавиÑ\82Ñ\8c Ð²Ð½ÐµÑ\88ний Ñ\80епозиÑ\82оÑ\80ий"
 
-#: lib/choose_font.tcl:74
-msgid "Font Size"
-msgstr "РазмеÑ\80 Ñ\88Ñ\80иÑ\84Ñ\82а"
+#: lib/remote_add.tcl:30 lib/tools_dlg.tcl:37
+msgid "Add"
+msgstr "Ð\94обавиÑ\82Ñ\8c"
 
-#: lib/choose_font.tcl:91
-msgid "Font Example"
-msgstr "Ð\9fÑ\80имеÑ\80 Ñ\82екÑ\81Ñ\82а"
+#: lib/remote_add.tcl:39
+msgid "Remote Details"
+msgstr "Ð\98нÑ\84оÑ\80маÑ\86иÑ\8f Ð¾ Ð²Ð½ÐµÑ\88нем Ñ\80епозиÑ\82оÑ\80ии"
 
-#: lib/choose_font.tcl:103
-msgid ""
-"This is example text.\n"
-"If you like this text, it can be your font."
-msgstr "Это пример текста.\nЕсли Вам нравится этот текст, это может быть Ваш шрифт."
+#: lib/remote_add.tcl:41 lib/tools_dlg.tcl:51 lib/branch_create.tcl:44
+msgid "Name:"
+msgstr "Название:"
 
-#: lib/choose_repository.tcl:28
-msgid "Git Gui"
-msgstr "Git Gui"
+#: lib/remote_add.tcl:50
+msgid "Location:"
+msgstr "Положение:"
 
-#: lib/choose_repository.tcl:87 lib/choose_repository.tcl:386
-msgid "Create New Repository"
-msgstr "СоздаÑ\82Ñ\8c Ð½Ð¾Ð²Ñ\8bй Ñ\80епозиÑ\82оÑ\80ий"
+#: lib/remote_add.tcl:60
+msgid "Further Action"
+msgstr "СледÑ\83Ñ\8eÑ\89аÑ\8f Ð¾Ð¿ÐµÑ\80аÑ\86иÑ\8f"
 
-#: lib/choose_repository.tcl:93
-msgid "New..."
-msgstr "Ð\9dовÑ\8bйâ\80¦"
+#: lib/remote_add.tcl:63
+msgid "Fetch Immediately"
+msgstr "СÑ\80азÑ\83 Ð¸Ð·Ð²Ð»ÐµÑ\87Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f"
 
-#: lib/choose_repository.tcl:100 lib/choose_repository.tcl:471
-msgid "Clone Existing Repository"
-msgstr "СклониÑ\80оваÑ\82Ñ\8c Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83Ñ\8eÑ\89ий Ñ\80епозиÑ\82оÑ\80ий"
+#: lib/remote_add.tcl:69
+msgid "Initialize Remote Repository and Push"
+msgstr "Ð\98ниÑ\86иализиÑ\80оваÑ\82Ñ\8c Ð²Ð½ÐµÑ\88ний Ñ\80епозиÑ\82оÑ\80ий Ð¸ Ð¾Ñ\82пÑ\80авиÑ\82Ñ\8c"
 
-#: lib/choose_repository.tcl:106
-msgid "Clone..."
-msgstr "Ð\9aлониÑ\80оваÑ\82Ñ\8câ\80¦"
+#: lib/remote_add.tcl:75
+msgid "Do Nothing Else Now"
+msgstr "Ð\91олÑ\8cÑ\88е Ð½Ð¸Ñ\87его Ð½Ðµ Ð´ÐµÐ»Ð°Ñ\82Ñ\8c"
 
-#: lib/choose_repository.tcl:113 lib/choose_repository.tcl:1016
-msgid "Open Existing Repository"
-msgstr "Ð\92Ñ\8bбÑ\80аÑ\82Ñ\8c Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83Ñ\8eÑ\89ий Ñ\80епозиÑ\82оÑ\80ий"
+#: lib/remote_add.tcl:100
+msgid "Please supply a remote name."
+msgstr "УкажиÑ\82е Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ðµ Ð²Ð½ÐµÑ\88него Ñ\80епозиÑ\82оÑ\80иÑ\8f."
 
-#: lib/choose_repository.tcl:119
-msgid "Open..."
-msgstr "Открыть…"
+#: lib/remote_add.tcl:113
+#, tcl-format
+msgid "'%s' is not an acceptable remote name."
+msgstr "«%s» не является допустимым именем внешнего репозитория."
 
-#: lib/choose_repository.tcl:132
-msgid "Recent Repositories"
-msgstr "Недавние репозитории"
+#: lib/remote_add.tcl:124
+#, tcl-format
+msgid "Failed to add remote '%s' of location '%s'."
+msgstr "Не удалось добавить «%s» из «%s». "
 
-#: lib/choose_repository.tcl:138
-msgid "Open Recent Repository:"
-msgstr "Открыть последний репозиторий"
+#: lib/remote_add.tcl:133
+#, tcl-format
+msgid "Fetching the %s"
+msgstr "Извлечение %s"
 
-#: lib/choose_repository.tcl:306 lib/choose_repository.tcl:313
-#: lib/choose_repository.tcl:320
+#: lib/remote_add.tcl:156
 #, tcl-format
-msgid "Failed to create repository %s:"
-msgstr "Не удалось создать репозиторий %s:"
+msgid "Do not know how to initialize repository at location '%s'."
+msgstr "Невозможно инициализировать репозиторий в «%s»."
 
-#: lib/choose_repository.tcl:391
-msgid "Directory:"
-msgstr "Каталог:"
+#: lib/remote_add.tcl:163
+#, tcl-format
+msgid "Setting up the %s (at %s)"
+msgstr "Настройка %s (в %s)"
 
-#: lib/choose_repository.tcl:423 lib/choose_repository.tcl:550
-#: lib/choose_repository.tcl:1052
-msgid "Git Repository"
-msgstr "Репозиторий"
+#: lib/browser.tcl:17
+msgid "Starting..."
+msgstr "Запуск…"
 
-#: lib/choose_repository.tcl:448
+#: lib/browser.tcl:27
 #, tcl-format
-msgid "Directory %s already exists."
-msgstr "Каталог '%s' уже существует."
+msgid "%s (%s): File Browser"
+msgstr "%s (%s): Просмотр списка файлов"
 
-#: lib/choose_repository.tcl:452
+#: lib/browser.tcl:132 lib/browser.tcl:149
 #, tcl-format
-msgid "File %s already exists."
-msgstr "Файл '%s' Ñ\83же Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83еÑ\82."
+msgid "Loading %s..."
+msgstr "Ð\97агÑ\80Ñ\83зка %sâ\80¦"
 
-#: lib/choose_repository.tcl:466
-msgid "Clone"
-msgstr "Склонировать"
+#: lib/browser.tcl:193
+msgid "[Up To Parent]"
+msgstr "[На уровень выше]"
 
-#: lib/choose_repository.tcl:479
-msgid "Source Location:"
-msgstr "Исходное положение:"
+#: lib/browser.tcl:275
+#, tcl-format
+msgid "%s (%s): Browse Branch Files"
+msgstr "%s (%s): Просмотр файлов ветки"
 
-#: lib/choose_repository.tcl:490
-msgid "Target Directory:"
-msgstr "Ð\9aаÑ\82алог Ð½Ð°Ð·Ð½Ð°Ñ\87ениÑ\8f:"
+#: lib/browser.tcl:282
+msgid "Browse Branch Files"
+msgstr "Ð\9fоказаÑ\82Ñ\8c Ñ\84айлÑ\8b Ð²ÐµÑ\82ки"
 
-#: lib/choose_repository.tcl:502
-msgid "Clone Type:"
-msgstr "Тип клона:"
+#: lib/browser.tcl:288 lib/choose_repository.tcl:437
+#: lib/choose_repository.tcl:524 lib/choose_repository.tcl:533
+#: lib/choose_repository.tcl:1115
+msgid "Browse"
+msgstr "Показать"
 
-#: lib/choose_repository.tcl:508
-msgid "Standard (Fast, Semi-Redundant, Hardlinks)"
-msgstr "СÑ\82андаÑ\80Ñ\82нÑ\8bй (Ð\91Ñ\8bÑ\81Ñ\82Ñ\80Ñ\8bй, Ð¿Ð¾Ð»Ñ\83избÑ\8bÑ\82оÑ\87нÑ\8bй, Â«Ð¶ÐµÑ\81Ñ\82кие» Ñ\81Ñ\81Ñ\8bлки)"
+#: lib/browser.tcl:297 lib/branch_checkout.tcl:35 lib/tools_dlg.tcl:321
+msgid "Revision"
+msgstr "Ð\92еÑ\80Ñ\81иÑ\8f"
 
-#: lib/choose_repository.tcl:514
-msgid "Full Copy (Slower, Redundant Backup)"
-msgstr "Ð\9fолнаÑ\8f ÐºÐ¾Ð¿Ð¸Ñ\8f (Ð\9cедленнÑ\8bй, Ñ\81оздаеÑ\82 Ñ\80езеÑ\80внÑ\83Ñ\8e ÐºÐ¾Ð¿Ð¸Ñ\8e)"
+#: lib/index.tcl:6
+msgid "Unable to unlock the index."
+msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ñ\80азблокиÑ\80оваÑ\82Ñ\8c Ð¸Ð½Ð´ÐµÐºÑ\81"
 
-#: lib/choose_repository.tcl:520
-msgid "Shared (Fastest, Not Recommended, No Backup)"
-msgstr "Общий (Самый быстрый, не рекомендуется, без резервной копии)"
+#: lib/index.tcl:30
+msgid "Index Error"
+msgstr "Ошибка в индексе"
 
-#: lib/choose_repository.tcl:556 lib/choose_repository.tcl:603
-#: lib/choose_repository.tcl:749 lib/choose_repository.tcl:819
-#: lib/choose_repository.tcl:1058 lib/choose_repository.tcl:1066
-#, tcl-format
-msgid "Not a Git repository: %s"
-msgstr "Каталог не является репозиторием: %s"
+#: lib/index.tcl:32
+msgid ""
+"Updating the Git index failed.  A rescan will be automatically started to "
+"resynchronize git-gui."
+msgstr "Не удалось обновить индекс Git. Состояние репозитория будет перечитано автоматически."
 
-#: lib/choose_repository.tcl:592
-msgid "Standard only available for local repository."
-msgstr "СÑ\82андаÑ\80Ñ\82нÑ\8bй ÐºÐ»Ð¾Ð½ Ð²Ð¾Ð·Ð¼Ð¾Ð¶ÐµÐ½ Ñ\82олÑ\8cко Ð´Ð»Ñ\8f Ð»Ð¾ÐºÐ°Ð»Ñ\8cного Ñ\80епозиÑ\82оÑ\80иÑ\8f."
+#: lib/index.tcl:43
+msgid "Continue"
+msgstr "Ð\9fÑ\80одолжиÑ\82Ñ\8c"
 
-#: lib/choose_repository.tcl:596
-msgid "Shared only available for local repository."
-msgstr "Общий клон возможен только для локального репозитория."
+#: lib/index.tcl:46
+msgid "Unlock Index"
+msgstr "Разблокировать индекс"
+
+#: lib/index.tcl:77 lib/index.tcl:146 lib/index.tcl:220 lib/index.tcl:587
+#: lib/choose_repository.tcl:999
+msgid "files"
+msgstr "файлов"
+
+#: lib/index.tcl:326
+msgid "Unstaging selected files from commit"
+msgstr "Уборка выбранных файлов из индекса"
 
-#: lib/choose_repository.tcl:617
+#: lib/index.tcl:330
 #, tcl-format
-msgid "Location %s already exists."
-msgstr "Ð\9fÑ\83Ñ\82Ñ\8c '%s' Ñ\83же Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83еÑ\82."
+msgid "Unstaging %s from commit"
+msgstr "Удаление %s Ð¸Ð· Ð¸Ð½Ð´ÐµÐºÑ\81а"
 
-#: lib/choose_repository.tcl:628
-msgid "Failed to configure origin"
-msgstr "Ð\9dе Ð¼Ð¾Ð³Ñ\83 Ñ\81конÑ\84игÑ\83Ñ\80иÑ\80оваÑ\82Ñ\8c Ð¸Ñ\81Ñ\85однÑ\8bй Ñ\80епозиÑ\82оÑ\80ий."
+#: lib/index.tcl:369
+msgid "Ready to commit."
+msgstr "Ð\93оÑ\82ов Ð´Ð»Ñ\8f ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82а."
 
-#: lib/choose_repository.tcl:640
-msgid "Counting objects"
-msgstr "СÑ\87иÑ\82аÑ\8e Ð¾Ð±Ñ\8aекÑ\82Ñ\8b"
+#: lib/index.tcl:378
+msgid "Adding selected files"
+msgstr "Ð\94обавление Ð²Ñ\8bбÑ\80аннÑ\8bÑ\85 Ñ\84айлов"
 
-#: lib/choose_repository.tcl:641
-msgid "buckets"
-msgstr "блоки"
-
-#: lib/choose_repository.tcl:665
+#: lib/index.tcl:382
 #, tcl-format
-msgid "Unable to copy objects/info/alternates: %s"
-msgstr "Ð\9dе Ð¼Ð¾Ð³Ñ\83 Ñ\81копиÑ\80оваÑ\82Ñ\8c objects/info/alternates: %s"
+msgid "Adding %s"
+msgstr "Ð\94обавление %sâ\80¦"
 
-#: lib/choose_repository.tcl:701
+#: lib/index.tcl:412
 #, tcl-format
-msgid "Nothing to clone from %s."
-msgstr "Ð\9dеÑ\87его ÐºÐ»Ð¾Ð½Ð¸Ñ\80оваÑ\82Ñ\8c Ñ\81 %s."
+msgid "Stage %d untracked files?"
+msgstr "Ð\9fÑ\80оиндекÑ\81иÑ\80оваÑ\82Ñ\8c %d Ð½ÐµÐ¾Ñ\82Ñ\81леживаемÑ\8bе Ñ\84айла?"
 
-#: lib/choose_repository.tcl:703 lib/choose_repository.tcl:917
-#: lib/choose_repository.tcl:929
-msgid "The 'master' branch has not been initialized."
-msgstr "Не инициализирована ветвь «master»."
+#: lib/index.tcl:420
+msgid "Adding all changed files"
+msgstr "Добавление всех измененных файлов"
 
-#: lib/choose_repository.tcl:716
-msgid "Hardlinks are unavailable.  Falling back to copying."
-msgstr "«Жесткие ссылки» недоступны. Будет использовано копирование."
+#: lib/index.tcl:503
+#, tcl-format
+msgid "Revert changes in file %s?"
+msgstr "Обратить изменения в файле %s?"
 
-#: lib/choose_repository.tcl:728
+#: lib/index.tcl:508
 #, tcl-format
-msgid "Cloning from %s"
-msgstr "Ð\9aлониÑ\80ование %s"
+msgid "Revert changes in these %i files?"
+msgstr "Ð\9eбÑ\80аÑ\82иÑ\82Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f Ð² %i Ñ\84айле(-аÑ\85)?"
 
-#: lib/choose_repository.tcl:759
-msgid "Copying objects"
-msgstr "Ð\9aопиÑ\80ование objects"
+#: lib/index.tcl:517
+msgid "Any unstaged changes will be permanently lost by the revert."
+msgstr "Ð\9bÑ\8eбÑ\8bе Ð½ÐµÐ¿Ñ\80оиндекÑ\81иÑ\80ованнÑ\8bе Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f, Ð±Ñ\83дÑ\83Ñ\82 Ð¿Ð¾Ñ\82еÑ\80Ñ\8fнÑ\8b Ð¿Ñ\80и Ð¾Ð±Ñ\80аÑ\89ении Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹."
 
-#: lib/choose_repository.tcl:760
-msgid "KiB"
-msgstr "Ð\9aÐ\91"
+#: lib/index.tcl:520 lib/index.tcl:563
+msgid "Do Nothing"
+msgstr "Ð\9dиÑ\87его Ð½Ðµ Ð´ÐµÐ»Ð°Ñ\82Ñ\8c"
 
-#: lib/choose_repository.tcl:784
+#: lib/index.tcl:545
 #, tcl-format
-msgid "Unable to copy object: %s"
-msgstr "Ð\9dе Ð¼Ð¾Ð³Ñ\83 Ñ\81копиÑ\80оваÑ\82Ñ\8c Ð¾Ð±Ñ\8aекÑ\82: %s"
+msgid "Delete untracked file %s?"
+msgstr "УдалиÑ\82Ñ\8c Ð½ÐµÐ¾Ñ\82Ñ\81леживаемÑ\8bй Ñ\84айл %s?"
 
-#: lib/choose_repository.tcl:794
-msgid "Linking objects"
-msgstr "Создание ссылок на objects"
+#: lib/index.tcl:550
+#, tcl-format
+msgid "Delete these %i untracked files?"
+msgstr "Удалить %i неотслеживаемые файла?"
 
-#: lib/choose_repository.tcl:795
-msgid "objects"
-msgstr "обÑ\8aекÑ\82Ñ\8b"
+#: lib/index.tcl:560
+msgid "Files will be permanently deleted."
+msgstr "ФайлÑ\8b Ð±Ñ\83дÑ\83Ñ\82 Ñ\83даленÑ\8b Ð½Ð°Ð²Ñ\81егда."
 
-#: lib/choose_repository.tcl:803
-#, tcl-format
-msgid "Unable to hardlink object: %s"
-msgstr "Не могу создать «жесткую ссылку» на объект: %s"
+#: lib/index.tcl:564
+msgid "Delete Files"
+msgstr "Удалить файлы"
 
-#: lib/choose_repository.tcl:858
-msgid "Cannot fetch branches and objects.  See console output for details."
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð¸Ð·Ð²Ð»ÐµÑ\87Ñ\8c Ð²ÐµÑ\82ки Ð¸ Ð¾Ð±Ñ\8aекÑ\82Ñ\8b. Ð\94ополниÑ\82елÑ\8cнаÑ\8f Ð¸Ð½Ñ\84оÑ\80маÑ\86иÑ\8f Ð½Ð° ÐºÐ¾Ð½Ñ\81оли."
+#: lib/index.tcl:586
+msgid "Deleting"
+msgstr "Удаление"
 
-#: lib/choose_repository.tcl:869
-msgid "Cannot fetch tags.  See console output for details."
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð¸Ð·Ð²Ð»ÐµÑ\87Ñ\8c Ð¼ÐµÑ\82ки. Ð\94ополниÑ\82елÑ\8cнаÑ\8f Ð¸Ð½Ñ\84оÑ\80маÑ\86иÑ\8f Ð½Ð° ÐºÐ¾Ð½Ñ\81оли."
+#: lib/index.tcl:665
+msgid "Encountered errors deleting files:\n"
+msgstr "Ð\92озникÑ\88ие Ð¾Ñ\88ибки Ð¿Ñ\80и Ñ\83далении Ñ\84айлов:\n"
 
-#: lib/choose_repository.tcl:893
-msgid "Cannot determine HEAD.  See console output for details."
-msgstr "Не могу определить HEAD. Дополнительная информация на консоли."
+#: lib/index.tcl:674
+#, tcl-format
+msgid "None of the %d selected files could be deleted."
+msgstr "Не удалось удалить ни один из выбранных %d файлов."
 
-#: lib/choose_repository.tcl:902
+#: lib/index.tcl:679
 #, tcl-format
-msgid "Unable to cleanup %s"
-msgstr "Не могу очистить %s"
+msgid "%d of the %d selected files could not be deleted."
+msgstr "Не удалось удалить %d из выбранных  %d файлов."
 
-#: lib/choose_repository.tcl:908
-msgid "Clone failed."
-msgstr "Ð\9aлониÑ\80ование Ð½Ðµ Ñ\83далоÑ\81Ñ\8c."
+#: lib/index.tcl:726
+msgid "Reverting selected files"
+msgstr "Ð\9eбÑ\80аÑ\89ение Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹ Ð² Ð²Ñ\8bбÑ\80аннÑ\8bÑ\85 Ñ\84айлаÑ\85"
 
-#: lib/choose_repository.tcl:915
-msgid "No default branch obtained."
-msgstr "Ветка по умолчанию не была получена."
+#: lib/index.tcl:730
+#, tcl-format
+msgid "Reverting %s"
+msgstr "Обращение изменений в %s"
 
-#: lib/choose_repository.tcl:926
+#: lib/branch_checkout.tcl:16
 #, tcl-format
-msgid "Cannot resolve %s as a commit."
-msgstr "Не могу распознать %s как коммит."
+msgid "%s (%s): Checkout Branch"
+msgstr "%s (%s): Переход на ветку"
 
-#: lib/choose_repository.tcl:938
-msgid "Creating working directory"
-msgstr "СоздаÑ\8e Ñ\80абоÑ\87ий ÐºÐ°Ñ\82алог"
+#: lib/branch_checkout.tcl:21
+msgid "Checkout Branch"
+msgstr "Ð\9fеÑ\80ейÑ\82и Ð½Ð° Ð²ÐµÑ\82кÑ\83"
 
-#: lib/choose_repository.tcl:939 lib/index.tcl:67 lib/index.tcl:130
-#: lib/index.tcl:198
-msgid "files"
-msgstr "файлов"
+#: lib/branch_checkout.tcl:26
+msgid "Checkout"
+msgstr "Перейти"
 
-#: lib/choose_repository.tcl:968
-msgid "Initial file checkout failed."
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð¿Ð¾Ð»Ñ\83Ñ\87иÑ\82Ñ\8c Ð½Ð°Ñ\87алÑ\8cное Ñ\81оÑ\81Ñ\82оÑ\8fние Ñ\84айлов Ñ\80епозиÑ\82оÑ\80иÑ\8f."
+#: lib/branch_checkout.tcl:39 lib/option.tcl:310 lib/branch_create.tcl:69
+msgid "Options"
+msgstr "Ð\9dаÑ\81Ñ\82Ñ\80ойки"
 
-#: lib/choose_repository.tcl:1011
-msgid "Open"
-msgstr "Ð\9eÑ\82кÑ\80Ñ\8bÑ\82Ñ\8c"
+#: lib/branch_checkout.tcl:42 lib/branch_create.tcl:92
+msgid "Fetch Tracking Branch"
+msgstr "Ð\98звлеÑ\87Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f Ð¸Ð· Ð²Ð½ÐµÑ\88ней Ð²ÐµÑ\82ки"
 
-#: lib/choose_repository.tcl:1021
-msgid "Repository:"
-msgstr "РепозиÑ\82оÑ\80ий:"
+#: lib/branch_checkout.tcl:47
+msgid "Detach From Local Branch"
+msgstr "Ð\9eÑ\82Ñ\81оединиÑ\82Ñ\8c Ð¾Ñ\82 Ð»Ð¾ÐºÐ°Ð»Ñ\8cной Ð²ÐµÑ\82ки"
 
-#: lib/choose_repository.tcl:1072
+#: lib/status_bar.tcl:263
 #, tcl-format
-msgid "Failed to open repository %s:"
-msgstr "Не удалось открыть репозиторий %s:"
+msgid "%s ... %*i of %*i %s (%3i%%)"
+msgstr "%s … %*i из %*i %s (%3i%%)"
 
-#: lib/choose_rev.tcl:53
-msgid "This Detached Checkout"
-msgstr "ТекÑ\83Ñ\89ее Ð¾Ñ\82Ñ\81оединенное Ñ\81оÑ\81Ñ\82оÑ\8fние"
+#: lib/remote.tcl:200
+msgid "Push to"
+msgstr "Ð\9eÑ\82пÑ\80авиÑ\82Ñ\8c"
 
-#: lib/choose_rev.tcl:60
-msgid "Revision Expression:"
-msgstr "Ð\92Ñ\8bÑ\80ажение Ð´Ð»Ñ\8f Ð¾Ð¿Ñ\80еделениÑ\8f Ð²ÐµÑ\80Ñ\81ии:"
+#: lib/remote.tcl:218
+msgid "Remove Remote"
+msgstr "УдалиÑ\82Ñ\8c Ñ\81Ñ\81Ñ\8bлкÑ\83 Ð½Ð° Ð²Ð½ÐµÑ\88ний Ñ\80епозиÑ\82оÑ\80ий"
 
-#: lib/choose_rev.tcl:74
-msgid "Local Branch"
-msgstr "Ð\9bокалÑ\8cнаÑ\8f Ð²ÐµÑ\82ка:"
+#: lib/remote.tcl:223
+msgid "Prune from"
+msgstr "ЧиÑ\81Ñ\82ка"
 
-#: lib/choose_rev.tcl:79
-msgid "Tracking Branch"
-msgstr "Ð\9eÑ\82Ñ\81леживаемаÑ\8f Ð²ÐµÑ\82ка"
+#: lib/remote.tcl:228
+msgid "Fetch from"
+msgstr "Ð\98звлеÑ\87ение Ð¸Ð·"
 
-#: lib/choose_rev.tcl:84 lib/choose_rev.tcl:538
-msgid "Tag"
-msgstr "Ð\9cеÑ\82ка"
+#: lib/remote.tcl:249 lib/remote.tcl:253 lib/remote.tcl:258 lib/remote.tcl:264
+msgid "All"
+msgstr "Ð\92Ñ\81е"
 
-#: lib/choose_rev.tcl:317
+#: lib/branch_rename.tcl:15
 #, tcl-format
-msgid "Invalid revision: %s"
-msgstr "Неверная версия: %s"
+msgid "%s (%s): Rename Branch"
+msgstr "%s (%s): Переименовать ветку"
 
-#: lib/choose_rev.tcl:338
-msgid "No revision selected."
-msgstr "Ð\92еÑ\80Ñ\81иÑ\8f Ð½Ðµ Ñ\83казана."
+#: lib/branch_rename.tcl:23
+msgid "Rename Branch"
+msgstr "Ð\9fеÑ\80еименование Ð²ÐµÑ\82ки"
 
-#: lib/choose_rev.tcl:346
-msgid "Revision expression is empty."
-msgstr "Пустое выражение для определения версии."
+#: lib/branch_rename.tcl:28
+msgid "Rename"
+msgstr "Переименовать"
 
-#: lib/choose_rev.tcl:531
-msgid "Updated"
-msgstr "Ð\9eбновлено"
+#: lib/branch_rename.tcl:38
+msgid "Branch:"
+msgstr "Ð\92еÑ\82ка:"
 
-#: lib/choose_rev.tcl:559
-msgid "URL"
-msgstr "СÑ\81Ñ\8bлка"
+#: lib/branch_rename.tcl:46
+msgid "New Name:"
+msgstr "Ð\9dовое Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ðµ:"
 
-#: lib/commit.tcl:9
-msgid ""
-"There is nothing to amend.\n"
-"\n"
-"You are about to create the initial commit.  There is no commit before this to amend.\n"
-msgstr "Отсутствует коммиты для исправления.\n\nВы создаете начальный коммит, здесь еще нечего исправлять.\n"
+#: lib/branch_rename.tcl:81
+msgid "Please select a branch to rename."
+msgstr "Укажите ветку для переименования."
 
-#: lib/commit.tcl:18
-msgid ""
-"Cannot amend while merging.\n"
-"\n"
-"You are currently in the middle of a merge that has not been fully completed.  You cannot amend the prior commit unless you first abort the current merge activity.\n"
-msgstr "Невозможно исправить коммит во время слияния.\n\nТекущее слияние не завершено. Невозможно исправить предыдуий коммит, не прерывая эту операцию.\n"
+#: lib/branch_rename.tcl:92 lib/branch_create.tcl:154
+msgid "Please supply a branch name."
+msgstr "Укажите имя ветки."
 
-#: lib/commit.tcl:48
-msgid "Error loading commit data for amend:"
-msgstr "Ошибка при загрузке данных для исправления коммита:"
+#: lib/branch_rename.tcl:112 lib/branch_create.tcl:165
+#, tcl-format
+msgid "'%s' is not an acceptable branch name."
+msgstr "Недопустимое имя ветки «%s»."
 
-#: lib/commit.tcl:75
-msgid "Unable to obtain your identity:"
-msgstr "Невозможно получить информацию об авторстве:"
+#: lib/branch_rename.tcl:123
+#, tcl-format
+msgid "Failed to rename '%s'."
+msgstr "Не удалось переименовать «%s». "
 
-#: lib/commit.tcl:80
-msgid "Invalid GIT_COMMITTER_IDENT:"
-msgstr "Ð\9dедопÑ\83Ñ\81Ñ\82имÑ\8bй GIT_COMMITTER_IDENT:"
+#: lib/choose_font.tcl:41
+msgid "Select"
+msgstr "Ð\92Ñ\8bбÑ\80аÑ\82Ñ\8c"
 
-#: lib/commit.tcl:129
-#, tcl-format
-msgid "warning: Tcl does not support encoding '%s'."
-msgstr "предупреждение: Tcl не поддерживает кодировку «%s»."
+#: lib/choose_font.tcl:55
+msgid "Font Family"
+msgstr "Шрифт"
 
-#: lib/commit.tcl:149
-msgid ""
-"Last scanned state does not match repository state.\n"
-"\n"
-"Another Git program has modified this repository since the last scan.  A rescan must be performed before another commit can be created.\n"
-"\n"
-"The rescan will be automatically started now.\n"
-msgstr "Последнее прочитанное состояние репозитория не соответствует текущему.\n\nС момента последней проверки репозиторий был изменен другой программой Git. Необходимо перечитать репозиторий, прежде чем изменять текущую ветвь. \n\nЭто будет сделано сейчас автоматически.\n"
+#: lib/choose_font.tcl:76
+msgid "Font Size"
+msgstr "Размер шрифта"
 
-#: lib/commit.tcl:172
-#, tcl-format
+#: lib/choose_font.tcl:93
+msgid "Font Example"
+msgstr "Пример текста"
+
+#: lib/choose_font.tcl:105
 msgid ""
-"Unmerged files cannot be committed.\n"
-"\n"
-"File %s has merge conflicts.  You must resolve them and stage the file before committing.\n"
-msgstr "Нельзя выполнить коммит с незавершённой операцией слияния.\n\nДля файла %s возник конфликт слияния. Разрешите конфликт и добавьте их в индекс перед выполнением коммита.\n"
+"This is example text.\n"
+"If you like this text, it can be your font."
+msgstr "Это пример текста.\nЕсли Вам нравится этот текст, это может быть Ваш шрифт."
 
-#: lib/commit.tcl:180
+#: lib/option.tcl:11
 #, tcl-format
-msgid ""
-"Unknown file state %s detected.\n"
-"\n"
-"File %s cannot be committed by this program.\n"
-msgstr "Обнаружено неизвестное состояние файла %s.\n\nФайл %s не может быть закоммичен этой программой.\n"
+msgid "Invalid global encoding '%s'"
+msgstr "Неверная глобальная кодировка «%s»"
 
-#: lib/commit.tcl:188
-msgid ""
-"No changes to commit.\n"
-"\n"
-"You must stage at least 1 file before you can commit.\n"
-msgstr "Отсутствуют изменения для сохранения.\n\nДобавьте в индекс хотя бы один файл перед выполнением коммита.\n"
+#: lib/option.tcl:19
+#, tcl-format
+msgid "Invalid repo encoding '%s'"
+msgstr "Неверная кодировка репозитория «%s»"
 
-#: lib/commit.tcl:203
-msgid ""
-"Please supply a commit message.\n"
-"\n"
-"A good commit message has the following format:\n"
-"\n"
-"- First line: Describe in one sentence what you did.\n"
-"- Second line: Blank\n"
-"- Remaining lines: Describe why this change is good.\n"
-msgstr "Укажите сообщение коммита.\n\nРекомендуется следующий формат сообщения:\n\n- в первой строке краткое описание сделанных изменений\n- вторая строка пустая\n- в оставшихся строках опишите, что дают ваши изменения\n"
+#: lib/option.tcl:119
+msgid "Restore Defaults"
+msgstr "Восстановить настройки по умолчанию"
 
-#: lib/commit.tcl:234
-msgid "Calling pre-commit hook..."
-msgstr "Ð\92Ñ\8bзов Ð¿ÐµÑ\80еÑ\85ваÑ\82Ñ\87ика pre-commitâ\80¦"
+#: lib/option.tcl:123
+msgid "Save"
+msgstr "СоÑ\85Ñ\80аниÑ\82Ñ\8c"
 
-#: lib/commit.tcl:249
-msgid "Commit declined by pre-commit hook."
-msgstr "Коммит прерван переватчиком pre-commit."
+#: lib/option.tcl:133
+#, tcl-format
+msgid "%s Repository"
+msgstr "Для репозитория %s"
 
-#: lib/commit.tcl:272
-msgid "Calling commit-msg hook..."
-msgstr "Ð\92Ñ\8bзов Ð¿ÐµÑ\80еÑ\85ваÑ\82Ñ\87ика commit-msgâ\80¦"
+#: lib/option.tcl:134
+msgid "Global (All Repositories)"
+msgstr "Ð\9eбÑ\89ие (длÑ\8f Ð²Ñ\81еÑ\85 Ñ\80епозиÑ\82оÑ\80иев)"
 
-#: lib/commit.tcl:287
-msgid "Commit declined by commit-msg hook."
-msgstr "Ð\9aоммиÑ\82 Ð¿Ñ\80еÑ\80ван Ð¿ÐµÑ\80еваÑ\82Ñ\87иком commit-msg"
+#: lib/option.tcl:140
+msgid "User Name"
+msgstr "Ð\98мÑ\8f Ð¿Ð¾Ð»Ñ\8cзоваÑ\82елÑ\8f"
 
-#: lib/commit.tcl:300
-msgid "Committing changes..."
-msgstr "Ð\9aоммиÑ\82 Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹â\80¦"
+#: lib/option.tcl:141
+msgid "Email Address"
+msgstr "Ð\90дÑ\80еÑ\81 Ñ\8dлекÑ\82Ñ\80онной Ð¿Ð¾Ñ\87Ñ\82Ñ\8b"
 
-#: lib/commit.tcl:316
-msgid "write-tree failed:"
-msgstr "Ð\9fÑ\80огÑ\80амма write-tree Ð·Ð°Ð²ÐµÑ\80Ñ\88илаÑ\81Ñ\8c Ñ\81 Ð¾Ñ\88ибкой:"
+#: lib/option.tcl:143
+msgid "Summarize Merge Commits"
+msgstr "СÑ\83ммаÑ\80ное Ñ\81ообÑ\89ение Ð¿Ñ\80и Ñ\81лиÑ\8fнии"
 
-#: lib/commit.tcl:317 lib/commit.tcl:361 lib/commit.tcl:382
-msgid "Commit failed."
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð·Ð°ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82иÑ\82Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f."
+#: lib/option.tcl:144
+msgid "Merge Verbosity"
+msgstr "УÑ\80овенÑ\8c Ð´ÐµÑ\82алÑ\8cноÑ\81Ñ\82и Ñ\81ообÑ\89ений Ð¿Ñ\80и Ñ\81лиÑ\8fнии"
 
-#: lib/commit.tcl:334
-#, tcl-format
-msgid "Commit %s appears to be corrupt"
-msgstr "Коммит %s похоже поврежден"
+#: lib/option.tcl:145
+msgid "Show Diffstat After Merge"
+msgstr "Показать отчет об изменениях после слияния"
 
-#: lib/commit.tcl:339
-msgid ""
-"No changes to commit.\n"
-"\n"
-"No files were modified by this commit and it was not a merge commit.\n"
-"\n"
-"A rescan will be automatically started now.\n"
-msgstr "Нет изменения для коммита.\n\nНи один файл не был изменен и не было слияния.\n\nСейчас автоматически запустится перечитывание репозитория.\n"
+#: lib/option.tcl:146
+msgid "Use Merge Tool"
+msgstr "Использовать для слияния программу"
 
-#: lib/commit.tcl:346
-msgid "No changes to commit."
-msgstr "Ð\9dеÑ\82 Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f Ð´Ð»Ñ\8f ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82а."
+#: lib/option.tcl:148
+msgid "Trust File Modification Timestamps"
+msgstr "Ð\94овеÑ\80Ñ\8fÑ\82Ñ\8c Ð²Ñ\80емени Ð¼Ð¾Ð´Ð¸Ñ\84икаÑ\86ии Ñ\84айла"
 
-#: lib/commit.tcl:360
-msgid "commit-tree failed:"
-msgstr "Ð\9fÑ\80огÑ\80амма commit-tree Ð·Ð°Ð²ÐµÑ\80Ñ\88илаÑ\81Ñ\8c Ñ\81 Ð¾Ñ\88ибкой:"
+#: lib/option.tcl:149
+msgid "Prune Tracking Branches During Fetch"
+msgstr "ЧиÑ\81Ñ\82ка Ð¾Ñ\82Ñ\81леживаемÑ\8bÑ\85 Ð²ÐµÑ\82ок Ð¿Ñ\80и Ð¸Ð·Ð²Ð»ÐµÑ\87ении Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹"
 
-#: lib/commit.tcl:381
-msgid "update-ref failed:"
-msgstr "Программа update-ref завершилась с ошибкой:"
-
-#: lib/commit.tcl:469
-#, tcl-format
-msgid "Created commit %s: %s"
-msgstr "Создан коммит %s: %s "
-
-#: lib/console.tcl:59
-msgid "Working... please wait..."
-msgstr "В процессе… пожалуйста, ждите…"
-
-#: lib/console.tcl:186
-msgid "Success"
-msgstr "Процесс успешно завершен"
-
-#: lib/console.tcl:200
-msgid "Error: Command Failed"
-msgstr "Ошибка: не удалось выполнить команду"
-
-#: lib/database.tcl:43
-msgid "Number of loose objects"
-msgstr "Количество несвязанных объектов"
-
-#: lib/database.tcl:44
-msgid "Disk space used by loose objects"
-msgstr "Объем дискового пространства, занятый несвязанными объектами"
-
-#: lib/database.tcl:45
-msgid "Number of packed objects"
-msgstr "Количество упакованных объектов"
+#: lib/option.tcl:150
+msgid "Match Tracking Branches"
+msgstr "Такое же имя, как и у отслеживаемой ветки"
 
-#: lib/database.tcl:46
-msgid "Number of packs"
-msgstr "Ð\9aолиÑ\87еÑ\81Ñ\82во pack-Ñ\84айлов"
+#: lib/option.tcl:151
+msgid "Use Textconv For Diffs and Blames"
+msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c Textconv Ð´Ð»Ñ\8f Ð¿Ñ\80оÑ\81моÑ\82Ñ\80а Ñ\80азлиÑ\87ий Ð¸ Ð°Ð²Ñ\82оÑ\80Ñ\81Ñ\82ва"
 
-#: lib/database.tcl:47
-msgid "Disk space used by packed objects"
-msgstr "Ð\9eбÑ\8aем Ð´Ð¸Ñ\81кового Ð¿Ñ\80оÑ\81Ñ\82Ñ\80анÑ\81Ñ\82ва, Ð·Ð°Ð½Ñ\8fÑ\82Ñ\8bй Ñ\83пакованнÑ\8bми Ð¾Ð±Ñ\8aекÑ\82ами"
+#: lib/option.tcl:152
+msgid "Blame Copy Only On Changed Files"
+msgstr "Ð\9fоиÑ\81к ÐºÐ¾Ð¿Ð¸Ð¹ Ñ\82олÑ\8cко Ð² Ð¸Ð·Ð¼ÐµÐ½Ñ\91ннÑ\8bÑ\85 Ñ\84айлаÑ\85"
 
-#: lib/database.tcl:48
-msgid "Packed objects waiting for pruning"
-msgstr "Ð\9dеÑ\81вÑ\8fзаннÑ\8bе Ð¾Ð±Ñ\8aекÑ\82Ñ\8b, ÐºÐ¾Ñ\82оÑ\80Ñ\8bе Ð¼Ð¾Ð¶Ð½Ð¾ Ñ\83далиÑ\82Ñ\8c"
+#: lib/option.tcl:153
+msgid "Maximum Length of Recent Repositories List"
+msgstr "Ð\9cакÑ\81ималÑ\8cнаÑ\8f Ð´Ð»Ð¸Ð½Ð½Ð° Ñ\81пиÑ\81ка Ð½ÐµÐ´Ð°Ð²Ð½Ð¸Ñ\85 Ñ\80епозиÑ\82оÑ\80иев"
 
-#: lib/database.tcl:49
-msgid "Garbage files"
-msgstr "Мусор"
+#: lib/option.tcl:154
+msgid "Minimum Letters To Blame Copy On"
+msgstr "Минимальное количество символов для поиска копий"
 
-#: lib/database.tcl:72
-msgid "Compressing the object database"
-msgstr "СжаÑ\82ие Ð±Ð°Ð·Ñ\8b Ð¾Ð±Ñ\8aекÑ\82ов"
+#: lib/option.tcl:155
+msgid "Blame History Context Radius (days)"
+msgstr "РадиÑ\83Ñ\81 Ð¸Ñ\81Ñ\82оÑ\80иÑ\87еÑ\81кого ÐºÐ¾Ð½Ñ\82екÑ\81Ñ\82а (в Ð´Ð½Ñ\8fÑ\85)"
 
-#: lib/database.tcl:83
-msgid "Verifying the object database with fsck-objects"
-msgstr "Ð\9fÑ\80овеÑ\80ка Ð±Ð°Ð·Ñ\8b Ð¾Ð±Ñ\8aекÑ\82ов Ð¿Ñ\80и Ð¿Ð¾Ð¼Ð¾Ñ\89и fsck"
+#: lib/option.tcl:156
+msgid "Number of Diff Context Lines"
+msgstr "ЧиÑ\81ло Ñ\81Ñ\82Ñ\80ок Ð² ÐºÐ¾Ð½Ñ\82екÑ\81Ñ\82е diff"
 
-#: lib/database.tcl:107
-#, tcl-format
-msgid ""
-"This repository currently has approximately %i loose objects.\n"
-"\n"
-"To maintain optimal performance it is strongly recommended that you compress the database.\n"
-"\n"
-"Compress the database now?"
-msgstr "Этот репозиторий сейчас содержит примерно %i свободных объектов\n\nДля лучшей производительности рекомендуется сжать базу данных.\n\nСжать базу данных сейчас?"
+#: lib/option.tcl:157
+msgid "Additional Diff Parameters"
+msgstr "Дополнительные параметры для diff"
 
-#: lib/date.tcl:25
-#, tcl-format
-msgid "Invalid date from Git: %s"
-msgstr "Неправильная дата в репозитории: %s"
+#: lib/option.tcl:158
+msgid "Commit Message Text Width"
+msgstr "Ширина текста сообщения коммита"
 
-#: lib/diff.tcl:64
-#, tcl-format
-msgid ""
-"No differences detected.\n"
-"\n"
-"%s has no changes.\n"
-"\n"
-"The modification date of this file was updated by another application, but the content within the file was not changed.\n"
-"\n"
-"A rescan will be automatically started to find other files which may have the same state."
-msgstr "Изменений не обнаружено.\n\nв %s отсутствуют изменения.\n\nДата изменения файла была обновлена другой программой, но содержимое файла осталось прежним.\n\nСейчас будет запущено перечитывание репозитория, чтобы найти подобные файлы."
+#: lib/option.tcl:159
+msgid "New Branch Name Template"
+msgstr "Шаблон для имени новой ветки"
 
-#: lib/diff.tcl:104
-#, tcl-format
-msgid "Loading diff of %s..."
-msgstr "Загрузка изменений %s…"
+#: lib/option.tcl:160
+msgid "Default File Contents Encoding"
+msgstr "Кодировка содержания файла по умолчанию"
 
-#: lib/diff.tcl:125
-msgid ""
-"LOCAL: deleted\n"
-"REMOTE:\n"
-msgstr "ЛОКАЛЬНО: удалён\nВНЕШНИЙ:\n"
+#: lib/option.tcl:161
+msgid "Warn before committing to a detached head"
+msgstr "Предупреждать перед коммитом в отделённый HEAD"
 
-#: lib/diff.tcl:130
-msgid ""
-"REMOTE: deleted\n"
-"LOCAL:\n"
-msgstr "ВНЕШНИЙ: удалён\nЛОКАЛЬНО:\n"
+#: lib/option.tcl:162
+msgid "Staging of untracked files"
+msgstr "Индексирование неотслеживаемых файлов"
 
-#: lib/diff.tcl:137
-msgid "LOCAL:\n"
-msgstr "Ð\9bÐ\9eÐ\9aÐ\90Ð\9bЬÐ\9dÐ\9e:\n"
+#: lib/option.tcl:163
+msgid "Show untracked files"
+msgstr "Ð\9fоказаÑ\82Ñ\8c Ð½ÐµÐ¾Ñ\82Ñ\81леживаемÑ\8bе Ñ\84айлÑ\8b"
 
-#: lib/diff.tcl:140
-msgid "REMOTE:\n"
-msgstr "Ð\92Ð\9dÐ\95ШÐ\9dÐ\98Ð\99:\n"
+#: lib/option.tcl:164
+msgid "Tab spacing"
+msgstr "ШиÑ\80ина Ñ\82абÑ\83лÑ\8fÑ\86ии"
 
-#: lib/diff.tcl:202 lib/diff.tcl:319
+#: lib/option.tcl:182 lib/option.tcl:197 lib/option.tcl:220 lib/option.tcl:282
+#: lib/database.tcl:57
 #, tcl-format
-msgid "Unable to display %s"
-msgstr "Не могу показать %s"
+msgid "%s:"
+msgstr "%s:"
 
-#: lib/diff.tcl:203
-msgid "Error loading file:"
-msgstr "Ошибка загрузки файла:"
-
-#: lib/diff.tcl:210
-msgid "Git Repository (subproject)"
-msgstr "Репозиторий Git (подпроект)"
+#: lib/option.tcl:210
+msgid "Change"
+msgstr "Изменить"
 
-#: lib/diff.tcl:222
-msgid "* Binary file (not showing content)."
-msgstr "* Двоичный файл (содержимое не показано)"
+#: lib/option.tcl:254
+msgid "Spelling Dictionary:"
+msgstr "Словарь для проверки правописания:"
 
-#: lib/diff.tcl:227
-#, tcl-format
-msgid ""
-"* Untracked file is %d bytes.\n"
-"* Showing only first %d bytes.\n"
-msgstr "* Размер неотслеживаемого файла %d байт.\n* Показано первых %d байт.\n"
+#: lib/option.tcl:284
+msgid "Change Font"
+msgstr "Изменить"
 
-#: lib/diff.tcl:233
+#: lib/option.tcl:288
 #, tcl-format
-msgid ""
-"\n"
-"* Untracked file clipped here by %s.\n"
-"* To see the entire file, use an external editor.\n"
-msgstr "\n* Неотслеживаемый файл обрезан: %s.\n* Чтобы увидеть весь файл, используйте внешний редактор.\n"
-
-#: lib/diff.tcl:482
-msgid "Failed to unstage selected hunk."
-msgstr "Не удалось исключить выбранную часть."
+msgid "Choose %s"
+msgstr "Выберите %s"
 
-#: lib/diff.tcl:489
-msgid "Failed to stage selected hunk."
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð¿Ñ\80оиндекÑ\81иÑ\80оваÑ\82Ñ\8c Ð²Ñ\8bбÑ\80аннÑ\8bй Ð±Ð»Ð¾Ðº Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹."
+#: lib/option.tcl:294
+msgid "pt."
+msgstr "п."
 
-#: lib/diff.tcl:568
-msgid "Failed to unstage selected line."
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð¸Ñ\81клÑ\8eÑ\87иÑ\82Ñ\8c Ð²Ñ\8bбÑ\80аннÑ\83Ñ\8e Ñ\81Ñ\82Ñ\80окÑ\83."
+#: lib/option.tcl:308
+msgid "Preferences"
+msgstr "Ð\9dаÑ\81Ñ\82Ñ\80ойки"
 
-#: lib/diff.tcl:576
-msgid "Failed to stage selected line."
-msgstr "Не удалось проиндексировать выбранную строку."
+#: lib/option.tcl:345
+msgid "Failed to completely save options:"
+msgstr "Не удалось полностью сохранить настройки:"
 
 #: lib/encoding.tcl:443
 msgid "Default"
@@ -1559,824 +1375,1277 @@ msgstr "Системная (%s)"
 msgid "Other"
 msgstr "Другая"
 
-#: lib/error.tcl:20 lib/error.tcl:114
-msgid "error"
-msgstr "ошибка"
+#: lib/tools.tcl:76
+#, tcl-format
+msgid "Running %s requires a selected file."
+msgstr "Запуск %s требует выбранного файла."
 
-#: lib/error.tcl:36
-msgid "warning"
-msgstr "предупреждение"
+#: lib/tools.tcl:92
+#, tcl-format
+msgid "Are you sure you want to run %1$s on file \"%2$s\"?"
+msgstr "Вы действительно хотите выполнить %1$s на «%2$s»?"
 
-#: lib/error.tcl:94
-msgid "You must correct the above errors before committing."
-msgstr "Перед коммитом, исправьте вышеуказанные ошибки."
+#: lib/tools.tcl:96
+#, tcl-format
+msgid "Are you sure you want to run %s?"
+msgstr "Действительно запустить %s?"
 
-#: lib/index.tcl:6
-msgid "Unable to unlock the index."
-msgstr "Не удалось разблокировать индекс"
+#: lib/tools.tcl:118
+#, tcl-format
+msgid "Tool: %s"
+msgstr "Вспомогательная операция: %s"
 
-#: lib/index.tcl:15
-msgid "Index Error"
-msgstr "Ошибка в индексе"
+#: lib/tools.tcl:119
+#, tcl-format
+msgid "Running: %s"
+msgstr "Выполнение: %s"
 
-#: lib/index.tcl:17
-msgid ""
-"Updating the Git index failed.  A rescan will be automatically started to "
-"resynchronize git-gui."
-msgstr "Не удалось обновить индекс Git. Состояние репозитория будет перечитано автоматически."
+#: lib/tools.tcl:158
+#, tcl-format
+msgid "Tool completed successfully: %s"
+msgstr "Программа %s завершилась успешно."
 
-#: lib/index.tcl:28
-msgid "Continue"
-msgstr "Продолжить"
+#: lib/tools.tcl:160
+#, tcl-format
+msgid "Tool failed: %s"
+msgstr "Ошибка выполнения программы: %s"
 
-#: lib/index.tcl:31
-msgid "Unlock Index"
-msgstr "РазблокиÑ\80оваÑ\82Ñ\8c Ð¸Ð½Ð´ÐµÐºÑ\81"
+#: lib/mergetool.tcl:8
+msgid "Force resolution to the base version?"
+msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c Ð±Ð°Ð·Ð¾Ð²Ñ\83Ñ\8e Ð²ÐµÑ\80Ñ\81иÑ\8e Ð´Ð»Ñ\8f Ñ\80азÑ\80еÑ\88ениÑ\8f ÐºÐ¾Ð½Ñ\84ликÑ\82а?"
 
-#: lib/index.tcl:289
-#, tcl-format
-msgid "Unstaging %s from commit"
-msgstr "Удаление %s из индекса"
+#: lib/mergetool.tcl:9
+msgid "Force resolution to this branch?"
+msgstr "Использовать версию из этой ветки для разрешения конфликта?"
 
-#: lib/index.tcl:328
-msgid "Ready to commit."
-msgstr "Ð\93оÑ\82ов Ð´Ð»Ñ\8f ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82а."
+#: lib/mergetool.tcl:10
+msgid "Force resolution to the other branch?"
+msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c Ð²ÐµÑ\80Ñ\81иÑ\8e Ð¸Ð· Ð´Ñ\80Ñ\83гой Ð²ÐµÑ\82ки Ð´Ð»Ñ\8f Ñ\80азÑ\80еÑ\88ениÑ\8f ÐºÐ¾Ð½Ñ\84ликÑ\82а?"
 
-#: lib/index.tcl:341
+#: lib/mergetool.tcl:14
 #, tcl-format
-msgid "Adding %s"
-msgstr "Добавление %s…"
+msgid ""
+"Note that the diff shows only conflicting changes.\n"
+"\n"
+"%s will be overwritten.\n"
+"\n"
+"This operation can be undone only by restarting the merge."
+msgstr "Внимание! Список изменений показывает только конфликтующие отличия.\n\n%s будет переписан.\n\nЭто действие можно отменить только перезапуском операции слияния."
 
-#: lib/index.tcl:398
+#: lib/mergetool.tcl:45
 #, tcl-format
-msgid "Revert changes in file %s?"
-msgstr "Ð\9eбÑ\80аÑ\82иÑ\82Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f Ð² Ñ\84айле %s?"
+msgid "File %s seems to have unresolved conflicts, still stage?"
+msgstr "Ð\9fоÑ\85оже, Ñ\87Ñ\82о Ñ\84айл %s Ñ\81одеÑ\80жиÑ\82 Ð½ÐµÑ\80азÑ\80еÑ\88еннÑ\8bе ÐºÐ¾Ð½Ñ\84ликÑ\82Ñ\8b. Ð\9fÑ\80одолжиÑ\82Ñ\8c Ð¸Ð½Ð´ÐµÐºÑ\81аÑ\86иÑ\8e?"
 
-#: lib/index.tcl:400
+#: lib/mergetool.tcl:60
 #, tcl-format
-msgid "Revert changes in these %i files?"
-msgstr "Ð\9eбÑ\80аÑ\82иÑ\82Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f Ð² %i Ñ\84айле(-аÑ\85)?"
+msgid "Adding resolution for %s"
+msgstr "Ð\94обавлÑ\8fÑ\8e Ñ\80езÑ\83лÑ\8cÑ\82аÑ\82 Ñ\80азÑ\80еÑ\88ениÑ\8f Ð´Ð»Ñ\8f %s"
 
-#: lib/index.tcl:408
-msgid "Any unstaged changes will be permanently lost by the revert."
-msgstr "Ð\9bÑ\8eбÑ\8bе Ð½ÐµÐ¿Ñ\80оиндекÑ\81иÑ\80ованнÑ\8bе Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f, Ð±Ñ\83дÑ\83Ñ\82 Ð¿Ð¾Ñ\82еÑ\80Ñ\8fнÑ\8b Ð¿Ñ\80и Ð¾Ð±Ñ\80аÑ\89ении Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹."
+#: lib/mergetool.tcl:141
+msgid "Cannot resolve deletion or link conflicts using a tool"
+msgstr "Ð\9fÑ\80огÑ\80амма Ñ\81лиÑ\8fниÑ\8f Ð½Ðµ Ð¾Ð±Ñ\80абаÑ\82Ñ\8bваеÑ\82 ÐºÐ¾Ð½Ñ\84ликÑ\82Ñ\8b Ñ\81 Ñ\83далением Ð¸Ð»Ð¸ Ñ\83Ñ\87аÑ\81Ñ\82ием Ñ\81Ñ\81Ñ\8bлок"
 
-#: lib/index.tcl:411
-msgid "Do Nothing"
-msgstr "Ð\9dиÑ\87его Ð½Ðµ Ð´ÐµÐ»Ð°Ñ\82Ñ\8c"
+#: lib/mergetool.tcl:146
+msgid "Conflict file does not exist"
+msgstr "Ð\9aонÑ\84ликÑ\82Ñ\83Ñ\8eÑ\89ий Ñ\84айл Ð½Ðµ Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83еÑ\82"
 
-#: lib/index.tcl:429
-msgid "Reverting selected files"
-msgstr "Обращение изменений в выбранных файлах"
+#: lib/mergetool.tcl:246
+#, tcl-format
+msgid "Not a GUI merge tool: '%s'"
+msgstr "«%s» не является программой слияния"
 
-#: lib/index.tcl:433
+#: lib/mergetool.tcl:275
 #, tcl-format
-msgid "Reverting %s"
-msgstr "Ð\9eбÑ\80аÑ\89ение Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹ Ð² %s"
+msgid "Unsupported merge tool '%s'"
+msgstr "Ð\9dеподдеÑ\80живаемаÑ\8f Ð¿Ñ\80огÑ\80амма Ñ\81лиÑ\8fниÑ\8f Â«%s»"
 
-#: lib/merge.tcl:13
+#: lib/mergetool.tcl:310
+msgid "Merge tool is already running, terminate it?"
+msgstr "Программа слияния уже работает. Прервать?"
+
+#: lib/mergetool.tcl:330
+#, tcl-format
 msgid ""
-"Cannot merge while amending.\n"
-"\n"
-"You must finish amending this commit before starting any type of merge.\n"
-msgstr "Невозможно выполнить слияние во время исправления.\n\nЗавершите исправление данного коммита перед выполнением операции слияния.\n"
+"Error retrieving versions:\n"
+"%s"
+msgstr "Ошибка получения версий:\n%s"
 
-#: lib/merge.tcl:27
+#: lib/mergetool.tcl:350
+#, tcl-format
 msgid ""
-"Last scanned state does not match repository state.\n"
-"\n"
-"Another Git program has modified this repository since the last scan.  A rescan must be performed before a merge can be performed.\n"
+"Could not start the merge tool:\n"
 "\n"
-"The rescan will be automatically started now.\n"
-msgstr "Последнее прочитанное состояние репозитория не соответствует текущему.\n\nС момента последней проверки репозиторий был изменен другой программой Git. Необходимо перечитать репозиторий, прежде чем слияние может быть сделано.\n\nЭто будет сделано сейчас автоматически.\n"
-
-#: lib/merge.tcl:45
-#, tcl-format
-msgid ""
-"You are in the middle of a conflicted merge.\n"
-"\n"
-"File %s has merge conflicts.\n"
-"\n"
-"You must resolve them, stage the file, and commit to complete the current merge.  Only then can you begin another merge.\n"
-msgstr "Предыдущее слияние не завершено из-за конфликта.\n\nДля файла %s возник конфликт слияния.\n\nРазрешите конфликт, добавьте файл в индекс и закоммитьте. Только после этого можно начать следующее слияние.\n"
+"%s"
+msgstr "Ошибка запуска программы слияния:\n\n%s"
 
-#: lib/merge.tcl:55
-#, tcl-format
-msgid ""
-"You are in the middle of a change.\n"
-"\n"
-"File %s is modified.\n"
-"\n"
-"You should complete the current commit before starting a merge.  Doing so will help you abort a failed merge, should the need arise.\n"
-msgstr "Вы находитесь в процессе изменений.\n\nФайл %s изменён.\n\nВы должны завершить текущий коммит перед началом слияния. В случае необходимости, это позволит прервать операцию слияния.\n"
+#: lib/mergetool.tcl:354
+msgid "Running merge tool..."
+msgstr "Запуск программы слияния…"
 
-#: lib/merge.tcl:107
-#, tcl-format
-msgid "%s of %s"
-msgstr "%s из %s"
+#: lib/mergetool.tcl:382 lib/mergetool.tcl:390
+msgid "Merge tool failed."
+msgstr "Ошибка выполнения программы слияния."
 
-#: lib/merge.tcl:120
+#: lib/tools_dlg.tcl:22
 #, tcl-format
-msgid "Merging %s and %s..."
-msgstr "Слияние %s и %s…"
+msgid "%s (%s): Add Tool"
+msgstr "%s (%s): Добавить инструмент"
 
-#: lib/merge.tcl:131
-msgid "Merge completed successfully."
-msgstr "Слияние успешно завершено."
-
-#: lib/merge.tcl:133
-msgid "Merge failed.  Conflict resolution is required."
-msgstr "Не удалось завершить слияние. Требуется разрешение конфликта."
-
-#: lib/merge.tcl:158
-#, tcl-format
-msgid "Merge Into %s"
-msgstr "Слияние с %s"
+#: lib/tools_dlg.tcl:28
+msgid "Add New Tool Command"
+msgstr "Новая вспомогательная операция"
 
-#: lib/merge.tcl:177
-msgid "Revision To Merge"
-msgstr "Ð\92еÑ\80Ñ\81иÑ\8f, Ñ\81 ÐºÐ¾Ñ\82оÑ\80ой Ð¿Ñ\80овеÑ\81Ñ\82и Ñ\81лиÑ\8fние"
+#: lib/tools_dlg.tcl:34
+msgid "Add globally"
+msgstr "Ð\94обавиÑ\82Ñ\8c Ð´Ð»Ñ\8f Ð²Ñ\81еÑ\85 Ñ\80епозиÑ\82оÑ\80иев"
 
-#: lib/merge.tcl:212
-msgid ""
-"Cannot abort while amending.\n"
-"\n"
-"You must finish amending this commit.\n"
-msgstr "Невозможно прервать исправление.\n\nЗавершите текущее исправление коммита.\n"
+#: lib/tools_dlg.tcl:46
+msgid "Tool Details"
+msgstr "Описание вспомогательной операции"
 
-#: lib/merge.tcl:222
-msgid ""
-"Abort merge?\n"
-"\n"
-"Aborting the current merge will cause *ALL* uncommitted changes to be lost.\n"
-"\n"
-"Continue with aborting the current merge?"
-msgstr "Прервать операцию слияния?\n\nПрерывание текущего слияния приведет к потере *ВСЕХ* несохраненных изменений.\n\nПродолжить?"
+#: lib/tools_dlg.tcl:49
+msgid "Use '/' separators to create a submenu tree:"
+msgstr "Используйте «/» для создания подменю"
 
-#: lib/merge.tcl:228
-msgid ""
-"Reset changes?\n"
-"\n"
-"Resetting the changes will cause *ALL* uncommitted changes to be lost.\n"
-"\n"
-"Continue with resetting the current changes?"
-msgstr "Сбросить изменения?\n\nСброс изменений приведет к потере *ВСЕХ* несохраненных изменений.\n\nПродолжить?"
+#: lib/tools_dlg.tcl:60
+msgid "Command:"
+msgstr "Команда:"
 
-#: lib/merge.tcl:239
-msgid "Aborting"
-msgstr "Прерываю"
+#: lib/tools_dlg.tcl:71
+msgid "Show a dialog before running"
+msgstr "Показать диалог перед запуском"
 
-#: lib/merge.tcl:239
-msgid "files reset"
-msgstr "изменениÑ\8f Ð² Ñ\84айлаÑ\85 Ð¾Ñ\82мененÑ\8b"
+#: lib/tools_dlg.tcl:77
+msgid "Ask the user to select a revision (sets $REVISION)"
+msgstr "Ð\97апÑ\80оÑ\81 Ð½Ð° Ð²Ñ\8bбоÑ\80 Ð²ÐµÑ\80Ñ\81ии (Ñ\83Ñ\81Ñ\82анавливаеÑ\82 $REVISION)"
 
-#: lib/merge.tcl:267
-msgid "Abort failed."
-msgstr "Ð\9fÑ\80еÑ\80ваÑ\82Ñ\8c Ð½Ðµ Ñ\83далоÑ\81Ñ\8c."
+#: lib/tools_dlg.tcl:82
+msgid "Ask the user for additional arguments (sets $ARGS)"
+msgstr "Ð\97апÑ\80оÑ\81 Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ\82елÑ\8cнÑ\8bÑ\85 Ð°Ñ\80гÑ\83менÑ\82ов (Ñ\83Ñ\81Ñ\82анавливаеÑ\82 $ARGS)"
 
-#: lib/merge.tcl:269
-msgid "Abort completed.  Ready."
-msgstr "Ð\9fÑ\80еÑ\80вано."
+#: lib/tools_dlg.tcl:89
+msgid "Don't show the command output window"
+msgstr "Ð\9dе Ð¿Ð¾ÐºÐ°Ð·Ñ\8bваÑ\82Ñ\8c Ð¾ÐºÐ½Ð¾ Ð²Ñ\8bвода ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ\8b"
 
-#: lib/mergetool.tcl:8
-msgid "Force resolution to the base version?"
-msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c Ð±Ð°Ð·Ð¾Ð²Ñ\83Ñ\8e Ð²ÐµÑ\80Ñ\81иÑ\8e Ð´Ð»Ñ\8f Ñ\80азÑ\80еÑ\88ениÑ\8f ÐºÐ¾Ð½Ñ\84ликÑ\82а?"
+#: lib/tools_dlg.tcl:94
+msgid "Run only if a diff is selected ($FILENAME not empty)"
+msgstr "Ð\97апÑ\83Ñ\81к Ñ\82олÑ\8cко ÐµÑ\81ли Ð¿Ð¾ÐºÐ°Ð·Ð°Ð½ Ñ\81пиÑ\81ок Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹ ($FILENAME Ð½Ðµ Ð¿Ñ\83Ñ\81Ñ\82о)"
 
-#: lib/mergetool.tcl:9
-msgid "Force resolution to this branch?"
-msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c Ð²ÐµÑ\80Ñ\81иÑ\8e Ð¸Ð· Ñ\8dÑ\82ой Ð²ÐµÑ\82ки Ð´Ð»Ñ\8f Ñ\80азÑ\80еÑ\88ениÑ\8f ÐºÐ¾Ð½Ñ\84ликÑ\82а?"
+#: lib/tools_dlg.tcl:118
+msgid "Please supply a name for the tool."
+msgstr "УкажиÑ\82е Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ðµ Ð²Ñ\81помогаÑ\82елÑ\8cной Ð¾Ð¿ÐµÑ\80аÑ\86ии."
 
-#: lib/mergetool.tcl:10
-msgid "Force resolution to the other branch?"
-msgstr "Использовать версию из другой ветки для разрешения конфликта?"
+#: lib/tools_dlg.tcl:126
+#, tcl-format
+msgid "Tool '%s' already exists."
+msgstr "Вспомогательная операция «%s» уже существует."
 
-#: lib/mergetool.tcl:14
+#: lib/tools_dlg.tcl:148
 #, tcl-format
 msgid ""
-"Note that the diff shows only conflicting changes.\n"
-"\n"
-"%s will be overwritten.\n"
-"\n"
-"This operation can be undone only by restarting the merge."
-msgstr "Внимание! Список изменений показывает только конфликтующие отличия.\n\n%s будет переписан.\n\nЭто действие можно отменить только перезапуском операции слияния."
+"Could not add tool:\n"
+"%s"
+msgstr "Ошибка добавления программы:\n%s"
 
-#: lib/mergetool.tcl:45
+#: lib/tools_dlg.tcl:187
 #, tcl-format
-msgid "File %s seems to have unresolved conflicts, still stage?"
-msgstr "Похоже, что файл %s содержит неразрешенные конфликты. Продолжить индексацию?"
+msgid "%s (%s): Remove Tool"
+msgstr "%s (%s): Удалить инструмент"
 
-#: lib/mergetool.tcl:60
-#, tcl-format
-msgid "Adding resolution for %s"
-msgstr "Добавляю результат разрешения для %s"
+#: lib/tools_dlg.tcl:193
+msgid "Remove Tool Commands"
+msgstr "Удалить команды программы"
 
-#: lib/mergetool.tcl:141
-msgid "Cannot resolve deletion or link conflicts using a tool"
-msgstr "Ð\9fÑ\80огÑ\80амма Ñ\81лиÑ\8fниÑ\8f Ð½Ðµ Ð¾Ð±Ñ\80абаÑ\82Ñ\8bваеÑ\82 ÐºÐ¾Ð½Ñ\84ликÑ\82Ñ\8b Ñ\81 Ñ\83далением Ð¸Ð»Ð¸ Ñ\83Ñ\87аÑ\81Ñ\82ием Ñ\81Ñ\81Ñ\8bлок"
+#: lib/tools_dlg.tcl:198
+msgid "Remove"
+msgstr "УдалиÑ\82Ñ\8c"
 
-#: lib/mergetool.tcl:146
-msgid "Conflict file does not exist"
-msgstr "Конфликтующий файл не существует"
+#: lib/tools_dlg.tcl:231
+msgid "(Blue denotes repository-local tools)"
+msgstr "(Синим выделены программы локальные репозиторию)"
 
-#: lib/mergetool.tcl:264
+#: lib/tools_dlg.tcl:283
 #, tcl-format
-msgid "Not a GUI merge tool: '%s'"
-msgstr "«%s» не является программой слияния"
+msgid "%s (%s):"
+msgstr "%s (%s):"
 
-#: lib/mergetool.tcl:268
+#: lib/tools_dlg.tcl:292
 #, tcl-format
-msgid "Unsupported merge tool '%s'"
-msgstr "Ð\9dеподдеÑ\80живаемаÑ\8f Ð¿Ñ\80огÑ\80амма Ñ\81лиÑ\8fниÑ\8f Â«%s»"
+msgid "Run Command: %s"
+msgstr "Ð\97апÑ\83Ñ\81к ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ\8b: %s"
 
-#: lib/mergetool.tcl:303
-msgid "Merge tool is already running, terminate it?"
-msgstr "Ð\9fÑ\80огÑ\80амма Ñ\81лиÑ\8fниÑ\8f Ñ\83же Ñ\80абоÑ\82аеÑ\82. Ð\9fÑ\80еÑ\80ваÑ\82Ñ\8c?"
+#: lib/tools_dlg.tcl:306
+msgid "Arguments"
+msgstr "Ð\90Ñ\80гÑ\83менÑ\82Ñ\8b"
 
-#: lib/mergetool.tcl:323
-#, tcl-format
-msgid ""
-"Error retrieving versions:\n"
-"%s"
-msgstr "Ошибка получения версий:\n%s"
+#: lib/tools_dlg.tcl:341
+msgid "OK"
+msgstr "OK"
 
-#: lib/mergetool.tcl:343
-#, tcl-format
-msgid ""
-"Could not start the merge tool:\n"
-"\n"
-"%s"
-msgstr "Ошибка запуска программы слияния:\n\n%s"
+#: lib/search.tcl:48
+msgid "Find:"
+msgstr "Поиск:"
 
-#: lib/mergetool.tcl:347
-msgid "Running merge tool..."
-msgstr "Ð\97апÑ\83Ñ\81к Ð¿Ñ\80огÑ\80аммÑ\8b Ñ\81лиÑ\8fниÑ\8fâ\80¦"
+#: lib/search.tcl:50
+msgid "Next"
+msgstr "Ð\94алÑ\8cÑ\88е"
 
-#: lib/mergetool.tcl:375 lib/mergetool.tcl:383
-msgid "Merge tool failed."
-msgstr "Ошибка выполнения программы слияния."
+#: lib/search.tcl:51
+msgid "Prev"
+msgstr "Обратно"
 
-#: lib/option.tcl:11
-#, tcl-format
-msgid "Invalid global encoding '%s'"
-msgstr "Неверная глобальная кодировка «%s»"
+#: lib/search.tcl:52
+msgid "RegExp"
+msgstr "Регулярные выражения"
 
-#: lib/option.tcl:19
+#: lib/search.tcl:54
+msgid "Case"
+msgstr "Учёт регистра"
+
+#: lib/shortcut.tcl:8 lib/shortcut.tcl:43 lib/shortcut.tcl:75
 #, tcl-format
-msgid "Invalid repo encoding '%s'"
-msgstr "Неверная кодировка репозитория «%s»"
+msgid "%s (%s): Create Desktop Icon"
+msgstr "%s (%s): Создать ярлык на рабочем столе"
 
-#: lib/option.tcl:117
-msgid "Restore Defaults"
-msgstr "Ð\92оÑ\81Ñ\81Ñ\82ановиÑ\82Ñ\8c Ð½Ð°Ñ\81Ñ\82Ñ\80ойки Ð¿Ð¾ Ñ\83молÑ\87аниÑ\8e"
+#: lib/shortcut.tcl:24 lib/shortcut.tcl:65
+msgid "Cannot write shortcut:"
+msgstr "Ð\9dевозможно Ð·Ð°Ð¿Ð¸Ñ\81аÑ\82Ñ\8c Ñ\81Ñ\81Ñ\8bлкÑ\83:"
 
-#: lib/option.tcl:121
-msgid "Save"
-msgstr "СоÑ\85Ñ\80аниÑ\82Ñ\8c"
+#: lib/shortcut.tcl:140
+msgid "Cannot write icon:"
+msgstr "Ð\9dевозможно Ð·Ð°Ð¿Ð¸Ñ\81аÑ\82Ñ\8c Ð·Ð½Ð°Ñ\87ок:"
 
-#: lib/option.tcl:131
+#: lib/remote_branch_delete.tcl:29
 #, tcl-format
-msgid "%s Repository"
-msgstr "Для репозитория %s"
-
-#: lib/option.tcl:132
-msgid "Global (All Repositories)"
-msgstr "Общие (для всех репозиториев)"
+msgid "%s (%s): Delete Branch Remotely"
+msgstr "%s (%s): Удаление внешней ветки"
 
-#: lib/option.tcl:138
-msgid "User Name"
-msgstr "Ð\98мÑ\8f Ð¿Ð¾Ð»Ñ\8cзоваÑ\82елÑ\8f"
+#: lib/remote_branch_delete.tcl:34
+msgid "Delete Branch Remotely"
+msgstr "Удаление Ð²ÐµÑ\82ки Ð²Ð¾ Ð²Ð½ÐµÑ\88нем Ñ\80епозиÑ\82оÑ\80ии"
 
-#: lib/option.tcl:139
-msgid "Email Address"
-msgstr "Ð\90дÑ\80еÑ\81 Ñ\8dлекÑ\82Ñ\80онной Ð¿Ð¾Ñ\87Ñ\82Ñ\8b"
+#: lib/remote_branch_delete.tcl:48
+msgid "From Repository"
+msgstr "Ð\98з Ñ\80епозиÑ\82оÑ\80иÑ\8f"
 
-#: lib/option.tcl:141
-msgid "Summarize Merge Commits"
-msgstr "СÑ\83ммаÑ\80ное Ñ\81ообÑ\89ение Ð¿Ñ\80и Ñ\81лиÑ\8fнии"
+#: lib/remote_branch_delete.tcl:88
+msgid "Branches"
+msgstr "Ð\92еÑ\82ки"
 
-#: lib/option.tcl:142
-msgid "Merge Verbosity"
-msgstr "Уровень детальности сообщений при слиянии"
+#: lib/remote_branch_delete.tcl:110
+msgid "Delete Only If"
+msgstr "Удалить только в случае, если"
 
-#: lib/option.tcl:143
-msgid "Show Diffstat After Merge"
-msgstr "Ð\9fоказаÑ\82Ñ\8c Ð¾Ñ\82Ñ\87еÑ\82 Ð¾Ð± Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8fÑ\85 Ð¿Ð¾Ñ\81ле Ñ\81лиÑ\8fниÑ\8f"
+#: lib/remote_branch_delete.tcl:112
+msgid "Merged Into:"
+msgstr "СлиÑ\8fние Ñ\81:"
 
-#: lib/option.tcl:144
-msgid "Use Merge Tool"
-msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c Ð´Ð»Ñ\8f Ñ\81лиÑ\8fниÑ\8f Ð¿Ñ\80огÑ\80аммÑ\83"
+#: lib/remote_branch_delete.tcl:120 lib/branch_delete.tcl:53
+msgid "Always (Do not perform merge checks)"
+msgstr "Ð\92Ñ\81егда (не Ð²Ñ\8bполнÑ\8fÑ\82Ñ\8c Ð¿Ñ\80овеÑ\80кÑ\83 Ð½Ð° Ñ\81лиÑ\8fние)"
 
-#: lib/option.tcl:146
-msgid "Trust File Modification Timestamps"
-msgstr "Ð\94овеÑ\80Ñ\8fÑ\82Ñ\8c Ð²Ñ\80емени Ð¼Ð¾Ð´Ð¸Ñ\84икаÑ\86ии Ñ\84айла"
+#: lib/remote_branch_delete.tcl:153
+msgid "A branch is required for 'Merged Into'."
+msgstr "Ð\94лÑ\8f Ð¾Ð¿ÐµÑ\80аÑ\86ии Â«Ð¡Ð»Ð¸Ñ\8fние Ñ\81» Ñ\82Ñ\80ебÑ\83еÑ\82Ñ\81Ñ\8f Ñ\83казаÑ\82Ñ\8c Ð²ÐµÑ\82кÑ\83."
 
-#: lib/option.tcl:147
-msgid "Prune Tracking Branches During Fetch"
-msgstr "Чистка отслеживаемых веток при извлечении изменений"
+#: lib/remote_branch_delete.tcl:185
+#, tcl-format
+msgid ""
+"The following branches are not completely merged into %s:\n"
+"\n"
+" - %s"
+msgstr "Следующие ветки могут быть объединены с %s при помощи операции слияния:\n\n - %s"
 
-#: lib/option.tcl:148
-msgid "Match Tracking Branches"
-msgstr "Такое же имя, как и у отслеживаемой ветки"
+#: lib/remote_branch_delete.tcl:190
+#, tcl-format
+msgid ""
+"One or more of the merge tests failed because you have not fetched the "
+"necessary commits.  Try fetching from %s first."
+msgstr "Некоторые тесты на слияние не прошли, потому что вы не извлекли необходимые коммиты. Попытайтесь извлечь их из %s."
 
-#: lib/option.tcl:149
-msgid "Blame Copy Only On Changed Files"
-msgstr "Ð\9fоиÑ\81к ÐºÐ¾Ð¿Ð¸Ð¹ Ñ\82олÑ\8cко Ð² Ð¸Ð·Ð¼ÐµÐ½Ñ\91ннÑ\8bÑ\85 Ñ\84айлаÑ\85"
+#: lib/remote_branch_delete.tcl:208
+msgid "Please select one or more branches to delete."
+msgstr "УкажиÑ\82е Ð¾Ð´Ð½Ñ\83 Ð¸Ð»Ð¸ Ð½ÐµÑ\81колÑ\8cко Ð²ÐµÑ\82ок Ð´Ð»Ñ\8f Ñ\83далениÑ\8f."
 
-#: lib/option.tcl:150
-msgid "Minimum Letters To Blame Copy On"
-msgstr "Минимальное количество символов для поиска копий"
+#: lib/remote_branch_delete.tcl:218 lib/branch_delete.tcl:115
+msgid ""
+"Recovering deleted branches is difficult.\n"
+"\n"
+"Delete the selected branches?"
+msgstr "Восстановить удаленные ветки сложно.\n\nПродолжить?"
 
-#: lib/option.tcl:151
-msgid "Blame History Context Radius (days)"
-msgstr "Радиус исторического контекста (в днях)"
+#: lib/remote_branch_delete.tcl:227
+#, tcl-format
+msgid "Deleting branches from %s"
+msgstr "Удаление веток из %s"
 
-#: lib/option.tcl:152
-msgid "Number of Diff Context Lines"
-msgstr "ЧиÑ\81ло Ñ\81Ñ\82Ñ\80ок Ð² ÐºÐ¾Ð½Ñ\82екÑ\81Ñ\82е diff"
+#: lib/remote_branch_delete.tcl:300
+msgid "No repository selected."
+msgstr "Ð\9dе Ñ\83казан Ñ\80епозиÑ\82оÑ\80ий."
 
-#: lib/option.tcl:153
-msgid "Commit Message Text Width"
-msgstr "Ширина текста сообщения коммита"
+#: lib/remote_branch_delete.tcl:305
+#, tcl-format
+msgid "Scanning %s..."
+msgstr "Перечитывание %s…"
 
-#: lib/option.tcl:154
-msgid "New Branch Name Template"
-msgstr "Шаблон для имени новой ветки"
+#: lib/choose_repository.tcl:45
+msgid "Git Gui"
+msgstr "Git Gui"
 
-#: lib/option.tcl:155
-msgid "Default File Contents Encoding"
-msgstr "Ð\9aодиÑ\80овка Ñ\81одеÑ\80жаниÑ\8f Ñ\84айла Ð¿Ð¾ Ñ\83молÑ\87аниÑ\8e"
+#: lib/choose_repository.tcl:104 lib/choose_repository.tcl:427
+msgid "Create New Repository"
+msgstr "СоздаÑ\82Ñ\8c Ð½Ð¾Ð²Ñ\8bй Ñ\80епозиÑ\82оÑ\80ий"
 
-#: lib/option.tcl:203
-msgid "Change"
-msgstr "Ð\98змениÑ\82Ñ\8c"
+#: lib/choose_repository.tcl:110
+msgid "New..."
+msgstr "Ð\9dовÑ\8bйâ\80¦"
 
-#: lib/option.tcl:230
-msgid "Spelling Dictionary:"
-msgstr "СловаÑ\80Ñ\8c Ð´Ð»Ñ\8f Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f:"
+#: lib/choose_repository.tcl:117 lib/choose_repository.tcl:511
+msgid "Clone Existing Repository"
+msgstr "СклониÑ\80оваÑ\82Ñ\8c Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83Ñ\8eÑ\89ий Ñ\80епозиÑ\82оÑ\80ий"
 
-#: lib/option.tcl:254
-msgid "Change Font"
-msgstr "Ð\98змениÑ\82Ñ\8c"
+#: lib/choose_repository.tcl:128
+msgid "Clone..."
+msgstr "Ð\9aлониÑ\80оваÑ\82Ñ\8câ\80¦"
 
-#: lib/option.tcl:258
-#, tcl-format
-msgid "Choose %s"
-msgstr "Выберите %s"
+#: lib/choose_repository.tcl:135 lib/choose_repository.tcl:1105
+msgid "Open Existing Repository"
+msgstr "Выбрать существующий репозиторий"
 
-#: lib/option.tcl:264
-msgid "pt."
-msgstr "pt."
+#: lib/choose_repository.tcl:141
+msgid "Open..."
+msgstr "Открыть…"
 
-#: lib/option.tcl:278
-msgid "Preferences"
-msgstr "Ð\9dаÑ\81Ñ\82Ñ\80ойки"
+#: lib/choose_repository.tcl:154
+msgid "Recent Repositories"
+msgstr "Ð\9dедавние Ñ\80епозиÑ\82оÑ\80ии"
 
-#: lib/option.tcl:314
-msgid "Failed to completely save options:"
-msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð¿Ð¾Ð»Ð½Ð¾Ñ\81Ñ\82Ñ\8cÑ\8e Ñ\81оÑ\85Ñ\80аниÑ\82Ñ\8c Ð½Ð°Ñ\81Ñ\82Ñ\80ойки:"
+#: lib/choose_repository.tcl:164
+msgid "Open Recent Repository:"
+msgstr "Ð\9eÑ\82кÑ\80Ñ\8bÑ\82Ñ\8c Ð¿Ð¾Ñ\81ледний Ñ\80епозиÑ\82оÑ\80ий"
 
-#: lib/remote.tcl:163
-msgid "Remove Remote"
-msgstr "Удалить ссылку на внешний репозиторий"
+#: lib/choose_repository.tcl:331 lib/choose_repository.tcl:338
+#: lib/choose_repository.tcl:345
+#, tcl-format
+msgid "Failed to create repository %s:"
+msgstr "Не удалось создать репозиторий %s:"
 
-#: lib/remote.tcl:168
-msgid "Prune from"
-msgstr "ЧиÑ\81Ñ\82ка"
+#: lib/choose_repository.tcl:422 lib/branch_create.tcl:33
+msgid "Create"
+msgstr "СоздаÑ\82Ñ\8c"
 
-#: lib/remote.tcl:173
-msgid "Fetch from"
-msgstr "Ð\98звлеÑ\87ение Ð¸Ð·"
+#: lib/choose_repository.tcl:432
+msgid "Directory:"
+msgstr "Ð\9aаÑ\82алог:"
 
-#: lib/remote.tcl:215
-msgid "Push to"
-msgstr "Отправить"
+#: lib/choose_repository.tcl:462 lib/choose_repository.tcl:588
+#: lib/choose_repository.tcl:1139
+msgid "Git Repository"
+msgstr "Репозиторий"
 
-#: lib/remote_add.tcl:19
-msgid "Add Remote"
-msgstr "Зарегистрировать внешний репозиторий"
+#: lib/choose_repository.tcl:487
+#, tcl-format
+msgid "Directory %s already exists."
+msgstr "Каталог '%s' уже существует."
 
-#: lib/remote_add.tcl:24
-msgid "Add New Remote"
-msgstr "Добавить внешний репозиторий"
+#: lib/choose_repository.tcl:491
+#, tcl-format
+msgid "File %s already exists."
+msgstr "Файл '%s' уже существует."
 
-#: lib/remote_add.tcl:28 lib/tools_dlg.tcl:36
-msgid "Add"
-msgstr "Ð\94обавить"
+#: lib/choose_repository.tcl:506
+msgid "Clone"
+msgstr "СклониÑ\80овать"
 
-#: lib/remote_add.tcl:37
-msgid "Remote Details"
-msgstr "Информация о внешнем репозитории"
+#: lib/choose_repository.tcl:519
+msgid "Source Location:"
+msgstr "Исходное положение:"
 
-#: lib/remote_add.tcl:50
-msgid "Location:"
-msgstr "Ð\9fоложение:"
+#: lib/choose_repository.tcl:528
+msgid "Target Directory:"
+msgstr "Ð\9aаÑ\82алог Ð½Ð°Ð·Ð½Ð°Ñ\87ениÑ\8f:"
 
-#: lib/remote_add.tcl:62
-msgid "Further Action"
-msgstr "СледÑ\83Ñ\8eÑ\89аÑ\8f Ð¾Ð¿ÐµÑ\80аÑ\86иÑ\8f"
+#: lib/choose_repository.tcl:538
+msgid "Clone Type:"
+msgstr "Тип ÐºÐ»Ð¾Ð½Ð°:"
 
-#: lib/remote_add.tcl:65
-msgid "Fetch Immediately"
-msgstr "СÑ\80азÑ\83 Ð¸Ð·Ð²Ð»ÐµÑ\87Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f"
+#: lib/choose_repository.tcl:543
+msgid "Standard (Fast, Semi-Redundant, Hardlinks)"
+msgstr "СÑ\82андаÑ\80Ñ\82нÑ\8bй (Ð\91Ñ\8bÑ\81Ñ\82Ñ\80Ñ\8bй, Ð¿Ð¾Ð»Ñ\83избÑ\8bÑ\82оÑ\87нÑ\8bй, Â«Ð¶ÐµÑ\81Ñ\82кие» Ñ\81Ñ\81Ñ\8bлки)"
 
-#: lib/remote_add.tcl:71
-msgid "Initialize Remote Repository and Push"
-msgstr "Ð\98ниÑ\86иализиÑ\80оваÑ\82Ñ\8c Ð²Ð½ÐµÑ\88ний Ñ\80епозиÑ\82оÑ\80ий Ð¸ Ð¾Ñ\82пÑ\80авиÑ\82Ñ\8c"
+#: lib/choose_repository.tcl:548
+msgid "Full Copy (Slower, Redundant Backup)"
+msgstr "Ð\9fолнаÑ\8f ÐºÐ¾Ð¿Ð¸Ñ\8f (Ð\9cедленнÑ\8bй, Ñ\81оздаеÑ\82 Ñ\80езеÑ\80внÑ\83Ñ\8e ÐºÐ¾Ð¿Ð¸Ñ\8e)"
 
-#: lib/remote_add.tcl:77
-msgid "Do Nothing Else Now"
-msgstr "Ð\91олÑ\8cÑ\88е Ð½Ð¸Ñ\87его Ð½Ðµ Ð´ÐµÐ»Ð°Ñ\82Ñ\8c"
+#: lib/choose_repository.tcl:553
+msgid "Shared (Fastest, Not Recommended, No Backup)"
+msgstr "Ð\9eбÑ\89ий (СамÑ\8bй Ð±Ñ\8bÑ\81Ñ\82Ñ\80Ñ\8bй, Ð½Ðµ Ñ\80екомендÑ\83еÑ\82Ñ\81Ñ\8f, Ð±ÐµÐ· Ñ\80езеÑ\80вной ÐºÐ¾Ð¿Ð¸Ð¸)"
 
-#: lib/remote_add.tcl:101
-msgid "Please supply a remote name."
-msgstr "УкажиÑ\82е Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ðµ Ð²Ð½ÐµÑ\88него Ñ\80епозиÑ\82оÑ\80иÑ\8f."
+#: lib/choose_repository.tcl:560
+msgid "Recursively clone submodules too"
+msgstr "Также Ñ\80екÑ\83Ñ\80Ñ\81ивно ÐºÐ»Ð¾Ð½Ð¸Ñ\80оваÑ\82Ñ\8c Ð¿Ð¾Ð´Ð¼Ð¾Ð´Ñ\83ли"
 
-#: lib/remote_add.tcl:114
+#: lib/choose_repository.tcl:594 lib/choose_repository.tcl:641
+#: lib/choose_repository.tcl:790 lib/choose_repository.tcl:864
+#: lib/choose_repository.tcl:1145 lib/choose_repository.tcl:1153
 #, tcl-format
-msgid "'%s' is not an acceptable remote name."
-msgstr "«%s» не является допустимым именем внешнего репозитория."
+msgid "Not a Git repository: %s"
+msgstr "Каталог не является репозиторием Git: %s"
 
-#: lib/remote_add.tcl:125
-#, tcl-format
-msgid "Failed to add remote '%s' of location '%s'."
-msgstr "Не удалось добавить «%s» из «%s». "
+#: lib/choose_repository.tcl:630
+msgid "Standard only available for local repository."
+msgstr "Стандартный клон возможен только для локального репозитория."
 
-#: lib/remote_add.tcl:133 lib/transport.tcl:6
-#, tcl-format
-msgid "fetch %s"
-msgstr "извлечение %s"
+#: lib/choose_repository.tcl:634
+msgid "Shared only available for local repository."
+msgstr "Общий клон возможен только для локального репозитория."
 
-#: lib/remote_add.tcl:134
+#: lib/choose_repository.tcl:655
 #, tcl-format
-msgid "Fetching the %s"
-msgstr "Ð\98звлеÑ\87ение %s"
+msgid "Location %s already exists."
+msgstr "Ð\9fÑ\83Ñ\82Ñ\8c %s Ñ\83же Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83еÑ\82."
 
-#: lib/remote_add.tcl:157
-#, tcl-format
-msgid "Do not know how to initialize repository at location '%s'."
-msgstr "Невозможно инициализировать репозиторий в «%s»."
+#: lib/choose_repository.tcl:666
+msgid "Failed to configure origin"
+msgstr "Не удалось сконфигурировать исходный репозиторий"
+
+#: lib/choose_repository.tcl:678
+msgid "Counting objects"
+msgstr "Подсчёт объектов"
 
-#: lib/remote_add.tcl:163 lib/transport.tcl:25 lib/transport.tcl:63
-#: lib/transport.tcl:81
+#: lib/choose_repository.tcl:679
+msgid "buckets"
+msgstr "блоки"
+
+#: lib/choose_repository.tcl:703
 #, tcl-format
-msgid "push %s"
-msgstr "оÑ\82пÑ\80авиÑ\82Ñ\8c %s"
+msgid "Unable to copy objects/info/alternates: %s"
+msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ñ\81копиÑ\80оваÑ\82Ñ\8c objects/info/alternates: %s"
 
-#: lib/remote_add.tcl:164
+#: lib/choose_repository.tcl:740
 #, tcl-format
-msgid "Setting up the %s (at %s)"
-msgstr "Ð\9dаÑ\81Ñ\82Ñ\80ойка %s (в %s)"
+msgid "Nothing to clone from %s."
+msgstr "Ð\9dеÑ\87его ÐºÐ»Ð¾Ð½Ð¸Ñ\80оваÑ\82Ñ\8c Ñ\81 %s."
 
-#: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34
-msgid "Delete Branch Remotely"
-msgstr "Удаление ветки во внешнем репозитории"
+#: lib/choose_repository.tcl:742 lib/choose_repository.tcl:962
+#: lib/choose_repository.tcl:974
+msgid "The 'master' branch has not been initialized."
+msgstr "Не инициализирована ветка «master»."
 
-#: lib/remote_branch_delete.tcl:47
-msgid "From Repository"
-msgstr "Ð\98з Ñ\80епозиÑ\82оÑ\80иÑ\8f"
+#: lib/choose_repository.tcl:755
+msgid "Hardlinks are unavailable.  Falling back to copying."
+msgstr "Ð\96еÑ\81Ñ\82кие Ñ\81Ñ\81Ñ\8bлки Ð½ÐµÐ´Ð¾Ñ\81Ñ\82Ñ\83пнÑ\8b. Ð\91Ñ\83деÑ\82 Ð¸Ñ\81полÑ\8cзовано ÐºÐ¾Ð¿Ð¸Ñ\80ование."
 
-#: lib/remote_branch_delete.tcl:50 lib/transport.tcl:134
-msgid "Remote:"
-msgstr "внешний:"
+#: lib/choose_repository.tcl:769
+#, tcl-format
+msgid "Cloning from %s"
+msgstr "Клонирование из %s"
 
-#: lib/remote_branch_delete.tcl:66 lib/transport.tcl:149
-msgid "Arbitrary Location:"
-msgstr "Указанное Ð¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ðµ:"
+#: lib/choose_repository.tcl:800
+msgid "Copying objects"
+msgstr "Ð\9aопиÑ\80ование Ð¾Ð±Ñ\8aекÑ\82ов"
 
-#: lib/remote_branch_delete.tcl:84
-msgid "Branches"
-msgstr "Ð\92еÑ\82ки"
+#: lib/choose_repository.tcl:801
+msgid "KiB"
+msgstr "Ð\9aÐ\91"
 
-#: lib/remote_branch_delete.tcl:109
-msgid "Delete Only If"
-msgstr "Удалить только в случае, если"
+#: lib/choose_repository.tcl:825
+#, tcl-format
+msgid "Unable to copy object: %s"
+msgstr "Не могу скопировать объект: %s"
 
-#: lib/remote_branch_delete.tcl:111
-msgid "Merged Into:"
-msgstr "СлиÑ\8fние Ñ\81:"
+#: lib/choose_repository.tcl:837
+msgid "Linking objects"
+msgstr "Создание Ñ\81Ñ\81Ñ\8bлок Ð½Ð° objects"
 
-#: lib/remote_branch_delete.tcl:152
-msgid "A branch is required for 'Merged Into'."
-msgstr "Ð\94лÑ\8f Ð¾Ð¿ÐµÑ\80аÑ\86ии Â«Ð¡Ð»Ð¸Ñ\8fние Ñ\81» Ñ\82Ñ\80ебÑ\83еÑ\82Ñ\81Ñ\8f Ñ\83казаÑ\82Ñ\8c Ð²ÐµÑ\82кÑ\83."
+#: lib/choose_repository.tcl:838
+msgid "objects"
+msgstr "обÑ\8aекÑ\82Ñ\8b"
 
-#: lib/remote_branch_delete.tcl:184
+#: lib/choose_repository.tcl:846
 #, tcl-format
-msgid ""
-"The following branches are not completely merged into %s:\n"
-"\n"
-" - %s"
-msgstr "Следующие ветки могут быть объединены с %s при помощи операции слияния:\n\n - %s"
+msgid "Unable to hardlink object: %s"
+msgstr "Не могу создать «жесткую ссылку» на объект: %s"
 
-#: lib/remote_branch_delete.tcl:189
-#, tcl-format
-msgid ""
-"One or more of the merge tests failed because you have not fetched the "
-"necessary commits.  Try fetching from %s first."
-msgstr "Некоторые тесты на слияние не прошли, потому что вы не извлекли необходимые коммиты. Попытайтесь извлечь их из %s."
+#: lib/choose_repository.tcl:903
+msgid "Cannot fetch branches and objects.  See console output for details."
+msgstr "Не удалось извлечь ветки и объекты. Дополнительная информация на консоли."
 
-#: lib/remote_branch_delete.tcl:207
-msgid "Please select one or more branches to delete."
-msgstr "Укажите одну или несколько веток для удаления."
+#: lib/choose_repository.tcl:914
+msgid "Cannot fetch tags.  See console output for details."
+msgstr "Не удалось извлечь метки. Дополнительная информация на консоли."
+
+#: lib/choose_repository.tcl:938
+msgid "Cannot determine HEAD.  See console output for details."
+msgstr "Не могу определить HEAD. Дополнительная информация на консоли."
 
-#: lib/remote_branch_delete.tcl:226
+#: lib/choose_repository.tcl:947
 #, tcl-format
-msgid "Deleting branches from %s"
-msgstr "Удаление Ð²ÐµÑ\82ок Ð¸Ð· %s"
+msgid "Unable to cleanup %s"
+msgstr "Ð\9dе Ð¼Ð¾Ð³Ñ\83 Ð¾Ñ\87иÑ\81Ñ\82иÑ\82Ñ\8c %s"
 
-#: lib/remote_branch_delete.tcl:292
-msgid "No repository selected."
-msgstr "Не указан репозиторий."
+#: lib/choose_repository.tcl:953
+msgid "Clone failed."
+msgstr "Клонирование не удалось."
+
+#: lib/choose_repository.tcl:960
+msgid "No default branch obtained."
+msgstr "Ветка по умолчанию не была получена."
 
-#: lib/remote_branch_delete.tcl:297
+#: lib/choose_repository.tcl:971
 #, tcl-format
-msgid "Scanning %s..."
-msgstr "Ð\9fеÑ\80еÑ\87иÑ\82Ñ\8bвание %sâ\80¦"
+msgid "Cannot resolve %s as a commit."
+msgstr "Ð\9dе Ð¼Ð¾Ð³Ñ\83 Ñ\80аÑ\81познаÑ\82Ñ\8c %s ÐºÐ°Ðº ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82."
 
-#: lib/search.tcl:21
-msgid "Find:"
-msgstr "Ð\9fоиÑ\81к:"
+#: lib/choose_repository.tcl:998
+msgid "Creating working directory"
+msgstr "СоздаÑ\8e Ñ\80абоÑ\87ий ÐºÐ°Ñ\82алог"
 
-#: lib/search.tcl:23
-msgid "Next"
-msgstr "Ð\94алÑ\8cÑ\88е"
+#: lib/choose_repository.tcl:1028
+msgid "Initial file checkout failed."
+msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð¿Ð¾Ð»Ñ\83Ñ\87иÑ\82Ñ\8c Ð½Ð°Ñ\87алÑ\8cное Ñ\81оÑ\81Ñ\82оÑ\8fние Ñ\84айлов Ñ\80епозиÑ\82оÑ\80иÑ\8f."
 
-#: lib/search.tcl:24
-msgid "Prev"
-msgstr "Ð\9eбÑ\80аÑ\82но"
+#: lib/choose_repository.tcl:1072
+msgid "Cloning submodules"
+msgstr "Ð\9aлониÑ\80ование Ð¿Ð¾Ð´Ð¼Ð¾Ð´Ñ\83лей"
 
-#: lib/search.tcl:25
-msgid "Case-Sensitive"
-msgstr "Ð\98гн. Ð±Ð¾Ð»Ñ\8cÑ\88ие/маленÑ\8cкие"
+#: lib/choose_repository.tcl:1087
+msgid "Cannot clone submodules."
+msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c ÐºÐ»Ð¾Ð½Ð¸Ñ\80оваÑ\82Ñ\8c Ð¿Ð¾Ð´Ð¼Ð¾Ð´Ñ\83ли."
 
-#: lib/shortcut.tcl:21 lib/shortcut.tcl:62
-msgid "Cannot write shortcut:"
-msgstr "Ð\9dевозможно Ð·Ð°Ð¿Ð¸Ñ\81аÑ\82Ñ\8c Ñ\81Ñ\81Ñ\8bлкÑ\83:"
+#: lib/choose_repository.tcl:1110
+msgid "Repository:"
+msgstr "РепозиÑ\82оÑ\80ий:"
 
-#: lib/shortcut.tcl:137
-msgid "Cannot write icon:"
-msgstr "Невозможно записать значок:"
+#: lib/choose_repository.tcl:1159
+#, tcl-format
+msgid "Failed to open repository %s:"
+msgstr "Не удалось открыть репозиторий %s:"
 
-#: lib/spellcheck.tcl:57
-msgid "Unsupported spell checker"
-msgstr "Неподдерживаемая программа проверки правописания"
+#: lib/about.tcl:26
+msgid "git-gui - a graphical user interface for Git."
+msgstr "git-gui - графический пользовательский интерфейс к Git."
 
-#: lib/spellcheck.tcl:65
-msgid "Spell checking is unavailable"
-msgstr "Проверка правописания не доступна"
+#: lib/blame.tcl:74
+#, tcl-format
+msgid "%s (%s): File Viewer"
+msgstr "%s (%s): Просмотр файла"
 
-#: lib/spellcheck.tcl:68
-msgid "Invalid spell checking configuration"
-msgstr "Ð\9dепÑ\80авилÑ\8cнаÑ\8f ÐºÐ¾Ð½Ñ\84игÑ\83Ñ\80аÑ\86иÑ\8f Ð¿Ñ\80огÑ\80аммÑ\8b Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f"
+#: lib/blame.tcl:80
+msgid "Commit:"
+msgstr "Ð\9aоммиÑ\82:"
 
-#: lib/spellcheck.tcl:70
-#, tcl-format
-msgid "Reverting dictionary to %s."
-msgstr "Словарь вернут к %s."
+#: lib/blame.tcl:282
+msgid "Copy Commit"
+msgstr "Копировать SHA-1"
 
-#: lib/spellcheck.tcl:73
-msgid "Spell checker silently failed on startup"
-msgstr "Ð\9fÑ\80огÑ\80амма Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f Ð½Ðµ Ñ\81могла Ð·Ð°Ð¿Ñ\83Ñ\81Ñ\82иÑ\82Ñ\8cÑ\81Ñ\8f"
+#: lib/blame.tcl:286
+msgid "Find Text..."
+msgstr "Ð\9dайÑ\82и Ñ\82екÑ\81Ñ\82â\80¦"
 
-#: lib/spellcheck.tcl:80
-msgid "Unrecognized spell checker"
-msgstr "Ð\9dеÑ\80аÑ\81познаннаÑ\8f Ð¿Ñ\80огÑ\80амма Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f"
+#: lib/blame.tcl:290
+msgid "Goto Line..."
+msgstr "Ð\9fеÑ\80ейÑ\82и Ð½Ð° Ñ\81Ñ\82Ñ\80окÑ\83â\80¦"
 
-#: lib/spellcheck.tcl:186
-msgid "No Suggestions"
-msgstr "Ð\98Ñ\81пÑ\80авлений Ð½Ðµ Ð½Ð°Ð¹Ð´ÐµÐ½Ð¾"
+#: lib/blame.tcl:299
+msgid "Do Full Copy Detection"
+msgstr "Ð\9fÑ\80овеÑ\81Ñ\82и Ð¿Ð¾Ð»Ð½Ñ\8bй Ð¿Ð¾Ð¸Ñ\81к ÐºÐ¾Ð¿Ð¸Ð¹"
 
-#: lib/spellcheck.tcl:388
-msgid "Unexpected EOF from spell checker"
-msgstr "Программа проверки правописания прервала передачу данных"
+#: lib/blame.tcl:303
+msgid "Show History Context"
+msgstr "Показать исторический контекст"
 
-#: lib/spellcheck.tcl:392
-msgid "Spell Checker Failed"
-msgstr "Ð\9eÑ\88ибка Ð¿Ñ\80овеÑ\80ки Ð¿Ñ\80авопиÑ\81аниÑ\8f"
+#: lib/blame.tcl:306
+msgid "Blame Parent Commit"
+msgstr "Ð\90вÑ\82оÑ\80Ñ\8b Ñ\80одиÑ\82елÑ\8cÑ\81кого ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82а"
 
-#: lib/sshkey.tcl:31
+#: lib/blame.tcl:468
+#, tcl-format
+msgid "Reading %s..."
+msgstr "Чтение %s…"
+
+#: lib/blame.tcl:596
+msgid "Loading copy/move tracking annotations..."
+msgstr "Загрузка аннотации копирований/переименований…"
+
+#: lib/blame.tcl:613
+msgid "lines annotated"
+msgstr "строк прокомментировано"
+
+#: lib/blame.tcl:815
+msgid "Loading original location annotations..."
+msgstr "Загрузка аннотаций первоначального положения объекта…"
+
+#: lib/blame.tcl:818
+msgid "Annotation complete."
+msgstr "Аннотация завершена."
+
+#: lib/blame.tcl:849
+msgid "Busy"
+msgstr "Занят"
+
+#: lib/blame.tcl:850
+msgid "Annotation process is already running."
+msgstr "Аннотация уже запущена"
+
+#: lib/blame.tcl:889
+msgid "Running thorough copy detection..."
+msgstr "Выполнение полного поиска копий…"
+
+#: lib/blame.tcl:957
+msgid "Loading annotation..."
+msgstr "Загрузка аннотации…"
+
+#: lib/blame.tcl:1010
+msgid "Author:"
+msgstr "Автор:"
+
+#: lib/blame.tcl:1014
+msgid "Committer:"
+msgstr "Коммитер:"
+
+#: lib/blame.tcl:1019
+msgid "Original File:"
+msgstr "Исходный файл:"
+
+#: lib/blame.tcl:1067
+msgid "Cannot find HEAD commit:"
+msgstr "Не удалось найти текущее состояние:"
+
+#: lib/blame.tcl:1122
+msgid "Cannot find parent commit:"
+msgstr "Не удалось найти родительское состояние:"
+
+#: lib/blame.tcl:1137
+msgid "Unable to display parent"
+msgstr "Не могу показать предка"
+
+#: lib/blame.tcl:1138 lib/diff.tcl:345
+msgid "Error loading diff:"
+msgstr "Ошибка загрузки изменений:"
+
+#: lib/blame.tcl:1279
+msgid "Originally By:"
+msgstr "Источник:"
+
+#: lib/blame.tcl:1285
+msgid "In File:"
+msgstr "Файл:"
+
+#: lib/blame.tcl:1290
+msgid "Copied Or Moved Here By:"
+msgstr "Скопировано/перемещено в:"
+
+#: lib/diff.tcl:77
+#, tcl-format
+msgid ""
+"No differences detected.\n"
+"\n"
+"%s has no changes.\n"
+"\n"
+"The modification date of this file was updated by another application, but the content within the file was not changed.\n"
+"\n"
+"A rescan will be automatically started to find other files which may have the same state."
+msgstr "Изменений не обнаружено.\n\nв %s отсутствуют изменения.\n\nДата изменения файла была обновлена другой программой, но содержимое файла осталось прежним.\n\nСейчас будет запущено перечитывание репозитория, чтобы найти подобные файлы."
+
+#: lib/diff.tcl:117
+#, tcl-format
+msgid "Loading diff of %s..."
+msgstr "Загрузка изменений %s…"
+
+#: lib/diff.tcl:143
+msgid ""
+"LOCAL: deleted\n"
+"REMOTE:\n"
+msgstr "ЛОКАЛЬНО: удалён\nВНЕШНИЙ:\n"
+
+#: lib/diff.tcl:148
+msgid ""
+"REMOTE: deleted\n"
+"LOCAL:\n"
+msgstr "ВНЕШНИЙ: удалён\nЛОКАЛЬНО:\n"
+
+#: lib/diff.tcl:155
+msgid "LOCAL:\n"
+msgstr "ЛОКАЛЬНО:\n"
+
+#: lib/diff.tcl:158
+msgid "REMOTE:\n"
+msgstr "ВНЕШНИЙ:\n"
+
+#: lib/diff.tcl:220 lib/diff.tcl:344
+#, tcl-format
+msgid "Unable to display %s"
+msgstr "Не могу показать %s"
+
+#: lib/diff.tcl:221
+msgid "Error loading file:"
+msgstr "Ошибка загрузки файла:"
+
+#: lib/diff.tcl:227
+msgid "Git Repository (subproject)"
+msgstr "Репозиторий Git (подпроект)"
+
+#: lib/diff.tcl:239
+msgid "* Binary file (not showing content)."
+msgstr "* Двоичный файл (содержимое не показано)"
+
+#: lib/diff.tcl:244
+#, tcl-format
+msgid ""
+"* Untracked file is %d bytes.\n"
+"* Showing only first %d bytes.\n"
+msgstr "* Размер неотслеживаемого файла %d байт.\n* Показано первых %d байт.\n"
+
+#: lib/diff.tcl:250
+#, tcl-format
+msgid ""
+"\n"
+"* Untracked file clipped here by %s.\n"
+"* To see the entire file, use an external editor.\n"
+msgstr "\n* Неотслеживаемый файл обрезан: %s.\n* Чтобы увидеть весь файл, используйте внешний редактор.\n"
+
+#: lib/diff.tcl:583
+msgid "Failed to unstage selected hunk."
+msgstr "Не удалось исключить выбранную часть."
+
+#: lib/diff.tcl:591
+msgid "Failed to revert selected hunk."
+msgstr "Не удалось обратить изменения выбранного блока."
+
+#: lib/diff.tcl:594
+msgid "Failed to stage selected hunk."
+msgstr "Не удалось проиндексировать выбранный блок изменений."
+
+#: lib/diff.tcl:687
+msgid "Failed to unstage selected line."
+msgstr "Не удалось исключить выбранную строку."
+
+#: lib/diff.tcl:696
+msgid "Failed to revert selected line."
+msgstr "Не удалось обратить изменения выбраной строки."
+
+#: lib/diff.tcl:700
+msgid "Failed to stage selected line."
+msgstr "Не удалось проиндексировать выбранную строку."
+
+#: lib/diff.tcl:889
+msgid "Failed to undo last revert."
+msgstr "Не удалось отменить посленднее обращение изменений."
+
+#: lib/sshkey.tcl:34
 msgid "No keys found."
 msgstr "Ключ не найден"
 
-#: lib/sshkey.tcl:34
+#: lib/sshkey.tcl:37
 #, tcl-format
 msgid "Found a public key in: %s"
 msgstr "Публичный ключ из %s"
 
-#: lib/sshkey.tcl:40
+#: lib/sshkey.tcl:43
 msgid "Generate Key"
 msgstr "Создать ключ"
 
-#: lib/sshkey.tcl:56
+#: lib/sshkey.tcl:61
 msgid "Copy To Clipboard"
 msgstr "Скопировать в буфер обмена"
 
-#: lib/sshkey.tcl:70
-msgid "Your OpenSSH Public Key"
-msgstr "Ваш публичный ключ OpenSSH"
+#: lib/sshkey.tcl:75
+msgid "Your OpenSSH Public Key"
+msgstr "Ваш публичный ключ OpenSSH"
+
+#: lib/sshkey.tcl:83
+msgid "Generating..."
+msgstr "Создание…"
+
+#: lib/sshkey.tcl:89
+#, tcl-format
+msgid ""
+"Could not start ssh-keygen:\n"
+"\n"
+"%s"
+msgstr "Ошибка запуска ssh-keygen:\n\n%s"
+
+#: lib/sshkey.tcl:116
+msgid "Generation failed."
+msgstr "Ключ не создан."
+
+#: lib/sshkey.tcl:123
+msgid "Generation succeeded, but no keys found."
+msgstr "Создание ключа завершилось, но результат не был найден"
+
+#: lib/sshkey.tcl:126
+#, tcl-format
+msgid "Your key is in: %s"
+msgstr "Ваш ключ находится в: %s"
+
+#: lib/branch_create.tcl:23
+#, tcl-format
+msgid "%s (%s): Create Branch"
+msgstr "%s (%s): Создание ветки"
+
+#: lib/branch_create.tcl:28
+msgid "Create New Branch"
+msgstr "Создать новую ветку"
+
+#: lib/branch_create.tcl:42
+msgid "Branch Name"
+msgstr "Имя ветки"
+
+#: lib/branch_create.tcl:57
+msgid "Match Tracking Branch Name"
+msgstr "Соответствовать имени отслеживаемой ветки"
+
+#: lib/branch_create.tcl:66
+msgid "Starting Revision"
+msgstr "Начальная версия"
+
+#: lib/branch_create.tcl:72
+msgid "Update Existing Branch:"
+msgstr "Обновить имеющуюся ветку:"
+
+#: lib/branch_create.tcl:75
+msgid "No"
+msgstr "Нет"
+
+#: lib/branch_create.tcl:80
+msgid "Fast Forward Only"
+msgstr "Только Fast Forward"
+
+#: lib/branch_create.tcl:97
+msgid "Checkout After Creation"
+msgstr "После создания сделать текущей"
+
+#: lib/branch_create.tcl:132
+msgid "Please select a tracking branch."
+msgstr "Укажите отлеживаемую ветку."
+
+#: lib/branch_create.tcl:141
+#, tcl-format
+msgid "Tracking branch %s is not a branch in the remote repository."
+msgstr "Отслеживаемая ветка %s не является веткой на внешнем репозитории."
+
+#: lib/console.tcl:59
+msgid "Working... please wait..."
+msgstr "В процессе… пожалуйста, ждите…"
+
+#: lib/console.tcl:186
+msgid "Success"
+msgstr "Процесс успешно завершен"
+
+#: lib/console.tcl:200
+msgid "Error: Command Failed"
+msgstr "Ошибка: не удалось выполнить команду"
+
+#: lib/line.tcl:17
+msgid "Goto Line:"
+msgstr "Перейти на строку:"
+
+#: lib/line.tcl:23
+msgid "Go"
+msgstr "Перейти"
+
+#: lib/choose_rev.tcl:52
+msgid "This Detached Checkout"
+msgstr "Текущее отсоединенное состояние"
+
+#: lib/choose_rev.tcl:60
+msgid "Revision Expression:"
+msgstr "Выражение для определения версии:"
+
+#: lib/choose_rev.tcl:72
+msgid "Local Branch"
+msgstr "Локальная ветка:"
+
+#: lib/choose_rev.tcl:77
+msgid "Tracking Branch"
+msgstr "Отслеживаемая ветка"
+
+#: lib/choose_rev.tcl:82 lib/choose_rev.tcl:544
+msgid "Tag"
+msgstr "Метка"
+
+#: lib/choose_rev.tcl:321
+#, tcl-format
+msgid "Invalid revision: %s"
+msgstr "Неверная версия: %s"
+
+#: lib/choose_rev.tcl:342
+msgid "No revision selected."
+msgstr "Версия не указана."
+
+#: lib/choose_rev.tcl:350
+msgid "Revision expression is empty."
+msgstr "Пустое выражение для определения версии."
+
+#: lib/choose_rev.tcl:537
+msgid "Updated"
+msgstr "Обновлено"
+
+#: lib/choose_rev.tcl:565
+msgid "URL"
+msgstr "Ссылка"
+
+#: lib/commit.tcl:9
+msgid ""
+"There is nothing to amend.\n"
+"\n"
+"You are about to create the initial commit.  There is no commit before this to amend.\n"
+msgstr "Отсутствует коммиты для исправления.\n\nВы создаете начальный коммит, здесь еще нечего исправлять.\n"
+
+#: lib/commit.tcl:18
+msgid ""
+"Cannot amend while merging.\n"
+"\n"
+"You are currently in the middle of a merge that has not been fully completed.  You cannot amend the prior commit unless you first abort the current merge activity.\n"
+msgstr "Невозможно исправить коммит во время слияния.\n\nТекущее слияние не завершено. Невозможно исправить предыдуий коммит, не прерывая эту операцию.\n"
+
+#: lib/commit.tcl:56
+msgid "Error loading commit data for amend:"
+msgstr "Ошибка при загрузке данных для исправления коммита:"
+
+#: lib/commit.tcl:83
+msgid "Unable to obtain your identity:"
+msgstr "Невозможно получить информацию об авторстве:"
+
+#: lib/commit.tcl:88
+msgid "Invalid GIT_COMMITTER_IDENT:"
+msgstr "Недопустимый GIT_COMMITTER_IDENT:"
+
+#: lib/commit.tcl:138
+#, tcl-format
+msgid "warning: Tcl does not support encoding '%s'."
+msgstr "предупреждение: Tcl не поддерживает кодировку «%s»."
+
+#: lib/commit.tcl:158
+msgid ""
+"Last scanned state does not match repository state.\n"
+"\n"
+"Another Git program has modified this repository since the last scan.  A rescan must be performed before another commit can be created.\n"
+"\n"
+"The rescan will be automatically started now.\n"
+msgstr "Последнее прочитанное состояние репозитория не соответствует текущему.\n\nС момента последней проверки репозиторий был изменен другой программой Git. Необходимо перечитать репозиторий, прежде чем изменять текущую ветвь. \n\nЭто будет сделано сейчас автоматически.\n"
+
+#: lib/commit.tcl:182
+#, tcl-format
+msgid ""
+"Unmerged files cannot be committed.\n"
+"\n"
+"File %s has merge conflicts.  You must resolve them and stage the file before committing.\n"
+msgstr "Нельзя выполнить коммит с незавершённой операцией слияния.\n\nДля файла %s возник конфликт слияния. Разрешите конфликт и добавьте их в индекс перед выполнением коммита.\n"
+
+#: lib/commit.tcl:190
+#, tcl-format
+msgid ""
+"Unknown file state %s detected.\n"
+"\n"
+"File %s cannot be committed by this program.\n"
+msgstr "Обнаружено неизвестное состояние файла %s.\n\nФайл %s не может быть закоммичен этой программой.\n"
+
+#: lib/commit.tcl:198
+msgid ""
+"No changes to commit.\n"
+"\n"
+"You must stage at least 1 file before you can commit.\n"
+msgstr "Отсутствуют изменения для сохранения.\n\nДобавьте в индекс хотя бы один файл перед выполнением коммита.\n"
+
+#: lib/commit.tcl:213
+msgid ""
+"Please supply a commit message.\n"
+"\n"
+"A good commit message has the following format:\n"
+"\n"
+"- First line: Describe in one sentence what you did.\n"
+"- Second line: Blank\n"
+"- Remaining lines: Describe why this change is good.\n"
+msgstr "Укажите сообщение коммита.\n\nРекомендуется следующий формат сообщения:\n\n- в первой строке краткое описание сделанных изменений\n- вторая строка пустая\n- в оставшихся строках опишите, что дают ваши изменения\n"
+
+#: lib/commit.tcl:244
+msgid "Calling pre-commit hook..."
+msgstr "Вызов перехватчика pre-commit…"
+
+#: lib/commit.tcl:259
+msgid "Commit declined by pre-commit hook."
+msgstr "Коммит прерван переватчиком pre-commit."
+
+#: lib/commit.tcl:278
+msgid ""
+"You are about to commit on a detached head. This is a potentially dangerous thing to do because if you switch to another branch you will lose your changes and it can be difficult to retrieve them later from the reflog. You should probably cancel this commit and create a new branch to continue.\n"
+" \n"
+" Do you really want to proceed with your Commit?"
+msgstr "Вы собираетесь сделать коммит в отделённый HEAD. Это действие потенциально опасно, так как если вы переключитесь на другую ветку после этого, то вы потеряете свои изменения и их сложно будет потом найти с помощью журнала ссылок (reflog). Вам скорее всего следует отменить этот коммит и создать новую ветку до продолжения.\n \n Вы действительно хотите продолжить и создать коммит?"
+
+#: lib/commit.tcl:299
+msgid "Calling commit-msg hook..."
+msgstr "Вызов перехватчика commit-msg…"
+
+#: lib/commit.tcl:314
+msgid "Commit declined by commit-msg hook."
+msgstr "Коммит прерван переватчиком commit-msg"
+
+#: lib/commit.tcl:327
+msgid "Committing changes..."
+msgstr "Коммит изменений…"
+
+#: lib/commit.tcl:344
+msgid "write-tree failed:"
+msgstr "Программа write-tree завершилась с ошибкой:"
 
-#: lib/sshkey.tcl:78
-msgid "Generating..."
-msgstr "Созданиеâ\80¦"
+#: lib/commit.tcl:345 lib/commit.tcl:395 lib/commit.tcl:422
+msgid "Commit failed."
+msgstr "Ð\9dе Ñ\83далоÑ\81Ñ\8c Ð·Ð°ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82иÑ\82Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f."
 
-#: lib/sshkey.tcl:84
+#: lib/commit.tcl:362
 #, tcl-format
+msgid "Commit %s appears to be corrupt"
+msgstr "Коммит %s похоже поврежден"
+
+#: lib/commit.tcl:367
 msgid ""
-"Could not start ssh-keygen:\n"
+"No changes to commit.\n"
 "\n"
-"%s"
-msgstr "Ошибка запуска ssh-keygen:\n\n%s"
+"No files were modified by this commit and it was not a merge commit.\n"
+"\n"
+"A rescan will be automatically started now.\n"
+msgstr "Нет изменения для коммита.\n\nНи один файл не был изменен и не было слияния.\n\nСейчас автоматически запустится перечитывание репозитория.\n"
 
-#: lib/sshkey.tcl:111
-msgid "Generation failed."
-msgstr "Ð\9aлÑ\8eÑ\87 Ð½Ðµ Ñ\81оздан."
+#: lib/commit.tcl:374
+msgid "No changes to commit."
+msgstr "Ð\9dеÑ\82 Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f Ð´Ð»Ñ\8f ÐºÐ¾Ð¼Ð¼Ð¸Ñ\82а."
 
-#: lib/sshkey.tcl:118
-msgid "Generation succeeded, but no keys found."
-msgstr "Создание ÐºÐ»Ñ\8eÑ\87а Ð·Ð°Ð²ÐµÑ\80Ñ\88илоÑ\81Ñ\8c, Ð½Ð¾ Ñ\80езÑ\83лÑ\8cÑ\82аÑ\82 Ð½Ðµ Ð±Ñ\8bл Ð½Ð°Ð¹Ð´ÐµÐ½"
+#: lib/commit.tcl:394
+msgid "commit-tree failed:"
+msgstr "Ð\9fÑ\80огÑ\80амма commit-tree Ð·Ð°Ð²ÐµÑ\80Ñ\88илаÑ\81Ñ\8c Ñ\81 Ð¾Ñ\88ибкой:"
 
-#: lib/sshkey.tcl:121
-#, tcl-format
-msgid "Your key is in: %s"
-msgstr "Ваш ключ находится в: %s"
+#: lib/commit.tcl:421
+msgid "update-ref failed:"
+msgstr "Программа update-ref завершилась с ошибкой:"
 
-#: lib/status_bar.tcl:83
+#: lib/commit.tcl:514
 #, tcl-format
-msgid "%s ... %*i of %*i %s (%3i%%)"
-msgstr "%s … %*i из %*i %s (%3i%%)"
+msgid "Created commit %s: %s"
+msgstr "Создан коммит %s: %s "
 
-#: lib/tools.tcl:75
+#: lib/branch_delete.tcl:16
 #, tcl-format
-msgid "Running %s requires a selected file."
-msgstr "Запуск %s требует выбранного файла."
+msgid "%s (%s): Delete Branch"
+msgstr "%s (%s): Удаление ветки"
 
-#: lib/tools.tcl:90
-#, tcl-format
-msgid "Are you sure you want to run %s?"
-msgstr "Действительно запустить %s?"
+#: lib/branch_delete.tcl:21
+msgid "Delete Local Branch"
+msgstr "Удалить локальную ветку"
 
-#: lib/tools.tcl:110
-#, tcl-format
-msgid "Tool: %s"
-msgstr "Вспомогательная операция: %s"
+#: lib/branch_delete.tcl:39
+msgid "Local Branches"
+msgstr "Локальные ветки"
 
-#: lib/tools.tcl:111
-#, tcl-format
-msgid "Running: %s"
-msgstr "Выполнение: %s"
+#: lib/branch_delete.tcl:51
+msgid "Delete Only If Merged Into"
+msgstr "Удалить только в случае, если было слияние с"
 
-#: lib/tools.tcl:149
+#: lib/branch_delete.tcl:103
 #, tcl-format
-msgid "Tool completed successfully: %s"
-msgstr "Ð\9fÑ\80огÑ\80амма %s Ð·Ð°Ð²ÐµÑ\80Ñ\88илаÑ\81Ñ\8c Ñ\83Ñ\81пеÑ\88но."
+msgid "The following branches are not completely merged into %s:"
+msgstr "Ð\92еÑ\82ки, ÐºÐ¾Ñ\82оÑ\80Ñ\8bе Ð½Ðµ Ð¿Ð¾Ð»Ð½Ð¾Ñ\81Ñ\82Ñ\8cÑ\8e Ñ\81ливаÑ\8eÑ\82Ñ\81Ñ\8f Ñ\81 %s:"
 
-#: lib/tools.tcl:151
+#: lib/branch_delete.tcl:131
 #, tcl-format
-msgid "Tool failed: %s"
-msgstr "Ошибка выполнения программы: %s"
+msgid " - %s:"
+msgstr " — %s:"
 
-#: lib/tools_dlg.tcl:22
-msgid "Add Tool"
-msgstr "Добавить вспомогательную операцию"
-
-#: lib/tools_dlg.tcl:28
-msgid "Add New Tool Command"
-msgstr "Новая вспомогательная операция"
+#: lib/branch_delete.tcl:141
+#, tcl-format
+msgid ""
+"Failed to delete branches:\n"
+"%s"
+msgstr "Не удалось удалить ветки:\n%s"
 
-#: lib/tools_dlg.tcl:33
-msgid "Add globally"
-msgstr "Добавить для всех репозиториев"
+#: lib/date.tcl:25
+#, tcl-format
+msgid "Invalid date from Git: %s"
+msgstr "Неправильная дата в репозитории: %s"
 
-#: lib/tools_dlg.tcl:45
-msgid "Tool Details"
-msgstr "Ð\9eпиÑ\81ание Ð²Ñ\81помогаÑ\82елÑ\8cной Ð¾Ð¿ÐµÑ\80аÑ\86ии"
+#: lib/database.tcl:42
+msgid "Number of loose objects"
+msgstr "Ð\9aолиÑ\87еÑ\81Ñ\82во Ð½ÐµÑ\81вÑ\8fзаннÑ\8bÑ\85 Ð¾Ð±Ñ\8aекÑ\82ов"
 
-#: lib/tools_dlg.tcl:48
-msgid "Use '/' separators to create a submenu tree:"
-msgstr "Ð\98Ñ\81полÑ\8cзÑ\83йÑ\82е Â«/» Ð´Ð»Ñ\8f Ñ\81озданиÑ\8f Ð¿Ð¾Ð´Ð¼ÐµÐ½Ñ\8e"
+#: lib/database.tcl:43
+msgid "Disk space used by loose objects"
+msgstr "Ð\9eбÑ\8aем Ð´Ð¸Ñ\81кового Ð¿Ñ\80оÑ\81Ñ\82Ñ\80анÑ\81Ñ\82ва, Ð·Ð°Ð½Ñ\8fÑ\82Ñ\8bй Ð½ÐµÑ\81вÑ\8fзаннÑ\8bми Ð¾Ð±Ñ\8aекÑ\82ами"
 
-#: lib/tools_dlg.tcl:61
-msgid "Command:"
-msgstr "Ð\9aоманда:"
+#: lib/database.tcl:44
+msgid "Number of packed objects"
+msgstr "Ð\9aолиÑ\87еÑ\81Ñ\82во Ñ\83пакованнÑ\8bÑ\85 Ð¾Ð±Ñ\8aекÑ\82ов"
 
-#: lib/tools_dlg.tcl:74
-msgid "Show a dialog before running"
-msgstr "Ð\9fоказаÑ\82Ñ\8c Ð´Ð¸Ð°Ð»Ð¾Ð³ Ð¿ÐµÑ\80ед Ð·Ð°Ð¿Ñ\83Ñ\81ком"
+#: lib/database.tcl:45
+msgid "Number of packs"
+msgstr "Ð\9aолиÑ\87еÑ\81Ñ\82во pack-Ñ\84айлов"
 
-#: lib/tools_dlg.tcl:80
-msgid "Ask the user to select a revision (sets $REVISION)"
-msgstr "Ð\97апÑ\80оÑ\81 Ð½Ð° Ð²Ñ\8bбоÑ\80 Ð²ÐµÑ\80Ñ\81ии (Ñ\83Ñ\81Ñ\82анавливаеÑ\82 $REVISION)"
+#: lib/database.tcl:46
+msgid "Disk space used by packed objects"
+msgstr "Ð\9eбÑ\8aем Ð´Ð¸Ñ\81кового Ð¿Ñ\80оÑ\81Ñ\82Ñ\80анÑ\81Ñ\82ва, Ð·Ð°Ð½Ñ\8fÑ\82Ñ\8bй Ñ\83пакованнÑ\8bми Ð¾Ð±Ñ\8aекÑ\82ами"
 
-#: lib/tools_dlg.tcl:85
-msgid "Ask the user for additional arguments (sets $ARGS)"
-msgstr "Ð\97апÑ\80оÑ\81 Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ\82елÑ\8cнÑ\8bÑ\85 Ð°Ñ\80гÑ\83менÑ\82ов (Ñ\83Ñ\81Ñ\82анавливаеÑ\82 $ARGS)"
+#: lib/database.tcl:47
+msgid "Packed objects waiting for pruning"
+msgstr "Ð\9dеÑ\81вÑ\8fзаннÑ\8bе Ð¾Ð±Ñ\8aекÑ\82Ñ\8b, ÐºÐ¾Ñ\82оÑ\80Ñ\8bе Ð¼Ð¾Ð¶Ð½Ð¾ Ñ\83далиÑ\82Ñ\8c"
 
-#: lib/tools_dlg.tcl:92
-msgid "Don't show the command output window"
-msgstr "Ð\9dе Ð¿Ð¾ÐºÐ°Ð·Ñ\8bваÑ\82Ñ\8c Ð¾ÐºÐ½Ð¾ Ð²Ñ\8bвода ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ\8b"
+#: lib/database.tcl:48
+msgid "Garbage files"
+msgstr "Ð\9cÑ\83Ñ\81оÑ\80"
 
-#: lib/tools_dlg.tcl:97
-msgid "Run only if a diff is selected ($FILENAME not empty)"
-msgstr "Запуск только если показан список изменений ($FILENAME не пусто)"
+#: lib/database.tcl:66
+#, tcl-format
+msgid "%s (%s): Database Statistics"
+msgstr "%s (%s): Статистика базы данных"
 
-#: lib/tools_dlg.tcl:121
-msgid "Please supply a name for the tool."
-msgstr "УкажиÑ\82е Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ðµ Ð²Ñ\81помогаÑ\82елÑ\8cной Ð¾Ð¿ÐµÑ\80аÑ\86ии."
+#: lib/database.tcl:72
+msgid "Compressing the object database"
+msgstr "СжаÑ\82ие Ð±Ð°Ð·Ñ\8b Ð¾Ð±Ñ\8aекÑ\82ов"
 
-#: lib/tools_dlg.tcl:129
-#, tcl-format
-msgid "Tool '%s' already exists."
-msgstr "Вспомогательная операция «%s» уже существует."
+#: lib/database.tcl:83
+msgid "Verifying the object database with fsck-objects"
+msgstr "Проверка базы объектов при помощи fsck"
 
-#: lib/tools_dlg.tcl:151
+#: lib/database.tcl:107
 #, tcl-format
 msgid ""
-"Could not add tool:\n"
-"%s"
-msgstr "Ошибка добавления программы:\n%s"
+"This repository currently has approximately %i loose objects.\n"
+"\n"
+"To maintain optimal performance it is strongly recommended that you compress the database.\n"
+"\n"
+"Compress the database now?"
+msgstr "Этот репозиторий сейчас содержит примерно %i свободных объектов\n\nДля лучшей производительности рекомендуется сжать базу данных.\n\nСжать базу данных сейчас?"
 
-#: lib/tools_dlg.tcl:190
-msgid "Remove Tool"
-msgstr "Удалить программу"
+#: lib/error.tcl:20
+#, tcl-format
+msgid "%s: error"
+msgstr "%s: ошибка"
 
-#: lib/tools_dlg.tcl:196
-msgid "Remove Tool Commands"
-msgstr "Удалить команды программы"
+#: lib/error.tcl:36
+#, tcl-format
+msgid "%s: warning"
+msgstr "%s: предупреждение"
 
-#: lib/tools_dlg.tcl:200
-msgid "Remove"
-msgstr "Удалить"
+#: lib/error.tcl:80
+#, tcl-format
+msgid "%s hook failed:"
+msgstr "ошибка перехватчика %s:"
 
-#: lib/tools_dlg.tcl:236
-msgid "(Blue denotes repository-local tools)"
-msgstr "(Синим выделены программы локальные репозиторию)"
+#: lib/error.tcl:96
+msgid "You must correct the above errors before committing."
+msgstr "Перед коммитом, исправьте вышеуказанные ошибки."
 
-#: lib/tools_dlg.tcl:297
+#: lib/error.tcl:116
 #, tcl-format
-msgid "Run Command: %s"
-msgstr "Запуск команды: %s"
+msgid "%s (%s): error"
+msgstr "%s (%s): ошибка"
 
-#: lib/tools_dlg.tcl:311
-msgid "Arguments"
-msgstr "Аргументы"
+#: lib/merge.tcl:13
+msgid ""
+"Cannot merge while amending.\n"
+"\n"
+"You must finish amending this commit before starting any type of merge.\n"
+msgstr "Невозможно выполнить слияние во время исправления.\n\nЗавершите исправление данного коммита перед выполнением операции слияния.\n"
 
-#: lib/tools_dlg.tcl:348
-msgid "OK"
-msgstr "OK"
+#: lib/merge.tcl:27
+msgid ""
+"Last scanned state does not match repository state.\n"
+"\n"
+"Another Git program has modified this repository since the last scan.  A rescan must be performed before a merge can be performed.\n"
+"\n"
+"The rescan will be automatically started now.\n"
+msgstr "Последнее прочитанное состояние репозитория не соответствует текущему.\n\nС момента последней проверки репозиторий был изменен другой программой Git. Необходимо перечитать репозиторий, прежде чем слияние может быть сделано.\n\nЭто будет сделано сейчас автоматически.\n"
 
-#: lib/transport.tcl:7
+#: lib/merge.tcl:45
 #, tcl-format
-msgid "Fetching new changes from %s"
-msgstr "Извлечение изменений из %s "
+msgid ""
+"You are in the middle of a conflicted merge.\n"
+"\n"
+"File %s has merge conflicts.\n"
+"\n"
+"You must resolve them, stage the file, and commit to complete the current merge.  Only then can you begin another merge.\n"
+msgstr "Предыдущее слияние не завершено из-за конфликта.\n\nДля файла %s возник конфликт слияния.\n\nРазрешите конфликт, добавьте файл в индекс и закоммитьте. Только после этого можно начать следующее слияние.\n"
 
-#: lib/transport.tcl:18
+#: lib/merge.tcl:55
 #, tcl-format
-msgid "remote prune %s"
-msgstr "чистка внешнего %s"
+msgid ""
+"You are in the middle of a change.\n"
+"\n"
+"File %s is modified.\n"
+"\n"
+"You should complete the current commit before starting a merge.  Doing so will help you abort a failed merge, should the need arise.\n"
+msgstr "Вы находитесь в процессе изменений.\n\nФайл %s изменён.\n\nВы должны завершить текущий коммит перед началом слияния. В случае необходимости, это позволит прервать операцию слияния.\n"
 
-#: lib/transport.tcl:19
+#: lib/merge.tcl:108
 #, tcl-format
-msgid "Pruning tracking branches deleted from %s"
-msgstr "Чистка отслеживаемых веток, удалённых из %s"
+msgid "%s of %s"
+msgstr "%s из %s"
 
-#: lib/transport.tcl:26
+#: lib/merge.tcl:126
 #, tcl-format
-msgid "Pushing changes to %s"
-msgstr "Отправка изменений в %s "
+msgid "Merging %s and %s..."
+msgstr "Слияние %s и %s…"
+
+#: lib/merge.tcl:137
+msgid "Merge completed successfully."
+msgstr "Слияние успешно завершено."
+
+#: lib/merge.tcl:139
+msgid "Merge failed.  Conflict resolution is required."
+msgstr "Не удалось завершить слияние. Требуется разрешение конфликта."
 
-#: lib/transport.tcl:64
+#: lib/merge.tcl:156
 #, tcl-format
-msgid "Mirroring to %s"
-msgstr "Точное копирование в %s"
+msgid "%s (%s): Merge"
+msgstr "%s (%s): Слияние"
 
-#: lib/transport.tcl:82
+#: lib/merge.tcl:164
 #, tcl-format
-msgid "Pushing %s %s to %s"
-msgstr "Ð\9eÑ\82пÑ\80авка %s %s Ð² %s"
+msgid "Merge Into %s"
+msgstr "СлиÑ\8fние Ñ\81 %s"
 
-#: lib/transport.tcl:100
-msgid "Push Branches"
-msgstr "Ð\9eÑ\82пÑ\80авиÑ\82Ñ\8c Ð²ÐµÑ\82ки"
+#: lib/merge.tcl:183
+msgid "Revision To Merge"
+msgstr "Ð\92еÑ\80Ñ\81иÑ\8f, Ñ\81 ÐºÐ¾Ñ\82оÑ\80ой Ð¿Ñ\80овеÑ\81Ñ\82и Ñ\81лиÑ\8fние"
 
-#: lib/transport.tcl:114
-msgid "Source Branches"
-msgstr "Исходные ветки"
+#: lib/merge.tcl:218
+msgid ""
+"Cannot abort while amending.\n"
+"\n"
+"You must finish amending this commit.\n"
+msgstr "Невозможно прервать исправление.\n\nЗавершите текущее исправление коммита.\n"
 
-#: lib/transport.tcl:131
-msgid "Destination Repository"
-msgstr "Репозиторий назначения"
+#: lib/merge.tcl:228
+msgid ""
+"Abort merge?\n"
+"\n"
+"Aborting the current merge will cause *ALL* uncommitted changes to be lost.\n"
+"\n"
+"Continue with aborting the current merge?"
+msgstr "Прервать операцию слияния?\n\nПрерывание текущего слияния приведет к потере *ВСЕХ* несохраненных изменений.\n\nПродолжить?"
 
-#: lib/transport.tcl:169
-msgid "Transfer Options"
-msgstr "Настройки отправки"
+#: lib/merge.tcl:234
+msgid ""
+"Reset changes?\n"
+"\n"
+"Resetting the changes will cause *ALL* uncommitted changes to be lost.\n"
+"\n"
+"Continue with resetting the current changes?"
+msgstr "Сбросить изменения?\n\nСброс изменений приведет к потере *ВСЕХ* несохраненных изменений.\n\nПродолжить?"
 
-#: lib/transport.tcl:171
-msgid "Force overwrite existing branch (may discard changes)"
-msgstr "Ð\9fÑ\80инÑ\83диÑ\82елÑ\8cно Ð¿ÐµÑ\80езапиÑ\81аÑ\82Ñ\8c Ñ\81Ñ\83Ñ\89еÑ\81Ñ\82вÑ\83Ñ\8eÑ\89Ñ\83Ñ\8e Ð²ÐµÑ\82кÑ\83 (возможна Ð¿Ð¾Ñ\82еÑ\80Ñ\8f Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹)"
+#: lib/merge.tcl:246
+msgid "Aborting"
+msgstr "Ð\9fÑ\80еÑ\80Ñ\8bваÑ\8e"
 
-#: lib/transport.tcl:175
-msgid "Use thin pack (for slow network connections)"
-msgstr "Ð\98Ñ\81полÑ\8cзоваÑ\82Ñ\8c thin pack (длÑ\8f Ð¼ÐµÐ´Ð»ÐµÐ½Ð½Ñ\8bÑ\85 Ñ\81еÑ\82евÑ\8bÑ\85 Ð¿Ð¾Ð´ÐºÐ»Ñ\8eÑ\87ений)"
+#: lib/merge.tcl:247
+msgid "files reset"
+msgstr "изменениÑ\8f Ð² Ñ\84айлаÑ\85 Ð¾Ñ\82мененÑ\8b"
 
-#: lib/transport.tcl:179
-msgid "Include tags"
-msgstr "Передать метки"
+#: lib/merge.tcl:277
+msgid "Abort failed."
+msgstr "Прервать не удалось."
+
+#: lib/merge.tcl:279
+msgid "Abort completed.  Ready."
+msgstr "Прервано."
index 2defef28cd931fc9dca041ee7ec0ea5d440c3dd7..7225abd81122e6bd798989d6e21fae1279cf3929 100644 (file)
@@ -138,6 +138,10 @@ setup_user_tool () {
        merge_cmd () {
                ( eval $merge_tool_cmd )
        }
+
+       list_tool_variants () {
+               echo "$tool"
+       }
 }
 
 setup_tool () {
index 4433ca53de7eff82c29a191019f1b6477f53f3bb..6ae5bbfe999942f58122de442cb160b53d0b35b9 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -1668,7 +1668,7 @@ class P4Submit(Command, P4UserMap):
     Submit after inspect the message file.
 
     The `p4-post-changelist` hook is invoked after the submit has successfully
-    occured in P4. It takes no parameters and is meant primarily for notification
+    occurred in P4. It takes no parameters and is meant primarily for notification
     and cannot affect the outcome of the git p4 submit action.
     """
 
@@ -4186,7 +4186,7 @@ class P4Clone(P4Sync):
 
         # create a master branch and check out a work tree
         if gitBranchExists(self.branch):
-            system([ "git", "branch", "master", self.branch ])
+            system([ "git", "branch", currentGitBranch(), self.branch ])
             if not self.cloneBare:
                 system([ "git", "checkout", "-f" ])
         else:
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
deleted file mode 100644 (file)
index d3c3998..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-# This is a shell library to calculate the remote repository and
-# upstream branch that should be pulled by "git pull" from the current
-# branch.
-
-# git-ls-remote could be called from outside a git managed repository;
-# this would fail in that case and would issue an error message.
-GIT_DIR=$(git rev-parse -q --git-dir) || :;
-
-get_default_remote () {
-       curr_branch=$(git symbolic-ref -q HEAD)
-       curr_branch="${curr_branch#refs/heads/}"
-       origin=$(git config --get "branch.$curr_branch.remote")
-       echo ${origin:-origin}
-}
-
-get_remote_merge_branch () {
-       case "$#" in
-       0|1)
-           origin="$1"
-           default=$(get_default_remote)
-           test -z "$origin" && origin=$default
-           curr_branch=$(git symbolic-ref -q HEAD) &&
-           [ "$origin" = "$default" ] &&
-           echo $(git for-each-ref --format='%(upstream)' $curr_branch)
-           ;;
-       *)
-           repo=$1
-           shift
-           ref=$1
-           # FIXME: It should return the tracking branch
-           #        Currently only works with the default mapping
-           case "$ref" in
-           +*)
-               ref=$(expr "z$ref" : 'z+\(.*\)')
-               ;;
-           esac
-           expr "z$ref" : 'z.*:' >/dev/null || ref="${ref}:"
-           remote=$(expr "z$ref" : 'z\([^:]*\):')
-           case "$remote" in
-           '' | HEAD ) remote=HEAD ;;
-           heads/*) remote=${remote#heads/} ;;
-           refs/heads/*) remote=${remote#refs/heads/} ;;
-           refs/* | tags/* | remotes/* ) remote=
-           esac
-           [ -n "$remote" ] && case "$repo" in
-               .)
-                   echo "refs/heads/$remote"
-                   ;;
-               *)
-                   echo "refs/remotes/$repo/$remote"
-                   ;;
-           esac
-       esac
-}
-
-error_on_missing_default_upstream () {
-       cmd="$1"
-       op_type="$2"
-       op_prep="$3" # FIXME: op_prep is no longer used
-       example="$4"
-       branch_name=$(git symbolic-ref -q HEAD)
-       display_branch_name="${branch_name#refs/heads/}"
-       # If there's only one remote, use that in the suggestion
-       remote="$(gettext "<remote>")"
-       branch="$(gettext "<branch>")"
-       if test $(git remote | wc -l) = 1
-       then
-               remote=$(git remote)
-       fi
-
-       if test -z "$branch_name"
-       then
-               gettextln "You are not currently on a branch."
-       else
-               gettextln "There is no tracking information for the current branch."
-       fi
-       case "$op_type" in
-       rebase)
-               gettextln "Please specify which branch you want to rebase against."
-               ;;
-       merge)
-               gettextln "Please specify which branch you want to merge with."
-               ;;
-       *)
-               echo >&2 "BUG: unknown operation type: $op_type"
-               exit 1
-               ;;
-       esac
-       eval_gettextln "See git-\${cmd}(1) for details."
-       echo
-       echo "    $example"
-       echo
-       if test -n "$branch_name"
-       then
-               gettextln "If you wish to set tracking information for this branch you can do so with:"
-               echo
-               echo "    git branch --set-upstream-to=$remote/$branch $display_branch_name"
-               echo
-       fi
-       exit 1
-}
index 7ce52872b721d0db8f6c7c68a25ec0b0978c4366..eb90f182296c0127b45ecd2aca20aff96e24bddb 100755 (executable)
@@ -20,7 +20,6 @@ USAGE="[--quiet] [--cached]
 OPTIONS_SPEC=
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
-. git-parse-remote
 require_work_tree
 wt_prefix=$(git rev-parse --show-prefix)
 cd_to_toplevel
@@ -413,16 +412,18 @@ is_tip_reachable () (
        test -z "$rev"
 )
 
+# usage: fetch_in_submodule <module_path> [<depth>] [<sha1>]
+# Because arguments are positional, use an empty string to omit <depth>
+# but include <sha1>.
 fetch_in_submodule () (
        sanitize_submodule_env &&
        cd "$1" &&
-       case "$2" in
-       '')
-               git fetch ;;
-       *)
-               shift
-               git fetch $(get_default_remote) "$@" ;;
-       esac
+       if test $# -eq 3
+       then
+               echo "$3" | git fetch --stdin ${2:+"$2"}
+       else
+               git fetch ${2:+"$2"}
+       fi
 )
 
 #
@@ -576,7 +577,7 @@ cmd_update()
                                fetch_in_submodule "$sm_path" $depth ||
                                die "$(eval_gettext "Unable to fetch in submodule path '\$sm_path'")"
                        fi
-                       remote_name=$(sanitize_submodule_env; cd "$sm_path" && get_default_remote)
+                       remote_name=$(sanitize_submodule_env; cd "$sm_path" && git submodule--helper print-default-remote)
                        sha1=$(sanitize_submodule_env; cd "$sm_path" &&
                                git rev-parse --verify "${remote_name}/${branch}") ||
                        die "$(eval_gettext "Unable to find current \${remote_name}/\${branch} revision in submodule path '\$sm_path'")"
@@ -602,7 +603,7 @@ cmd_update()
                                # Now we tried the usual fetch, but $sha1 may
                                # not be reachable from any of the refs
                                is_tip_reachable "$sm_path" "$sha1" ||
-                               fetch_in_submodule "$sm_path" $depth "$sha1" ||
+                               fetch_in_submodule "$sm_path" "$depth" "$sha1" ||
                                die "$(eval_gettext "Fetched in submodule path '\$displaypath', but it did not contain \$sha1. Direct fetching of that commit failed.")"
                        fi
 
index 58f5a7ac8f80ac609fe1b35a558f936c7af42b98..70cb5e2a83b5bec6e9f95ea0cb7feb112e2dfec5 100755 (executable)
@@ -2,7 +2,7 @@
 # Copyright (C) 2006, Eric Wong <normalperson@yhbt.net>
 # License: GPL v2 or later
 use 5.008;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use strict;
 use vars qw/   $AUTHOR $VERSION
                $oid $oid_short $oid_length
diff --git a/git.c b/git.c
index 4bdcdad2ccd3e7b268074dcffcbc9bbcbf273e8b..a00a0a4d941261b8f7d39390d6f518197f38be15 100644 (file)
--- a/git.c
+++ b/git.c
@@ -516,6 +516,7 @@ static struct cmd_struct commands[] = {
        { "fetch-pack", cmd_fetch_pack, RUN_SETUP | NO_PARSEOPT },
        { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },
        { "for-each-ref", cmd_for_each_ref, RUN_SETUP },
+       { "for-each-repo", cmd_for_each_repo, RUN_SETUP_GENTLY },
        { "format-patch", cmd_format_patch, RUN_SETUP },
        { "fsck", cmd_fsck, RUN_SETUP },
        { "fsck-objects", cmd_fsck, RUN_SETUP },
@@ -534,7 +535,7 @@ static struct cmd_struct commands[] = {
        { "ls-tree", cmd_ls_tree, RUN_SETUP },
        { "mailinfo", cmd_mailinfo, RUN_SETUP_GENTLY | NO_PARSEOPT },
        { "mailsplit", cmd_mailsplit, NO_PARSEOPT },
-       { "maintenance", cmd_maintenance, RUN_SETUP_GENTLY | NO_PARSEOPT },
+       { "maintenance", cmd_maintenance, RUN_SETUP | NO_PARSEOPT },
        { "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE },
        { "merge-base", cmd_merge_base, RUN_SETUP },
        { "merge-file", cmd_merge_file, RUN_SETUP_GENTLY },
index cd194d057f9231ed77f57f05b22a226cd1210f6d..f13e23c4de41a602537043c0b21fab7ccb65df0b 100644 (file)
@@ -48,7 +48,9 @@ HIGHLIGHT_BIN = highlight
 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
        $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
 
+ifneq ($(MAKECMDGOALS),clean)
 -include ../GIT-VERSION-FILE
+endif
 
 ### Build rules
 
diff --git a/grep.c b/grep.c
index 54af9f813e99043c723ba4f6e9fd32023d0be655..efeb6dc58dbec7dad4ea715909d92780faa27ee0 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -14,7 +14,31 @@ static int grep_source_load(struct grep_source *gs);
 static int grep_source_is_binary(struct grep_source *gs,
                                 struct index_state *istate);
 
-static struct grep_opt grep_defaults;
+static void std_output(struct grep_opt *opt, const void *buf, size_t size)
+{
+       fwrite(buf, size, 1, stdout);
+}
+
+static struct grep_opt grep_defaults = {
+       .relative = 1,
+       .pathname = 1,
+       .max_depth = -1,
+       .pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED,
+       .colors = {
+               [GREP_COLOR_CONTEXT] = "",
+               [GREP_COLOR_FILENAME] = "",
+               [GREP_COLOR_FUNCTION] = "",
+               [GREP_COLOR_LINENO] = "",
+               [GREP_COLOR_COLUMNNO] = "",
+               [GREP_COLOR_MATCH_CONTEXT] = GIT_COLOR_BOLD_RED,
+               [GREP_COLOR_MATCH_SELECTED] = GIT_COLOR_BOLD_RED,
+               [GREP_COLOR_SELECTED] = "",
+               [GREP_COLOR_SEP] = GIT_COLOR_CYAN,
+       },
+       .only_matching = 0,
+       .color = -1,
+       .output = std_output,
+};
 
 #ifdef USE_LIBPCRE2
 static pcre2_general_context *pcre2_global_context;
@@ -42,50 +66,6 @@ static const char *color_grep_slots[] = {
        [GREP_COLOR_SEP]            = "separator",
 };
 
-static void std_output(struct grep_opt *opt, const void *buf, size_t size)
-{
-       fwrite(buf, size, 1, stdout);
-}
-
-static void color_set(char *dst, const char *color_bytes)
-{
-       xsnprintf(dst, COLOR_MAXLEN, "%s", color_bytes);
-}
-
-/*
- * Initialize the grep_defaults template with hardcoded defaults.
- * We could let the compiler do this, but without C99 initializers
- * the code gets unwieldy and unreadable, so...
- */
-void init_grep_defaults(struct repository *repo)
-{
-       struct grep_opt *opt = &grep_defaults;
-       static int run_once;
-
-       if (run_once)
-               return;
-       run_once++;
-
-       memset(opt, 0, sizeof(*opt));
-       opt->repo = repo;
-       opt->relative = 1;
-       opt->pathname = 1;
-       opt->max_depth = -1;
-       opt->pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED;
-       color_set(opt->colors[GREP_COLOR_CONTEXT], "");
-       color_set(opt->colors[GREP_COLOR_FILENAME], "");
-       color_set(opt->colors[GREP_COLOR_FUNCTION], "");
-       color_set(opt->colors[GREP_COLOR_LINENO], "");
-       color_set(opt->colors[GREP_COLOR_COLUMNNO], "");
-       color_set(opt->colors[GREP_COLOR_MATCH_CONTEXT], GIT_COLOR_BOLD_RED);
-       color_set(opt->colors[GREP_COLOR_MATCH_SELECTED], GIT_COLOR_BOLD_RED);
-       color_set(opt->colors[GREP_COLOR_SELECTED], "");
-       color_set(opt->colors[GREP_COLOR_SEP], GIT_COLOR_CYAN);
-       opt->only_matching = 0;
-       opt->color = -1;
-       opt->output = std_output;
-}
-
 static int parse_pattern_type_arg(const char *opt, const char *arg)
 {
        if (!strcmp(arg, "default"))
@@ -115,6 +95,14 @@ int grep_config(const char *var, const char *value, void *cb)
        if (userdiff_config(var, value) < 0)
                return -1;
 
+       /*
+        * The instance of grep_opt that we set up here is copied by
+        * grep_init() to be used by each individual invocation.
+        * When populating a new field of this structure here, be
+        * sure to think about ownership -- e.g., you might need to
+        * override the shallow copy in grep_init() with a deep copy.
+        */
+
        if (!strcmp(var, "grep.extendedregexp")) {
                opt->extended_regexp_option = git_config_bool(var, value);
                return 0;
@@ -172,9 +160,6 @@ int grep_config(const char *var, const char *value, void *cb)
  */
 void grep_init(struct grep_opt *opt, struct repository *repo, const char *prefix)
 {
-       struct grep_opt *def = &grep_defaults;
-       int i;
-
 #if defined(USE_LIBPCRE2)
        if (!pcre2_global_context)
                pcre2_global_context = pcre2_general_context_create(
@@ -186,26 +171,13 @@ void grep_init(struct grep_opt *opt, struct repository *repo, const char *prefix
        pcre_free = free;
 #endif
 
-       memset(opt, 0, sizeof(*opt));
+       *opt = grep_defaults;
+
        opt->repo = repo;
        opt->prefix = prefix;
        opt->prefix_length = (prefix && *prefix) ? strlen(prefix) : 0;
        opt->pattern_tail = &opt->pattern_list;
        opt->header_tail = &opt->header_list;
-
-       opt->only_matching = def->only_matching;
-       opt->color = def->color;
-       opt->extended_regexp_option = def->extended_regexp_option;
-       opt->pattern_type_option = def->pattern_type_option;
-       opt->linenum = def->linenum;
-       opt->columnnum = def->columnnum;
-       opt->max_depth = def->max_depth;
-       opt->pathname = def->pathname;
-       opt->relative = def->relative;
-       opt->output = def->output;
-
-       for (i = 0; i < NR_GREP_COLORS; i++)
-               color_set(opt->colors[i], def->colors[i]);
 }
 
 void grep_destroy(void)
diff --git a/grep.h b/grep.h
index 9115db8515059bf170d3d56e8146f9193d3318e4..b5c4e223a8f337fb476b5e375685045189389e82 100644 (file)
--- a/grep.h
+++ b/grep.h
@@ -170,7 +170,6 @@ struct grep_opt {
        void *output_priv;
 };
 
-void init_grep_defaults(struct repository *);
 int grep_config(const char *var, const char *value, void *);
 void grep_init(struct grep_opt *, struct repository *repo, const char *prefix);
 void grep_destroy(void);
diff --git a/hash.h b/hash.h
index e0f3f16b06b7930e448912bdc699a47125a19b0c..3fb0c3d4005aeb2267625e365a83e6de608efd28 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -2,6 +2,7 @@
 #define HASH_H
 
 #include "git-compat-util.h"
+#include "repository.h"
 
 #if defined(SHA1_PPC)
 #include "ppc/sha1.h"
@@ -184,4 +185,98 @@ struct object_id {
 
 #define the_hash_algo the_repository->hash_algo
 
+extern const struct object_id null_oid;
+
+static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
+{
+       /*
+        * Teach the compiler that there are only two possibilities of hash size
+        * here, so that it can optimize for this case as much as possible.
+        */
+       if (the_hash_algo->rawsz == GIT_MAX_RAWSZ)
+               return memcmp(sha1, sha2, GIT_MAX_RAWSZ);
+       return memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
+}
+
+static inline int oidcmp(const struct object_id *oid1, const struct object_id *oid2)
+{
+       return hashcmp(oid1->hash, oid2->hash);
+}
+
+static inline int hasheq(const unsigned char *sha1, const unsigned char *sha2)
+{
+       /*
+        * We write this here instead of deferring to hashcmp so that the
+        * compiler can properly inline it and avoid calling memcmp.
+        */
+       if (the_hash_algo->rawsz == GIT_MAX_RAWSZ)
+               return !memcmp(sha1, sha2, GIT_MAX_RAWSZ);
+       return !memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
+}
+
+static inline int oideq(const struct object_id *oid1, const struct object_id *oid2)
+{
+       return hasheq(oid1->hash, oid2->hash);
+}
+
+static inline int is_null_oid(const struct object_id *oid)
+{
+       return oideq(oid, &null_oid);
+}
+
+static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src)
+{
+       memcpy(sha_dst, sha_src, the_hash_algo->rawsz);
+}
+
+static inline void oidcpy(struct object_id *dst, const struct object_id *src)
+{
+       memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
+}
+
+static inline struct object_id *oiddup(const struct object_id *src)
+{
+       struct object_id *dst = xmalloc(sizeof(struct object_id));
+       oidcpy(dst, src);
+       return dst;
+}
+
+static inline void hashclr(unsigned char *hash)
+{
+       memset(hash, 0, the_hash_algo->rawsz);
+}
+
+static inline void oidclr(struct object_id *oid)
+{
+       memset(oid->hash, 0, GIT_MAX_RAWSZ);
+}
+
+static inline void oidread(struct object_id *oid, const unsigned char *hash)
+{
+       memcpy(oid->hash, hash, the_hash_algo->rawsz);
+}
+
+static inline int is_empty_blob_sha1(const unsigned char *sha1)
+{
+       return hasheq(sha1, the_hash_algo->empty_blob->hash);
+}
+
+static inline int is_empty_blob_oid(const struct object_id *oid)
+{
+       return oideq(oid, the_hash_algo->empty_blob);
+}
+
+static inline int is_empty_tree_sha1(const unsigned char *sha1)
+{
+       return hasheq(sha1, the_hash_algo->empty_tree->hash);
+}
+
+static inline int is_empty_tree_oid(const struct object_id *oid)
+{
+       return oideq(oid, the_hash_algo->empty_tree);
+}
+
+const char *empty_tree_oid_hex(void);
+const char *empty_blob_oid_hex(void);
+
 #endif
index 09813e1a46676c1475c1ad903f1d9358bf56827e..5009471800e8c61b50bfd670a7714daaa26a01c7 100644 (file)
--- a/hashmap.c
+++ b/hashmap.c
@@ -92,8 +92,9 @@ static void alloc_table(struct hashmap *map, unsigned int size)
 }
 
 static inline int entry_equals(const struct hashmap *map,
-               const struct hashmap_entry *e1, const struct hashmap_entry *e2,
-               const void *keydata)
+                              const struct hashmap_entry *e1,
+                              const struct hashmap_entry *e2,
+                              const void *keydata)
 {
        return (e1 == e2) ||
               (e1->hash == e2->hash &&
@@ -101,7 +102,7 @@ static inline int entry_equals(const struct hashmap *map,
 }
 
 static inline unsigned int bucket(const struct hashmap *map,
-               const struct hashmap_entry *key)
+                                 const struct hashmap_entry *key)
 {
        return key->hash & (map->tablesize - 1);
 }
@@ -113,6 +114,7 @@ int hashmap_bucket(const struct hashmap *map, unsigned int hash)
 
 static void rehash(struct hashmap *map, unsigned int newsize)
 {
+       /* map->table MUST NOT be NULL when this function is called */
        unsigned int i, oldsize = map->tablesize;
        struct hashmap_entry **oldtable = map->table;
 
@@ -133,6 +135,7 @@ static void rehash(struct hashmap *map, unsigned int newsize)
 static inline struct hashmap_entry **find_entry_ptr(const struct hashmap *map,
                const struct hashmap_entry *key, const void *keydata)
 {
+       /* map->table MUST NOT be NULL when this function is called */
        struct hashmap_entry **e = &map->table[bucket(map, key)];
        while (*e && !entry_equals(map, *e, key, keydata))
                e = &(*e)->next;
@@ -148,7 +151,7 @@ static int always_equal(const void *unused_cmp_data,
 }
 
 void hashmap_init(struct hashmap *map, hashmap_cmp_fn equals_function,
-               const void *cmpfn_data, size_t initial_size)
+                 const void *cmpfn_data, size_t initial_size)
 {
        unsigned int size = HASHMAP_INITIAL_SIZE;
 
@@ -171,22 +174,37 @@ void hashmap_init(struct hashmap *map, hashmap_cmp_fn equals_function,
        map->do_count_items = 1;
 }
 
-void hashmap_free_(struct hashmap *map, ssize_t entry_offset)
+static void free_individual_entries(struct hashmap *map, ssize_t entry_offset)
+{
+       struct hashmap_iter iter;
+       struct hashmap_entry *e;
+
+       hashmap_iter_init(map, &iter);
+       while ((e = hashmap_iter_next(&iter)))
+               /*
+                * like container_of, but using caller-calculated
+                * offset (caller being hashmap_clear_and_free)
+                */
+               free((char *)e - entry_offset);
+}
+
+void hashmap_partial_clear_(struct hashmap *map, ssize_t entry_offset)
 {
        if (!map || !map->table)
                return;
-       if (entry_offset >= 0) { /* called by hashmap_free_entries */
-               struct hashmap_iter iter;
-               struct hashmap_entry *e;
-
-               hashmap_iter_init(map, &iter);
-               while ((e = hashmap_iter_next(&iter)))
-                       /*
-                        * like container_of, but using caller-calculated
-                        * offset (caller being hashmap_free_entries)
-                        */
-                       free((char *)e - entry_offset);
-       }
+       if (entry_offset >= 0)  /* called by hashmap_clear_entries */
+               free_individual_entries(map, entry_offset);
+       memset(map->table, 0, map->tablesize * sizeof(struct hashmap_entry *));
+       map->shrink_at = 0;
+       map->private_size = 0;
+}
+
+void hashmap_clear_(struct hashmap *map, ssize_t entry_offset)
+{
+       if (!map || !map->table)
+               return;
+       if (entry_offset >= 0)  /* called by hashmap_clear_and_free */
+               free_individual_entries(map, entry_offset);
        free(map->table);
        memset(map, 0, sizeof(*map));
 }
@@ -195,11 +213,13 @@ struct hashmap_entry *hashmap_get(const struct hashmap *map,
                                const struct hashmap_entry *key,
                                const void *keydata)
 {
+       if (!map->table)
+               return NULL;
        return *find_entry_ptr(map, key, keydata);
 }
 
 struct hashmap_entry *hashmap_get_next(const struct hashmap *map,
-                       const struct hashmap_entry *entry)
+                                      const struct hashmap_entry *entry)
 {
        struct hashmap_entry *e = entry->next;
        for (; e; e = e->next)
@@ -210,8 +230,12 @@ struct hashmap_entry *hashmap_get_next(const struct hashmap *map,
 
 void hashmap_add(struct hashmap *map, struct hashmap_entry *entry)
 {
-       unsigned int b = bucket(map, entry);
+       unsigned int b;
+
+       if (!map->table)
+               alloc_table(map, HASHMAP_INITIAL_SIZE);
 
+       b = bucket(map, entry);
        /* add entry */
        entry->next = map->table[b];
        map->table[b] = entry;
@@ -225,11 +249,15 @@ void hashmap_add(struct hashmap *map, struct hashmap_entry *entry)
 }
 
 struct hashmap_entry *hashmap_remove(struct hashmap *map,
-                                       const struct hashmap_entry *key,
-                                       const void *keydata)
+                                    const struct hashmap_entry *key,
+                                    const void *keydata)
 {
        struct hashmap_entry *old;
-       struct hashmap_entry **e = find_entry_ptr(map, key, keydata);
+       struct hashmap_entry **e;
+
+       if (!map->table)
+               return NULL;
+       e = find_entry_ptr(map, key, keydata);
        if (!*e)
                return NULL;
 
@@ -249,7 +277,7 @@ struct hashmap_entry *hashmap_remove(struct hashmap *map,
 }
 
 struct hashmap_entry *hashmap_put(struct hashmap *map,
-                               struct hashmap_entry *entry)
+                                 struct hashmap_entry *entry)
 {
        struct hashmap_entry *old = hashmap_remove(map, entry, NULL);
        hashmap_add(map, entry);
index b011b394fefe34f46d098f02f1e19fd987bb2476..7251687d730d608437a8ed24e4551cf9344fd7f4 100644 (file)
--- a/hashmap.h
+++ b/hashmap.h
@@ -96,7 +96,7 @@
  *         }
  *
  *         if (!strcmp("end", action)) {
- *             hashmap_free_entries(&map, struct long2string, ent);
+ *             hashmap_clear_and_free(&map, struct long2string, ent);
  *             break;
  *         }
  *     }
@@ -210,6 +210,9 @@ struct hashmap {
 
 /* hashmap functions */
 
+#define HASHMAP_INIT(fn, data) { .cmpfn = fn, .cmpfn_data = data, \
+                                .do_count_items = 1 }
+
 /*
  * Initializes a hashmap structure.
  *
@@ -228,24 +231,72 @@ struct hashmap {
  * prevent expensive resizing. If 0, the table is dynamically resized.
  */
 void hashmap_init(struct hashmap *map,
-                        hashmap_cmp_fn equals_function,
-                        const void *equals_function_data,
-                        size_t initial_size);
+                 hashmap_cmp_fn equals_function,
+                 const void *equals_function_data,
+                 size_t initial_size);
 
-/* internal function for freeing hashmap */
-void hashmap_free_(struct hashmap *map, ssize_t offset);
+/* internal functions for clearing or freeing hashmap */
+void hashmap_partial_clear_(struct hashmap *map, ssize_t offset);
+void hashmap_clear_(struct hashmap *map, ssize_t offset);
 
 /*
- * Frees a hashmap structure and allocated memory, leaves entries undisturbed
+ * Frees a hashmap structure and allocated memory for the table, but does not
+ * free the entries nor anything they point to.
+ *
+ * Usage note:
+ *
+ * Many callers will need to iterate over all entries and free the data each
+ * entry points to; in such a case, they can free the entry itself while at it.
+ * Thus, you might see:
+ *
+ *    hashmap_for_each_entry(map, hashmap_iter, e, hashmap_entry_name) {
+ *      free(e->somefield);
+ *      free(e);
+ *    }
+ *    hashmap_clear(map);
+ *
+ * instead of
+ *
+ *    hashmap_for_each_entry(map, hashmap_iter, e, hashmap_entry_name) {
+ *      free(e->somefield);
+ *    }
+ *    hashmap_clear_and_free(map, struct my_entry_struct, hashmap_entry_name);
+ *
+ * to avoid the implicit extra loop over the entries.  However, if there are
+ * no special fields in your entry that need to be freed beyond the entry
+ * itself, it is probably simpler to avoid the explicit loop and just call
+ * hashmap_clear_and_free().
  */
-#define hashmap_free(map) hashmap_free_(map, -1)
+#define hashmap_clear(map) hashmap_clear_(map, -1)
 
 /*
- * Frees @map and all entries.  @type is the struct type of the entry
- * where @member is the hashmap_entry struct used to associate with @map
+ * Similar to hashmap_clear(), except that the table is no deallocated; it
+ * is merely zeroed out but left the same size as before.  If the hashmap
+ * will be reused, this avoids the overhead of deallocating and
+ * reallocating map->table.  As with hashmap_clear(), you may need to free
+ * the entries yourself before calling this function.
+ */
+#define hashmap_partial_clear(map) hashmap_partial_clear_(map, -1)
+
+/*
+ * Similar to hashmap_clear() but also frees all entries.  @type is the
+ * struct type of the entry where @member is the hashmap_entry struct used
+ * to associate with @map.
+ *
+ * See usage note above hashmap_clear().
+ */
+#define hashmap_clear_and_free(map, type, member) \
+       hashmap_clear_(map, offsetof(type, member))
+
+/*
+ * Similar to hashmap_partial_clear() but also frees all entries.  @type is
+ * the struct type of the entry where @member is the hashmap_entry struct
+ * used to associate with @map.
+ *
+ * See usage note above hashmap_clear().
  */
-#define hashmap_free_entries(map, type, member) \
-       hashmap_free_(map, offsetof(type, member));
+#define hashmap_partial_clear_and_free(map, type, member) \
+       hashmap_partial_clear_(map, offsetof(type, member))
 
 /* hashmap_entry functions */
 
@@ -261,7 +312,7 @@ void hashmap_free_(struct hashmap *map, ssize_t offset);
  * and if it is on stack, you can just let it go out of scope).
  */
 static inline void hashmap_entry_init(struct hashmap_entry *e,
-                                       unsigned int hash)
+                                     unsigned int hash)
 {
        e->hash = hash;
        e->next = NULL;
@@ -303,8 +354,8 @@ static inline unsigned int hashmap_get_size(struct hashmap *map)
  * to `hashmap_cmp_fn` to decide whether the entry matches the key.
  */
 struct hashmap_entry *hashmap_get(const struct hashmap *map,
-                               const struct hashmap_entry *key,
-                               const void *keydata);
+                                 const struct hashmap_entry *key,
+                                 const void *keydata);
 
 /*
  * Returns the hashmap entry for the specified hash code and key data,
@@ -337,7 +388,7 @@ static inline struct hashmap_entry *hashmap_get_from_hash(
  * call to `hashmap_get` or `hashmap_get_next`.
  */
 struct hashmap_entry *hashmap_get_next(const struct hashmap *map,
-                       const struct hashmap_entry *entry);
+                                      const struct hashmap_entry *entry);
 
 /*
  * Adds a hashmap entry. This allows to add duplicate entries (i.e.
@@ -357,7 +408,7 @@ void hashmap_add(struct hashmap *map, struct hashmap_entry *entry);
  * Returns the replaced entry, or NULL if not found (i.e. the entry was added).
  */
 struct hashmap_entry *hashmap_put(struct hashmap *map,
-                               struct hashmap_entry *entry);
+                                 struct hashmap_entry *entry);
 
 /*
  * Adds or replaces a hashmap entry contained within @keyvar,
@@ -379,8 +430,8 @@ struct hashmap_entry *hashmap_put(struct hashmap *map,
  * Argument explanation is the same as in `hashmap_get`.
  */
 struct hashmap_entry *hashmap_remove(struct hashmap *map,
-                                       const struct hashmap_entry *key,
-                                       const void *keydata);
+                                    const struct hashmap_entry *key,
+                                    const void *keydata);
 
 /*
  * Removes a hashmap entry contained within @keyvar,
@@ -422,7 +473,7 @@ struct hashmap_entry *hashmap_iter_next(struct hashmap_iter *iter);
 
 /* Initializes the iterator and returns the first entry, if any. */
 static inline struct hashmap_entry *hashmap_iter_first(struct hashmap *map,
-               struct hashmap_iter *iter)
+                                                      struct hashmap_iter *iter)
 {
        hashmap_iter_init(map, iter);
        return hashmap_iter_next(iter);
diff --git a/help.c b/help.c
index 919cbb9206aedf98ac97e59e2132451210e1d4e4..3c3bdec21356d9e346ef2185d7ddaffa8229d6d0 100644 (file)
--- a/help.c
+++ b/help.c
@@ -472,12 +472,26 @@ int is_in_cmdlist(struct cmdnames *c, const char *s)
 static int autocorrect;
 static struct cmdnames aliases;
 
+#define AUTOCORRECT_NEVER (-2)
+#define AUTOCORRECT_IMMEDIATELY (-1)
+
 static int git_unknown_cmd_config(const char *var, const char *value, void *cb)
 {
        const char *p;
 
-       if (!strcmp(var, "help.autocorrect"))
-               autocorrect = git_config_int(var,value);
+       if (!strcmp(var, "help.autocorrect")) {
+               if (!value)
+                       return config_error_nonbool(var);
+               if (!strcmp(value, "never")) {
+                       autocorrect = AUTOCORRECT_NEVER;
+               } else if (!strcmp(value, "immediate")) {
+                       autocorrect = AUTOCORRECT_IMMEDIATELY;
+               } else {
+                       int v = git_config_int(var, value);
+                       autocorrect = (v < 0)
+                               ? AUTOCORRECT_IMMEDIATELY : v;
+               }
+       }
        /* Also use aliases for command lookup */
        if (skip_prefix(var, "alias.", &p))
                add_cmdname(&aliases, p, strlen(p));
@@ -525,6 +539,11 @@ const char *help_unknown_cmd(const char *cmd)
 
        read_early_config(git_unknown_cmd_config, NULL);
 
+       if (autocorrect == AUTOCORRECT_NEVER) {
+               fprintf_ln(stderr, _("git: '%s' is not a git command. See 'git --help'."), cmd);
+               exit(1);
+       }
+
        load_command_list("git-", &main_cmds, &other_cmds);
 
        add_cmd_list(&main_cmds, &aliases);
@@ -594,7 +613,7 @@ const char *help_unknown_cmd(const char *cmd)
                           _("WARNING: You called a Git command named '%s', "
                             "which does not exist."),
                           cmd);
-               if (autocorrect < 0)
+               if (autocorrect == AUTOCORRECT_IMMEDIATELY)
                        fprintf_ln(stderr,
                                   _("Continuing under the assumption that "
                                     "you meant '%s'."),
index 5764dd812ca768002aacd67b066f9af22ab8994e..d0b94f911eebfb23389ecd2e6e24f182ddb4e57e 100644 (file)
@@ -84,17 +84,17 @@ static int nfvasprintf(char **strp, const char *fmt, va_list ap)
 }
 
 struct imap_server_conf {
-       char *name;
-       char *tunnel;
-       char *host;
+       const char *name;
+       const char *tunnel;
+       const char *host;
        int port;
-       char *folder;
-       char *user;
-       char *pass;
+       const char *folder;
+       const char *user;
+       const char *pass;
        int use_ssl;
        int ssl_verify;
        int use_html;
-       char *auth_method;
+       const char *auth_method;
 };
 
 static struct imap_server_conf server = {
@@ -955,7 +955,7 @@ static void server_fill_credential(struct imap_server_conf *srvc, struct credent
                srvc->pass = xstrdup(cred->password);
 }
 
-static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *folder)
+static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const char *folder)
 {
        struct credential cred = CREDENTIAL_INIT;
        struct imap_store *ctx;
@@ -1338,15 +1338,26 @@ static int split_msg(struct strbuf *all_msgs, struct strbuf *msg, int *ofs)
        return 1;
 }
 
-static void git_imap_config(void)
+static int git_imap_config(const char *var, const char *val, void *cb)
 {
-       const char *val = NULL;
 
-       git_config_get_bool("imap.sslverify", &server.ssl_verify);
-       git_config_get_bool("imap.preformattedhtml", &server.use_html);
-       git_config_get_string("imap.folder", &server.folder);
-
-       if (!git_config_get_value("imap.host", &val)) {
+       if (!strcmp("imap.sslverify", var))
+               server.ssl_verify = git_config_bool(var, val);
+       else if (!strcmp("imap.preformattedhtml", var))
+               server.use_html = git_config_bool(var, val);
+       else if (!strcmp("imap.folder", var))
+               return git_config_string(&server.folder, var, val);
+       else if (!strcmp("imap.user", var))
+               return git_config_string(&server.user, var, val);
+       else if (!strcmp("imap.pass", var))
+               return git_config_string(&server.pass, var, val);
+       else if (!strcmp("imap.tunnel", var))
+               return git_config_string(&server.tunnel, var, val);
+       else if (!strcmp("imap.authmethod", var))
+               return git_config_string(&server.auth_method, var, val);
+       else if (!strcmp("imap.port", var))
+               server.port = git_config_int(var, val);
+       else if (!strcmp("imap.host", var)) {
                if (!val) {
                        git_die_config("imap.host", "Missing value for 'imap.host'");
                } else {
@@ -1360,13 +1371,10 @@ static void git_imap_config(void)
                                val += 2;
                        server.host = xstrdup(val);
                }
-       }
+       } else
+               return git_default_config(var, val, cb);
 
-       git_config_get_string("imap.user", &server.user);
-       git_config_get_string("imap.pass", &server.pass);
-       git_config_get_int("imap.port", &server.port);
-       git_config_get_string("imap.tunnel", &server.tunnel);
-       git_config_get_string("imap.authmethod", &server.auth_method);
+       return 0;
 }
 
 static int append_msgs_to_imap(struct imap_server_conf *server,
@@ -1539,7 +1547,7 @@ int cmd_main(int argc, const char **argv)
        int nongit_ok;
 
        setup_git_directory_gently(&nongit_ok);
-       git_imap_config();
+       git_config(git_imap_config, NULL);
 
        argc = parse_options(argc, (const char **)argv, "", imap_send_options, imap_send_usage, 0);
 
index 68eeb425f8adff845409d2f0f7f64118d97593a2..75c8b1acfff86508614321a83989e2940fc21d4b 100644 (file)
@@ -481,7 +481,7 @@ static struct commit *check_single_commit(struct rev_info *revs)
                if (obj->flags & UNINTERESTING)
                        continue;
                obj = deref_tag(revs->repo, obj, NULL, 0);
-               if (obj->type != OBJ_COMMIT)
+               if (!obj || obj->type != OBJ_COMMIT)
                        die("Non commit %s?", revs->pending.objects[i].name);
                if (commit)
                        die("More than one commit to dig from: %s and %s?",
index defd3dfd101f414c5708dc576ff4b7fac8a058a3..d2d1c81caf33fdc12eea412dd428bfe80ee36103 100644 (file)
@@ -35,7 +35,7 @@ const char *list_object_filter_config_name(enum list_objects_filter_choice c)
                /* not a real filter type; just the count of all filters */
                break;
        }
-       BUG("list_object_filter_choice_name: invalid argument '%d'", c);
+       BUG("list_object_filter_config_name: invalid argument '%d'", c);
 }
 
 /*
index 1927f917ce94ce2ec95c889754d6a86177fa2cac..fd0dde97ec324ff6611fa5a7685d4b2831350b3c 100644 (file)
@@ -367,7 +367,7 @@ void fmt_output_subject(struct strbuf *filename,
        const char *suffix = info->patch_suffix;
        int nr = info->nr;
        int start_len = filename->len;
-       int max_len = start_len + FORMAT_PATCH_NAME_MAX - (strlen(suffix) + 1);
+       int max_len = start_len + info->patch_name_max - (strlen(suffix) + 1);
 
        if (0 < info->reroll_count)
                strbuf_addf(filename, "v%d-", info->reroll_count);
index 8fa79289ec6b6cb27e68534845d345caf40137ea..1e8c91dbf21f365efcb2b4e966ba6e1cff23ad95 100644 (file)
@@ -33,7 +33,6 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
                             int maybe_multipart);
 void load_ref_decorations(struct decoration_filter *filter, int flags);
 
-#define FORMAT_PATCH_NAME_MAX 64
 void fmt_output_commit(struct strbuf *, struct commit *, struct rev_info *);
 void fmt_output_subject(struct strbuf *, const char *subject, struct rev_info *);
 void fmt_output_email_subject(struct strbuf *, struct rev_info *);
diff --git a/merge-ort-wrappers.c b/merge-ort-wrappers.c
new file mode 100644 (file)
index 0000000..7eec25f
--- /dev/null
@@ -0,0 +1,62 @@
+#include "cache.h"
+#include "merge-ort.h"
+#include "merge-ort-wrappers.h"
+
+#include "commit.h"
+
+static int unclean(struct merge_options *opt, struct tree *head)
+{
+       /* Sanity check on repo state; index must match head */
+       struct strbuf sb = STRBUF_INIT;
+
+       if (head && repo_index_has_changes(opt->repo, head, &sb)) {
+               fprintf(stderr, _("Your local changes to the following files would be overwritten by merge:\n  %s"),
+                   sb.buf);
+               strbuf_release(&sb);
+               return -1;
+       }
+
+       return 0;
+}
+
+int merge_ort_nonrecursive(struct merge_options *opt,
+                          struct tree *head,
+                          struct tree *merge,
+                          struct tree *merge_base)
+{
+       struct merge_result result;
+
+       if (unclean(opt, head))
+               return -1;
+
+       if (oideq(&merge_base->object.oid, &merge->object.oid)) {
+               printf(_("Already up to date!"));
+               return 1;
+       }
+
+       memset(&result, 0, sizeof(result));
+       merge_incore_nonrecursive(opt, merge_base, head, merge, &result);
+       merge_switch_to_result(opt, head, &result, 1, 1);
+
+       return result.clean;
+}
+
+int merge_ort_recursive(struct merge_options *opt,
+                       struct commit *side1,
+                       struct commit *side2,
+                       struct commit_list *merge_bases,
+                       struct commit **result)
+{
+       struct tree *head = repo_get_commit_tree(opt->repo, side1);
+       struct merge_result tmp;
+
+       if (unclean(opt, head))
+               return -1;
+
+       memset(&tmp, 0, sizeof(tmp));
+       merge_incore_recursive(opt, merge_bases, side1, side2, &tmp);
+       merge_switch_to_result(opt, head, &tmp, 1, 1);
+       *result = NULL;
+
+       return tmp.clean;
+}
diff --git a/merge-ort-wrappers.h b/merge-ort-wrappers.h
new file mode 100644 (file)
index 0000000..0c4c57a
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef MERGE_ORT_WRAPPERS_H
+#define MERGE_ORT_WRAPPERS_H
+
+#include "merge-recursive.h"
+
+/*
+ * rename-detecting three-way merge, no recursion.
+ * Wrapper mimicking the old merge_trees() function.
+ */
+int merge_ort_nonrecursive(struct merge_options *opt,
+                          struct tree *head,
+                          struct tree *merge,
+                          struct tree *common);
+
+/*
+ * rename-detecting three-way merge with recursive ancestor consolidation.
+ * Wrapper mimicking the old merge_recursive() function.
+ */
+int merge_ort_recursive(struct merge_options *opt,
+                       struct commit *h1,
+                       struct commit *h2,
+                       struct commit_list *ancestors,
+                       struct commit **result);
+
+#endif
diff --git a/merge-ort.c b/merge-ort.c
new file mode 100644 (file)
index 0000000..b487901
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * "Ostensibly Recursive's Twin" merge strategy, or "ort" for short.  Meant
+ * as a drop-in replacement for the "recursive" merge strategy, allowing one
+ * to replace
+ *
+ *   git merge [-s recursive]
+ *
+ * with
+ *
+ *   git merge -s ort
+ *
+ * Note: git's parser allows the space between '-s' and its argument to be
+ * missing.  (Should I have backronymed "ham", "alsa", "kip", "nap, "alvo",
+ * "cale", "peedy", or "ins" instead of "ort"?)
+ */
+
+#include "cache.h"
+#include "merge-ort.h"
+
+void merge_switch_to_result(struct merge_options *opt,
+                           struct tree *head,
+                           struct merge_result *result,
+                           int update_worktree_and_index,
+                           int display_update_msgs)
+{
+       die("Not yet implemented");
+       merge_finalize(opt, result);
+}
+
+void merge_finalize(struct merge_options *opt,
+                   struct merge_result *result)
+{
+       die("Not yet implemented");
+}
+
+void merge_incore_nonrecursive(struct merge_options *opt,
+                              struct tree *merge_base,
+                              struct tree *side1,
+                              struct tree *side2,
+                              struct merge_result *result)
+{
+       die("Not yet implemented");
+}
+
+void merge_incore_recursive(struct merge_options *opt,
+                           struct commit_list *merge_bases,
+                           struct commit *side1,
+                           struct commit *side2,
+                           struct merge_result *result)
+{
+       die("Not yet implemented");
+}
diff --git a/merge-ort.h b/merge-ort.h
new file mode 100644 (file)
index 0000000..74adcca
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef MERGE_ORT_H
+#define MERGE_ORT_H
+
+#include "merge-recursive.h"
+
+struct commit;
+struct tree;
+
+struct merge_result {
+       /* Whether the merge is clean */
+       int clean;
+
+       /*
+        * Result of merge.  If !clean, represents what would go in worktree
+        * (thus possibly including files containing conflict markers).
+        */
+       struct tree *tree;
+
+       /*
+        * Additional metadata used by merge_switch_to_result() or future calls
+        * to merge_incore_*().  Includes data needed to update the index (if
+        * !clean) and to print "CONFLICT" messages.  Not for external use.
+        */
+       void *priv;
+};
+
+/*
+ * rename-detecting three-way merge with recursive ancestor consolidation.
+ * working tree and index are untouched.
+ */
+void merge_incore_recursive(struct merge_options *opt,
+                           struct commit_list *merge_bases,
+                           struct commit *side1,
+                           struct commit *side2,
+                           struct merge_result *result);
+
+/*
+ * rename-detecting three-way merge, no recursion.
+ * working tree and index are untouched.
+ */
+void merge_incore_nonrecursive(struct merge_options *opt,
+                              struct tree *merge_base,
+                              struct tree *side1,
+                              struct tree *side2,
+                              struct merge_result *result);
+
+/* Update the working tree and index from head to result after incore merge */
+void merge_switch_to_result(struct merge_options *opt,
+                           struct tree *head,
+                           struct merge_result *result,
+                           int update_worktree_and_index,
+                           int display_update_msgs);
+
+/* Do needed cleanup when not calling merge_switch_to_result() */
+void merge_finalize(struct merge_options *opt,
+                   struct merge_result *result);
+
+#endif
index d0214335a79ddef7202e0552b80111a05c36f14c..f736a0f63234fee610b42abdf2d7458d932e1d70 100644 (file)
@@ -2651,7 +2651,7 @@ static struct string_list *get_renames(struct merge_options *opt,
                free(e->target_file);
                string_list_clear(&e->source_files, 0);
        }
-       hashmap_free_entries(&collisions, struct collision_entry, ent);
+       hashmap_clear_and_free(&collisions, struct collision_entry, ent);
        return renames;
 }
 
@@ -2870,7 +2870,7 @@ static void initial_cleanup_rename(struct diff_queue_struct *pairs,
                strbuf_release(&e->new_dir);
                /* possible_new_dirs already cleared in get_directory_renames */
        }
-       hashmap_free_entries(dir_renames, struct dir_rename_entry, ent);
+       hashmap_clear_and_free(dir_renames, struct dir_rename_entry, ent);
        free(dir_renames);
 
        free(pairs->queue);
@@ -3497,7 +3497,7 @@ static int merge_trees_internal(struct merge_options *opt,
                string_list_clear(entries, 1);
                free(entries);
 
-               hashmap_free_entries(&opt->priv->current_file_dir_set,
+               hashmap_clear_and_free(&opt->priv->current_file_dir_set,
                                        struct path_hashmap_entry, e);
 
                if (clean < 0) {
index a89086ee720f842359eefe58f369af2774457438..26c19d46a5bdee5739b9a9425cc48fac3efd6bfb 100644 (file)
@@ -25,4 +25,5 @@ translate_merge_tool_path() {
 list_tool_variants () {
        echo bc
        echo bc3
+       echo bc4
 }
diff --git a/midx.c b/midx.c
index 0de42ffdfb22c630e5b28f4997aa558c01a44d79..79c282b070d26d5ffac866feaaee244fea986d43 100644 (file)
--- a/midx.c
+++ b/midx.c
@@ -10,6 +10,7 @@
 #include "progress.h"
 #include "trace2.h"
 #include "run-command.h"
+#include "repository.h"
 
 #define MIDX_SIGNATURE 0x4d494458 /* "MIDX" */
 #define MIDX_VERSION 1
@@ -297,7 +298,7 @@ static int nth_midxed_pack_entry(struct repository *r,
        pack_int_id = nth_midxed_pack_int_id(m, pos);
 
        if (prepare_midx_pack(r, m, pack_int_id))
-               die(_("error preparing packfile from multi-pack-index"));
+               return 0;
        p = m->packs[pack_int_id];
 
        /*
@@ -398,15 +399,9 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i
 {
        struct multi_pack_index *m;
        struct multi_pack_index *m_search;
-       int config_value;
-       static int env_value = -1;
-
-       if (env_value < 0)
-               env_value = git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0);
 
-       if (!env_value &&
-           (repo_config_get_bool(r, "core.multipackindex", &config_value) ||
-           !config_value))
+       prepare_repo_settings(r);
+       if (!r->settings.core_multi_pack_index)
                return 0;
 
        for (m_search = r->objects->multi_pack_index; m_search; m_search = m_search->next)
@@ -790,9 +785,7 @@ static size_t write_midx_large_offsets(struct hashfile *f, uint32_t nr_large_off
                if (!(offset >> 31))
                        continue;
 
-               hashwrite_be32(f, offset >> 32);
-               hashwrite_be32(f, offset & 0xffffffffUL);
-               written += 2 * sizeof(uint32_t);
+               written += hashwrite_be64(f, offset);
 
                nr_large_offset--;
        }
@@ -850,7 +843,7 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
 
        packs.pack_paths_checked = 0;
        if (flags & MIDX_PROGRESS)
-               packs.progress = start_progress(_("Adding packfiles to multi-pack-index"), 0);
+               packs.progress = start_delayed_progress(_("Adding packfiles to multi-pack-index"), 0);
        else
                packs.progress = NULL;
 
@@ -980,14 +973,13 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
                            chunk_offsets[i]);
 
                hashwrite_be32(f, chunk_ids[i]);
-               hashwrite_be32(f, chunk_offsets[i] >> 32);
-               hashwrite_be32(f, chunk_offsets[i]);
+               hashwrite_be64(f, chunk_offsets[i]);
 
                written += MIDX_CHUNKLOOKUP_WIDTH;
        }
 
        if (flags & MIDX_PROGRESS)
-               progress = start_progress(_("Writing chunks to multi-pack-index"),
+               progress = start_delayed_progress(_("Writing chunks to multi-pack-index"),
                                          num_chunks);
        for (i = 0; i < num_chunks; i++) {
                if (written != chunk_offsets[i])
@@ -1129,7 +1121,7 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
        }
 
        if (flags & MIDX_PROGRESS)
-               progress = start_progress(_("Looking for referenced packfiles"),
+               progress = start_delayed_progress(_("Looking for referenced packfiles"),
                                          m->num_packs);
        for (i = 0; i < m->num_packs; i++) {
                if (prepare_midx_pack(r, m, i))
@@ -1250,7 +1242,7 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
        count = xcalloc(m->num_packs, sizeof(uint32_t));
 
        if (flags & MIDX_PROGRESS)
-               progress = start_progress(_("Counting referenced objects"),
+               progress = start_delayed_progress(_("Counting referenced objects"),
                                          m->num_objects);
        for (i = 0; i < m->num_objects; i++) {
                int pack_int_id = nth_midxed_pack_int_id(m, i);
@@ -1260,7 +1252,7 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
        stop_progress(&progress);
 
        if (flags & MIDX_PROGRESS)
-               progress = start_progress(_("Finding and deleting unreferenced packfiles"),
+               progress = start_delayed_progress(_("Finding and deleting unreferenced packfiles"),
                                          m->num_packs);
        for (i = 0; i < m->num_packs; i++) {
                char *pack_name;
index fb526a3775f69eb02d6b7e47629bf60a8a0153fa..5d3c7b12c1805cad19e8cef165e79e232d0f4de4 100644 (file)
@@ -726,6 +726,6 @@ void free_name_hash(struct index_state *istate)
                return;
        istate->name_hash_initialized = 0;
 
-       hashmap_free(&istate->name_hash);
-       hashmap_free_entries(&istate->dir_hash, struct dir_entry, ent);
+       hashmap_clear(&istate->name_hash);
+       hashmap_clear_and_free(&istate->dir_hash, struct dir_entry, ent);
 }
diff --git a/notes.c b/notes.c
index 564baac64d762044064b0b0ba3b548f696df6105..d5ac081e76df9cd03edd273177a15e42aa25d407 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -970,7 +970,7 @@ static int notes_display_config(const char *k, const char *v, void *cb)
 
        if (*load_refs && !strcmp(k, "notes.displayref")) {
                if (!v)
-                       config_error_nonbool(k);
+                       return config_error_nonbool(k);
                string_list_add_refs_by_glob(&display_notes_refs, v);
        }
 
index 32575186562507b2774c6abf097df7810e9cce5e..68f80b0b3d83e09f46bf3875c45647cee79772e8 100644 (file)
--- a/object.c
+++ b/object.c
@@ -453,12 +453,12 @@ void clear_object_flags(unsigned flags)
        }
 }
 
-void clear_commit_marks_all(unsigned int flags)
+void repo_clear_commit_marks(struct repository *r, unsigned int flags)
 {
        int i;
 
-       for (i = 0; i < the_repository->parsed_objects->obj_hash_size; i++) {
-               struct object *obj = the_repository->parsed_objects->obj_hash[i];
+       for (i = 0; i < r->parsed_objects->obj_hash_size; i++) {
+               struct object *obj = r->parsed_objects->obj_hash[i];
                if (obj && obj->type == OBJ_COMMIT)
                        obj->flags &= ~flags;
        }
@@ -532,7 +532,7 @@ void raw_object_store_clear(struct raw_object_store *o)
        close_object_store(o);
        o->packed_git = NULL;
 
-       hashmap_free(&o->pack_map);
+       hashmap_clear(&o->pack_map);
 }
 
 void parsed_object_pool_clear(struct parsed_object_pool *o)
index 20b18805f08f6eb2d472abc377b3766594dc4e78..59daadce21453c707bb439d047725b40d95f153d 100644 (file)
--- a/object.h
+++ b/object.h
@@ -191,8 +191,9 @@ void object_array_clear(struct object_array *array);
 void clear_object_flags(unsigned flags);
 
 /*
- * Clear the specified object flags from all in-core commit objects.
+ * Clear the specified object flags from all in-core commit objects from
+ * the specified repository.
  */
-void clear_commit_marks_all(unsigned int flags);
+void repo_clear_commit_marks(struct repository *r, unsigned int flags);
 
 #endif /* OBJECT_H */
index 8657a5cedfa68cbc3711d4b288e514978ff5b6df..8e1bcedc0cb56a11a4cb6d27d33b33ed39b02bfe 100644 (file)
@@ -14,8 +14,10 @@ static int void_hashcmp(const void *a, const void *b)
        return oidcmp(a, b);
 }
 
-static void oid_array_sort(struct oid_array *array)
+void oid_array_sort(struct oid_array *array)
 {
+       if (array->sorted)
+               return;
        QSORT(array->oid, array->nr, void_hashcmp);
        array->sorted = 1;
 }
@@ -28,8 +30,7 @@ static const unsigned char *sha1_access(size_t index, void *table)
 
 int oid_array_lookup(struct oid_array *array, const struct object_id *oid)
 {
-       if (!array->sorted)
-               oid_array_sort(array);
+       oid_array_sort(array);
        return sha1_pos(oid->hash, array->oid, array->nr, sha1_access);
 }
 
@@ -64,14 +65,10 @@ int oid_array_for_each_unique(struct oid_array *array,
 {
        size_t i;
 
-       if (!array->sorted)
-               oid_array_sort(array);
+       oid_array_sort(array);
 
-       for (i = 0; i < array->nr; i++) {
-               int ret;
-               if (i > 0 && oideq(array->oid + i, array->oid + i - 1))
-                       continue;
-               ret = fn(array->oid + i, data);
+       for (i = 0; i < array->nr; i = oid_array_next_unique(array, i)) {
+               int ret = fn(array->oid + i, data);
                if (ret)
                        return ret;
        }
index f28d322c9006553c1335b836cea9252f80bb1e96..72bca78b7dc129313dfd2e0b6d9271179cda1ce0 100644 (file)
@@ -1,5 +1,7 @@
-#ifndef SHA1_ARRAY_H
-#define SHA1_ARRAY_H
+#ifndef OID_ARRAY_H
+#define OID_ARRAY_H
+
+#include "hash.h"
 
 /**
  * The API provides storage and manipulation of sets of object identifiers.
@@ -106,4 +108,30 @@ void oid_array_filter(struct oid_array *array,
                      for_each_oid_fn want,
                      void *cbdata);
 
-#endif /* SHA1_ARRAY_H */
+/**
+ * Sort the array in order of ascending object id.
+ */
+void oid_array_sort(struct oid_array *array);
+
+/**
+ * Find the next unique oid in the array after position "cur".
+ * The array must be sorted for this to work. You can iterate
+ * over unique elements like this:
+ *
+ *   size_t i;
+ *   oid_array_sort(array);
+ *   for (i = 0; i < array->nr; i = oid_array_next_unique(array, i))
+ *     printf("%s", oid_to_hex(array->oids[i]);
+ *
+ * Non-unique iteration can just increment with "i++" to visit each element.
+ */
+static inline size_t oid_array_next_unique(struct oid_array *array, size_t cur)
+{
+       do {
+               cur++;
+       } while (cur < array->nr &&
+                oideq(array->oid + cur, array->oid + cur - 1));
+       return cur;
+}
+
+#endif /* OID_ARRAY_H */
index 423aa014a33eda2c6b695906eb0c349552d9e2b8..286a04a53c20119fe567eec4accbaba4d9f04a97 100644 (file)
--- a/oidmap.c
+++ b/oidmap.c
@@ -27,7 +27,7 @@ void oidmap_free(struct oidmap *map, int free_entries)
                return;
 
        /* TODO: make oidmap itself not depend on struct layouts */
-       hashmap_free_(&map->map, free_entries ? 0 : -1);
+       hashmap_clear_(&map->map, free_entries ? 0 : -1);
 }
 
 void *oidmap_get(const struct oidmap *map, const struct object_id *key)
index 2d0ab76fb569be21dacc68e66098a4814191325b..5aac633c1f405580447001dfae114660e6120e90 100644 (file)
--- a/oidset.c
+++ b/oidset.c
@@ -72,9 +72,10 @@ void oidset_parse_file_carefully(struct oidset *set, const char *path,
                if (!sb.len)
                        continue;
 
-               if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0' ||
-                   (fn && fn(&oid, cbdata)))
+               if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0')
                        die("invalid object name: %s", sb.buf);
+               if (fn && fn(&oid, cbdata))
+                       continue;
                oidset_insert(set, &oid);
        }
        if (ferror(fp))
index dad6d8ae7f23541a886e7cc6dc7a6b10dead10fe..4b089fe8ec051af05044225c283ee5ff3c1dac84 100644 (file)
@@ -39,7 +39,7 @@ int check_pack_crc(struct packed_git *p, struct pack_window **w_curs,
        } while (len);
 
        index_crc = p->index_data;
-       index_crc += 2 + 256 + p->num_objects * (the_hash_algo->rawsz/4) + nr;
+       index_crc += 2 + 256 + (size_t)p->num_objects * (the_hash_algo->rawsz/4) + nr;
 
        return data_crc != ntohl(*index_crc);
 }
@@ -164,7 +164,7 @@ static int verify_packfile(struct repository *r,
 
 int verify_pack_index(struct packed_git *p)
 {
-       off_t index_size;
+       size_t len;
        const unsigned char *index_base;
        git_hash_ctx ctx;
        unsigned char hash[GIT_MAX_RAWSZ];
@@ -172,14 +172,14 @@ int verify_pack_index(struct packed_git *p)
 
        if (open_pack_index(p))
                return error("packfile %s index not opened", p->pack_name);
-       index_size = p->index_size;
        index_base = p->index_data;
+       len = p->index_size - the_hash_algo->rawsz;
 
        /* Verify SHA1 sum of the index file */
        the_hash_algo->init_fn(&ctx);
-       the_hash_algo->update_fn(&ctx, index_base, (unsigned int)(index_size - the_hash_algo->rawsz));
+       the_hash_algo->update_fn(&ctx, index_base, len);
        the_hash_algo->final_fn(hash, &ctx);
-       if (!hasheq(hash, index_base + index_size - the_hash_algo->rawsz))
+       if (!hasheq(hash, index_base + len))
                err = error("Packfile index for %s hash mismatch",
                            p->pack_name);
        return err;
index d28a7e43d0bd80c3dc968439b3262da7c80117c1..ecdde39cf446f31e4c07f4d80cdb3767272c9cc8 100644 (file)
@@ -130,7 +130,7 @@ static void create_pack_revindex(struct packed_git *p)
 
        if (p->index_version > 1) {
                const uint32_t *off_32 =
-                       (uint32_t *)(index + 8 + p->num_objects * (hashsz + 4));
+                       (uint32_t *)(index + 8 + (size_t)p->num_objects * (hashsz + 4));
                const uint32_t *off_64 = off_32 + p->num_objects;
                for (i = 0; i < num_ent; i++) {
                        const uint32_t off = ntohl(*off_32++);
index a6cdb3c67ccac3a0cb273d4e4d24bd35ac2b4bf4..3513665e1e1be606dd116370fefbbb2a0d781245 100644 (file)
@@ -48,7 +48,6 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec
        struct hashfile *f;
        struct pack_idx_entry **sorted_by_sha, **list, **last;
        off_t last_obj_offset = 0;
-       uint32_t array[256];
        int i, fd;
        uint32_t index_version;
 
@@ -106,10 +105,9 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec
                                break;
                        next++;
                }
-               array[i] = htonl(next - sorted_by_sha);
+               hashwrite_be32(f, next - sorted_by_sha);
                list = next;
        }
-       hashwrite(f, array, 256 * 4);
 
        /*
         * Write the actual SHA1 entries..
@@ -153,13 +151,10 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec
                while (nr_large_offset) {
                        struct pack_idx_entry *obj = *list++;
                        uint64_t offset = obj->offset;
-                       uint32_t split[2];
 
                        if (!need_large_offset(offset, opts))
                                continue;
-                       split[0] = htonl(offset >> 32);
-                       split[1] = htonl(offset & 0xffffffff);
-                       hashwrite(f, split, 8);
+                       hashwrite_be64(f, offset);
                        nr_large_offset--;
                }
        }
index 0929ebe4fc747fc52c98d45542d9b257dc25a31d..86f5c8dbf6677195ffca0e03f3cf810e84c5f0df 100644 (file)
@@ -148,7 +148,7 @@ int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
                 *  - hash of the packfile
                 *  - file checksum
                 */
-               if (idx_size != 4 * 256 + nr * (hashsz + 4) + hashsz + hashsz)
+               if (idx_size != st_add(4 * 256 + hashsz + hashsz, st_mult(nr, hashsz + 4)))
                        return error("wrong index v1 file size in %s", path);
        } else if (version == 2) {
                /*
@@ -164,10 +164,10 @@ int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
                 * variable sized table containing 8-byte entries
                 * for offsets larger than 2^31.
                 */
-               unsigned long min_size = 8 + 4*256 + nr*(hashsz + 4 + 4) + hashsz + hashsz;
-               unsigned long max_size = min_size;
+               size_t min_size = st_add(8 + 4*256 + hashsz + hashsz, st_mult(nr, hashsz + 4 + 4));
+               size_t max_size = min_size;
                if (nr)
-                       max_size += (nr - 1)*8;
+                       max_size = st_add(max_size, st_mult(nr - 1, 8));
                if (idx_size < min_size || idx_size > max_size)
                        return error("wrong index v2 file size in %s", path);
                if (idx_size != min_size &&
@@ -514,19 +514,8 @@ static int open_packed_git_1(struct packed_git *p)
        ssize_t read_result;
        const unsigned hashsz = the_hash_algo->rawsz;
 
-       if (!p->index_data) {
-               struct multi_pack_index *m;
-               const char *pack_name = pack_basename(p);
-
-               for (m = the_repository->objects->multi_pack_index;
-                    m; m = m->next) {
-                       if (midx_contains_pack(m, pack_name))
-                               break;
-               }
-
-               if (!m && open_pack_index(p))
-                       return error("packfile %s index unavailable", p->pack_name);
-       }
+       if (open_pack_index(p))
+               return error("packfile %s index unavailable", p->pack_name);
 
        if (!pack_max_fds) {
                unsigned int max_fds = get_max_fd_limit();
@@ -567,10 +556,6 @@ static int open_packed_git_1(struct packed_git *p)
                        " supported (try upgrading GIT to a newer version)",
                        p->pack_name, ntohl(hdr.hdr_version));
 
-       /* Skip index checking if in multi-pack-index */
-       if (!p->index_data)
-               return 0;
-
        /* Verify the pack matches its index. */
        if (p->num_objects != ntohl(hdr.hdr_entries))
                return error("packfile %s claims to have %"PRIu32" objects"
@@ -1933,14 +1918,14 @@ off_t nth_packed_object_offset(const struct packed_git *p, uint32_t n)
        const unsigned int hashsz = the_hash_algo->rawsz;
        index += 4 * 256;
        if (p->index_version == 1) {
-               return ntohl(*((uint32_t *)(index + (hashsz + 4) * n)));
+               return ntohl(*((uint32_t *)(index + (hashsz + 4) * (size_t)n)));
        } else {
                uint32_t off;
-               index += 8 + p->num_objects * (hashsz + 4);
+               index += 8 + (size_t)p->num_objects * (hashsz + 4);
                off = ntohl(*((uint32_t *)(index + 4 * n)));
                if (!(off & 0x80000000))
                        return off;
-               index += p->num_objects * 4 + (off & 0x7fffffff) * 8;
+               index += (size_t)p->num_objects * 4 + (off & 0x7fffffff) * 8;
                check_pack_index_ptr(p, index);
                return get_be64(index);
        }
index 12aa6d494b4ed47d1a486307b6b9d9024ee78734..21973e49332c36532438bb067c8821a0e377baf9 100644 (file)
@@ -71,7 +71,7 @@ int init_patch_ids(struct repository *r, struct patch_ids *ids)
 
 int free_patch_ids(struct patch_ids *ids)
 {
-       hashmap_free_entries(&ids->patches, struct patch_id, ent);
+       hashmap_clear_and_free(&ids->patches, struct patch_id, ent);
        return 0;
 }
 
index 8b95e2d73d0f8f8d5b50eaaa360135f102b52b74..d82b71325c6bd492cd7eb0f703b00fa6634c627d 100644 (file)
@@ -12,7 +12,7 @@
 package Error;
 
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 
 use vars qw($VERSION);
 use 5.004;
index 10df990959e63938e1742d1cdaf0d009b61bee96..02eacef0c2a4a43058a74dda4cebe1ae16bdd2eb 100644 (file)
@@ -9,7 +9,7 @@ package Git;
 
 use 5.008;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 
 use File::Temp ();
 use File::Spec ();
index bfb4fb67a13f4530aae2d974e579b9ba45e20cdb..2037f387c89e8a8769910e164174085f1d2e645c 100644 (file)
@@ -1,7 +1,7 @@
 package Git::I18N;
 use 5.008;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 BEGIN {
        require Exporter;
        if ($] < 5.008003) {
index 2a7b4908f3e637d3e93462799c91cd75a8221354..9ee054f854e8682e16933ad0a770be5847bd33e5 100644 (file)
@@ -1,6 +1,6 @@
 package Git::IndexInfo;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Git qw/command_input_pipe command_close_pipe/;
 
 sub new {
index e5585e75e809ef5763d3d4f19ebd185c6f7c0f51..0c360bc799860798ade6b2afce6e05b0a567d21f 100644 (file)
@@ -1,7 +1,7 @@
 package Git::LoadCPAN;
 use 5.008;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 
 =head1 NAME
 
index c6d2c45d808b2ec553f53f15ad5f495844199ac0..5d84c202884b7cb7cea576ea1a6f146b2e653ae2 100644 (file)
@@ -1,7 +1,7 @@
 package Git::LoadCPAN::Error;
 use 5.008;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Git::LoadCPAN (
        module => 'Error',
        import => 1,
index f70a4f064c3c78a87be3f876ea3f325d6b6fa4de..340e88a7a56be37af8b1f437c92ecb52b1b29089 100644 (file)
@@ -1,7 +1,7 @@
 package Git::LoadCPAN::Mail::Address;
 use 5.008;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Git::LoadCPAN (
        module => 'Mail::Address',
        import => 0,
index b75738bed4b52ac0085eb6a4919ba954d8fcfe98..d144f5168f37adaf54a2f9b768f04ad2a1c20196 100644 (file)
@@ -1,7 +1,7 @@
 package Git::Packet;
 use 5.008;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 BEGIN {
        require Exporter;
        if ($] < 5.008003) {
index d1c352f92b58392961b8e958c5539cba65458856..f6f1dc03c60861ca1fba1faf66617ad8b6c1b8b4 100644 (file)
@@ -1,6 +1,6 @@
 package Git::SVN;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Fcntl qw/:DEFAULT :seek/;
 use constant rev_map_fmt => 'NH*';
 use vars qw/$_no_metadata
index c961444d4cbb622ea8045587c7294d50f2b655ef..47fd048bf2d14e3274ed0b6f7d3dbe957ac75b3c 100644 (file)
@@ -1,7 +1,7 @@
 package Git::SVN::Editor;
 use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use SVN::Core;
 use SVN::Delta;
 use Carp qw/croak/;
index 729e5337df7accad3340f3a8f7411ba0ffd31085..968309e6d63b904c6ed76d78ee3f60bdfe64e271 100644 (file)
@@ -3,7 +3,7 @@ use vars qw/@ISA $_ignore_regex $_include_regex $_preserve_empty_dirs
             $_placeholder_filename @deleted_gpath %added_placeholder
             $repo_id/;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use SVN::Delta;
 use Carp qw/croak/;
 use File::Basename qw/dirname/;
index a0a8d1762150acd5b6a91116d4835fba1834d425..f2c1e1f6fbe8899cd3f871d4fefcee2c5939f2a5 100644 (file)
@@ -1,6 +1,6 @@
 package Git::SVN::GlobSpec;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 
 sub new {
        my ($class, $glob, $pattern_ok) = @_;
index 3858fcf27dee85c8d2b72ff96402d253c8ea1772..cc8b484f848028e397fb5030f73b0d875a5602c9 100644 (file)
@@ -1,6 +1,6 @@
 package Git::SVN::Log;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Git::SVN::Utils qw(fatal);
 use Git qw(command
            command_oneline
@@ -298,7 +298,7 @@ sub cmd_show_log {
                        get_author_info($c, $1, $2, $3);
                } elsif (/^${esc_color}(?:tree|parent|committer) /o) {
                        # ignore
-               } elsif (/^${esc_color}:\d{6} \d{6} $::sha1_short/o) {
+               } elsif (/^${esc_color}:\d{6} \d{6} $::oid_short/o) {
                        push @{$c->{raw}}, $_;
                } elsif (/^${esc_color}[ACRMDT]\t/) {
                        # we could add $SVN->{svn_path} here, but that requires
index 9676b8f2f73520735b68f6ff13d03d52575afaae..8fcf6644a1c198ce7ea4d67d490f4a975251bf86 100644 (file)
@@ -1,5 +1,5 @@
 package Git::SVN::Memoize::YAML;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use strict;
 use YAML::Any ();
 
index dc90f6a6214281386c401235827a8fd268994eeb..ed96ac593e8098fcdf93a8a7b9639ae1a2734c73 100644 (file)
@@ -33,7 +33,7 @@ package Git::SVN::Migration;
 #              possible if noMetadata or useSvmProps are set; but should
 #              be no problem for users that use the (sensible) defaults.
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Carp qw/croak/;
 use File::Path qw/mkpath/;
 use File::Basename qw/dirname basename/;
index e940b08505f1488efbe257201b3881b7e00a0a2a..de158e848fb0be0e3c7b8239cc774f695cf3ec7c 100644 (file)
@@ -1,6 +1,6 @@
 package Git::SVN::Prompt;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 require SVN::Core;
 use vars qw/$_no_auth_cache $_username/;
 
index 2cfe055a9a04305ab5b248a6de0bab2a8abfcec0..912e035040448858e0a53ecdd72deb4bf11206ab 100644 (file)
@@ -1,7 +1,7 @@
 package Git::SVN::Ra;
 use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/;
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 use Memoize;
 use Git::SVN::Utils qw(
        canonicalize_url
index 3d1a0933a2eb27dc123730c67470be503e91bf93..5ca09ab448328b7e29c1cc248191cd8abf2a82f3 100644 (file)
@@ -1,7 +1,7 @@
 package Git::SVN::Utils;
 
 use strict;
-use warnings;
+use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
 
 use SVN::Core;
 
index 844c253ccd9a9ee770fe494a0cce84f53dc8fed8..d633005ef746ad1eb7445cb75401e0c3f55a2312 100644 (file)
@@ -461,9 +461,11 @@ int recv_sideband(const char *me, int in_stream, int out)
        enum sideband_type sideband_type;
 
        while (1) {
-               len = packet_read(in_stream, NULL, NULL, buf, LARGE_PACKET_MAX,
-                                 0);
-               if (!demultiplex_sideband(me, buf, len, 0, &scratch,
+               int status = packet_read_with_status(in_stream, NULL, NULL,
+                                                    buf, LARGE_PACKET_MAX,
+                                                    &len,
+                                                    PACKET_READ_GENTLE_ON_EOF);
+               if (!demultiplex_sideband(me, status, buf, len, 0, &scratch,
                                          &sideband_type))
                        continue;
                switch (sideband_type) {
@@ -471,6 +473,9 @@ int recv_sideband(const char *me, int in_stream, int out)
                        write_or_die(out, buf + 1, len - 1);
                        break;
                default: /* errors: message already written */
+                       if (scratch.len > 0)
+                               BUG("unhandled incomplete sideband: '%s'",
+                                   scratch.buf);
                        return sideband_type;
                }
        }
@@ -517,9 +522,9 @@ enum packet_read_status packet_reader_read(struct packet_reader *reader)
                                                         reader->options);
                if (!reader->use_sideband)
                        break;
-               if (demultiplex_sideband(reader->me, reader->buffer,
-                                        reader->pktlen, 1, &scratch,
-                                        &sideband_type))
+               if (demultiplex_sideband(reader->me, reader->status,
+                                        reader->buffer, reader->pktlen, 1,
+                                        &scratch, &sideband_type))
                        break;
        }
 
index 24dc435e482c0364ebc88e7ad55930f437d73ad2..b9950f10c8c486b16a2b916b0898d88c8d82fb59 100644 (file)
@@ -232,11 +232,9 @@ static int patch_util_cmp(const void *dummy, const struct patch_util *a,
 
 static void find_exact_matches(struct string_list *a, struct string_list *b)
 {
-       struct hashmap map;
+       struct hashmap map = HASHMAP_INIT((hashmap_cmp_fn)patch_util_cmp, NULL);
        int i;
 
-       hashmap_init(&map, (hashmap_cmp_fn)patch_util_cmp, NULL, 0);
-
        /* First, add the patches of a to a hash map */
        for (i = 0; i < a->nr; i++) {
                struct patch_util *util = a->items[i].util;
@@ -266,7 +264,7 @@ static void find_exact_matches(struct string_list *a, struct string_list *b)
                }
        }
 
-       hashmap_free(&map);
+       hashmap_clear(&map);
 }
 
 static void diffsize_consume(void *data, char *line, unsigned long len)
index c62f6b482271e124474aab6984820dcdd2db698c..aa260bfd0995564e085f69b5b1c7ecaf4b49f359 100644 (file)
@@ -1097,14 +1097,19 @@ static const char *copy_email(const char *buf, struct used_atom *atom)
 
 static char *copy_subject(const char *buf, unsigned long len)
 {
-       char *r = xmemdupz(buf, len);
+       struct strbuf sb = STRBUF_INIT;
        int i;
 
-       for (i = 0; i < len; i++)
-               if (r[i] == '\n')
-                       r[i] = ' ';
+       for (i = 0; i < len; i++) {
+               if (buf[i] == '\r' && i + 1 < len && buf[i + 1] == '\n')
+                       continue; /* ignore CR in CRLF */
 
-       return r;
+               if (buf[i] == '\n')
+                       strbuf_addch(&sb, ' ');
+               else
+                       strbuf_addch(&sb, buf[i]);
+       }
+       return strbuf_detach(&sb, NULL);
 }
 
 static void grab_date(const char *buf, struct atom_value *v, const char *atomname)
@@ -1228,20 +1233,23 @@ static void find_subpos(const char *buf,
 
        /* subject is first non-empty line */
        *sub = buf;
-       /* subject goes to first empty line */
-       while (buf < *sig && *buf && *buf != '\n') {
-               eol = strchrnul(buf, '\n');
-               if (*eol)
-                       eol++;
-               buf = eol;
-       }
+       /* subject goes to first empty line before signature begins */
+       if ((eol = strstr(*sub, "\n\n"))) {
+               eol = eol < *sig ? eol : *sig;
+       /* check if message uses CRLF */
+       } else if (! (eol = strstr(*sub, "\r\n\r\n"))) {
+               /* treat whole message as subject */
+               eol = strrchr(*sub, '\0');
+       }
+       buf = eol;
        *sublen = buf - *sub;
        /* drop trailing newline, if present */
-       if (*sublen && (*sub)[*sublen - 1] == '\n')
+       while (*sublen && ((*sub)[*sublen - 1] == '\n' ||
+                          (*sub)[*sublen - 1] == '\r'))
                *sublen -= 1;
 
        /* skip any empty lines */
-       while (*buf == '\n')
+       while (*buf == '\n' || *buf == '\r')
                buf++;
        *body = buf;
        *bodylen = strlen(buf);
@@ -2222,7 +2230,7 @@ void ref_array_clear(struct ref_array *array)
        used_atom_cnt = 0;
 
        if (ref_to_worktree_map.worktrees) {
-               hashmap_free_entries(&(ref_to_worktree_map.map),
+               hashmap_clear_and_free(&(ref_to_worktree_map.map),
                                        struct ref_to_worktree_entry, ent);
                free_worktrees(ref_to_worktree_map.worktrees);
                ref_to_worktree_map.worktrees = NULL;
diff --git a/refs.c b/refs.c
index fa01153151a8c66c18da4020a42f93063c835cdf..13dc2c3291b398aae7c9797155363922def64eff 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -562,17 +562,36 @@ void expand_ref_prefix(struct strvec *prefixes, const char *prefix)
                strvec_pushf(prefixes, *p, len, prefix);
 }
 
-char *repo_default_branch_name(struct repository *r)
+static const char default_branch_name_advice[] = N_(
+"Using '%s' as the name for the initial branch. This default branch name\n"
+"is subject to change. To configure the initial branch name to use in all\n"
+"of your new repositories, which will suppress this warning, call:\n"
+"\n"
+"\tgit config --global init.defaultBranch <name>\n"
+"\n"
+"Names commonly chosen instead of 'master' are 'main', 'trunk' and\n"
+"'development'. The just-created branch can be renamed via this command:\n"
+"\n"
+"\tgit branch -m <name>\n"
+);
+
+char *repo_default_branch_name(struct repository *r, int quiet)
 {
        const char *config_key = "init.defaultbranch";
        const char *config_display_key = "init.defaultBranch";
        char *ret = NULL, *full_ref;
+       const char *env = getenv("GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME");
 
-       if (repo_config_get_string(r, config_key, &ret) < 0)
+       if (env && *env)
+               ret = xstrdup(env);
+       else if (repo_config_get_string(r, config_key, &ret) < 0)
                die(_("could not retrieve `%s`"), config_display_key);
 
-       if (!ret)
+       if (!ret) {
                ret = xstrdup("master");
+               if (!quiet)
+                       advise(_(default_branch_name_advice), ret);
+       }
 
        full_ref = xstrfmt("refs/heads/%s", ret);
        if (check_refname_format(full_ref, 0))
@@ -582,12 +601,12 @@ char *repo_default_branch_name(struct repository *r)
        return ret;
 }
 
-const char *git_default_branch_name(void)
+const char *git_default_branch_name(int quiet)
 {
        static char *ret;
 
        if (!ret)
-               ret = repo_default_branch_name(the_repository);
+               ret = repo_default_branch_name(the_repository, quiet);
 
        return ret;
 }
diff --git a/refs.h b/refs.h
index 66955181569b3d71363d8da752245f2a1efb7b1f..ff05d2e9fe27cfc3486c42a1cfcf99941eaf9774 100644 (file)
--- a/refs.h
+++ b/refs.h
@@ -170,8 +170,8 @@ int dwim_log(const char *str, int len, struct object_id *oid, char **ref);
  * The return value of `repo_default_branch_name()` is an allocated string. The
  * return value of `git_default_branch_name()` is a singleton.
  */
-const char *git_default_branch_name(void);
-char *repo_default_branch_name(struct repository *r);
+const char *git_default_branch_name(int quiet);
+char *repo_default_branch_name(struct repository *r, int quiet);
 
 /*
  * A ref_transaction represents a collection of reference updates that
index 8af357a0a35d15267fb217337b3957be18577459..e3d852c0bfeca6bd5d166e5c8041d8176eae3a11 100644 (file)
--- a/refspec.c
+++ b/refspec.c
@@ -71,7 +71,10 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
        }
 
        item->pattern = is_glob;
-       item->src = xstrndup(lhs, llen);
+       if (llen == 1 && *lhs == '@')
+               item->src = xstrdup("HEAD");
+       else
+               item->src = xstrndup(lhs, llen);
        flags = REFNAME_ALLOW_ONELEVEL | (is_glob ? REFNAME_REFSPEC_PATTERN : 0);
 
        if (item->negative) {
@@ -245,6 +248,16 @@ int valid_fetch_refspec(const char *fetch_refspec_str)
        return ret;
 }
 
+int valid_remote_name(const char *name)
+{
+       int result;
+       struct strbuf refspec = STRBUF_INIT;
+       strbuf_addf(&refspec, "refs/heads/test:refs/remotes/%s/test", name);
+       result = valid_fetch_refspec(refspec.buf);
+       strbuf_release(&refspec);
+       return result;
+}
+
 void refspec_ref_prefixes(const struct refspec *rs,
                          struct strvec *ref_prefixes)
 {
@@ -262,15 +275,16 @@ void refspec_ref_prefixes(const struct refspec *rs,
                else if (item->src && !item->exact_sha1)
                        prefix = item->src;
 
-               if (prefix) {
-                       if (item->pattern) {
-                               const char *glob = strchr(prefix, '*');
-                               strvec_pushf(ref_prefixes, "%.*s",
-                                            (int)(glob - prefix),
-                                            prefix);
-                       } else {
-                               expand_ref_prefix(ref_prefixes, prefix);
-                       }
+               if (!prefix)
+                       continue;
+
+               if (item->pattern) {
+                       const char *glob = strchr(prefix, '*');
+                       strvec_pushf(ref_prefixes, "%.*s",
+                                    (int)(glob - prefix),
+                                    prefix);
+               } else {
+                       expand_ref_prefix(ref_prefixes, prefix);
                }
        }
 }
index 95518323992366d0d64576f6492fd8c504bb7607..8b79891d3218d526ef1216bc1525b6040730185a 100644 (file)
--- a/refspec.h
+++ b/refspec.h
@@ -64,6 +64,7 @@ void refspec_appendn(struct refspec *rs, const char **refspecs, int nr);
 void refspec_clear(struct refspec *rs);
 
 int valid_fetch_refspec(const char *refspec);
+int valid_remote_name(const char *name);
 
 struct strvec;
 /*
index 32cc4a0c553b3e6f953be247bd593e07222dd5b5..0290b04891596bd4ebed0154c25b0713acd30d08 100644 (file)
@@ -44,7 +44,8 @@ struct options {
                from_promisor : 1,
 
                atomic : 1,
-               object_format : 1;
+               object_format : 1,
+               force_if_includes : 1;
        const struct git_hash_algo *hash_algo;
 };
 static struct options options;
@@ -131,6 +132,14 @@ static int set_option(const char *name, const char *value)
                string_list_append(&cas_options, val.buf);
                strbuf_release(&val);
                return 0;
+       } else if (!strcmp(name, TRANS_OPT_FORCE_IF_INCLUDES)) {
+               if (!strcmp(value, "true"))
+                       options.force_if_includes = 1;
+               else if (!strcmp(value, "false"))
+                       options.force_if_includes = 0;
+               else
+                       return -1;
+               return 0;
        } else if (!strcmp(name, "cloning")) {
                if (!strcmp(value, "true"))
                        options.cloning = 1;
@@ -1318,6 +1327,9 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)
                strvec_push(&args, cas_option->string);
        strvec_push(&args, url.buf);
 
+       if (options.force_if_includes)
+               strvec_push(&args, "--force-if-includes");
+
        strvec_push(&args, "--stdin");
        for (i = 0; i < nr_spec; i++)
                packet_buf_write(&preamble, "%s\n", specs[i]);
index 8be67f0892b47d0f31f9f1579c80ad6420721a7b..9f2450cb51b1257c2baaf0930c3b4ce2d677f693 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -284,7 +284,7 @@ static void read_branches_file(struct remote *remote)
        if (frag)
                *(frag++) = '\0';
        else
-               frag = (char *)git_default_branch_name();
+               frag = (char *)git_default_branch_name(0);
 
        add_url_alias(remote, strbuf_detach(&buf, NULL));
        refspec_appendf(&remote->fetch, "refs/heads/%s:refs/heads/%s",
@@ -355,7 +355,7 @@ static int handle_config(const char *key, const char *value, void *cb)
        remote = make_remote(name, namelen);
        remote->origin = REMOTE_CONFIG;
        if (current_config_scope() == CONFIG_SCOPE_LOCAL ||
-       current_config_scope() == CONFIG_SCOPE_WORKTREE)
+           current_config_scope() == CONFIG_SCOPE_WORKTREE)
                remote->configured_in_repo = 1;
        if (!strcmp(subkey, "mirror"))
                remote->mirror = git_config_bool(key, value);
@@ -1568,12 +1568,23 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
                 * with the remote-tracking branch to find the value
                 * to expect, but we did not have such a tracking
                 * branch.
+                *
+                * If the tip of the remote-tracking ref is unreachable
+                * from any reflog entry of its local ref indicating a
+                * possible update since checkout; reject the push.
                 */
                if (ref->expect_old_sha1) {
                        if (!oideq(&ref->old_oid, &ref->old_oid_expect))
                                reject_reason = REF_STATUS_REJECT_STALE;
+                       else if (ref->check_reachable && ref->unreachable)
+                               reject_reason =
+                                       REF_STATUS_REJECT_REMOTE_UPDATED;
                        else
-                               /* If the ref isn't stale then force the update. */
+                               /*
+                                * If the ref isn't stale, and is reachable
+                                * from from one of the reflog entries of
+                                * the local branch, force the update.
+                                */
                                force_ref_update = 1;
                }
 
@@ -2195,7 +2206,8 @@ struct ref *guess_remote_head(const struct ref *head,
 
        /* If a remote branch exists with the default branch name, let's use it. */
        if (!all) {
-               char *ref = xstrfmt("refs/heads/%s", git_default_branch_name());
+               char *ref = xstrfmt("refs/heads/%s",
+                                   git_default_branch_name(0));
 
                r = find_ref_by_name(refs, ref);
                free(ref);
@@ -2351,12 +2363,13 @@ int is_empty_cas(const struct push_cas_option *cas)
 
 /*
  * Look at remote.fetch refspec and see if we have a remote
- * tracking branch for the refname there.  Fill its current
- * value in sha1[].
+ * tracking branch for the refname there. Fill the name of
+ * the remote-tracking branch in *dst_refname, and the name
+ * of the commit object at its tip in oid[].
  * If we cannot do so, return negative to signal an error.
  */
 static int remote_tracking(struct remote *remote, const char *refname,
-                          struct object_id *oid)
+                          struct object_id *oid, char **dst_refname)
 {
        char *dst;
 
@@ -2365,9 +2378,150 @@ static int remote_tracking(struct remote *remote, const char *refname,
                return -1; /* no tracking ref for refname at remote */
        if (read_ref(dst, oid))
                return -1; /* we know what the tracking ref is but we cannot read it */
+
+       *dst_refname = dst;
        return 0;
 }
 
+/*
+ * The struct "reflog_commit_array" and related helper functions
+ * are used for collecting commits into an array during reflog
+ * traversals in "check_and_collect_until()".
+ */
+struct reflog_commit_array {
+       struct commit **item;
+       size_t nr, alloc;
+};
+
+#define REFLOG_COMMIT_ARRAY_INIT { NULL, 0, 0 }
+
+/* Append a commit to the array. */
+static void append_commit(struct reflog_commit_array *arr,
+                         struct commit *commit)
+{
+       ALLOC_GROW(arr->item, arr->nr + 1, arr->alloc);
+       arr->item[arr->nr++] = commit;
+}
+
+/* Free and reset the array. */
+static void free_commit_array(struct reflog_commit_array *arr)
+{
+       FREE_AND_NULL(arr->item);
+       arr->nr = arr->alloc = 0;
+}
+
+struct check_and_collect_until_cb_data {
+       struct commit *remote_commit;
+       struct reflog_commit_array *local_commits;
+       timestamp_t remote_reflog_timestamp;
+};
+
+/* Get the timestamp of the latest entry. */
+static int peek_reflog(struct object_id *o_oid, struct object_id *n_oid,
+                      const char *ident, timestamp_t timestamp,
+                      int tz, const char *message, void *cb_data)
+{
+       timestamp_t *ts = cb_data;
+       *ts = timestamp;
+       return 1;
+}
+
+static int check_and_collect_until(struct object_id *o_oid,
+                                  struct object_id *n_oid,
+                                  const char *ident, timestamp_t timestamp,
+                                  int tz, const char *message, void *cb_data)
+{
+       struct commit *commit;
+       struct check_and_collect_until_cb_data *cb = cb_data;
+
+       /* An entry was found. */
+       if (oideq(n_oid, &cb->remote_commit->object.oid))
+               return 1;
+
+       if ((commit = lookup_commit_reference(the_repository, n_oid)))
+               append_commit(cb->local_commits, commit);
+
+       /*
+        * If the reflog entry timestamp is older than the remote ref's
+        * latest reflog entry, there is no need to check or collect
+        * entries older than this one.
+        */
+       if (timestamp < cb->remote_reflog_timestamp)
+               return -1;
+
+       return 0;
+}
+
+#define MERGE_BASES_BATCH_SIZE 8
+
+/*
+ * Iterate through the reflog of the local ref to check if there is an entry
+ * for the given remote-tracking ref; runs until the timestamp of an entry is
+ * older than latest timestamp of remote-tracking ref's reflog. Any commits
+ * are that seen along the way are collected into an array to check if the
+ * remote-tracking ref is reachable from any of them.
+ */
+static int is_reachable_in_reflog(const char *local, const struct ref *remote)
+{
+       timestamp_t date;
+       struct commit *commit;
+       struct commit **chunk;
+       struct check_and_collect_until_cb_data cb;
+       struct reflog_commit_array arr = REFLOG_COMMIT_ARRAY_INIT;
+       size_t size = 0;
+       int ret = 0;
+
+       commit = lookup_commit_reference(the_repository, &remote->old_oid);
+       if (!commit)
+               goto cleanup_return;
+
+       /*
+        * Get the timestamp from the latest entry
+        * of the remote-tracking ref's reflog.
+        */
+       for_each_reflog_ent_reverse(remote->tracking_ref, peek_reflog, &date);
+
+       cb.remote_commit = commit;
+       cb.local_commits = &arr;
+       cb.remote_reflog_timestamp = date;
+       ret = for_each_reflog_ent_reverse(local, check_and_collect_until, &cb);
+
+       /* We found an entry in the reflog. */
+       if (ret > 0)
+               goto cleanup_return;
+
+       /*
+        * Check if the remote commit is reachable from any
+        * of the commits in the collected array, in batches.
+        */
+       for (chunk = arr.item; chunk < arr.item + arr.nr; chunk += size) {
+               size = arr.item + arr.nr - chunk;
+               if (MERGE_BASES_BATCH_SIZE < size)
+                       size = MERGE_BASES_BATCH_SIZE;
+
+               if ((ret = in_merge_bases_many(commit, size, chunk)))
+                       break;
+       }
+
+cleanup_return:
+       free_commit_array(&arr);
+       return ret;
+}
+
+/*
+ * Check for reachability of a remote-tracking
+ * ref in the reflog entries of its local ref.
+ */
+static void check_if_includes_upstream(struct ref *remote)
+{
+       struct ref *local = get_local_ref(remote->name);
+       if (!local)
+               return;
+
+       if (is_reachable_in_reflog(local->name, remote) <= 0)
+               remote->unreachable = 1;
+}
+
 static void apply_cas(struct push_cas_option *cas,
                      struct remote *remote,
                      struct ref *ref)
@@ -2382,8 +2536,12 @@ static void apply_cas(struct push_cas_option *cas,
                ref->expect_old_sha1 = 1;
                if (!entry->use_tracking)
                        oidcpy(&ref->old_oid_expect, &entry->expect);
-               else if (remote_tracking(remote, ref->name, &ref->old_oid_expect))
+               else if (remote_tracking(remote, ref->name,
+                                        &ref->old_oid_expect,
+                                        &ref->tracking_ref))
                        oidclr(&ref->old_oid_expect);
+               else
+                       ref->check_reachable = cas->use_force_if_includes;
                return;
        }
 
@@ -2392,8 +2550,12 @@ static void apply_cas(struct push_cas_option *cas,
                return;
 
        ref->expect_old_sha1 = 1;
-       if (remote_tracking(remote, ref->name, &ref->old_oid_expect))
+       if (remote_tracking(remote, ref->name,
+                           &ref->old_oid_expect,
+                           &ref->tracking_ref))
                oidclr(&ref->old_oid_expect);
+       else
+               ref->check_reachable = cas->use_force_if_includes;
 }
 
 void apply_push_cas(struct push_cas_option *cas,
@@ -2401,6 +2563,15 @@ void apply_push_cas(struct push_cas_option *cas,
                    struct ref *remote_refs)
 {
        struct ref *ref;
-       for (ref = remote_refs; ref; ref = ref->next)
+       for (ref = remote_refs; ref; ref = ref->next) {
                apply_cas(cas, remote, ref);
+
+               /*
+                * If "compare-and-swap" is in "use_tracking[_for_rest]"
+                * mode, and if "--force-if-includes" was specified, run
+                * the check.
+                */
+               if (ref->check_reachable)
+                       check_if_includes_upstream(ref);
+       }
 }
index d0e3f51574c11423ec8b8d17ca373eddc13ae753..3211abdf05ceef275309053af0dafc06f51fbb13 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -107,12 +107,20 @@ struct ref {
        struct object_id new_oid;
        struct object_id old_oid_expect; /* used by expect-old */
        char *symref;
+       char *tracking_ref;
        unsigned int
                force:1,
                forced_update:1,
                expect_old_sha1:1,
                exact_oid:1,
-               deletion:1;
+               deletion:1,
+               /* Need to check if local reflog reaches the remote tip. */
+               check_reachable:1,
+               /*
+                * Store the result of the check enabled by "check_reachable";
+                * implies the local reflog does not reach the remote tip.
+                */
+               unreachable:1;
 
        enum {
                REF_NOT_MATCHED = 0, /* initial value */
@@ -142,6 +150,7 @@ struct ref {
                REF_STATUS_REJECT_NEEDS_FORCE,
                REF_STATUS_REJECT_STALE,
                REF_STATUS_REJECT_SHALLOW,
+               REF_STATUS_REJECT_REMOTE_UPDATED,
                REF_STATUS_UPTODATE,
                REF_STATUS_REMOTE_REJECT,
                REF_STATUS_EXPECTING_REPORT,
@@ -348,6 +357,7 @@ struct ref *get_stale_heads(struct refspec *rs, struct ref *fetch_map);
 
 struct push_cas_option {
        unsigned use_tracking_for_rest:1;
+       unsigned use_force_if_includes:1;
        struct push_cas {
                struct object_id expect;
                unsigned use_tracking:1;
index 88ccce2036b611f7ea1e6d8ac538f9ee4e155395..f7fff0f5ab837e05cd369ed7630e8e2648e9aba8 100644 (file)
@@ -1,6 +1,7 @@
 #include "cache.h"
 #include "config.h"
 #include "repository.h"
+#include "midx.h"
 
 #define UPDATE_DEFAULT_BOOL(s,v) do { if (s == -1) { s = v; } } while(0)
 
@@ -52,6 +53,11 @@ void prepare_repo_settings(struct repository *r)
                r->settings.pack_use_sparse = value;
        UPDATE_DEFAULT_BOOL(r->settings.pack_use_sparse, 1);
 
+       value = git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0);
+       if (value || !repo_config_get_bool(r, "core.multipackindex", &value))
+               r->settings.core_multi_pack_index = value;
+       UPDATE_DEFAULT_BOOL(r->settings.core_multi_pack_index, 1);
+
        if (!repo_config_get_bool(r, "feature.manyfiles", &value) && value) {
                UPDATE_DEFAULT_BOOL(r->settings.index_version, 4);
                UPDATE_DEFAULT_BOOL(r->settings.core_untracked_cache, UNTRACKED_CACHE_WRITE);
index bacf843d460d2ff8a28511288055dc12dfbb53c6..b385ca3c94b62b2095b0ddb1b2b7adcce037da9a 100644 (file)
@@ -39,6 +39,8 @@ struct repo_settings {
 
        int pack_use_sparse;
        enum fetch_negotiation_setting fetch_negotiation_algorithm;
+
+       int core_multi_pack_index;
 };
 
 struct repository {
index aa62212040814e29d17b8d1d7cafc15d1d50612d..9dff845bed6baa21c6d540657356d37710a7a433 100644 (file)
@@ -124,11 +124,6 @@ static int path_and_oids_cmp(const void *hashmap_cmp_fn_data,
        return strcmp(e1->path, e2->path);
 }
 
-static void paths_and_oids_init(struct hashmap *map)
-{
-       hashmap_init(map, path_and_oids_cmp, NULL, 0);
-}
-
 static void paths_and_oids_clear(struct hashmap *map)
 {
        struct hashmap_iter iter;
@@ -139,7 +134,7 @@ static void paths_and_oids_clear(struct hashmap *map)
                free(entry->path);
        }
 
-       hashmap_free_entries(map, struct path_and_oids_entry, ent);
+       hashmap_clear_and_free(map, struct path_and_oids_entry, ent);
 }
 
 static void paths_and_oids_insert(struct hashmap *map,
@@ -213,7 +208,7 @@ void mark_trees_uninteresting_sparse(struct repository *r,
                                     struct oidset *trees)
 {
        unsigned has_interesting = 0, has_uninteresting = 0;
-       struct hashmap map;
+       struct hashmap map = HASHMAP_INIT(path_and_oids_cmp, NULL);
        struct hashmap_iter map_iter;
        struct path_and_oids_entry *entry;
        struct object_id *oid;
@@ -237,8 +232,6 @@ void mark_trees_uninteresting_sparse(struct repository *r,
        if (!has_uninteresting || !has_interesting)
                return;
 
-       paths_and_oids_init(&map);
-
        oidset_iter_init(trees, &iter);
        while ((oid = oidset_iter_next(&iter))) {
                struct tree *tree = lookup_tree(r, oid);
@@ -1834,7 +1827,6 @@ void repo_init_revisions(struct repository *r,
        revs->commit_format = CMIT_FMT_DEFAULT;
        revs->expand_tabs_in_log_default = 8;
 
-       init_grep_defaults(revs->repo);
        grep_init(&revs->grep_filter, revs->repo, prefix);
        revs->grep_filter.status_only = 1;
 
index f6bf860d19e5a2997193c25873a5ba82e030f68b..086ff10280db586f2c714f989b10e4e8b082cf03 100644 (file)
@@ -238,6 +238,7 @@ struct rev_info {
        const char      *extra_headers;
        const char      *log_reencode;
        const char      *subject_prefix;
+       int             patch_name_max;
        int             no_inline;
        int             show_log_size;
        struct string_list *mailmap;
index 2ee59acdc8c828ad81ccb7526bd7f23fc460d095..ea4d0fb4b154c89a0fcd12d29e41ffcbb2af0302 100644 (file)
@@ -7,6 +7,7 @@
 #include "strbuf.h"
 #include "string-list.h"
 #include "quote.h"
+#include "config.h"
 
 void child_process_init(struct child_process *child)
 {
@@ -1868,8 +1869,13 @@ int run_processes_parallel_tr2(int n, get_next_task_fn get_next_task,
 
 int run_auto_maintenance(int quiet)
 {
+       int enabled;
        struct child_process maint = CHILD_PROCESS_INIT;
 
+       if (!git_config_get_bool("maintenance.auto", &enabled) &&
+           !enabled)
+               return 0;
+
        maint.git_cmd = 1;
        strvec_pushl(&maint.args, "maintenance", "run", "--auto", NULL);
        strvec_push(&maint.args, quiet ? "--quiet" : "--no-quiet");
index c9698070fca18e403add1576ae9e1d0e818e16e7..9045f8a082bcd62c8ee116dc235561574ed35326 100644 (file)
@@ -85,6 +85,7 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *extra, struc
        po.in = -1;
        po.out = args->stateless_rpc ? -1 : fd;
        po.git_cmd = 1;
+       po.clean_on_exit = 1;
        if (start_command(&po))
                die_errno("git pack-objects failed");
 
@@ -299,6 +300,7 @@ static int check_to_send_update(const struct ref *ref, const struct send_pack_ar
        case REF_STATUS_REJECT_FETCH_FIRST:
        case REF_STATUS_REJECT_NEEDS_FORCE:
        case REF_STATUS_REJECT_STALE:
+       case REF_STATUS_REJECT_REMOTE_UPDATED:
        case REF_STATUS_REJECT_NODELETE:
                return CHECK_REF_STATUS_REJECTED;
        case REF_STATUS_UPTODATE:
@@ -423,6 +425,7 @@ int send_pack(struct send_pack_args *args,
        int use_sideband = 0;
        int quiet_supported = 0;
        int agent_supported = 0;
+       int advertise_sid = 0;
        int use_atomic = 0;
        int atomic_supported = 0;
        int use_push_options = 0;
@@ -434,6 +437,8 @@ int send_pack(struct send_pack_args *args,
        const char *push_cert_nonce = NULL;
        struct packet_reader reader;
 
+       git_config_get_bool("transfer.advertisesid", &advertise_sid);
+
        /* Does the other end support the reporting? */
        if (server_supports("report-status-v2"))
                status_report = 2;
@@ -449,6 +454,8 @@ int send_pack(struct send_pack_args *args,
                quiet_supported = 1;
        if (server_supports("agent"))
                agent_supported = 1;
+       if (!server_supports("session-id"))
+               advertise_sid = 0;
        if (server_supports("no-thin"))
                args->use_thin_pack = 0;
        if (server_supports("atomic"))
@@ -505,6 +512,8 @@ int send_pack(struct send_pack_args *args,
                strbuf_addf(&cap_buf, " object-format=%s", the_hash_algo->name);
        if (agent_supported)
                strbuf_addf(&cap_buf, " agent=%s", git_user_agent_sanitized());
+       if (advertise_sid)
+               strbuf_addf(&cap_buf, " session-id=%s", trace2_session_id());
 
        /*
         * NEEDSWORK: why does delete-refs have to be so specific to
index d76cbded00d0d39f9357861066a9670c8ed046ac..8909a467700c506f7068ed566aa7813c093157fd 100644 (file)
@@ -14,7 +14,8 @@
 #include "diff.h"
 #include "revision.h"
 #include "rerere.h"
-#include "merge-recursive.h"
+#include "merge-ort.h"
+#include "merge-ort-wrappers.h"
 #include "refs.h"
 #include "strvec.h"
 #include "quote.h"
@@ -204,6 +205,20 @@ static int git_sequencer_config(const char *k, const char *v, void *cb)
                return 0;
        }
 
+       if (!opts->default_strategy && !strcmp(k, "pull.twohead")) {
+               int ret = git_config_string((const char**)&opts->default_strategy, k, v);
+               if (ret == 0) {
+                       /*
+                        * pull.twohead is allowed to be multi-valued; we only
+                        * care about the first value.
+                        */
+                       char *tmp = strchr(opts->default_strategy, ' ');
+                       if (tmp)
+                               *tmp = '\0';
+               }
+               return ret;
+       }
+
        status = git_gpg_config(k, v, NULL);
        if (status)
                return status;
@@ -314,9 +329,8 @@ int sequencer_remove_state(struct replay_opts *opts)
                }
        }
 
-       free(opts->committer_name);
-       free(opts->committer_email);
        free(opts->gpg_sign);
+       free(opts->default_strategy);
        free(opts->strategy);
        for (i = 0; i < opts->xopts_nr; i++)
                free(opts->xopts[i]);
@@ -595,8 +609,9 @@ static int do_recursive_merge(struct repository *r,
                              struct replay_opts *opts)
 {
        struct merge_options o;
+       struct merge_result result;
        struct tree *next_tree, *base_tree, *head_tree;
-       int clean;
+       int clean, show_output;
        int i;
        struct lock_file index_lock = LOCK_INIT;
 
@@ -620,12 +635,27 @@ static int do_recursive_merge(struct repository *r,
        for (i = 0; i < opts->xopts_nr; i++)
                parse_merge_opt(&o, opts->xopts[i]);
 
-       clean = merge_trees(&o,
-                           head_tree,
-                           next_tree, base_tree);
-       if (is_rebase_i(opts) && clean <= 0)
-               fputs(o.obuf.buf, stdout);
-       strbuf_release(&o.obuf);
+       if (opts->strategy && !strcmp(opts->strategy, "ort")) {
+               memset(&result, 0, sizeof(result));
+               merge_incore_nonrecursive(&o, base_tree, head_tree, next_tree,
+                                           &result);
+               show_output = !is_rebase_i(opts) || !result.clean;
+               /*
+                * TODO: merge_switch_to_result will update index/working tree;
+                * we only really want to do that if !result.clean || this is
+                * the final patch to be picked.  But determining this is the
+                * final patch would take some work, and "head_tree" would need
+                * to be replace with the tree the index matched before we
+                * started doing any picks.
+                */
+               merge_switch_to_result(&o, head_tree, &result, 1, show_output);
+               clean = result.clean;
+       } else {
+               clean = merge_trees(&o, head_tree, next_tree, base_tree);
+               if (is_rebase_i(opts) && clean <= 0)
+                       fputs(o.obuf.buf, stdout);
+               strbuf_release(&o.obuf);
+       }
        if (clean < 0) {
                rollback_lock_file(&index_lock);
                return clean;
@@ -1460,8 +1490,8 @@ static int try_to_commit(struct repository *r,
                } else {
                        reset_ident_date();
                }
-               committer = fmt_ident(opts->committer_name,
-                                     opts->committer_email,
+               committer = fmt_ident(getenv("GIT_COMMITTER_NAME"),
+                                     getenv("GIT_COMMITTER_EMAIL"),
                                      WANT_COMMITTER_IDENT,
                                      opts->ignore_date ? NULL : date.buf,
                                      IDENT_STRICT);
@@ -1991,7 +2021,10 @@ static int do_pick_commit(struct repository *r,
 
        if (is_rebase_i(opts) && write_author_script(msg.message) < 0)
                res = -1;
-       else if (!opts->strategy || !strcmp(opts->strategy, "recursive") || command == TODO_REVERT) {
+       else if (!opts->strategy ||
+                !strcmp(opts->strategy, "recursive") ||
+                !strcmp(opts->strategy, "ort") ||
+                command == TODO_REVERT) {
                res = do_recursive_merge(r, base, next, base_label, next_label,
                                         &head, &msgbuf, opts);
                if (res < 0)
@@ -2653,7 +2686,7 @@ static int read_populate_opts(struct replay_opts *opts)
                }
 
                if (read_oneliner(&buf, rebase_path_squash_onto(), 0)) {
-                       if (get_oid_hex(buf.buf, &opts->squash_onto) < 0) {
+                       if (get_oid_committish(buf.buf, &opts->squash_onto) < 0) {
                                ret = error(_("unusable squash-onto"));
                                goto done_rebase_i;
                        }
@@ -2692,7 +2725,7 @@ static void write_strategy_opts(struct replay_opts *opts)
 }
 
 int write_basic_state(struct replay_opts *opts, const char *head_name,
-                     struct commit *onto, const char *orig_head)
+                     struct commit *onto, const struct object_id *orig_head)
 {
        if (head_name)
                write_file(rebase_path_head_name(), "%s\n", head_name);
@@ -2700,7 +2733,8 @@ int write_basic_state(struct replay_opts *opts, const char *head_name,
                write_file(rebase_path_onto(), "%s\n",
                           oid_to_hex(&onto->object.oid));
        if (orig_head)
-               write_file(rebase_path_orig_head(), "%s\n", orig_head);
+               write_file(rebase_path_orig_head(), "%s\n",
+                          oid_to_hex(orig_head));
 
        if (opts->quiet)
                write_file(rebase_path_quiet(), "%s", "");
@@ -3485,7 +3519,9 @@ static int do_merge(struct repository *r,
        struct commit_list *bases, *j, *reversed = NULL;
        struct commit_list *to_merge = NULL, **tail = &to_merge;
        const char *strategy = !opts->xopts_nr &&
-               (!opts->strategy || !strcmp(opts->strategy, "recursive")) ?
+               (!opts->strategy ||
+                !strcmp(opts->strategy, "recursive") ||
+                !strcmp(opts->strategy, "ort")) ?
                NULL : opts->strategy;
        struct merge_options o;
        int merge_arg_len, oneline_offset, can_fast_forward, ret, k;
@@ -3677,7 +3713,9 @@ static int do_merge(struct repository *r,
                strvec_push(&cmd.args, "-F");
                strvec_push(&cmd.args, git_path_merge_msg(r));
                if (opts->gpg_sign)
-                       strvec_push(&cmd.args, opts->gpg_sign);
+                       strvec_pushf(&cmd.args, "-S%s", opts->gpg_sign);
+               else
+                       strvec_push(&cmd.args, "--no-gpg-sign");
 
                /* Add the tips to be merged */
                for (j = to_merge; j; j = j->next)
@@ -3689,7 +3727,6 @@ static int do_merge(struct repository *r,
                                NULL, 0);
                rollback_lock_file(&lock);
 
-               rollback_lock_file(&lock);
                ret = run_command(&cmd);
 
                /* force re-reading of the cache */
@@ -3722,7 +3759,20 @@ static int do_merge(struct repository *r,
        o.branch2 = ref_name.buf;
        o.buffer_output = 2;
 
-       ret = merge_recursive(&o, head_commit, merge_commit, reversed, &i);
+       if (opts->strategy && !strcmp(opts->strategy, "ort")) {
+               /*
+                * TODO: Should use merge_incore_recursive() and
+                * merge_switch_to_result(), skipping the call to
+                * merge_switch_to_result() when we don't actually need to
+                * update the index and working copy immediately.
+                */
+               ret = merge_ort_recursive(&o,
+                                         head_commit, merge_commit, reversed,
+                                         &i);
+       } else {
+               ret = merge_recursive(&o, head_commit, merge_commit, reversed,
+                                     &i);
+       }
        if (ret <= 0)
                fputs(o.obuf.buf, stdout);
        strbuf_release(&o.obuf);
@@ -3965,21 +4015,17 @@ static int run_git_checkout(struct repository *r, struct replay_opts *opts,
 
 static int checkout_onto(struct repository *r, struct replay_opts *opts,
                         const char *onto_name, const struct object_id *onto,
-                        const char *orig_head)
+                        const struct object_id *orig_head)
 {
-       struct object_id oid;
        const char *action = reflog_message(opts, "start", "checkout %s", onto_name);
 
-       if (get_oid(orig_head, &oid))
-               return error(_("%s: not a valid OID"), orig_head);
-
        if (run_git_checkout(r, opts, oid_to_hex(onto), action)) {
                apply_autostash(rebase_path_autostash());
                sequencer_remove_state(opts);
                return error(_("could not detach HEAD"));
        }
 
-       return update_ref(NULL, "ORIG_HEAD", &oid, NULL, 0, UPDATE_REFS_MSG_ON_ERR);
+       return update_ref(NULL, "ORIG_HEAD", orig_head, NULL, 0, UPDATE_REFS_MSG_ON_ERR);
 }
 
 static int stopped_at_head(struct repository *r)
@@ -4467,22 +4513,6 @@ static int commit_staged_changes(struct repository *r,
        return 0;
 }
 
-static int init_committer(struct replay_opts *opts)
-{
-       struct ident_split id;
-       const char *committer;
-
-       committer = git_committer_info(IDENT_STRICT);
-       if (split_ident_line(&id, committer, strlen(committer)) < 0)
-               return error(_("invalid committer '%s'"), committer);
-       opts->committer_name =
-               xmemdupz(id.name_begin, id.name_end - id.name_begin);
-       opts->committer_email =
-               xmemdupz(id.mail_begin, id.mail_end - id.mail_begin);
-
-       return 0;
-}
-
 int sequencer_continue(struct repository *r, struct replay_opts *opts)
 {
        struct todo_list todo_list = TODO_LIST_INIT;
@@ -4494,9 +4524,6 @@ int sequencer_continue(struct repository *r, struct replay_opts *opts)
        if (read_populate_opts(opts))
                return -1;
        if (is_rebase_i(opts)) {
-               if (opts->committer_date_is_author_date && init_committer(opts))
-                       return -1;
-
                if ((res = read_populate_todo(r, &todo_list, opts)))
                        goto release_todo_list;
 
@@ -5058,7 +5085,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
 
        oidmap_free(&commit2todo, 1);
        oidmap_free(&state.commit2label, 1);
-       hashmap_free_entries(&state.labels, struct labels_entry, entry);
+       hashmap_clear_and_free(&state.labels, struct labels_entry, entry);
        strbuf_release(&state.buf);
 
        return 0;
@@ -5314,7 +5341,7 @@ static int skip_unnecessary_picks(struct repository *r,
 
 int complete_action(struct repository *r, struct replay_opts *opts, unsigned flags,
                    const char *shortrevisions, const char *onto_name,
-                   struct commit *onto, const char *orig_head,
+                   struct commit *onto, const struct object_id *orig_head,
                    struct string_list *commands, unsigned autosquash,
                    struct todo_list *todo_list)
 {
@@ -5391,9 +5418,6 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
 
        res = -1;
 
-       if (opts->committer_date_is_author_date && init_committer(opts))
-               goto cleanup;
-
        if (checkout_onto(r, opts, onto_name, &oid, orig_head))
                goto cleanup;
 
@@ -5577,7 +5601,7 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)
        for (i = 0; i < todo_list->nr; i++)
                free(subjects[i]);
        free(subjects);
-       hashmap_free_entries(&subject2item, struct subject2item_entry, entry);
+       hashmap_clear_and_free(&subject2item, struct subject2item_entry, entry);
 
        clear_commit_todo_item(&commit_todo);
 
index b2a501e445316fc5a6d5befb341be3cfc1c74077..f8b2e4ab8527b5742cbd4b9beff246938f421c3d 100644 (file)
@@ -50,13 +50,12 @@ struct replay_opts {
 
        int mainline;
 
-       char *committer_name;
-       char *committer_email;
        char *gpg_sign;
        enum commit_msg_cleanup_mode default_msg_cleanup;
        int explicit_cleanup;
 
        /* Merge strategy */
+       char *default_strategy;  /* from config options */
        char *strategy;
        char **xopts;
        size_t xopts_nr, xopts_alloc;
@@ -163,8 +162,9 @@ void todo_list_add_exec_commands(struct todo_list *todo_list,
                                 struct string_list *commands);
 int complete_action(struct repository *r, struct replay_opts *opts, unsigned flags,
                    const char *shortrevisions, const char *onto_name,
-                   struct commit *onto, const char *orig_head, struct string_list *commands,
-                   unsigned autosquash, struct todo_list *todo_list);
+                   struct commit *onto, const struct object_id *orig_head,
+                   struct string_list *commands, unsigned autosquash,
+                   struct todo_list *todo_list);
 int todo_list_rearrange_squash(struct todo_list *todo_list);
 
 /*
@@ -226,7 +226,7 @@ int read_author_script(const char *path, char **name, char **email, char **date,
                       int allow_missing);
 void parse_strategy_opts(struct replay_opts *opts, char *raw_opts);
 int write_basic_state(struct replay_opts *opts, const char *head_name,
-                     struct commit *onto, const char *orig_head);
+                     struct commit *onto, const struct object_id *orig_head);
 void sequencer_post_commit_cleanup(struct repository *r, int verbose);
 int sequencer_get_last_command(struct repository* r,
                               enum replay_action *action);
diff --git a/serve.c b/serve.c
index f6341206c4e30122c3cb819ef8c01f6d2be06d22..eec2fe6f294cd1c0c5e8a76b66b09d78dd4e22da 100644 (file)
--- a/serve.c
+++ b/serve.c
@@ -8,6 +8,8 @@
 #include "serve.h"
 #include "upload-pack.h"
 
+static int advertise_sid;
+
 static int always_advertise(struct repository *r,
                            struct strbuf *value)
 {
@@ -30,6 +32,15 @@ static int object_format_advertise(struct repository *r,
        return 1;
 }
 
+static int session_id_advertise(struct repository *r, struct strbuf *value)
+{
+       if (!advertise_sid)
+               return 0;
+       if (value)
+               strbuf_addstr(value, trace2_session_id());
+       return 1;
+}
+
 struct protocol_capability {
        /*
         * The name of the capability.  The server uses this name when
@@ -66,6 +77,7 @@ static struct protocol_capability capabilities[] = {
        { "fetch", upload_pack_advertise, upload_pack_v2 },
        { "server-option", always_advertise, NULL },
        { "object-format", object_format_advertise, NULL },
+       { "session-id", session_id_advertise, NULL },
 };
 
 static void advertise_capabilities(void)
@@ -189,6 +201,7 @@ static int process_request(void)
        struct packet_reader reader;
        struct strvec keys = STRVEC_INIT;
        struct protocol_capability *command = NULL;
+       const char *client_sid;
 
        packet_reader_init(&reader, 0, NULL, 0,
                           PACKET_READ_CHOMP_NEWLINE |
@@ -252,6 +265,9 @@ static int process_request(void)
 
        check_algorithm(the_repository, &keys);
 
+       if (has_capability(&keys, "session-id", &client_sid))
+               trace2_data_string("transfer", NULL, "client-sid", client_sid);
+
        command->command(the_repository, &keys, &reader);
 
        strvec_clear(&keys);
@@ -261,6 +277,8 @@ static int process_request(void)
 /* Main serve loop for protocol version 2 */
 void serve(struct serve_options *options)
 {
+       git_config_get_bool("transfer.advertisesid", &advertise_sid);
+
        if (options->advertise_capabilities || !options->stateless_rpc) {
                /* serve by default supports v2 */
                packet_write_fmt(1, "version 2\n");
index dd65bd5c681513c1f7c9bf908dc9f8675e24a829..c3c49d2fa5587a86766d82539bb87b298b1e40ed 100644 (file)
@@ -291,7 +291,7 @@ int mkdir_in_gitdir(const char *path)
        return adjust_shared_perm(path);
 }
 
-enum scld_error safe_create_leading_directories(char *path)
+static enum scld_error safe_create_leading_directories_1(char *path, int share)
 {
        char *next_component = path + offset_1st_component(path);
        enum scld_error ret = SCLD_OK;
@@ -337,7 +337,7 @@ enum scld_error safe_create_leading_directories(char *path)
                                ret = SCLD_VANISHED;
                        else
                                ret = SCLD_FAILED;
-               } else if (adjust_shared_perm(path)) {
+               } else if (share && adjust_shared_perm(path)) {
                        ret = SCLD_PERMS;
                }
                *slash = slash_character;
@@ -345,6 +345,16 @@ enum scld_error safe_create_leading_directories(char *path)
        return ret;
 }
 
+enum scld_error safe_create_leading_directories(char *path)
+{
+       return safe_create_leading_directories_1(path, 1);
+}
+
+enum scld_error safe_create_leading_directories_no_share(char *path)
+{
+       return safe_create_leading_directories_1(path, 0);
+}
+
 enum scld_error safe_create_leading_directories_const(const char *path)
 {
        int save_errno;
index 0a60662fa64b34a9b70c9c362fac02aa8c61083c..6f9e02673201ac111acd7f69e0388282de834ed5 100644 (file)
@@ -3,6 +3,7 @@
 #include "config.h"
 #include "sideband.h"
 #include "help.h"
+#include "pkt-line.h"
 
 struct keyword_entry {
        /*
@@ -114,7 +115,8 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n)
 #define ANSI_SUFFIX "\033[K"
 #define DUMB_SUFFIX "        "
 
-int demultiplex_sideband(const char *me, char *buf, int len,
+int demultiplex_sideband(const char *me, int status,
+                        char *buf, int len,
                         int die_on_error,
                         struct strbuf *scratch,
                         enum sideband_type *sideband_type)
@@ -130,17 +132,30 @@ int demultiplex_sideband(const char *me, char *buf, int len,
                        suffix = DUMB_SUFFIX;
        }
 
-       if (len == 0) {
-               *sideband_type = SIDEBAND_FLUSH;
-               goto cleanup;
-       }
-       if (len < 1) {
+       if (status == PACKET_READ_EOF) {
                strbuf_addf(scratch,
-                           "%s%s: protocol error: no band designator",
+                           "%s%s: unexpected disconnect while reading sideband packet",
                            scratch->len ? "\n" : "", me);
                *sideband_type = SIDEBAND_PROTOCOL_ERROR;
                goto cleanup;
        }
+
+       if (len < 0)
+               BUG("negative length on non-eof packet read");
+
+       if (len == 0) {
+               if (status == PACKET_READ_NORMAL) {
+                       strbuf_addf(scratch,
+                                   "%s%s: protocol error: missing sideband designator",
+                                   scratch->len ? "\n" : "", me);
+                       *sideband_type = SIDEBAND_PROTOCOL_ERROR;
+               } else {
+                       /* covers flush, delim, etc */
+                       *sideband_type = SIDEBAND_FLUSH;
+               }
+               goto cleanup;
+       }
+
        band = buf[0] & 0xff;
        buf[len] = '\0';
        len--;
@@ -190,7 +205,7 @@ int demultiplex_sideband(const char *me, char *buf, int len,
                return 0;
        case 1:
                *sideband_type = SIDEBAND_PRIMARY;
-               break;
+               return 1;
        default:
                strbuf_addf(scratch, "%s%s: protocol error: bad band #%d",
                            scratch->len ? "\n" : "", me, band);
index 227740a58e58bd25c4625bc1963106542bd99779..5a25331be55d30dbc6b4d777da3cf015118dcf3d 100644 (file)
@@ -18,8 +18,12 @@ enum sideband_type {
  *
  * scratch must be a struct strbuf allocated by the caller. It is used to store
  * progress messages split across multiple packets.
+ *
+ * The "status" parameter is a pkt-line response as returned by
+ * packet_read_with_status() (e.g., PACKET_READ_NORMAL).
  */
-int demultiplex_sideband(const char *me, char *buf, int len,
+int demultiplex_sideband(const char *me, int status,
+                        char *buf, int len,
                         int die_on_error,
                         struct strbuf *scratch,
                         enum sideband_type *sideband_type);
diff --git a/strmap.c b/strmap.c
new file mode 100644 (file)
index 0000000..4fb9f61
--- /dev/null
+++ b/strmap.c
@@ -0,0 +1,178 @@
+#include "git-compat-util.h"
+#include "strmap.h"
+#include "mem-pool.h"
+
+int cmp_strmap_entry(const void *hashmap_cmp_fn_data,
+                    const struct hashmap_entry *entry1,
+                    const struct hashmap_entry *entry2,
+                    const void *keydata)
+{
+       const struct strmap_entry *e1, *e2;
+
+       e1 = container_of(entry1, const struct strmap_entry, ent);
+       e2 = container_of(entry2, const struct strmap_entry, ent);
+       return strcmp(e1->key, e2->key);
+}
+
+static struct strmap_entry *find_strmap_entry(struct strmap *map,
+                                             const char *str)
+{
+       struct strmap_entry entry;
+       hashmap_entry_init(&entry.ent, strhash(str));
+       entry.key = str;
+       return hashmap_get_entry(&map->map, &entry, ent, NULL);
+}
+
+void strmap_init(struct strmap *map)
+{
+       strmap_init_with_options(map, NULL, 1);
+}
+
+void strmap_init_with_options(struct strmap *map,
+                             struct mem_pool *pool,
+                             int strdup_strings)
+{
+       hashmap_init(&map->map, cmp_strmap_entry, NULL, 0);
+       map->pool = pool;
+       map->strdup_strings = strdup_strings;
+}
+
+static void strmap_free_entries_(struct strmap *map, int free_values)
+{
+       struct hashmap_iter iter;
+       struct strmap_entry *e;
+
+       if (!map)
+               return;
+
+       if (!free_values && map->pool)
+               /* Memory other than util is owned by and freed with the pool */
+               return;
+
+       /*
+        * We need to iterate over the hashmap entries and free
+        * e->key and e->value ourselves; hashmap has no API to
+        * take care of that for us.  Since we're already iterating over
+        * the hashmap, though, might as well free e too and avoid the need
+        * to make some call into the hashmap API to do that.
+        */
+       hashmap_for_each_entry(&map->map, &iter, e, ent) {
+               if (free_values)
+                       free(e->value);
+               if (!map->pool)
+                       free(e);
+       }
+}
+
+void strmap_clear(struct strmap *map, int free_values)
+{
+       strmap_free_entries_(map, free_values);
+       hashmap_clear(&map->map);
+}
+
+void strmap_partial_clear(struct strmap *map, int free_values)
+{
+       strmap_free_entries_(map, free_values);
+       hashmap_partial_clear(&map->map);
+}
+
+static struct strmap_entry *create_entry(struct strmap *map,
+                                        const char *str,
+                                        void *data)
+{
+       struct strmap_entry *entry;
+
+       if (map->strdup_strings) {
+               if (!map->pool) {
+                       FLEXPTR_ALLOC_STR(entry, key, str);
+               } else {
+                       size_t len = st_add(strlen(str), 1); /* include NUL */
+                       entry = mem_pool_alloc(map->pool,
+                                              st_add(sizeof(*entry), len));
+                       memcpy(entry + 1, str, len);
+                       entry->key = (void *)(entry + 1);
+               }
+       } else if (!map->pool) {
+               entry = xmalloc(sizeof(*entry));
+       } else {
+               entry = mem_pool_alloc(map->pool, sizeof(*entry));
+       }
+       hashmap_entry_init(&entry->ent, strhash(str));
+       if (!map->strdup_strings)
+               entry->key = str;
+       entry->value = data;
+       return entry;
+}
+
+void *strmap_put(struct strmap *map, const char *str, void *data)
+{
+       struct strmap_entry *entry = find_strmap_entry(map, str);
+
+       if (entry) {
+               void *old = entry->value;
+               entry->value = data;
+               return old;
+       }
+
+       entry = create_entry(map, str, data);
+       hashmap_add(&map->map, &entry->ent);
+       return NULL;
+}
+
+struct strmap_entry *strmap_get_entry(struct strmap *map, const char *str)
+{
+       return find_strmap_entry(map, str);
+}
+
+void *strmap_get(struct strmap *map, const char *str)
+{
+       struct strmap_entry *entry = find_strmap_entry(map, str);
+       return entry ? entry->value : NULL;
+}
+
+int strmap_contains(struct strmap *map, const char *str)
+{
+       return find_strmap_entry(map, str) != NULL;
+}
+
+void strmap_remove(struct strmap *map, const char *str, int free_value)
+{
+       struct strmap_entry entry, *ret;
+       hashmap_entry_init(&entry.ent, strhash(str));
+       entry.key = str;
+       ret = hashmap_remove_entry(&map->map, &entry, ent, NULL);
+       if (!ret)
+               return;
+       if (free_value)
+               free(ret->value);
+       if (!map->pool)
+               free(ret);
+}
+
+void strintmap_incr(struct strintmap *map, const char *str, intptr_t amt)
+{
+       struct strmap_entry *entry = find_strmap_entry(&map->map, str);
+       if (entry) {
+               intptr_t *whence = (intptr_t*)&entry->value;
+               *whence += amt;
+       }
+       else
+               strintmap_set(map, str, map->default_value + amt);
+}
+
+int strset_add(struct strset *set, const char *str)
+{
+       /*
+        * Cannot use strmap_put() because it'll return NULL in both cases:
+        *   - cannot find str: NULL means "not found"
+        *   - does find str: NULL is the value associated with str
+        */
+       struct strmap_entry *entry = find_strmap_entry(&set->map, str);
+
+       if (entry)
+               return 0;
+
+       entry = create_entry(&set->map, str, NULL);
+       hashmap_add(&set->map.map, &entry->ent);
+       return 1;
+}
diff --git a/strmap.h b/strmap.h
new file mode 100644 (file)
index 0000000..1e152d8
--- /dev/null
+++ b/strmap.h
@@ -0,0 +1,268 @@
+#ifndef STRMAP_H
+#define STRMAP_H
+
+#include "hashmap.h"
+
+struct mem_pool;
+struct strmap {
+       struct hashmap map;
+       struct mem_pool *pool;
+       unsigned int strdup_strings:1;
+};
+
+struct strmap_entry {
+       struct hashmap_entry ent;
+       const char *key;
+       void *value;
+       /* strmap_entry may be allocated extra space to store the key at end */
+};
+
+int cmp_strmap_entry(const void *hashmap_cmp_fn_data,
+                    const struct hashmap_entry *entry1,
+                    const struct hashmap_entry *entry2,
+                    const void *keydata);
+
+#define STRMAP_INIT { \
+                       .map = HASHMAP_INIT(cmp_strmap_entry, NULL),  \
+                       .strdup_strings = 1,                          \
+                   }
+#define STRINTMAP_INIT { \
+                       .map = STRMAP_INIT,   \
+                       .default_value = 0,   \
+                      }
+#define STRSET_INIT { .map = STRMAP_INIT }
+
+/*
+ * Initialize the members of the strmap.  Any keys added to the strmap will
+ * be strdup'ed with their memory managed by the strmap.
+ */
+void strmap_init(struct strmap *map);
+
+/*
+ * Same as strmap_init, but for those who want to control the memory management
+ * carefully instead of using the default of strdup_strings=1 and pool=NULL.
+ */
+void strmap_init_with_options(struct strmap *map,
+                             struct mem_pool *pool,
+                             int strdup_strings);
+
+/*
+ * Remove all entries from the map, releasing any allocated resources.
+ */
+void strmap_clear(struct strmap *map, int free_values);
+
+/*
+ * Similar to strmap_clear() but leaves map->map->table allocated and
+ * pre-sized so that subsequent uses won't need as many rehashings.
+ */
+void strmap_partial_clear(struct strmap *map, int free_values);
+
+/*
+ * Insert "str" into the map, pointing to "data".
+ *
+ * If an entry for "str" already exists, its data pointer is overwritten, and
+ * the original data pointer returned. Otherwise, returns NULL.
+ */
+void *strmap_put(struct strmap *map, const char *str, void *data);
+
+/*
+ * Return the strmap_entry mapped by "str", or NULL if there is not such
+ * an item in map.
+ */
+struct strmap_entry *strmap_get_entry(struct strmap *map, const char *str);
+
+/*
+ * Return the data pointer mapped by "str", or NULL if the entry does not
+ * exist.
+ */
+void *strmap_get(struct strmap *map, const char *str);
+
+/*
+ * Return non-zero iff "str" is present in the map. This differs from
+ * strmap_get() in that it can distinguish entries with a NULL data pointer.
+ */
+int strmap_contains(struct strmap *map, const char *str);
+
+/*
+ * Remove the given entry from the strmap.  If the string isn't in the
+ * strmap, the map is not altered.
+ */
+void strmap_remove(struct strmap *map, const char *str, int free_value);
+
+/*
+ * Return how many entries the strmap has.
+ */
+static inline unsigned int strmap_get_size(struct strmap *map)
+{
+       return hashmap_get_size(&map->map);
+}
+
+/*
+ * Return whether the strmap is empty.
+ */
+static inline int strmap_empty(struct strmap *map)
+{
+       return strmap_get_size(map) == 0;
+}
+
+/*
+ * iterate through @map using @iter, @var is a pointer to a type strmap_entry
+ */
+#define strmap_for_each_entry(mystrmap, iter, var)     \
+       hashmap_for_each_entry(&(mystrmap)->map, iter, var, ent)
+
+
+/*
+ * strintmap:
+ *    A map of string -> int, typecasting the void* of strmap to an int.
+ *
+ * Primary differences:
+ *    1) Since the void* value is just an int in disguise, there is no value
+ *       to free.  (Thus one fewer argument to strintmap_clear)
+ *    2) strintmap_get() returns an int, or returns the default_value if the
+ *       key is not found in the strintmap.
+ *    3) No strmap_put() equivalent; strintmap_set() and strintmap_incr()
+ *       instead.
+ */
+
+struct strintmap {
+       struct strmap map;
+       int default_value;
+};
+
+#define strintmap_for_each_entry(mystrmap, iter, var)  \
+       strmap_for_each_entry(&(mystrmap)->map, iter, var)
+
+static inline void strintmap_init(struct strintmap *map, int default_value)
+{
+       strmap_init(&map->map);
+       map->default_value = default_value;
+}
+
+static inline void strintmap_init_with_options(struct strintmap *map,
+                                              int default_value,
+                                              struct mem_pool *pool,
+                                              int strdup_strings)
+{
+       strmap_init_with_options(&map->map, pool, strdup_strings);
+       map->default_value = default_value;
+}
+
+static inline void strintmap_clear(struct strintmap *map)
+{
+       strmap_clear(&map->map, 0);
+}
+
+static inline void strintmap_partial_clear(struct strintmap *map)
+{
+       strmap_partial_clear(&map->map, 0);
+}
+
+static inline int strintmap_contains(struct strintmap *map, const char *str)
+{
+       return strmap_contains(&map->map, str);
+}
+
+static inline void strintmap_remove(struct strintmap *map, const char *str)
+{
+       strmap_remove(&map->map, str, 0);
+}
+
+static inline int strintmap_empty(struct strintmap *map)
+{
+       return strmap_empty(&map->map);
+}
+
+static inline unsigned int strintmap_get_size(struct strintmap *map)
+{
+       return strmap_get_size(&map->map);
+}
+
+/*
+ * Returns the value for str in the map.  If str isn't found in the map,
+ * the map's default_value is returned.
+ */
+static inline int strintmap_get(struct strintmap *map, const char *str)
+{
+       struct strmap_entry *result = strmap_get_entry(&map->map, str);
+       if (!result)
+               return map->default_value;
+       return (intptr_t)result->value;
+}
+
+static inline void strintmap_set(struct strintmap *map, const char *str,
+                                intptr_t v)
+{
+       strmap_put(&map->map, str, (void *)v);
+}
+
+/*
+ * Increment the value for str by amt.  If str isn't in the map, add it and
+ * set its value to default_value + amt.
+ */
+void strintmap_incr(struct strintmap *map, const char *str, intptr_t amt);
+
+/*
+ * strset:
+ *    A set of strings.
+ *
+ * Primary differences with strmap:
+ *    1) The value is always NULL, and ignored.  As there is no value to free,
+ *       there is one fewer argument to strset_clear
+ *    2) No strset_get() because there is no value.
+ *    3) No strset_put(); use strset_add() instead.
+ */
+
+struct strset {
+       struct strmap map;
+};
+
+#define strset_for_each_entry(mystrset, iter, var)     \
+       strmap_for_each_entry(&(mystrset)->map, iter, var)
+
+static inline void strset_init(struct strset *set)
+{
+       strmap_init(&set->map);
+}
+
+static inline void strset_init_with_options(struct strset *set,
+                                           struct mem_pool *pool,
+                                           int strdup_strings)
+{
+       strmap_init_with_options(&set->map, pool, strdup_strings);
+}
+
+static inline void strset_clear(struct strset *set)
+{
+       strmap_clear(&set->map, 0);
+}
+
+static inline void strset_partial_clear(struct strset *set)
+{
+       strmap_partial_clear(&set->map, 0);
+}
+
+static inline int strset_contains(struct strset *set, const char *str)
+{
+       return strmap_contains(&set->map, str);
+}
+
+static inline void strset_remove(struct strset *set, const char *str)
+{
+       strmap_remove(&set->map, str, 0);
+}
+
+static inline int strset_empty(struct strset *set)
+{
+       return strmap_empty(&set->map);
+}
+
+static inline unsigned int strset_get_size(struct strset *set)
+{
+       return strmap_get_size(&set->map);
+}
+
+/* Returns 1 if str is added to the set; returns 0 if str was already in set */
+int strset_add(struct strset *set, const char *str);
+
+#endif /* STRMAP_H */
index c569e22aa3678bf694c080785f499d619b4d2e23..f50250556698231762092f4e4b6be68800c2089c 100644 (file)
@@ -103,8 +103,8 @@ static void submodule_cache_clear(struct submodule_cache *cache)
                                ent /* member name */)
                free_one_config(entry);
 
-       hashmap_free_entries(&cache->for_path, struct submodule_entry, ent);
-       hashmap_free_entries(&cache->for_name, struct submodule_entry, ent);
+       hashmap_clear_and_free(&cache->for_path, struct submodule_entry, ent);
+       hashmap_clear_and_free(&cache->for_name, struct submodule_entry, ent);
        cache->initialized = 0;
        cache->gitmodules_read = 0;
 }
index c83fd18861f31039bc14ec71a9a897b03359b2c7..882d26eee30b115f4c656e0ab5048f4e2e96319b 100644 (file)
@@ -34,6 +34,7 @@ CHAINLINTTMP_SQ = $(subst ','\'',$(CHAINLINTTMP))
 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
 TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
 THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
+TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
 CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
 CHAINLINT = sed -f chainlint.sed
 
@@ -81,17 +82,17 @@ test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
        test-lint-filenames
 
 test-lint-duplicates:
-       @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
+       @dups=`echo $(T) $(TPERF) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
                test -z "$$dups" || { \
                echo >&2 "duplicate test numbers:" $$dups; exit 1; }
 
 test-lint-executable:
-       @bad=`for i in $(T); do test -x "$$i" || echo $$i; done` && \
+       @bad=`for i in $(T) $(TPERF); do test -x "$$i" || echo $$i; done` && \
                test -z "$$bad" || { \
                echo >&2 "non-executable tests:" $$bad; exit 1; }
 
 test-lint-shell-syntax:
-       @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
+       @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS) $(TPERF)
 
 test-lint-filenames:
        @# We do *not* pass a glob to ls-files but use grep instead, to catch
index 2adaf7c2d2747a1426b11a8d75e0cac667232b60..c730a7077057d4104a8d4f18737309a2e2dcbdf4 100644 (file)
--- a/t/README
+++ b/t/README
@@ -258,16 +258,21 @@ For an individual test suite --run could be used to specify that
 only some tests should be run or that some tests should be
 excluded from a run.
 
-The argument for --run is a list of individual test numbers or
-ranges with an optional negation prefix that define what tests in
-a test suite to include in the run.  A range is two numbers
-separated with a dash and matches a range of tests with both ends
-been included.  You may omit the first or the second number to
-mean "from the first test" or "up to the very last test"
-respectively.
-
-Optional prefix of '!' means that the test or a range of tests
-should be excluded from the run.
+The argument for --run, <test-selector>, is a list of description
+substrings or globs or individual test numbers or ranges with an
+optional negation prefix (of '!') that define what tests in a test
+suite to include (or exclude, if negated) in the run.  A range is two
+numbers separated with a dash and matches a range of tests with both
+ends been included.  You may omit the first or the second number to
+mean "from the first test" or "up to the very last test" respectively.
+
+The argument to --run is split on commas into separate strings,
+numbers, and ranges, and picks all tests that match any of the
+individual selection criteria.  If the substring of the description
+text that you want to match includes a comma, use the glob character
+'?' instead.  For example --run='rebase,merge?cherry-pick' would match
+on all tests that match either the glob *rebase* or the glob
+*merge?cherry-pick*.
 
 If --run starts with an unprefixed number or range the initial
 set of tests to run is empty. If the first item starts with '!'
@@ -275,9 +280,6 @@ all the tests are added to the initial set.  After initial set is
 determined every test number or range is added or excluded from
 the set one by one, from left to right.
 
-Individual numbers or ranges could be separated either by a space
-or a comma.
-
 For example, to run only tests up to a specific test (21), one
 could do this:
 
@@ -290,7 +292,7 @@ or this:
 Common case is to run several setup tests (1, 2, 3) and then a
 specific test (21) that relies on that setup:
 
-    $ sh ./t9200-git-cvsexport-commit.sh --run='1 2 3 21'
+    $ sh ./t9200-git-cvsexport-commit.sh --run='1,2,3,21'
 
 or:
 
@@ -298,17 +300,17 @@ or:
 
 or:
 
-    $ sh ./t9200-git-cvsexport-commit.sh --run='-3 21'
+    $ sh ./t9200-git-cvsexport-commit.sh --run='-3,21'
 
 As noted above, the test set is built by going through the items
 from left to right, so this:
 
-    $ sh ./t9200-git-cvsexport-commit.sh --run='1-4 !3'
+    $ sh ./t9200-git-cvsexport-commit.sh --run='1-4,!3'
 
 will run tests 1, 2, and 4.  Items that come later have higher
 precedence.  It means that this:
 
-    $ sh ./t9200-git-cvsexport-commit.sh --run='!3 1-4'
+    $ sh ./t9200-git-cvsexport-commit.sh --run='!3,1-4'
 
 would just run tests from 1 to 4, including 3.
 
@@ -317,6 +319,18 @@ test in the test suite except from 7 up to 11:
 
     $ sh ./t9200-git-cvsexport-commit.sh --run='!7-11'
 
+Sometimes there may be multiple tests with e.g. "setup" in their name
+that are needed and rather than figuring out the number for all of them
+we can just use "setup" as a substring/glob to match against the test
+description:
+
+    $ sh ./t0050-filesystem.sh --run=setup,9-11
+
+or one could select both the setup tests and the rename ones (assuming all
+relevant tests had those words in their descriptions):
+
+    $ sh ./t0050-filesystem.sh --run=setup,rename
+
 Some tests in a test suite rely on the previous tests performing
 certain actions, specifically some tests are designated as
 "setup" test, so you cannot _arbitrarily_ disable one test and
index d933af571474f365c8e6ad478f5c833f3b67b315..3aee61d2cc1fa6bc97976fff30d3516f55abab80 100644 (file)
@@ -479,6 +479,24 @@ test_expect_success 'blame -L ^:RE (absolute: end-of-file)' '
        check_count -f hello.c -L$n -L^:ma.. F 4 G 1 H 1
 '
 
+test_expect_success 'setup -L :funcname with userdiff driver' '
+       echo "fortran-* diff=fortran" >.gitattributes &&
+       fortran_file=fortran-external-function &&
+       orig_file="$TEST_DIRECTORY/t4018/$fortran_file" &&
+       cp $orig_file . &&
+       git add $fortran_file &&
+       GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \
+       git commit -m "add fortran file" &&
+       sed -e "s/ChangeMe/IWasChanged/" <"$orig_file" >$fortran_file &&
+       git add $fortran_file &&
+       GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \
+       git commit -m "change fortran file"
+'
+
+test_expect_success 'blame -L :funcname with userdiff driver' '
+       check_count -f fortran-external-function -L:RIGHT A 7 B 1
+'
+
 test_expect_success 'setup incremental' '
        (
        GIT_AUTHOR_NAME=I &&
diff --git a/t/helper/test-crontab.c b/t/helper/test-crontab.c
new file mode 100644 (file)
index 0000000..e7c0137
--- /dev/null
@@ -0,0 +1,35 @@
+#include "test-tool.h"
+#include "cache.h"
+
+/*
+ * Usage: test-tool cron <file> [-l]
+ *
+ * If -l is specified, then write the contents of <file> to stdout.
+ * Otherwise, write from stdin into <file>.
+ */
+int cmd__crontab(int argc, const char **argv)
+{
+       int a;
+       FILE *from, *to;
+
+       if (argc == 3 && !strcmp(argv[2], "-l")) {
+               from = fopen(argv[1], "r");
+               if (!from)
+                       return 0;
+               to = stdout;
+       } else if (argc == 2) {
+               from = stdin;
+               to = fopen(argv[1], "w");
+       } else
+               return error("unknown arguments");
+
+       while ((a = fgetc(from)) != EOF)
+               fputc(a, to);
+
+       if (argc == 3)
+               fclose(from);
+       else
+               fclose(to);
+
+       return 0;
+}
diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c
new file mode 100644 (file)
index 0000000..3732122
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+ * "git fast-rebase" builtin command
+ *
+ * FAST: Forking Any Subprocesses (is) Taboo
+ *
+ * This is meant SOLELY as a demo of what is possible.  sequencer.c and
+ * rebase.c should be refactored to use the ideas here, rather than attempting
+ * to extend this file to replace those (unless Phillip or Dscho say that
+ * refactoring is too hard and we need a clean slate, but I'm guessing that
+ * refactoring is the better route).
+ */
+
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#include "test-tool.h"
+
+#include "cache-tree.h"
+#include "commit.h"
+#include "lockfile.h"
+#include "merge-ort.h"
+#include "refs.h"
+#include "revision.h"
+#include "sequencer.h"
+#include "strvec.h"
+#include "tree.h"
+
+static const char *short_commit_name(struct commit *commit)
+{
+       return find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV);
+}
+
+static struct commit *peel_committish(const char *name)
+{
+       struct object *obj;
+       struct object_id oid;
+
+       if (get_oid(name, &oid))
+               return NULL;
+       obj = parse_object(the_repository, &oid);
+       return (struct commit *)peel_to_type(name, 0, obj, OBJ_COMMIT);
+}
+
+static char *get_author(const char *message)
+{
+       size_t len;
+       const char *a;
+
+       a = find_commit_header(message, "author", &len);
+       if (a)
+               return xmemdupz(a, len);
+
+       return NULL;
+}
+
+static struct commit *create_commit(struct tree *tree,
+                                   struct commit *based_on,
+                                   struct commit *parent)
+{
+       struct object_id ret;
+       struct object *obj;
+       struct commit_list *parents = NULL;
+       char *author;
+       char *sign_commit = NULL;
+       struct commit_extra_header *extra;
+       struct strbuf msg = STRBUF_INIT;
+       const char *out_enc = get_commit_output_encoding();
+       const char *message = logmsg_reencode(based_on, NULL, out_enc);
+       const char *orig_message = NULL;
+       const char *exclude_gpgsig[] = { "gpgsig", NULL };
+
+       commit_list_insert(parent, &parents);
+       extra = read_commit_extra_headers(based_on, exclude_gpgsig);
+       find_commit_subject(message, &orig_message);
+       strbuf_addstr(&msg, orig_message);
+       author = get_author(message);
+       reset_ident_date();
+       if (commit_tree_extended(msg.buf, msg.len, &tree->object.oid, parents,
+                                &ret, author, NULL, sign_commit, extra)) {
+               error(_("failed to write commit object"));
+               return NULL;
+       }
+       free(author);
+       strbuf_release(&msg);
+
+       obj = parse_object(the_repository, &ret);
+       return (struct commit *)obj;
+}
+
+int cmd__fast_rebase(int argc, const char **argv)
+{
+       struct commit *onto;
+       struct commit *last_commit = NULL, *last_picked_commit = NULL;
+       struct object_id head;
+       struct lock_file lock = LOCK_INIT;
+       int clean = 1;
+       struct strvec rev_walk_args = STRVEC_INIT;
+       struct rev_info revs;
+       struct commit *commit;
+       struct merge_options merge_opt;
+       struct tree *next_tree, *base_tree, *head_tree;
+       struct merge_result result;
+       struct strbuf reflog_msg = STRBUF_INIT;
+       struct strbuf branch_name = STRBUF_INIT;
+
+       /*
+        * test-tool stuff doesn't set up the git directory by default; need to
+        * do that manually.
+        */
+       setup_git_directory();
+
+       if (argc == 2 && !strcmp(argv[1], "-h")) {
+               printf("Sorry, I am not a psychiatrist; I can not give you the help you need.  Oh, you meant usage...\n");
+               exit(129);
+       }
+
+       if (argc != 5 || strcmp(argv[1], "--onto"))
+               die("usage: read the code, figure out how to use it, then do so");
+
+       onto = peel_committish(argv[2]);
+       strbuf_addf(&branch_name, "refs/heads/%s", argv[4]);
+
+       /* Sanity check */
+       if (get_oid("HEAD", &head))
+               die(_("Cannot read HEAD"));
+       assert(oideq(&onto->object.oid, &head));
+
+       hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
+       assert(repo_read_index(the_repository) >= 0);
+
+       repo_init_revisions(the_repository, &revs, NULL);
+       revs.verbose_header = 1;
+       revs.max_parents = 1;
+       revs.cherry_mark = 1;
+       revs.limited = 1;
+       revs.reverse = 1;
+       revs.right_only = 1;
+       revs.sort_order = REV_SORT_IN_GRAPH_ORDER;
+       revs.topo_order = 1;
+       strvec_pushl(&rev_walk_args, "", argv[4], "--not", argv[3], NULL);
+
+       if (setup_revisions(rev_walk_args.nr, rev_walk_args.v, &revs, NULL) > 1)
+               return error(_("unhandled options"));
+
+       strvec_clear(&rev_walk_args);
+
+       if (prepare_revision_walk(&revs) < 0)
+               return error(_("error preparing revisions"));
+
+       init_merge_options(&merge_opt, the_repository);
+       memset(&result, 0, sizeof(result));
+       merge_opt.show_rename_progress = 1;
+       merge_opt.branch1 = "HEAD";
+       head_tree = get_commit_tree(onto);
+       result.tree = head_tree;
+       last_commit = onto;
+       while ((commit = get_revision(&revs))) {
+               struct commit *base;
+
+               fprintf(stderr, "Rebasing %s...\r",
+                       oid_to_hex(&commit->object.oid));
+               assert(commit->parents && !commit->parents->next);
+               base = commit->parents->item;
+
+               next_tree = get_commit_tree(commit);
+               base_tree = get_commit_tree(base);
+
+               merge_opt.branch2 = short_commit_name(commit);
+               merge_opt.ancestor = xstrfmt("parent of %s", merge_opt.branch2);
+
+               merge_incore_nonrecursive(&merge_opt,
+                                         base_tree,
+                                         result.tree,
+                                         next_tree,
+                                         &result);
+
+               free((char*)merge_opt.ancestor);
+               merge_opt.ancestor = NULL;
+               if (!result.clean)
+                       die("Aborting: Hit a conflict and restarting is not implemented.");
+               last_picked_commit = commit;
+               last_commit = create_commit(result.tree, commit, last_commit);
+       }
+       fprintf(stderr, "\nDone.\n");
+       /* TODO: There should be some kind of rev_info_free(&revs) call... */
+       memset(&revs, 0, sizeof(revs));
+
+       merge_switch_to_result(&merge_opt, head_tree, &result, 1, !result.clean);
+
+       if (result.clean < 0)
+               exit(128);
+
+       strbuf_addf(&reflog_msg, "finish rebase %s onto %s",
+                   oid_to_hex(&last_picked_commit->object.oid),
+                   oid_to_hex(&last_commit->object.oid));
+       if (update_ref(reflog_msg.buf, branch_name.buf,
+                      &last_commit->object.oid,
+                      &last_picked_commit->object.oid,
+                      REF_NO_DEREF, UPDATE_REFS_MSG_ON_ERR)) {
+               error(_("could not update %s"), argv[4]);
+               die("Failed to update %s", argv[4]);
+       }
+       if (create_symref("HEAD", branch_name.buf, reflog_msg.buf) < 0)
+               die(_("unable to update HEAD"));
+       strbuf_release(&reflog_msg);
+       strbuf_release(&branch_name);
+
+       prime_cache_tree(the_repository, the_repository->index, result.tree);
+       if (write_locked_index(&the_index, &lock,
+                              COMMIT_LOCK | SKIP_IF_UNCHANGED))
+               die(_("unable to write %s"), get_index_file());
+       return (clean == 0);
+}
index f38706216f44c3c881f1d52b250fe74d5140bb37..36ff07bd4beaefabe5f42d119b0eac26cf3ae8d9 100644 (file)
@@ -110,7 +110,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
                                hashmap_add(&map, &entries[i]->ent);
                        }
 
-                       hashmap_free(&map);
+                       hashmap_clear(&map);
                }
        } else {
                /* test map lookups */
@@ -130,7 +130,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
                        }
                }
 
-               hashmap_free(&map);
+               hashmap_clear(&map);
        }
 }
 
@@ -151,12 +151,11 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
 int cmd__hashmap(int argc, const char **argv)
 {
        struct strbuf line = STRBUF_INIT;
-       struct hashmap map;
        int icase;
+       struct hashmap map = HASHMAP_INIT(test_entry_cmp, &icase);
 
        /* init hash map */
        icase = argc > 1 && !strcmp("ignorecase", argv[1]);
-       hashmap_init(&map, test_entry_cmp, &icase, 0);
 
        /* process commands from stdin */
        while (strbuf_getline(&line, stdin) != EOF) {
@@ -262,6 +261,6 @@ int cmd__hashmap(int argc, const char **argv)
        }
 
        strbuf_release(&line);
-       hashmap_free_entries(&map, struct test_entry, ent);
+       hashmap_clear_and_free(&map, struct test_entry, ent);
        return 0;
 }
index 69152958e58eafea73264b1edb99e729613c6843..5e638f0b970d37e57cc0b17d1aa9e17b29e52a0e 100644 (file)
@@ -84,6 +84,25 @@ static void unpack_sideband(void)
        }
 }
 
+static int send_split_sideband(void)
+{
+       const char *part1 = "Hello,";
+       const char *primary = "\001primary: regular output\n";
+       const char *part2 = " world!\n";
+
+       send_sideband(1, 2, part1, strlen(part1), LARGE_PACKET_MAX);
+       packet_write(1, primary, strlen(primary));
+       send_sideband(1, 2, part2, strlen(part2), LARGE_PACKET_MAX);
+       packet_response_end(1);
+
+       return 0;
+}
+
+static int receive_sideband(void)
+{
+       return recv_sideband("sideband", 0, 1);
+}
+
 int cmd__pkt_line(int argc, const char **argv)
 {
        if (argc < 2)
@@ -95,6 +114,10 @@ int cmd__pkt_line(int argc, const char **argv)
                unpack();
        else if (!strcmp(argv[1], "unpack-sideband"))
                unpack_sideband();
+       else if (!strcmp(argv[1], "send-split-sideband"))
+               send_split_sideband();
+       else if (!strcmp(argv[1], "receive-sideband"))
+               receive_sideband();
        else
                die("invalid argument '%s'", argv[1]);
 
index 42164d98983975bdfb9699268e6ff3d6d0c675ba..cc08506cf0bb73b1aefda41079f60cba1edcb9c1 100644 (file)
@@ -10,8 +10,11 @@ static const char *proc_receive_usage[] = {
        NULL
 };
 
-static int die_version;
-static int die_readline;
+static int die_read_version;
+static int die_write_version;
+static int die_read_commands;
+static int die_read_push_options;
+static int die_write_report;
 static int no_push_options;
 static int use_atomic;
 static int use_push_options;
@@ -33,14 +36,23 @@ struct command {
 static void proc_receive_verison(struct packet_reader *reader) {
        int server_version = 0;
 
+       if (die_read_version)
+               die("die with the --die-read-version option");
+
        for (;;) {
                int linelen;
 
                if (packet_reader_read(reader) != PACKET_READ_NORMAL)
                        break;
 
+               /* Ignore version negotiation for version 0 */
+               if (version == 0)
+                       continue;
+
                if (reader->pktlen > 8 && starts_with(reader->line, "version=")) {
                        server_version = atoi(reader->line+8);
+                       if (server_version != 1)
+                               die("bad protocol version: %d", server_version);
                        linelen = strlen(reader->line);
                        if (linelen < reader->pktlen) {
                                const char *feature_list = reader->line + linelen + 1;
@@ -52,12 +64,13 @@ static void proc_receive_verison(struct packet_reader *reader) {
                }
        }
 
-       if (server_version != 1 || die_version)
-               die("bad protocol version: %d", server_version);
+       if (die_write_version)
+               die("die with the --die-write-version option");
 
-       packet_write_fmt(1, "version=%d%c%s\n",
-                        version, '\0',
-                        use_push_options && !no_push_options ? "push-options": "");
+       if (version != 0)
+               packet_write_fmt(1, "version=%d%c%s\n",
+                                version, '\0',
+                                use_push_options && !no_push_options ? "push-options": "");
        packet_flush(1);
 }
 
@@ -75,11 +88,13 @@ static void proc_receive_read_commands(struct packet_reader *reader,
                if (packet_reader_read(reader) != PACKET_READ_NORMAL)
                        break;
 
+               if (die_read_commands)
+                       die("die with the --die-read-commands option");
+
                if (parse_oid_hex(reader->line, &old_oid, &p) ||
                    *p++ != ' ' ||
                    parse_oid_hex(p, &new_oid, &p) ||
-                   *p++ != ' ' ||
-                   die_readline)
+                   *p++ != ' ')
                        die("protocol error: expected 'old new ref', got '%s'",
                            reader->line);
                refname = p;
@@ -99,6 +114,9 @@ static void proc_receive_read_push_options(struct packet_reader *reader,
        if (no_push_options || !use_push_options)
               return;
 
+       if (die_read_push_options)
+               die("die with the --die-read-push-options option");
+
        while (1) {
                if (packet_reader_read(reader) != PACKET_READ_NORMAL)
                        break;
@@ -117,10 +135,16 @@ int cmd__proc_receive(int argc, const char **argv)
        struct option options[] = {
                OPT_BOOL(0, "no-push-options", &no_push_options,
                         "disable push options"),
-               OPT_BOOL(0, "die-version", &die_version,
-                        "die during version negotiation"),
-               OPT_BOOL(0, "die-readline", &die_readline,
-                        "die when readline"),
+               OPT_BOOL(0, "die-read-version", &die_read_version,
+                        "die when reading version"),
+               OPT_BOOL(0, "die-write-version", &die_write_version,
+                        "die when writing version"),
+               OPT_BOOL(0, "die-read-commands", &die_read_commands,
+                        "die when reading commands"),
+               OPT_BOOL(0, "die-read-push-options", &die_read_push_options,
+                        "die when reading push-options"),
+               OPT_BOOL(0, "die-write-report", &die_write_report,
+                        "die when writing report"),
                OPT_STRING_LIST('r', "return", &returns, "old/new/ref/status/msg",
                                "return of results"),
                OPT__VERBOSE(&verbose, "be verbose"),
@@ -136,7 +160,7 @@ int cmd__proc_receive(int argc, const char **argv)
                usage_msg_opt("Too many arguments.", proc_receive_usage, options);
        packet_reader_init(&reader, 0, NULL, 0,
                           PACKET_READ_CHOMP_NEWLINE |
-                          PACKET_READ_DIE_ON_ERR_PACKET);
+                          PACKET_READ_GENTLE_ON_EOF);
 
        sigchain_push(SIGPIPE, SIG_IGN);
        proc_receive_verison(&reader);
@@ -166,6 +190,8 @@ int cmd__proc_receive(int argc, const char **argv)
                                fprintf(stderr, "proc-receive> %s\n", item->string);
        }
 
+       if (die_write_report)
+               die("die with the --die-write-report option");
        if (returns.nr)
                for_each_string_list_item(item, &returns)
                        packet_write_fmt(1, "%s\n", item->string);
index a0d3966b29ea0909c6b0535bf399dcbfd61b9dbc..9d6d14d92937533e84bb30fc689750cceb1180b1 100644 (file)
@@ -18,6 +18,7 @@ static struct test_cmd cmds[] = {
        { "bloom", cmd__bloom },
        { "chmtime", cmd__chmtime },
        { "config", cmd__config },
+       { "crontab", cmd__crontab },
        { "ctype", cmd__ctype },
        { "date", cmd__date },
        { "delta", cmd__delta },
@@ -28,6 +29,7 @@ static struct test_cmd cmds[] = {
        { "dump-split-index", cmd__dump_split_index },
        { "dump-untracked-cache", cmd__dump_untracked_cache },
        { "example-decorate", cmd__example_decorate },
+       { "fast-rebase", cmd__fast_rebase },
        { "genrandom", cmd__genrandom },
        { "genzeros", cmd__genzeros },
        { "hashmap", cmd__hashmap },
index 07034d3f38a4470984f21ecf7fba74eb9adc3739..a6470ff62c42521d3ba16e505d37b31b53554925 100644 (file)
@@ -8,6 +8,7 @@ int cmd__advise_if_enabled(int argc, const char **argv);
 int cmd__bloom(int argc, const char **argv);
 int cmd__chmtime(int argc, const char **argv);
 int cmd__config(int argc, const char **argv);
+int cmd__crontab(int argc, const char **argv);
 int cmd__ctype(int argc, const char **argv);
 int cmd__date(int argc, const char **argv);
 int cmd__delta(int argc, const char **argv);
@@ -18,6 +19,7 @@ int cmd__dump_fsmonitor(int argc, const char **argv);
 int cmd__dump_split_index(int argc, const char **argv);
 int cmd__dump_untracked_cache(int argc, const char **argv);
 int cmd__example_decorate(int argc, const char **argv);
+int cmd__fast_rebase(int argc, const char **argv);
 int cmd__genrandom(int argc, const char **argv);
 int cmd__genzeros(int argc, const char **argv);
 int cmd__hashmap(int argc, const char **argv);
diff --git a/t/lib-merge.sh b/t/lib-merge.sh
new file mode 100644 (file)
index 0000000..8734ebf
--- /dev/null
@@ -0,0 +1,13 @@
+# Helper functions used by merge tests.
+
+test_expect_merge_algorithm () {
+       status_for_recursive=$1 status_for_ort=$2
+       shift 2
+
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test_expect_${status_for_ort} "$@"
+       else
+               test_expect_${status_for_recursive} "$@"
+       fi
+}
index 87a759149faf37c748568c31b0a9017ae5ec6940..bd3fa3c6da40d7018baf56b3360ed68f046eca48 100644 (file)
@@ -144,7 +144,7 @@ create_lib_submodule_repo () {
                git checkout -b valid_sub1 &&
                git revert HEAD &&
 
-               git checkout master
+               git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}"
        )
 }
 
index 8c47155a7c86eebe4b8189601866b2b4df4a4f22..fcb0e8865e49335d5a9afe3941bcea2c58f4bcd8 100644 (file)
@@ -1,7 +1,7 @@
 -include ../../config.mak
 export GIT_TEST_OPTIONS
 
-all: perf
+all: test-lint perf
 
 perf: pre-clean
        ./run
@@ -12,4 +12,7 @@ pre-clean:
 clean:
        rm -rf build "trash directory".* test-results
 
+test-lint:
+       $(MAKE) -C .. test-lint
+
 .PHONY: all perf pre-clean clean
index bd649afa978393373c209b507f3713c8f716986c..fb9127a66f7561e528584c326a7d2539d2647dcb 100644 (file)
@@ -28,6 +28,8 @@ the tests on the current git repository.
     7810.3: grep --cached, cheap regex       3.07(3.02+0.25)
     7810.4: grep --cached, expensive regex   9.39(30.57+0.24)
 
+Output format is in seconds "Elapsed(User + System)"
+
 You can compare multiple repositories and even git revisions with the
 'run' script:
 
index ce5ac3ed85e10efc2b4dd784e5d8949d8f269a75..dda8a7486634488d65ca30ca6da1e795c4eb3a3a 100755 (executable)
@@ -7,13 +7,14 @@ test_description="Tests performance of update-ref"
 test_perf_fresh_repo
 
 test_expect_success "setup" '
-       git init --bare target-repo.git &&
        test_commit PRE &&
        test_commit POST &&
-       printf "create refs/heads/%d PRE\n" $(test_seq 1000) >create &&
-       printf "update refs/heads/%d POST PRE\n" $(test_seq 1000) >update &&
-       printf "delete refs/heads/%d POST\n" $(test_seq 1000) >delete &&
-       git update-ref --stdin <create
+       for i in $(test_seq 5000)
+       do
+               printf "start\ncreate refs/heads/%d PRE\ncommit\n" $i &&
+               printf "start\nupdate refs/heads/%d POST PRE\ncommit\n" $i &&
+               printf "start\ndelete refs/heads/%d POST\ncommit\n" $i
+       done >instructions
 '
 
 test_perf "update-ref" '
@@ -26,14 +27,7 @@ test_perf "update-ref" '
 '
 
 test_perf "update-ref --stdin" '
-       git update-ref --stdin <update &&
-       git update-ref --stdin <delete &&
-       git update-ref --stdin <create
-'
-
-test_perf "nonatomic push" '
-       git push ./target-repo.git $(test_seq 1000) &&
-       git push --delete ./target-repo.git $(test_seq 1000)
+       git update-ref --stdin <instructions >/dev/null
 '
 
 test_done
index d202aaed06fc6cba62a1955e790bbe324d365235..7a0bb294480a6d98ec3db506dff3eafa57cb30f0 100755 (executable)
@@ -9,16 +9,16 @@ test_expect_success 'setup rebasing on top of a lot of changes' '
        git checkout -f -B base &&
        git checkout -B to-rebase &&
        git checkout -B upstream &&
-       for i in $(seq 100)
+       for i in $(test_seq 100)
        do
                # simulate huge diffs
                echo change$i >unrelated-file$i &&
-               seq 1000 >>unrelated-file$i &&
+               test_seq 1000 >>unrelated-file$i &&
                git add unrelated-file$i &&
                test_tick &&
                git commit -m commit$i unrelated-file$i &&
                echo change$i >unrelated-file$i &&
-               seq 1000 | tac >>unrelated-file$i &&
+               test_seq 1000 | tac >>unrelated-file$i &&
                git add unrelated-file$i &&
                test_tick &&
                git commit -m commit$i-reverse unrelated-file$i ||
index def7ecdbc786c6472e5b7909a97650a1034cecb2..9b43342806b9e0243ccb81a60931abdf36034337 100755 (executable)
@@ -22,7 +22,9 @@ test_description="Test core.fsmonitor"
 #
 # GIT_PERF_7519_UNTRACKED_CACHE: used to configure core.untrackedCache
 # GIT_PERF_7519_SPLIT_INDEX: used to configure core.splitIndex
-# GIT_PERF_7519_FSMONITOR: used to configure core.fsMonitor
+# GIT_PERF_7519_FSMONITOR: used to configure core.fsMonitor. May be an
+#   absolute path to an integration. May be a space delimited list of
+#   absolute paths to integrations.
 #
 # The big win for using fsmonitor is the elimination of the need to scan the
 # working directory looking for changed and untracked files. If the file
@@ -68,7 +70,7 @@ then
        fi
 fi
 
-test_expect_success "setup for fsmonitor" '
+test_expect_success "one time repo setup" '
        # set untrackedCache depending on the environment
        if test -n "$GIT_PERF_7519_UNTRACKED_CACHE"
        then
@@ -88,24 +90,36 @@ test_expect_success "setup for fsmonitor" '
                git config core.splitIndex "$GIT_PERF_7519_SPLIT_INDEX"
        fi &&
 
+       mkdir 1_file 10_files 100_files 1000_files 10000_files &&
+       for i in $(test_seq 1 10); do touch 10_files/$i; done &&
+       for i in $(test_seq 1 100); do touch 100_files/$i; done &&
+       for i in $(test_seq 1 1000); do touch 1000_files/$i; done &&
+       for i in $(test_seq 1 10000); do touch 10000_files/$i; done &&
+       git add 1_file 10_files 100_files 1000_files 10000_files &&
+       git commit -qm "Add files" &&
+
+       # If Watchman exists, watch the work tree and attempt a query.
+       if test_have_prereq WATCHMAN; then
+               watchman watch "$GIT_WORK_TREE" &&
+               watchman watch-list | grep -q -F "$GIT_WORK_TREE"
+       fi
+'
+
+setup_for_fsmonitor() {
        # set INTEGRATION_SCRIPT depending on the environment
-       if test -n "$GIT_PERF_7519_FSMONITOR"
+       if test -n "$INTEGRATION_PATH"
        then
-               INTEGRATION_SCRIPT="$GIT_PERF_7519_FSMONITOR"
+               INTEGRATION_SCRIPT="$INTEGRATION_PATH"
        else
                #
                # Choose integration script based on existence of Watchman.
-               # If Watchman exists, watch the work tree and attempt a query.
-               # If everything succeeds, use Watchman integration script,
-               # else fall back to an empty integration script.
+               # Fall back to an empty integration script.
                #
                mkdir .git/hooks &&
                if test_have_prereq WATCHMAN
                then
                        INTEGRATION_SCRIPT=".git/hooks/fsmonitor-watchman" &&
-                       cp "$TEST_DIRECTORY/../templates/hooks--fsmonitor-watchman.sample" "$INTEGRATION_SCRIPT" &&
-                       watchman watch "$GIT_WORK_TREE" &&
-                       watchman watch-list | grep -q -F "$GIT_WORK_TREE"
+                       cp "$TEST_DIRECTORY/../templates/hooks--fsmonitor-watchman.sample" "$INTEGRATION_SCRIPT"
                else
                        INTEGRATION_SCRIPT=".git/hooks/fsmonitor-empty" &&
                        write_script "$INTEGRATION_SCRIPT"<<-\EOF
@@ -114,62 +128,93 @@ test_expect_success "setup for fsmonitor" '
        fi &&
 
        git config core.fsmonitor "$INTEGRATION_SCRIPT" &&
-       git update-index --fsmonitor
-'
+       git update-index --fsmonitor 2>error &&
+       test_must_be_empty error  # ensure no silent error
+}
 
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
-       test-tool drop-caches
-fi
-
-test_perf "status (fsmonitor=$INTEGRATION_SCRIPT)" '
-       git status
-'
+test_perf_w_drop_caches () {
+       if test -n "$GIT_PERF_7519_DROP_CACHE"; then
+               test-tool drop-caches
+       fi
 
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
-       test-tool drop-caches
-fi
+       test_perf "$@"
+}
 
-test_perf "status -uno (fsmonitor=$INTEGRATION_SCRIPT)" '
-       git status -uno
-'
+test_fsmonitor_suite() {
+       if test -n "$INTEGRATION_SCRIPT"; then
+               DESC="fsmonitor=$(basename $INTEGRATION_SCRIPT)"
+       else
+               DESC="fsmonitor=disabled"
+       fi
 
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
-       test-tool drop-caches
+       test_expect_success "test_initialization" '
+               git reset --hard &&
+               git status  # Warm caches
+       '
+
+       test_perf_w_drop_caches "status ($DESC)" '
+               git status
+       '
+
+       test_perf_w_drop_caches "status -uno ($DESC)" '
+               git status -uno
+       '
+
+       test_perf_w_drop_caches "status -uall ($DESC)" '
+               git status -uall
+       '
+
+       test_perf_w_drop_caches "status (dirty) ($DESC)" '
+               git ls-files | head -100000 | xargs -d "\n" touch -h &&
+               git status
+       '
+
+       test_perf_w_drop_caches "diff ($DESC)" '
+               git diff
+       '
+
+       test_perf_w_drop_caches "diff -- 0_files ($DESC)" '
+               git diff -- 1_file
+       '
+
+       test_perf_w_drop_caches "diff -- 10_files ($DESC)" '
+               git diff -- 10_files
+       '
+
+       test_perf_w_drop_caches "diff -- 100_files ($DESC)" '
+               git diff -- 100_files
+       '
+
+       test_perf_w_drop_caches "diff -- 1000_files ($DESC)" '
+               git diff -- 1000_files
+       '
+
+       test_perf_w_drop_caches "diff -- 10000_files ($DESC)" '
+               git diff -- 10000_files
+       '
+
+       test_perf_w_drop_caches "add ($DESC)" '
+               git add  --all
+       '
+}
+
+if test -n "$GIT_PERF_7519_FSMONITOR"; then
+       for INTEGRATION_PATH in $GIT_PERF_7519_FSMONITOR; do
+               test_expect_success "setup for fsmonitor $INTEGRATION_PATH" 'setup_for_fsmonitor'
+               test_fsmonitor_suite
+       done
+else
+       test_expect_success "setup for fsmonitor" 'setup_for_fsmonitor'
+       test_fsmonitor_suite
 fi
 
-test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" '
-       git status -uall
-'
-
 test_expect_success "setup without fsmonitor" '
        unset INTEGRATION_SCRIPT &&
        git config --unset core.fsmonitor &&
        git update-index --no-fsmonitor
 '
 
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
-       test-tool drop-caches
-fi
-
-test_perf "status (fsmonitor=$INTEGRATION_SCRIPT)" '
-       git status
-'
-
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
-       test-tool drop-caches
-fi
-
-test_perf "status -uno (fsmonitor=$INTEGRATION_SCRIPT)" '
-       git status -uno
-'
-
-if test -n "$GIT_PERF_7519_DROP_CACHE"; then
-       test-tool drop-caches
-fi
-
-test_perf "status -uall (fsmonitor=$INTEGRATION_SCRIPT)" '
-       git status -uall
-'
+test_fsmonitor_suite
 
 if test_have_prereq WATCHMAN
 then
index 923281af93981d5b6f67ace54f41849b44ecf0b1..f4ba2e8c85c8cd2406cd758ab3f9cdf5e622617d 100755 (executable)
@@ -430,7 +430,7 @@ test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' "
 
 test_expect_success '--run basic' "
        run_sub_test_lib_test run-basic \
-               '--run basic' --run='1 3 5' <<-\\EOF &&
+               '--run basic' --run='1,3,5' <<-\\EOF &&
        for i in 1 2 3 4 5 6
        do
                test_expect_success \"passing test #\$i\" 'true'
@@ -472,7 +472,7 @@ test_expect_success '--run with a range' "
 
 test_expect_success '--run with two ranges' "
        run_sub_test_lib_test run-two-ranges \
-               '--run with two ranges' --run='1-2 5-6' <<-\\EOF &&
+               '--run with two ranges' --run='1-2,5-6' <<-\\EOF &&
        for i in 1 2 3 4 5 6
        do
                test_expect_success \"passing test #\$i\" 'true'
@@ -556,7 +556,7 @@ test_expect_success '--run with basic negation' "
 
 test_expect_success '--run with two negations' "
        run_sub_test_lib_test run-two-neg \
-               '--run with two negations' --run='"'!3 !6'"' <<-\\EOF &&
+               '--run with two negations' --run='"'!3,!6'"' <<-\\EOF &&
        for i in 1 2 3 4 5 6
        do
                test_expect_success \"passing test #\$i\" 'true'
@@ -577,7 +577,7 @@ test_expect_success '--run with two negations' "
 
 test_expect_success '--run a range and negation' "
        run_sub_test_lib_test run-range-and-neg \
-               '--run a range and negation' --run='"'-4 !2'"' <<-\\EOF &&
+               '--run a range and negation' --run='"'-4,!2'"' <<-\\EOF &&
        for i in 1 2 3 4 5 6
        do
                test_expect_success \"passing test #\$i\" 'true'
@@ -620,7 +620,7 @@ test_expect_success '--run range negation' "
 test_expect_success '--run include, exclude and include' "
        run_sub_test_lib_test run-inc-neg-inc \
                '--run include, exclude and include' \
-               --run='"'1-5 !1-3 2'"' <<-\\EOF &&
+               --run='"'1-5,!1-3,2'"' <<-\\EOF &&
        for i in 1 2 3 4 5 6
        do
                test_expect_success \"passing test #\$i\" 'true'
@@ -664,7 +664,7 @@ test_expect_success '--run include, exclude and include, comma separated' "
 test_expect_success '--run exclude and include' "
        run_sub_test_lib_test run-neg-inc \
                '--run exclude and include' \
-               --run='"'!3- 5'"' <<-\\EOF &&
+               --run='"'!3-,5'"' <<-\\EOF &&
        for i in 1 2 3 4 5 6
        do
                test_expect_success \"passing test #\$i\" 'true'
@@ -705,7 +705,31 @@ test_expect_success '--run empty selectors' "
        EOF
 "
 
-test_expect_success '--run invalid range start' "
+test_expect_success '--run substring selector' "
+       run_sub_test_lib_test run-substring-selector \
+               '--run empty selectors' \
+               --run='relevant' <<-\\EOF &&
+       test_expect_success \"relevant test\" 'true'
+       for i in 1 2 3 4 5 6
+       do
+               test_expect_success \"other test #\$i\" 'true'
+       done
+       test_done
+       EOF
+       check_sub_test_lib_test run-substring-selector <<-\\EOF
+       > ok 1 - relevant test
+       > ok 2 # skip other test #1 (--run)
+       > ok 3 # skip other test #2 (--run)
+       > ok 4 # skip other test #3 (--run)
+       > ok 5 # skip other test #4 (--run)
+       > ok 6 # skip other test #5 (--run)
+       > ok 7 # skip other test #6 (--run)
+       > # passed all 7 test(s)
+       > 1..7
+       EOF
+"
+
+test_expect_success '--run keyword selection' "
        run_sub_test_lib_test_err run-inv-range-start \
                '--run invalid range start' \
                --run='a-5' <<-\\EOF &&
@@ -735,21 +759,6 @@ test_expect_success '--run invalid range end' "
        EOF_ERR
 "
 
-test_expect_success '--run invalid selector' "
-       run_sub_test_lib_test_err run-inv-selector \
-               '--run invalid selector' \
-               --run='1?' <<-\\EOF &&
-       test_expect_success \"passing test #1\" 'true'
-       test_done
-       EOF
-       check_sub_test_lib_test_err run-inv-selector \
-               <<-\\EOF_OUT 3<<-\\EOF_ERR
-       > FATAL: Unexpected exit with code 1
-       EOF_OUT
-       > error: --run: invalid non-numeric in test selector: '1?'
-       EOF_ERR
-"
-
 
 test_set_prereq HAVEIT
 haveit=no
@@ -831,6 +840,27 @@ then
        exit 1
 fi
 
+test_lazy_prereq NESTED_INNER '
+       >inner &&
+       rm -f outer
+'
+test_lazy_prereq NESTED_PREREQ '
+       >outer &&
+       test_have_prereq NESTED_INNER &&
+       echo "can create new file in cwd" >file &&
+       test -f outer &&
+       test ! -f inner
+'
+test_expect_success NESTED_PREREQ 'evaluating nested lazy prereqs dont interfere with each other' '
+       nestedworks=yes
+'
+
+if test -z "$GIT_TEST_FAIL_PREREQS_INTERNAL" && test "$nestedworks" != yes
+then
+       say 'bug in test framework: nested lazy prerequisites do not work'
+       exit 1
+fi
+
 test_expect_success 'lazy prereqs do not turn off tracing' "
        run_sub_test_lib_test lazy-prereq-and-tracing \
                'lazy prereqs and -x' -v -x <<-\\EOF &&
@@ -1191,7 +1221,7 @@ test_expect_success 'writing this tree with --missing-ok' '
 test_expect_success 'git read-tree followed by write-tree should be idempotent' '
        rm -f .git/index &&
        git read-tree $tree &&
-       test -f .git/index &&
+       test_path_is_file .git/index &&
        newtree=$(git write-tree) &&
        test "$newtree" = "$tree"
 '
index 2f7c3dcd0f85d41409a0a40520d2af821b2c147d..0803994874f91659551ac5e9f1a8c0b484430cfe 100755 (executable)
@@ -163,7 +163,7 @@ test_expect_success 'reinit' '
        (
                mkdir again &&
                cd again &&
-               git init >out1 2>err1 &&
+               git -c init.defaultBranch=initial init >out1 2>err1 &&
                git init >out2 2>err2
        ) &&
        test_i18ngrep "Initialized empty" again/out1 &&
@@ -553,15 +553,37 @@ test_expect_success '--initial-branch' '
 
 test_expect_success 'overridden default initial branch name (config)' '
        test_config_global init.defaultBranch nmb &&
-       git init initial-branch-config &&
+       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git init initial-branch-config &&
        git -C initial-branch-config symbolic-ref HEAD >actual &&
        grep nmb actual
 '
 
+test_expect_success 'advice on unconfigured init.defaultBranch' '
+       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git -c color.advice=always \
+               init unconfigured-default-branch-name 2>err &&
+       test_decode_color <err >decoded &&
+       test_i18ngrep "<YELLOW>hint: " decoded
+'
+
+test_expect_success 'overridden default main branch name (env)' '
+       test_config_global init.defaultBranch nmb &&
+       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env &&
+       git -C main-branch-env symbolic-ref HEAD >actual &&
+       grep env actual
+'
+
 test_expect_success 'invalid default branch name' '
-       test_config_global init.defaultBranch "with space" &&
-       test_must_fail git init initial-branch-invalid 2>err &&
+       test_must_fail env GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME="with space" \
+               git init initial-branch-invalid 2>err &&
        test_i18ngrep "invalid branch name" err
 '
 
+test_expect_success 'branch -m with the initial branch' '
+       git init rename-initial &&
+       git -C rename-initial branch -m renamed &&
+       test renamed = $(git -C rename-initial symbolic-ref --short HEAD) &&
+       git -C rename-initial branch -m renamed again &&
+       test again = $(git -C rename-initial symbolic-ref --short HEAD)
+'
+
 test_done
index 4bfffa9c314bf8236c9c7d74fca166ed86d5952a..f6deaf498ba9df88f9ea8c648aa3e6ce058207c9 100755 (executable)
@@ -23,10 +23,6 @@ generate_random_characters () {
                perl -pe "s/./chr((ord($&) % 26) + ord('a'))/sge" >"$TEST_ROOT/$NAME"
 }
 
-file_size () {
-       test-tool path-utils file-size "$1"
-}
-
 filter_git () {
        rm -f *.log &&
        git "$@"
@@ -361,9 +357,9 @@ test_expect_success PERL 'required process filter should filter data' '
                cp "$TEST_ROOT/test3 '\''sq'\'',\$x=.o" "testsubdir/test3 '\''sq'\'',\$x=.r" &&
                >test4-empty.r &&
 
-               S=$(file_size test.r) &&
-               S2=$(file_size test2.r) &&
-               S3=$(file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
+               S=$(test_file_size test.r) &&
+               S2=$(test_file_size test2.r) &&
+               S3=$(test_file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
                M=$(git hash-object test.r) &&
                M2=$(git hash-object test2.r) &&
                M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
@@ -432,9 +428,9 @@ test_expect_success PERL 'required process filter should filter data for various
        (
                cd repo &&
 
-               S=$(file_size test.r) &&
-               S2=$(file_size test2.r) &&
-               S3=$(file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
+               S=$(test_file_size test.r) &&
+               S2=$(test_file_size test2.r) &&
+               S3=$(test_file_size "testsubdir/test3 '\''sq'\'',\$x=.r") &&
                M=$(git hash-object test.r) &&
                M2=$(git hash-object test2.r) &&
                M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") &&
@@ -549,7 +545,7 @@ test_expect_success PERL 'required process filter takes precedence' '
 
                echo "*.r filter=protocol" >.gitattributes &&
                cp "$TEST_ROOT/test.o" test.r &&
-               S=$(file_size test.r) &&
+               S=$(test_file_size test.r) &&
 
                # Check that the process filter is invoked here
                filter_git add . &&
@@ -573,7 +569,7 @@ test_expect_success PERL 'required process filter should be used only for "clean
 
                echo "*.r filter=protocol" >.gitattributes &&
                cp "$TEST_ROOT/test.o" test.r &&
-               S=$(file_size test.r) &&
+               S=$(test_file_size test.r) &&
 
                filter_git add . &&
                cat >expected.log <<-EOF &&
@@ -697,9 +693,9 @@ test_expect_success PERL 'process filter should restart after unexpected write f
                echo "this is going to fail" >smudge-write-fail.o &&
                cp smudge-write-fail.o smudge-write-fail.r &&
 
-               S=$(file_size test.r) &&
-               S2=$(file_size test2.r) &&
-               SF=$(file_size smudge-write-fail.r) &&
+               S=$(test_file_size test.r) &&
+               S2=$(test_file_size test2.r) &&
+               SF=$(test_file_size smudge-write-fail.r) &&
                M=$(git hash-object test.r) &&
                M2=$(git hash-object test2.r) &&
                MF=$(git hash-object smudge-write-fail.r) &&
@@ -752,9 +748,9 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
                echo "this will cause an error" >error.o &&
                cp error.o error.r &&
 
-               S=$(file_size test.r) &&
-               S2=$(file_size test2.r) &&
-               SE=$(file_size error.r) &&
+               S=$(test_file_size test.r) &&
+               S2=$(test_file_size test2.r) &&
+               SE=$(test_file_size error.r) &&
                M=$(git hash-object test.r) &&
                M2=$(git hash-object test2.r) &&
                ME=$(git hash-object error.r) &&
@@ -797,7 +793,7 @@ test_expect_success PERL 'process filter abort stops processing of all further f
 
                M="blob=$(git hash-object abort.r)" &&
                rm -f debug.log &&
-               SA=$(file_size abort.r) &&
+               SA=$(test_file_size abort.r) &&
 
                git add . &&
                rm -f *.r &&
@@ -859,7 +855,7 @@ test_expect_success PERL 'delayed checkout in process filter' '
                git commit -m "test commit"
        ) &&
 
-       S=$(file_size "$TEST_ROOT/test.o") &&
+       S=$(test_file_size "$TEST_ROOT/test.o") &&
        PM="ref=refs/heads/master treeish=$(git -C repo rev-parse --verify master) " &&
        M="${PM}blob=$(git -C repo rev-parse --verify master:test.a)" &&
        cat >a.exp <<-EOF &&
similarity index 90%
rename from t/t0064-sha1-array.sh
rename to t/t0064-oid-array.sh
index 45685af2fd5095a9901fdb150de1c6fd8703728f..2e5438ccdacdeb31d60d3ffab22dcbc8151134fd 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-test_description='basic tests for the SHA1 array implementation'
+test_description='basic tests for the oid array implementation'
 . ./test-lib.sh
 
 echoid () {
@@ -25,6 +25,7 @@ test_expect_success 'ordered enumeration' '
 test_expect_success 'ordered enumeration with duplicate suppression' '
        echoid "" 44 55 88 aa >expect &&
        {
+               echoid append 88 44 aa 55 &&
                echoid append 88 44 aa 55 &&
                echoid append 88 44 aa 55 &&
                echo for_each_unique
@@ -52,17 +53,19 @@ test_expect_success 'lookup non-existing entry' '
 
 test_expect_success 'lookup with duplicates' '
        {
+               echoid append 88 44 aa 55 &&
                echoid append 88 44 aa 55 &&
                echoid append 88 44 aa 55 &&
                echoid lookup 55
        } | test-tool oid-array >actual &&
        n=$(cat actual) &&
-       test "$n" -ge 2 &&
-       test "$n" -le 3
+       test "$n" -ge 3 &&
+       test "$n" -le 5
 '
 
 test_expect_success 'lookup non-existing entry with duplicates' '
        {
+               echoid append 88 44 aa 55 &&
                echoid append 88 44 aa 55 &&
                echoid append 88 44 aa 55 &&
                echoid lookup 66
diff --git a/t/t0068-for-each-repo.sh b/t/t0068-for-each-repo.sh
new file mode 100755 (executable)
index 0000000..136b4ec
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='git for-each-repo builtin'
+
+. ./test-lib.sh
+
+test_expect_success 'run based on configured value' '
+       git init one &&
+       git init two &&
+       git init three &&
+       git -C two commit --allow-empty -m "DID NOT RUN" &&
+       git config run.key "$TRASH_DIRECTORY/one" &&
+       git config --add run.key "$TRASH_DIRECTORY/three" &&
+       git for-each-repo --config=run.key commit --allow-empty -m "ran" &&
+       git -C one log -1 --pretty=format:%s >message &&
+       grep ran message &&
+       git -C two log -1 --pretty=format:%s >message &&
+       ! grep ran message &&
+       git -C three log -1 --pretty=format:%s >message &&
+       grep ran message &&
+       git for-each-repo --config=run.key -- commit --allow-empty -m "ran again" &&
+       git -C one log -1 --pretty=format:%s >message &&
+       grep again message &&
+       git -C two log -1 --pretty=format:%s >message &&
+       ! grep again message &&
+       git -C three log -1 --pretty=format:%s >message &&
+       grep again message
+'
+
+test_done
index 7b111a56fdd3e13d34b538e52c2659a8f2e188a2..8d59905ef099bf0ab46d0681568dd17d7ed85d98 100755 (executable)
@@ -34,4 +34,22 @@ test_expect_success 'check for a bug in the regex routines' '
        test-tool regex --bug
 '
 
+test_expect_success 'incomplete sideband messages are reassembled' '
+       test-tool pkt-line send-split-sideband >split-sideband &&
+       test-tool pkt-line receive-sideband <split-sideband 2>err &&
+       grep "Hello, world" err
+'
+
+test_expect_success 'eof on sideband message is reported' '
+       printf 1234 >input &&
+       test-tool pkt-line receive-sideband <input 2>err &&
+       test_i18ngrep "unexpected disconnect" err
+'
+
+test_expect_success 'missing sideband designator is reported' '
+       printf 0004 >input &&
+       test-tool pkt-line receive-sideband <input 2>err &&
+       test_i18ngrep "missing sideband" err
+'
+
 test_done
index bc2d74098f035cde80de8282736188c6f6db3066..a18f8a473bfc667023c433a6c55c05defcc2e9f0 100755 (executable)
@@ -265,6 +265,32 @@ test_expect_success 'internal getpass does not ask for known username' '
        EOF
 '
 
+test_expect_success 'git-credential respects core.askPass' '
+       write_script alternate-askpass <<-\EOF &&
+       echo >&2 "alternate askpass invoked"
+       echo alternate-value
+       EOF
+       test_config core.askpass "$PWD/alternate-askpass" &&
+       (
+               # unset GIT_ASKPASS set by lib-credential.sh which would
+               # override our config, but do so in a subshell so that we do
+               # not interfere with other tests
+               sane_unset GIT_ASKPASS &&
+               check fill <<-\EOF
+               protocol=http
+               host=example.com
+               --
+               protocol=http
+               host=example.com
+               username=alternate-value
+               password=alternate-value
+               --
+               alternate askpass invoked
+               alternate askpass invoked
+               EOF
+       )
+'
+
 HELPER="!f() {
                cat >/dev/null
                echo username=foo
index c13578a635fbcf8b33c1cf912df69afa23e96885..181956b24137f2de91117d344b61c28214000a9f 100755 (executable)
@@ -20,7 +20,7 @@ test_expect_success 'two-way setup' '
        git branch side &&
        git tag -f branch-point &&
 
-       echo file2 is not tracked on the master anymore &&
+       echo file2 is not tracked on the master branch anymore &&
        rm -f file2 subdir/file2 &&
        git update-index --remove file2 subdir/file2 &&
        git commit -a -m "master removes file2 and subdir/file2"
index 61e89a8071c8a385d130c95cea5776314440e755..4bab6a513c5c951c084d59a0e6ccd42422f27978 100755 (executable)
@@ -5,12 +5,6 @@ test_description='adding and checking out large blobs'
 
 . ./test-lib.sh
 
-# This should be moved to test-lib.sh together with the
-# copy in t0021 after both topics have graduated to 'master'.
-file_size () {
-       test-tool path-utils file-size "$1"
-}
-
 test_expect_success setup '
        # clone does not allow us to pass core.bigfilethreshold to
        # new repos, so set core.bigfilethreshold globally
@@ -29,7 +23,7 @@ do
        test_expect_success "add with $config" '
                test_when_finished "rm -f .git/objects/pack/pack-*.* .git/index" &&
                git $config add large1 &&
-               sz=$(file_size .git/objects/pack/pack-*.pack) &&
+               sz=$(test_file_size .git/objects/pack/pack-*.pack) &&
                case "$expect" in
                small) test "$sz" -le 100000 ;;
                large) test "$sz" -ge 100000 ;;
index 825d9a184fbbf4c14a7b6b5d98125947d3336666..97a04c6cc26fda58417c9242d690e68148a3d9cc 100755 (executable)
@@ -1917,4 +1917,153 @@ test_expect_success '--replace-all does not invent newlines' '
        test_cmp expect .git/config
 '
 
+test_expect_success 'set all config with value-pattern' '
+       test_when_finished rm -f config initial &&
+       git config --file=initial abc.key one &&
+
+       # no match => add new entry
+       cp initial config &&
+       git config --file=config abc.key two a+ &&
+       git config --file=config --list >actual &&
+       cat >expect <<-\EOF &&
+       abc.key=one
+       abc.key=two
+       EOF
+       test_cmp expect actual &&
+
+       # multiple matches => failure
+       test_must_fail git config --file=config abc.key three o+ 2>err &&
+       test_i18ngrep "has multiple values" err &&
+
+       # multiple values, no match => add
+       git config --file=config abc.key three a+ &&
+       git config --file=config --list >actual &&
+       cat >expect <<-\EOF &&
+       abc.key=one
+       abc.key=two
+       abc.key=three
+       EOF
+       test_cmp expect actual &&
+
+       # single match => replace
+       git config --file=config abc.key four h+ &&
+       git config --file=config --list >actual &&
+       cat >expect <<-\EOF &&
+       abc.key=one
+       abc.key=two
+       abc.key=four
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success '--replace-all and value-pattern' '
+       test_when_finished rm -f config &&
+       git config --file=config --add abc.key one &&
+       git config --file=config --add abc.key two &&
+       git config --file=config --add abc.key three &&
+       git config --file=config --replace-all abc.key four "o+" &&
+       git config --file=config --list >actual &&
+       cat >expect <<-\EOF &&
+       abc.key=four
+       abc.key=three
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'refuse --fixed-value for incompatible actions' '
+       test_when_finished rm -f config &&
+       git config --file=config dev.null bogus &&
+
+       # These modes do not allow --fixed-value at all
+       test_must_fail git config --file=config --fixed-value --add dev.null bogus &&
+       test_must_fail git config --file=config --fixed-value --get-urlmatch dev.null bogus &&
+       test_must_fail git config --file=config --fixed-value --get-urlmatch dev.null bogus &&
+       test_must_fail git config --file=config --fixed-value --rename-section dev null &&
+       test_must_fail git config --file=config --fixed-value --remove-section dev &&
+       test_must_fail git config --file=config --fixed-value --list &&
+       test_must_fail git config --file=config --fixed-value --get-color dev.null &&
+       test_must_fail git config --file=config --fixed-value --get-colorbool dev.null &&
+
+       # These modes complain when --fixed-value has no value-pattern
+       test_must_fail git config --file=config --fixed-value dev.null bogus &&
+       test_must_fail git config --file=config --fixed-value --replace-all dev.null bogus &&
+       test_must_fail git config --file=config --fixed-value --get dev.null &&
+       test_must_fail git config --file=config --fixed-value --get-all dev.null &&
+       test_must_fail git config --file=config --fixed-value --get-regexp "dev.*" &&
+       test_must_fail git config --file=config --fixed-value --unset dev.null &&
+       test_must_fail git config --file=config --fixed-value --unset-all dev.null
+'
+
+test_expect_success '--fixed-value uses exact string matching' '
+       test_when_finished rm -f config initial &&
+       META="a+b*c?d[e]f.g" &&
+       git config --file=initial fixed.test "$META" &&
+
+       cp initial config &&
+       git config --file=config fixed.test bogus "$META" &&
+       git config --file=config --list >actual &&
+       cat >expect <<-EOF &&
+       fixed.test=$META
+       fixed.test=bogus
+       EOF
+       test_cmp expect actual &&
+
+       cp initial config &&
+       git config --file=config --fixed-value fixed.test bogus "$META" &&
+       git config --file=config --list >actual &&
+       cat >expect <<-\EOF &&
+       fixed.test=bogus
+       EOF
+       test_cmp expect actual &&
+
+       cp initial config &&
+       test_must_fail git config --file=config --unset fixed.test "$META" &&
+       git config --file=config --fixed-value --unset fixed.test "$META" &&
+       test_must_fail git config --file=config fixed.test &&
+
+       cp initial config &&
+       test_must_fail git config --file=config --unset-all fixed.test "$META" &&
+       git config --file=config --fixed-value --unset-all fixed.test "$META" &&
+       test_must_fail git config --file=config fixed.test &&
+
+       cp initial config &&
+       git config --file=config --replace-all fixed.test bogus "$META" &&
+       git config --file=config --list >actual &&
+       cat >expect <<-EOF &&
+       fixed.test=$META
+       fixed.test=bogus
+       EOF
+       test_cmp expect actual &&
+
+       git config --file=config --fixed-value --replace-all fixed.test bogus "$META" &&
+       git config --file=config --list >actual &&
+       cat >expect <<-EOF &&
+       fixed.test=bogus
+       fixed.test=bogus
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success '--get and --get-all with --fixed-value' '
+       test_when_finished rm -f config &&
+       META="a+b*c?d[e]f.g" &&
+       git config --file=config fixed.test bogus &&
+       git config --file=config --add fixed.test "$META" &&
+
+       git config --file=config --get fixed.test bogus &&
+       test_must_fail git config --file=config --get fixed.test "$META" &&
+       git config --file=config --get --fixed-value fixed.test "$META" &&
+       test_must_fail git config --file=config --get --fixed-value fixed.test non-existent &&
+
+       git config --file=config --get-all fixed.test bogus &&
+       test_must_fail git config --file=config --get-all fixed.test "$META" &&
+       git config --file=config --get-all --fixed-value fixed.test "$META" &&
+       test_must_fail git config --file=config --get-all --fixed-value fixed.test non-existent &&
+
+       git config --file=config --get-regexp fixed+ bogus &&
+       test_must_fail git config --file=config --get-regexp fixed+ "$META" &&
+       git config --file=config --get-regexp --fixed-value fixed+ "$META" &&
+       test_must_fail git config --file=config --get-regexp --fixed-value fixed+ non-existent
+'
+
 test_done
index ebb8e1aecbf424e1ec2d522bd7806c78992bedb6..b4a9158307fd210079211165fb507a037ceb75f0 100755 (executable)
@@ -91,11 +91,11 @@ test_expect_failure 'ignore .git/ with invalid config' '
 
 test_expect_success 'early config and onbranch' '
        echo "[broken" >broken &&
-       test_with_config "[includeif \"onbranch:master\"]path=../broken"
+       test_with_config "[includeif \"onbranch:topic\"]path=../broken"
 '
 
 test_expect_success 'onbranch config outside of git repo' '
-       test_config_global includeIf.onbranch:master.path non-existent &&
+       test_config_global includeIf.onbranch:topic.path non-existent &&
        nongit git help
 '
 
index 770e7be363cdaa0fbbfc52a03cbc195c0920aad1..31b64be521d28e7cce5ff77aacd43c900c1ee803 100755 (executable)
@@ -48,17 +48,17 @@ test_expect_success "fail to delete $m with stale ref" '
        test $B = "$(git show-ref -s --verify $m)"
 '
 test_expect_success "delete $m" '
-       test_when_finished "rm -f .git/$m" &&
+       test_when_finished "git update-ref -d $m" &&
        git update-ref -d $m $B &&
-       test_path_is_missing .git/$m
+       test_must_fail git show-ref --verify -q $m
 '
 
 test_expect_success "delete $m without oldvalue verification" '
-       test_when_finished "rm -f .git/$m" &&
+       test_when_finished "git update-ref -d $m" &&
        git update-ref $m $A &&
        test $A = $(git show-ref -s --verify $m) &&
        git update-ref -d $m &&
-       test_path_is_missing .git/$m
+       test_must_fail git show-ref --verify -q $m
 '
 
 test_expect_success "fail to create $n" '
@@ -80,26 +80,26 @@ test_expect_success "fail to delete $m (by HEAD) with stale ref" '
        test $B = $(git show-ref -s --verify $m)
 '
 test_expect_success "delete $m (by HEAD)" '
-       test_when_finished "rm -f .git/$m" &&
+       test_when_finished "git update-ref -d $m" &&
        git update-ref -d HEAD $B &&
-       test_path_is_missing .git/$m
+       test_must_fail git show-ref --verify -q $m
 '
 
 test_expect_success "deleting current branch adds message to HEAD's log" '
-       test_when_finished "rm -f .git/$m" &&
+       test_when_finished "git update-ref -d $m" &&
        git update-ref $m $A &&
        git symbolic-ref HEAD $m &&
        git update-ref -m delete-$m -d $m &&
-       test_path_is_missing .git/$m &&
+       test_must_fail git show-ref --verify -q $m &&
        grep "delete-$m$" .git/logs/HEAD
 '
 
 test_expect_success "deleting by HEAD adds message to HEAD's log" '
-       test_when_finished "rm -f .git/$m" &&
+       test_when_finished "git update-ref -d $m" &&
        git update-ref $m $A &&
        git symbolic-ref HEAD $m &&
        git update-ref -m delete-by-head -d HEAD &&
-       test_path_is_missing .git/$m &&
+       test_must_fail git show-ref --verify -q $m &&
        grep "delete-by-head$" .git/logs/HEAD
 '
 
@@ -188,31 +188,37 @@ test_expect_success "move $m (by HEAD)" '
        test $B = $(git show-ref -s --verify $m)
 '
 test_expect_success "delete $m (by HEAD) should remove both packed and loose $m" '
-       test_when_finished "rm -f .git/$m" &&
+       test_when_finished "git update-ref -d $m" &&
        git update-ref -d HEAD $B &&
        ! grep "$m" .git/packed-refs &&
-       test_path_is_missing .git/$m
+       test_must_fail git show-ref --verify -q $m
 '
 
-cp -f .git/HEAD .git/HEAD.orig
 test_expect_success 'delete symref without dereference' '
-       test_when_finished "cp -f .git/HEAD.orig .git/HEAD" &&
-       git update-ref --no-deref -d HEAD &&
-       test_path_is_missing .git/HEAD
+       test_when_finished "git update-ref -d $m" &&
+       echo foo >foo.c &&
+       git add foo.c &&
+       git commit -m foo &&
+       git symbolic-ref SYMREF $m &&
+       git update-ref --no-deref -d SYMREF &&
+       git show-ref --verify -q $m &&
+       test_must_fail git show-ref --verify -q SYMREF &&
+       test_must_fail git symbolic-ref SYMREF
 '
 
 test_expect_success 'delete symref without dereference when the referred ref is packed' '
-       test_when_finished "cp -f .git/HEAD.orig .git/HEAD" &&
+       test_when_finished "git update-ref -d $m" &&
        echo foo >foo.c &&
        git add foo.c &&
        git commit -m foo &&
+       git symbolic-ref SYMREF $m &&
        git pack-refs --all &&
-       git update-ref --no-deref -d HEAD &&
-       test_path_is_missing .git/HEAD
+       git update-ref --no-deref -d SYMREF &&
+       git show-ref --verify -q $m &&
+       test_must_fail git show-ref --verify -q SYMREF &&
+       test_must_fail git symbolic-ref SYMREF
 '
 
-git update-ref -d $m
-
 test_expect_success 'update-ref -d is not confused by self-reference' '
        git symbolic-ref refs/heads/self refs/heads/self &&
        test_when_finished "rm -f .git/refs/heads/self" &&
@@ -226,25 +232,25 @@ test_expect_success 'update-ref --no-deref -d can delete self-reference' '
        test_when_finished "rm -f .git/refs/heads/self" &&
        test_path_is_file .git/refs/heads/self &&
        git update-ref --no-deref -d refs/heads/self &&
-       test_path_is_missing .git/refs/heads/self
+       test_must_fail git show-ref --verify -q refs/heads/self
 '
 
 test_expect_success 'update-ref --no-deref -d can delete reference to bad ref' '
        >.git/refs/heads/bad &&
        test_when_finished "rm -f .git/refs/heads/bad" &&
        git symbolic-ref refs/heads/ref-to-bad refs/heads/bad &&
-       test_when_finished "rm -f .git/refs/heads/ref-to-bad" &&
+       test_when_finished "git update-ref -d refs/heads/ref-to-bad" &&
        test_path_is_file .git/refs/heads/ref-to-bad &&
        git update-ref --no-deref -d refs/heads/ref-to-bad &&
-       test_path_is_missing .git/refs/heads/ref-to-bad
+       test_must_fail git show-ref --verify -q refs/heads/ref-to-bad
 '
 
 test_expect_success '(not) create HEAD with old sha1' '
        test_must_fail git update-ref HEAD $A $B
 '
 test_expect_success "(not) prior created .git/$m" '
-       test_when_finished "rm -f .git/$m" &&
-       test_path_is_missing .git/$m
+       test_when_finished "git update-ref -d $m" &&
+       test_must_fail git show-ref --verify -q $m
 '
 
 test_expect_success 'create HEAD' '
@@ -254,7 +260,7 @@ test_expect_success '(not) change HEAD with wrong SHA1' '
        test_must_fail git update-ref HEAD $B $Z
 '
 test_expect_success "(not) changed .git/$m" '
-       test_when_finished "rm -f .git/$m" &&
+       test_when_finished "git update-ref -d $m" &&
        ! test $B = $(git show-ref -s --verify $m)
 '
 
@@ -284,8 +290,8 @@ test_expect_success 'empty directory removal' '
        test_path_is_file .git/refs/heads/d1/d2/r1 &&
        test_path_is_file .git/logs/refs/heads/d1/d2/r1 &&
        git branch -d d1/d2/r1 &&
-       test_path_is_missing .git/refs/heads/d1/d2 &&
-       test_path_is_missing .git/logs/refs/heads/d1/d2 &&
+       test_must_fail git show-ref --verify -q refs/heads/d1/d2 &&
+       test_must_fail git show-ref --verify -q logs/refs/heads/d1/d2 &&
        test_path_is_file .git/refs/heads/d1/r2 &&
        test_path_is_file .git/logs/refs/heads/d1/r2
 '
@@ -298,8 +304,8 @@ test_expect_success 'symref empty directory removal' '
        test_path_is_file .git/refs/heads/e1/e2/r1 &&
        test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
        git update-ref -d HEAD &&
-       test_path_is_missing .git/refs/heads/e1/e2 &&
-       test_path_is_missing .git/logs/refs/heads/e1/e2 &&
+       test_must_fail git show-ref --verify -q refs/heads/e1/e2 &&
+       test_must_fail git show-ref --verify -q logs/refs/heads/e1/e2 &&
        test_path_is_file .git/refs/heads/e1/r2 &&
        test_path_is_file .git/logs/refs/heads/e1/r2 &&
        test_path_is_file .git/logs/HEAD
@@ -585,10 +591,10 @@ test_expect_success 'stdin fails on unbalanced quotes' '
        grep "fatal: badly quoted argument: \\\"master" err
 '
 
-test_expect_success 'stdin fails on invalid escape' '
-       echo "create $a \"ma\zter\"" >stdin &&
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' '
+       echo "create $a \"ma\zn\"" >stdin &&
        test_must_fail git update-ref --stdin <stdin 2>err &&
-       grep "fatal: badly quoted argument: \\\"ma\\\\zter\\\"" err
+       grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
 '
 
 test_expect_success 'stdin fails on junk after quoted argument' '
@@ -704,9 +710,9 @@ test_expect_success 'stdin succeeds with quoted argument' '
        test_cmp expect actual
 '
 
-test_expect_success 'stdin succeeds with escaped character' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' '
        git update-ref -d $a &&
-       echo "create $a \"ma\\163ter\"" >stdin &&
+       echo "create $a \"ma\\151n\"" >stdin &&
        git update-ref --stdin <stdin &&
        git rev-parse $m >expect &&
        git rev-parse $a >actual &&
@@ -1388,7 +1394,8 @@ test_expect_success 'handle per-worktree refs in refs/bisect' '
                git rev-parse refs/bisect/something >../worktree-head &&
                git for-each-ref | grep refs/bisect/something
        ) &&
-       test_path_is_missing .git/refs/bisect &&
+       git show-ref >actual &&
+       ! grep 'refs/bisect' actual &&
        test_must_fail git rev-parse refs/bisect/something &&
        git update-ref refs/bisect/something HEAD &&
        git rev-parse refs/bisect/something >main-head &&
@@ -1500,7 +1507,7 @@ test_expect_success 'transaction can handle abort' '
        git update-ref --stdin <stdin >actual &&
        printf "%s: ok\n" start abort >expect &&
        test_cmp expect actual &&
-       test_path_is_missing .git/$b
+       test_must_fail git show-ref --verify -q $b
 '
 
 test_expect_success 'transaction aborts by default' '
@@ -1511,7 +1518,7 @@ test_expect_success 'transaction aborts by default' '
        git update-ref --stdin <stdin >actual &&
        printf "%s: ok\n" start >expect &&
        test_cmp expect actual &&
-       test_path_is_missing .git/$b
+       test_must_fail git show-ref --verify -q $b
 '
 
 test_expect_success 'transaction with prepare aborts by default' '
@@ -1523,7 +1530,68 @@ test_expect_success 'transaction with prepare aborts by default' '
        git update-ref --stdin <stdin >actual &&
        printf "%s: ok\n" start prepare >expect &&
        test_cmp expect actual &&
-       test_path_is_missing .git/$b
+       test_must_fail git show-ref --verify -q $b
+'
+
+test_expect_success 'transaction can commit multiple times' '
+       cat >stdin <<-EOF &&
+       start
+       create refs/heads/branch-1 $A
+       commit
+       start
+       create refs/heads/branch-2 $B
+       commit
+       EOF
+       git update-ref --stdin <stdin >actual &&
+       printf "%s: ok\n" start commit start commit >expect &&
+       test_cmp expect actual &&
+       echo "$A" >expect &&
+       git rev-parse refs/heads/branch-1 >actual &&
+       test_cmp expect actual &&
+       echo "$B" >expect &&
+       git rev-parse refs/heads/branch-2 >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'transaction can create and delete' '
+       cat >stdin <<-EOF &&
+       start
+       create refs/heads/create-and-delete $A
+       commit
+       start
+       delete refs/heads/create-and-delete $A
+       commit
+       EOF
+       git update-ref --stdin <stdin >actual &&
+       printf "%s: ok\n" start commit start commit >expect &&
+       test_must_fail git show-ref --verify refs/heads/create-and-delete
+'
+
+test_expect_success 'transaction can commit after abort' '
+       cat >stdin <<-EOF &&
+       start
+       create refs/heads/abort $A
+       abort
+       start
+       create refs/heads/abort $A
+       commit
+       EOF
+       git update-ref --stdin <stdin >actual &&
+       printf "%s: ok\n" start abort start commit >expect &&
+       echo "$A" >expect &&
+       git rev-parse refs/heads/abort >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'transaction cannot restart ongoing transaction' '
+       cat >stdin <<-EOF &&
+       start
+       create refs/heads/restart $A
+       start
+       commit
+       EOF
+       test_must_fail git update-ref --stdin <stdin >actual &&
+       test_must_fail git show-ref --verify refs/heads/restart
 '
 
 test_done
index 492edffa9cfb626b4747ead04251fc33b0502ac9..dc9fe3cbf1b09ea6498cc73ca394adccef34d98a 100755 (executable)
@@ -144,4 +144,17 @@ test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
        test_must_fail git rev-parse --verify broken
 '
 
+test_expect_success 'options can appear after --verify' '
+       git rev-parse --verify HEAD >expect &&
+       git rev-parse --verify -q HEAD >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'verify respects --end-of-options' '
+       git update-ref refs/heads/-tricky HEAD &&
+       git rev-parse --verify HEAD >expect &&
+       git rev-parse --verify --end-of-options -tricky >actual &&
+       test_cmp expect actual
+'
+
 test_done
index 3e657e693b272dec5711593ae85eec7c6725b9dc..e2ae15a2cf8542d066b3ea21d485d11689568e6e 100755 (executable)
@@ -254,4 +254,29 @@ test_expect_success 'escaped char does not trigger wildcard rule' '
        test_must_fail git rev-parse "foo\\*bar"
 '
 
+test_expect_success 'arg after dashdash not interpreted as option' '
+       cat >expect <<-\EOF &&
+       --
+       --local-env-vars
+       EOF
+       git rev-parse -- --local-env-vars >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'arg after end-of-options not interpreted as option' '
+       test_must_fail git rev-parse --end-of-options --not-real -- 2>err &&
+       test_i18ngrep bad.revision.*--not-real err
+'
+
+test_expect_success 'end-of-options still allows --' '
+       cat >expect <<-EOF &&
+       --end-of-options
+       $(git rev-parse --verify HEAD)
+       --
+       path
+       EOF
+       git rev-parse --end-of-options HEAD -- path >actual &&
+       test_cmp expect actual
+'
+
 test_done
index 9974457f5615c9c9204ebfaff6d42c621836fdec..bbfe05b8e4a5c4c13e531647bfa460c0a552de2e 100755 (executable)
@@ -79,7 +79,7 @@ setup_repo () {
        name=$1 worktreecfg=$2 gitfile=$3 barecfg=$4 &&
        sane_unset GIT_DIR GIT_WORK_TREE &&
 
-       git init "$name" &&
+       git -c init.defaultBranch=initial init "$name" &&
        maybe_config "$name/.git/config" core.worktree "$worktreecfg" &&
        maybe_config "$name/.git/config" core.bare "$barecfg" &&
        mkdir -p "$name/sub/sub" &&
index a12afe93f32948dd994d55418ed93485757d2ba8..a9352b08a8b80e4a58131f31f98eb7481914ecbe 100755 (executable)
@@ -88,9 +88,17 @@ test_expect_success 'checkout all stage 2 to temporary files' '
        done
 '
 
+test_expect_success 'checkout all stages of unknown path' '
+       rm -f path* .merge_* actual &&
+       test_must_fail git checkout-index --stage=all --temp \
+               -- does-not-exist 2>stderr &&
+       test_i18ngrep not.in.the.cache stderr
+'
+
 test_expect_success 'checkout all stages/one file to nothing' '
        rm -f path* .merge_* actual &&
-       git checkout-index --stage=all --temp -- path0 >actual &&
+       git checkout-index --stage=all --temp -- path0 >actual 2>stderr &&
+       test_must_be_empty stderr &&
        test_line_count = 0 actual
 '
 
index 57cbdfe9bce93ddd33df08fec506be93e362db58..8e181dbf01c46a324b54471cc62e1c9291852079 100755 (executable)
@@ -21,4 +21,15 @@ test_expect_success 'checkout-index -h in broken repository' '
        test_i18ngrep "[Uu]sage" broken/usage
 '
 
+test_expect_success 'checkout-index reports errors (cmdline)' '
+       test_must_fail git checkout-index -- does-not-exist 2>stderr &&
+       test_i18ngrep not.in.the.cache stderr
+'
+
+test_expect_success 'checkout-index reports errors (stdin)' '
+       echo does-not-exist |
+       test_must_fail git checkout-index --stdin 2>stderr &&
+       test_i18ngrep not.in.the.cache stderr
+'
+
 test_done
index 47aeb0b1674c01fd35e3aef759756348026a04bb..d91a329eb31af78110ced886c2680346f94236fc 100755 (executable)
@@ -18,6 +18,10 @@ test_expect_success PERL 'setup' '
 
 # note: bar sorts before dir/foo, so the first 'n' is always to skip 'bar'
 
+# NEEDSWORK: Since the builtin add-p is used when $GIT_TEST_ADD_I_USE_BUILTIN
+# is given, we should replace the PERL prerequisite with an ADD_I prerequisite
+# which first checks if $GIT_TEST_ADD_I_USE_BUILTIN is defined before checking
+# PERL.
 test_expect_success PERL 'saying "n" does nothing' '
        set_and_save_state dir/foo work head &&
        test_write_lines n n | git checkout -p &&
@@ -59,6 +63,13 @@ test_expect_success PERL 'git checkout -p HEAD with change already staged' '
        verify_state dir/foo head head
 '
 
+test_expect_success PERL 'git checkout -p HEAD^...' '
+       # the third n is to get out in case it mistakenly does not apply
+       test_write_lines n y n | git checkout -p HEAD^... &&
+       verify_saved_state bar &&
+       verify_state dir/foo parent parent
+'
+
 test_expect_success PERL 'git checkout -p HEAD^' '
        # the third n is to get out in case it mistakenly does not apply
        test_write_lines n y n | git checkout -p HEAD^ &&
index accfa9aa4bd82a5f13d3ce5e3755f33f47b38e3e..a4f8d3a67e8a4a36d6bccdda6a83da15c53ee5f3 100755 (executable)
@@ -166,6 +166,17 @@ test_expect_success '--no-guess suppresses branch auto-vivification' '
        test_branch master
 '
 
+test_expect_success 'checkout.guess = false suppresses branch auto-vivification' '
+       git checkout -B master &&
+       status_uno_is_clean &&
+       test_might_fail git branch -D bar &&
+
+       test_config checkout.guess false &&
+       test_must_fail git checkout bar &&
+       test_must_fail git rev-parse --verify refs/heads/bar &&
+       test_branch master
+'
+
 test_expect_success 'setup more remotes with unconventional refspecs' '
        git checkout -B master &&
        status_uno_is_clean &&
index 2c1b8c0d6d22469fadd9eeb05a19c1b7a53d0f51..68c9101b02f32d943ec5c167d7a726747f5970e4 100755 (executable)
@@ -85,9 +85,12 @@ test_expect_success 'switching ignores file of same branch name' '
        test_cmp expected actual
 '
 
-test_expect_success 'guess and create branch ' '
+test_expect_success 'guess and create branch' '
        test_when_finished git switch master &&
        test_must_fail git switch --no-guess foo &&
+       test_config checkout.guess false &&
+       test_must_fail git switch foo &&
+       test_config checkout.guess true &&
        git switch foo &&
        echo refs/heads/foo >expected &&
        git symbolic-ref HEAD >actual &&
index 98b2476e7c79f74745d8276035f94fe52a7133e5..b5c5c0ff7e37ced9b6b50a06e4ec3e30c536cd53 100755 (executable)
@@ -60,6 +60,14 @@ test_expect_success PERL 'git restore -p --source=HEAD^' '
        verify_state dir/foo parent index
 '
 
+test_expect_success PERL 'git restore -p --source=HEAD^...' '
+       set_state dir/foo work index &&
+       # the third n is to get out in case it mistakenly does not apply
+       test_write_lines n y n | git restore -p --source=HEAD^... &&
+       verify_saved_state bar &&
+       verify_state dir/foo parent index
+'
+
 test_expect_success PERL 'git restore -p handles deletion' '
        set_state dir/foo work index &&
        rm dir/foo &&
index 99d858c6b755f9d074173b25253a0ae0184ed23d..2d450daf5c8a441acda6eda604e2e28f749bc2dd 100755 (executable)
@@ -5,20 +5,23 @@ test_description='git update-index --assume-unchanged test.
 
 . ./test-lib.sh
 
-test_expect_success 'setup' \
-       ': >file &&
-        git add file &&
-        git commit -m initial &&
-        git branch other &&
-        echo upstream >file &&
-        git add file &&
-        git commit -m upstream'
+test_expect_success 'setup' '
+       : >file &&
+       git add file &&
+       git commit -m initial &&
+       git branch other &&
+       echo upstream >file &&
+       git add file &&
+       git commit -m upstream
+'
 
-test_expect_success 'do not switch branches with dirty file' \
-       'git reset --hard &&
-        git checkout other &&
-        echo dirt >file &&
-        git update-index --assume-unchanged file &&
-        test_must_fail git checkout master'
+test_expect_success 'do not switch branches with dirty file' '
+       git reset --hard &&
+       git checkout other &&
+       echo dirt >file &&
+       git update-index --assume-unchanged file &&
+       test_must_fail git checkout - 2>err &&
+       test_i18ngrep overwritten err
+'
 
 test_done
index f764b7e3f53e95e11acd4c2bdaafb737979d45e2..7cb7a7038277fdf5e55e984f998d56324d7c62cd 100755 (executable)
@@ -179,7 +179,8 @@ test_expect_success 'add -u resolves unmerged paths' '
 
 test_expect_success '"add -u non-existent" should fail' '
        test_must_fail git add -u non-existent &&
-       ! (git ls-files | grep "non-existent")
+       git ls-files >actual &&
+       ! grep "non-existent" actual
 '
 
 test_done
index 52585ec2aa8ba6d9104060361523c1b307bebfda..795ddca2e438f4c83df373bfe94195de60fd90bd 100755 (executable)
@@ -61,6 +61,16 @@ test_expect_success '"list" all worktrees --porcelain' '
        test_cmp expect actual
 '
 
+test_expect_success '"list" all worktrees with locked annotation' '
+       test_when_finished "rm -rf locked unlocked out && git worktree prune" &&
+       git worktree add --detach locked master &&
+       git worktree add --detach unlocked master &&
+       git worktree lock locked &&
+       git worktree list >out &&
+       grep "/locked  *[0-9a-f].* locked$" out &&
+       ! grep "/unlocked  *[0-9a-f].* locked$" out
+'
+
 test_expect_success 'bare repo setup' '
        git init --bare bare1 &&
        echo "data" >file1 &&
index b81eb5fd6ffaf02d2a404bcbbf71e674494fd6cb..6abdcbbc94ab46944123f817700cc1ea36ae831b 100755 (executable)
@@ -79,7 +79,4 @@ test_expect_success 'checkout in superproject' '
        git diff-index --exit-code --raw --cached save -- sub1
 '
 
-# just interesting what happened...
-# git diff --name-status -M save master
-
 test_done
index 6efe7a44bc628f413f965b379771e0376b605911..a0b832d59e611cd848a1bf5fc8d6334cbd5f3833 100755 (executable)
@@ -321,11 +321,11 @@ test_expect_success 'git branch --list -v with --abbrev' '
 
 '
 
-test_expect_success 'git branch --column' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' '
        COLUMNS=81 git branch --column=column >actual &&
        cat >expect <<\EOF &&
-  a/b/c    bam      foo      l      * master   n        o/p      r
-  abc      bar      j/k      m/m      mb       o/o      q        topic
+  a/b/c   bam     foo     l     * main    n       o/p     r
+  abc     bar     j/k     m/m     mb      o/o     q       topic
 EOF
        test_cmp expect actual
 '
@@ -358,15 +358,15 @@ EOF
        test_cmp expect actual
 '
 
-test_expect_success 'git branch with column.*' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' '
        git config column.ui column &&
        git config column.branch "dense" &&
        COLUMNS=80 git branch >actual &&
        git config --unset column.branch &&
        git config --unset column.ui &&
        cat >expect <<\EOF &&
-  a/b/c   bam   foo   l   * master   n     o/p   r
-  abc     bar   j/k   m/m   mb       o/o   q     topic
+  a/b/c   bam   foo   l   * main   n     o/p   r
+  abc     bar   j/k   m/m   mb     o/o   q     topic
 EOF
        test_cmp expect actual
 '
@@ -375,9 +375,9 @@ test_expect_success 'git branch --column -v should fail' '
        test_must_fail git branch --column -v
 '
 
-test_expect_success 'git branch -v with column.ui ignored' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' '
        git config column.ui column &&
-       COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
+       COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
        git config --unset column.ui &&
        cat >expect <<\EOF &&
   a/b/c
index efea5c49713888f12f19d693916553b8c9abd322..3733cd0091e5a44f059e402ec8283681356375ab 100755 (executable)
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' '
 # Here "topic" tracks "master" with one extra commit, and "zzz" points to the
 # same tip as master The name "zzz" must come alphabetically after "topic"
 # as we process them in that order.
-test_expect_success 'branch --merged with --verbose' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' '
        git branch --track topic master &&
        git branch zzz topic &&
        git checkout topic &&
@@ -256,9 +256,9 @@ test_expect_success 'branch --merged with --verbose' '
        test_cmp expect actual &&
        git branch --verbose --merged topic >actual &&
        cat >expect <<-EOF &&
-         master $(git rev-parse --short master) second on master
-       * topic  $(git rev-parse --short topic ) [ahead 1] foo
-         zzz    $(git rev-parse --short zzz   ) second on master
+         main  $(git rev-parse --short main) second on main
+       * topic $(git rev-parse --short topic ) [ahead 1] foo
+         zzz   $(git rev-parse --short zzz   ) second on main
        EOF
        test_i18ncmp expect actual
 '
index 71818b90f00d3727cb00e24da181fc9dec420f08..d65586541d2cce7a7466cfe735eb87f831afd589 100755 (executable)
@@ -329,7 +329,7 @@ test_expect_success '--color overrides auto-color' '
        test_cmp expect.color actual
 '
 
-test_expect_success 'verbose output lists worktree path' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' '
        one=$(git rev-parse --short HEAD) &&
        two=$(git rev-parse --short master) &&
        cat >expect <<-EOF &&
@@ -337,7 +337,7 @@ test_expect_success 'verbose output lists worktree path' '
          ambiguous                    $one one
          branch-one                   $two two
        + branch-two                   $one ($(pwd)/worktree_dir) one
-         master                       $two two
+         main                         $two two
          ref-to-branch                $two two
          ref-to-remote                $two two
        EOF
index 4f1e16bb44e279a0c5c0fc96f95eb285e4b22c3c..289625c4646464c412384c6c498383fe7e577da3 100755 (executable)
@@ -28,12 +28,12 @@ test_expect_success 'regular output shows colors' '
        test_cmp expect actual
 '
 
-test_expect_success 'verbose output shows colors' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
        oid=$(git rev-parse --short HEAD) &&
        cat >expect <<-EOF &&
-       * <CYAN>master               <RESET> $oid foo
-         <BLUE>other                <RESET> $oid foo
-         <YELLOW>remotes/origin/master<RESET> $oid foo
+       * <CYAN>main               <RESET> $oid foo
+         <BLUE>other              <RESET> $oid foo
+         <YELLOW>remotes/origin/main<RESET> $oid foo
        EOF
        git branch --color -v -a >actual.raw &&
        test_decode_color <actual.raw >actual &&
index 8f4330300707191fe1fcf94e0f3ea29ac55d3c4e..ca60faf48005e12687b990b7c64edc825d91a19f 100755 (executable)
@@ -672,6 +672,11 @@ test_expect_success 'notes.displayRef respects order' '
        test_cmp expect-both-reversed actual
 '
 
+test_expect_success 'notes.displayRef with no value handled gracefully' '
+       test_must_fail git -c notes.displayRef log -0 --notes &&
+       test_must_fail git -c notes.displayRef diff-tree --notes HEAD
+'
+
 test_expect_success 'GIT_NOTES_DISPLAY_REF works' '
        GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \
                git log -2 >actual &&
index 07a1617351dad9729b1b440422fced90a01cc25f..b06fc3615998584473b34cd5e4bfbba4fae70d83 100755 (executable)
@@ -12,7 +12,7 @@ Initial setup:
 
      one - two - three - four (conflict-branch)
    /
- A - B - C - D - E            (master)
+ A - B - C - D - E            (primary)
  | \
  |   F - G - H                (branch1)
  |     \
@@ -30,6 +30,7 @@ Initial setup:
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
 test_expect_success 'setup' '
+       git switch -C primary &&
        test_commit A file1 &&
        test_commit B file1 &&
        test_commit C file2 &&
@@ -65,7 +66,7 @@ SHELL=
 export SHELL
 
 test_expect_success 'rebase --keep-empty' '
-       git checkout -b emptybranch master &&
+       git checkout -b emptybranch primary &&
        git commit --allow-empty -m "empty" &&
        git rebase --keep-empty -i HEAD~2 &&
        git log --oneline >actual &&
@@ -86,7 +87,7 @@ test_expect_success 'rebase -i with empty todo list' '
 '
 
 test_expect_success 'rebase -i with the exec command' '
-       git checkout master &&
+       git checkout primary &&
        (
        set_fake_editor &&
        FAKE_LINES="1 exec_>touch-one
@@ -103,12 +104,12 @@ test_expect_success 'rebase -i with the exec command' '
        test_path_is_file touch-three &&
        test_path_is_file "touch-file  name with spaces" &&
        test_path_is_file touch-after-semicolon &&
-       test_cmp_rev master HEAD &&
+       test_cmp_rev primary HEAD &&
        rm -f touch-*
 '
 
 test_expect_success 'rebase -i with the exec command runs from tree root' '
-       git checkout master &&
+       git checkout primary &&
        mkdir subdir && (cd subdir &&
        set_fake_editor &&
        FAKE_LINES="1 exec_>touch-subdir" \
@@ -121,7 +122,7 @@ test_expect_success 'rebase -i with the exec command runs from tree root' '
 test_expect_success 'rebase -i with exec allows git commands in subdirs' '
        test_when_finished "rm -rf subdir" &&
        test_when_finished "git rebase --abort ||:" &&
-       git checkout master &&
+       git checkout primary &&
        mkdir subdir && (cd subdir &&
        set_fake_editor &&
        FAKE_LINES="1 x_cd_subdir_&&_git_rev-parse_--is-inside-work-tree" \
@@ -139,13 +140,13 @@ test_expect_success 'rebase -i sets work tree properly' '
 '
 
 test_expect_success 'rebase -i with the exec command checks tree cleanness' '
-       git checkout master &&
+       git checkout primary &&
        (
                set_fake_editor &&
                test_must_fail env FAKE_LINES="exec_echo_foo_>file1 1" \
                        git rebase -i HEAD^
        ) &&
-       test_cmp_rev master^ HEAD &&
+       test_cmp_rev primary^ HEAD &&
        git reset --hard &&
        git rebase --continue
 '
@@ -168,7 +169,7 @@ test_expect_success 'rebase -x with newline in command fails' '
 '
 
 test_expect_success 'rebase -i with exec of inexistent command' '
-       git checkout master &&
+       git checkout primary &&
        test_when_finished "git rebase --abort" &&
        (
                set_fake_editor &&
@@ -259,8 +260,8 @@ test_expect_success 'stop on conflicting pick' '
        >>>>>>> $commit (G)
        EOF
        git tag new-branch1 &&
-       test_must_fail git rebase -i master &&
-       test "$(git rev-parse HEAD~3)" = "$(git rev-parse master)" &&
+       test_must_fail git rebase -i primary &&
+       test "$(git rev-parse HEAD~3)" = "$(git rev-parse primary)" &&
        test_cmp expect .git/rebase-merge/patch &&
        test_cmp expect2 file1 &&
        test "$(git diff --name-status |
@@ -287,7 +288,7 @@ test_expect_success 'abort' '
 test_expect_success 'abort with error when new base cannot be checked out' '
        git rm --cached file1 &&
        git commit -m "remove file in base" &&
-       test_must_fail git rebase -i master > output 2>&1 &&
+       test_must_fail git rebase -i primary > output 2>&1 &&
        test_i18ngrep "The following untracked working tree files would be overwritten by checkout:" \
                output &&
        test_i18ngrep "file1" output &&
@@ -301,7 +302,7 @@ test_expect_success 'retain authorship' '
        test_tick &&
        GIT_AUTHOR_NAME="Twerp Snog" git commit -m "different author" &&
        git tag twerp &&
-       git rebase -i --onto master HEAD^ &&
+       git rebase -i --onto primary HEAD^ &&
        git show HEAD | grep "^Author: Twerp Snog"
 '
 
@@ -336,10 +337,10 @@ test_expect_success 'squash' '
        (
                set_fake_editor &&
                FAKE_LINES="1 squash 2" EXPECT_HEADER_COUNT=2 \
-                       git rebase -i --onto master HEAD~2
+                       git rebase -i --onto primary HEAD~2
        ) &&
        test B = $(cat file7) &&
-       test_cmp_rev HEAD^ master
+       test_cmp_rev HEAD^ primary
 '
 
 test_expect_success 'retain authorship when squashing' '
@@ -366,12 +367,12 @@ test_expect_failure REBASE_P 'exchange two commits with -p' '
 '
 
 test_expect_success REBASE_P 'preserve merges with -p' '
-       git checkout -b to-be-preserved master^ &&
+       git checkout -b to-be-preserved primary^ &&
        : > unrelated-file &&
        git add unrelated-file &&
        test_tick &&
        git commit -m "unrelated" &&
-       git checkout -b another-branch master &&
+       git checkout -b another-branch primary &&
        echo B > file1 &&
        test_tick &&
        git commit -m J file1 &&
@@ -394,7 +395,7 @@ test_expect_success REBASE_P 'preserve merges with -p' '
        git commit -m M file1 &&
        git checkout -b to-be-rebased &&
        test_tick &&
-       git rebase -i -p --onto branch1 master &&
+       git rebase -i -p --onto branch1 primary &&
        git update-index --refresh &&
        git diff-files --quiet &&
        git diff-index --quiet --cached HEAD -- &&
@@ -437,7 +438,7 @@ test_expect_success '--continue tries to commit' '
 '
 
 test_expect_success 'verbose flag is heeded, even after --continue' '
-       git reset --hard master@{1} &&
+       git reset --hard primary@{1} &&
        test_tick &&
        test_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&
        echo resolved > file1 &&
@@ -802,7 +803,7 @@ test_expect_success 'rebase -i continue with unstaged submodule' '
 '
 
 test_expect_success 'avoid unnecessary reset' '
-       git checkout master &&
+       git checkout primary &&
        git reset --hard &&
        test-tool chmtime =123456789 file3 &&
        git update-index --refresh &&
@@ -814,14 +815,14 @@ test_expect_success 'avoid unnecessary reset' '
 '
 
 test_expect_success 'reword' '
-       git checkout -b reword-branch master &&
+       git checkout -b reword-branch primary &&
        (
                set_fake_editor &&
                FAKE_LINES="1 2 3 reword 4" FAKE_COMMIT_MESSAGE="E changed" \
                        git rebase -i A &&
                git show HEAD | grep "E changed" &&
-               test $(git rev-parse master) != $(git rev-parse HEAD) &&
-               test_cmp_rev master^ HEAD^ &&
+               test $(git rev-parse primary) != $(git rev-parse HEAD) &&
+               test_cmp_rev primary^ HEAD^ &&
                FAKE_LINES="1 2 reword 3 4" FAKE_COMMIT_MESSAGE="D changed" \
                        git rebase -i A &&
                git show HEAD^ | grep "D changed" &&
@@ -918,7 +919,7 @@ test_expect_success 'rebase-i history with funny messages' '
 '
 
 test_expect_success 'prepare for rebase -i --exec' '
-       git checkout master &&
+       git checkout primary &&
        git checkout -b execute &&
        test_commit one_exec main.txt one_exec &&
        test_commit two_exec main.txt two_exec &&
@@ -1027,7 +1028,7 @@ test_expect_success 'rebase -i --exec without <CMD>' '
        git reset --hard execute &&
        test_must_fail git rebase -i --exec 2>actual &&
        test_i18ngrep "requires a value" actual &&
-       git checkout master
+       git checkout primary
 '
 
 test_expect_success 'rebase -i --root re-order and drop commits' '
@@ -1079,7 +1080,7 @@ test_expect_success 'rebase -i --root fixup root commit' '
 
 test_expect_success 'rebase -i --root reword original root commit' '
        test_when_finished "test_might_fail git rebase --abort" &&
-       git checkout -b reword-original-root-branch master &&
+       git checkout -b reword-original-root-branch primary &&
        (
                set_fake_editor &&
                FAKE_LINES="reword 1 2" FAKE_COMMIT_MESSAGE="A changed" \
@@ -1091,7 +1092,7 @@ test_expect_success 'rebase -i --root reword original root commit' '
 
 test_expect_success 'rebase -i --root reword new root commit' '
        test_when_finished "test_might_fail git rebase --abort" &&
-       git checkout -b reword-now-root-branch master &&
+       git checkout -b reword-now-root-branch primary &&
        (
                set_fake_editor &&
                FAKE_LINES="reword 3 1" FAKE_COMMIT_MESSAGE="C changed" \
@@ -1251,7 +1252,7 @@ test_expect_success 'rebase -i error on commits with \ in message' '
 '
 
 test_expect_success 'short commit ID setup' '
-       test_when_finished "git checkout master" &&
+       test_when_finished "git checkout primary" &&
        git checkout --orphan collide &&
        git rm -rf . &&
        (
@@ -1292,7 +1293,7 @@ test_expect_success 'short commit ID collide' '
        t3404_collider  sha1:ac4f2ee
        t3404_collider  sha256:16697
        EOF
-       test_when_finished "reset_rebase && git checkout master" &&
+       test_when_finished "reset_rebase && git checkout primary" &&
        git checkout collide &&
        colliding_id=$(test_oid t3404_collision) &&
        hexsz=$(test_oid hexsz) &&
@@ -1416,11 +1417,11 @@ test_expect_success 'rebase --continue removes CHERRY_PICK_HEAD' '
 
 rebase_setup_and_clean () {
        test_when_finished "
-               git checkout master &&
+               git checkout primary &&
                test_might_fail git branch -D $1 &&
                test_might_fail git rebase --abort
        " &&
-       git checkout -b $1 ${2:-master}
+       git checkout -b $1 ${2:-primary}
 }
 
 test_expect_success 'drop' '
@@ -1451,7 +1452,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '
        cat >expect <<-EOF &&
        Warning: some commits may have been dropped accidentally.
        Dropped commits (newer to older):
-        - $(git rev-list --pretty=oneline --abbrev-commit -1 master)
+        - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)
        To avoid this message, use "drop" to explicitly remove a commit.
        EOF
        test_config rebase.missingCommitsCheck warn &&
@@ -1469,8 +1470,8 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
        cat >expect <<-EOF &&
        Warning: some commits may have been dropped accidentally.
        Dropped commits (newer to older):
-        - $(git rev-list --pretty=oneline --abbrev-commit -1 master)
-        - $(git rev-list --pretty=oneline --abbrev-commit -1 master~2)
+        - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)
+        - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~2)
        To avoid this message, use "drop" to explicitly remove a commit.
 
        Use '\''git config rebase.missingCommitsCheck'\'' to change the level of warnings.
@@ -1512,11 +1513,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ig
 
 test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = warn' '
        cat >expect <<-EOF &&
-       error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 master~4)
+       error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
        Warning: some commits may have been dropped accidentally.
        Dropped commits (newer to older):
-        - $(git rev-list --pretty=oneline --abbrev-commit -1 master)
-        - $(git rev-list --pretty=oneline --abbrev-commit -1 master~4)
+        - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)
+        - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
        To avoid this message, use "drop" to explicitly remove a commit.
        EOF
        head -n4 expect >expect.2 &&
@@ -1546,11 +1547,11 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa
 
 test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = error' '
        cat >expect <<-EOF &&
-       error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 master~4)
+       error: invalid line 1: badcmd $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
        Warning: some commits may have been dropped accidentally.
        Dropped commits (newer to older):
-        - $(git rev-list --pretty=oneline --abbrev-commit -1 master)
-        - $(git rev-list --pretty=oneline --abbrev-commit -1 master~4)
+        - $(git rev-list --pretty=oneline --abbrev-commit -1 primary)
+        - $(git rev-list --pretty=oneline --abbrev-commit -1 primary~4)
        To avoid this message, use "drop" to explicitly remove a commit.
 
        Use '\''git config rebase.missingCommitsCheck'\'' to change the level of warnings.
@@ -1635,7 +1636,7 @@ test_expect_success 'respects rebase.abbreviateCommands with fixup, squash and e
        (
                set_cat_todo_editor &&
                test_must_fail git rebase -i --exec "git show HEAD" \
-                       --autosquash master >actual
+                       --autosquash primary >actual
        ) &&
        test_cmp expected actual
 '
@@ -1646,7 +1647,7 @@ test_expect_success 'static check of bad command' '
                set_fake_editor &&
                test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
                git rebase -i --root 2>actual &&
-               test_i18ngrep "badcmd $(git rev-list --oneline -1 master~1)" \
+               test_i18ngrep "badcmd $(git rev-list --oneline -1 primary~1)" \
                                actual &&
                test_i18ngrep "You can fix this with .git rebase --edit-todo.." \
                                actual &&
@@ -1797,6 +1798,17 @@ test_expect_success 'todo has correct onto hash' '
        test_i18ngrep "^# Rebase ..* onto $onto" actual
 '
 
+test_expect_success 'ORIG_HEAD is updated correctly' '
+       test_when_finished "git checkout primary && git branch -D test-orig-head" &&
+       git checkout -b test-orig-head A &&
+       git commit --allow-empty -m A1 &&
+       git commit --allow-empty -m A2 &&
+       git commit --allow-empty -m A3 &&
+       git commit --allow-empty -m A4 &&
+       git rebase primary &&
+       test_cmp_rev ORIG_HEAD test-orig-head@{1}
+'
+
 # This must be the last test in this file
 test_expect_success '$EDITOR and friends are unchanged' '
        test_editor_unchanged
index 927a4f4a4e4a2d1d79f3d12f77ae4918c4fd6cee..4afc528165998e3e16d9a444a936f7f46f861335 100755 (executable)
@@ -46,22 +46,22 @@ test_expect_success 'rebase fast-forward to master' '
 
 test_expect_success 'rebase --stat' '
        git reset --hard start &&
-        git rebase --stat master >diffstat.txt &&
-        grep "^ fileX |  *1 +$" diffstat.txt
+       git rebase --stat master >diffstat.txt &&
+       grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase w/config rebase.stat' '
        git reset --hard start &&
-        git config rebase.stat true &&
-        git rebase master >diffstat.txt &&
-        grep "^ fileX |  *1 +$" diffstat.txt
+       git config rebase.stat true &&
+       git rebase master >diffstat.txt &&
+       grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 test_expect_success 'rebase -n overrides config rebase.stat config' '
        git reset --hard start &&
-        git config rebase.stat true &&
-        git rebase -n master >diffstat.txt &&
-        ! grep "^ fileX |  *1 +$" diffstat.txt
+       git config rebase.stat true &&
+       git rebase -n master >diffstat.txt &&
+       ! grep "^ fileX |  *1 +$" diffstat.txt
 '
 
 # Output to stderr:
index 2a7d958ea753cdb5736a756c7e4171d7109f455a..5839719ba16e2ca27d688e5ea6f485a5c1c4f25c 100755 (executable)
@@ -19,7 +19,7 @@ commit_message() {
 #                             \
 # README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
 #
-# Where the merge moves the files master[123].t into the subdirectory
+# Where the merge moves the files topic_[123].t into the subdirectory
 # files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
 # directory directly.
 #
index b47c59c190b37d179cba0d9bd316ca4ad96930b8..54120b09d6e9b6e29784393458671d715b06efc4 100755 (executable)
@@ -68,4 +68,60 @@ test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '
        test_must_fail git verify-commit HEAD
 '
 
+test_expect_success 'rebase -r, merge strategy, --gpg-sign will sign commit' '
+       git reset --hard merged &&
+       test_unconfig commit.gpgsign &&
+       git rebase -fr --gpg-sign -s resolve --root &&
+       git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r, merge strategy, commit.gpgsign=true will sign commit' '
+       git reset --hard merged &&
+       git config commit.gpgsign true &&
+       git rebase -fr -s resolve --root &&
+       git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r, merge strategy, commit.gpgsign=false --gpg-sign will sign commit' '
+       git reset --hard merged &&
+       git config commit.gpgsign false &&
+       git rebase -fr --gpg-sign -s resolve --root &&
+       git verify-commit HEAD
+'
+
+test_expect_success "rebase -r, merge strategy, commit.gpgsign=true --no-gpg-sign won't sign commit" '
+       git reset --hard merged &&
+       git config commit.gpgsign true &&
+       git rebase -fr --no-gpg-sign -s resolve --root &&
+       test_must_fail git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r --gpg-sign will sign commit' '
+       git reset --hard merged &&
+       test_unconfig commit.gpgsign &&
+       git rebase -fr --gpg-sign --root &&
+       git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r with commit.gpgsign=true will sign commit' '
+       git reset --hard merged &&
+       git config commit.gpgsign true &&
+       git rebase -fr --root &&
+       git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r --gpg-sign with commit.gpgsign=false will sign commit' '
+       git reset --hard merged &&
+       git config commit.gpgsign false &&
+       git rebase -fr --gpg-sign --root &&
+       git verify-commit HEAD
+'
+
+test_expect_success "rebase -r --no-gpg-sign with commit.gpgsign=true won't sign commit" '
+       git reset --hard merged &&
+       git config commit.gpgsign true &&
+       git rebase -fr --no-gpg-sign --root &&
+       test_must_fail git verify-commit HEAD
+'
+
 test_done
index ca04fac4179d546cd61864e549ce8467efa95f09..cc3f434a97080a46ec92e8ba935ab349b1a17138 100755 (executable)
@@ -589,6 +589,90 @@ test_expect_success 'diffs can be colorized' '
        grep "$(printf "\\033")" output
 '
 
+test_expect_success 'colors can be overridden' '
+       git reset --hard &&
+       test_when_finished "git rm -f color-test" &&
+       test_write_lines context old more-context >color-test &&
+       git add color-test &&
+       test_write_lines context new more-context another-one >color-test &&
+
+       echo trigger an error message >input &&
+       force_color git \
+               -c color.interactive.error=blue \
+               add -i 2>err.raw <input &&
+       test_decode_color <err.raw >err &&
+       grep "<BLUE>Huh (trigger)?<RESET>" err &&
+
+       test_write_lines help quit >input &&
+       force_color git \
+               -c color.interactive.header=red \
+               -c color.interactive.help=green \
+               -c color.interactive.prompt=yellow \
+               add -i >actual.raw <input &&
+       test_decode_color <actual.raw >actual &&
+       cat >expect <<-\EOF &&
+       <RED>           staged     unstaged path<RESET>
+         1:        +3/-0        +2/-1 color-test
+
+       <RED>*** Commands ***<RESET>
+         1: <YELLOW>s<RESET>tatus        2: <YELLOW>u<RESET>pdate        3: <YELLOW>r<RESET>evert        4: <YELLOW>a<RESET>dd untracked
+         5: <YELLOW>p<RESET>atch         6: <YELLOW>d<RESET>iff          7: <YELLOW>q<RESET>uit          8: <YELLOW>h<RESET>elp
+       <YELLOW>What now<RESET>> <GREEN>status        - show paths with changes<RESET>
+       <GREEN>update        - add working tree state to the staged set of changes<RESET>
+       <GREEN>revert        - revert staged set of changes back to the HEAD version<RESET>
+       <GREEN>patch         - pick hunks and update selectively<RESET>
+       <GREEN>diff          - view diff between HEAD and index<RESET>
+       <GREEN>add untracked - add contents of untracked files to the staged set of changes<RESET>
+       <RED>*** Commands ***<RESET>
+         1: <YELLOW>s<RESET>tatus        2: <YELLOW>u<RESET>pdate        3: <YELLOW>r<RESET>evert        4: <YELLOW>a<RESET>dd untracked
+         5: <YELLOW>p<RESET>atch         6: <YELLOW>d<RESET>iff          7: <YELLOW>q<RESET>uit          8: <YELLOW>h<RESET>elp
+       <YELLOW>What now<RESET>> Bye.
+       EOF
+       test_cmp expect actual &&
+
+       : exercise recolor_hunk by editing and then look at the hunk again &&
+       test_write_lines s e K q >input &&
+       force_color git \
+               -c color.interactive.prompt=yellow \
+               -c color.diff.meta=italic \
+               -c color.diff.frag=magenta \
+               -c color.diff.context=cyan \
+               -c color.diff.old=bold \
+               -c color.diff.new=blue \
+               -c core.editor=touch \
+               add -p >actual.raw <input &&
+       test_decode_color <actual.raw >actual.decoded &&
+       sed "s/index [0-9a-f]*\\.\\.[0-9a-f]* 100644/<INDEX-LINE>/" <actual.decoded >actual &&
+       cat >expect <<-\EOF &&
+       <ITALIC>diff --git a/color-test b/color-test<RESET>
+       <ITALIC><INDEX-LINE><RESET>
+       <ITALIC>--- a/color-test<RESET>
+       <ITALIC>+++ b/color-test<RESET>
+       <MAGENTA>@@ -1,3 +1,4 @@<RESET>
+       <CYAN> context<RESET>
+       <BOLD>-old<RESET>
+       <BLUE>+<RESET><BLUE>new<RESET>
+       <CYAN> more-context<RESET>
+       <BLUE>+<RESET><BLUE>another-one<RESET>
+       <YELLOW>(1/1) Stage this hunk [y,n,q,a,d,s,e,?]? <RESET><BOLD>Split into 2 hunks.<RESET>
+       <MAGENTA>@@ -1,3 +1,3 @@<RESET>
+       <CYAN> context<RESET>
+       <BOLD>-old<RESET>
+       <BLUE>+<RESET><BLUE>new<RESET>
+       <CYAN> more-context<RESET>
+       <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? <RESET><MAGENTA>@@ -3 +3,2 @@<RESET>
+       <CYAN> more-context<RESET>
+       <BLUE>+<RESET><BLUE>another-one<RESET>
+       <YELLOW>(2/2) Stage this hunk [y,n,q,a,d,K,g,/,e,?]? <RESET><MAGENTA>@@ -1,3 +1,3 @@<RESET>
+       <CYAN> context<RESET>
+       <BOLD>-old<RESET>
+       <BLUE>+new<RESET>
+       <CYAN> more-context<RESET>
+       <YELLOW>(1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? <RESET>
+       EOF
+       test_cmp expect actual
+'
+
 test_expect_success 'colorized diffs respect diff.wsErrorHighlight' '
        git reset --hard &&
 
diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh
new file mode 100755 (executable)
index 0000000..70ddce3
--- /dev/null
@@ -0,0 +1,126 @@
+#!/bin/sh
+
+test_description='Test ref-filter and pretty APIs for commit and tag messages using CRLF'
+. ./test-lib.sh
+
+LIB_CRLF_BRANCHES=""
+
+create_crlf_ref () {
+       branch="$1" &&
+       cat >.crlf-orig-$branch.txt &&
+       cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&
+       grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt &&
+       grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true &&
+       LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" &&
+       test_tick &&
+       hash=$(git commit-tree HEAD^{tree} -p HEAD -F .crlf-message-${branch}.txt) &&
+       git branch ${branch} ${hash} &&
+       git tag tag-${branch} ${branch} -F .crlf-message-${branch}.txt --cleanup=verbatim
+}
+
+create_crlf_refs () {
+       create_crlf_ref crlf <<-\EOF &&
+       Subject first line
+
+       Body first line
+       Body second line
+       EOF
+       create_crlf_ref crlf-empty-lines-after-subject <<-\EOF &&
+       Subject first line
+
+
+       Body first line
+       Body second line
+       EOF
+       create_crlf_ref crlf-two-line-subject <<-\EOF &&
+       Subject first line
+       Subject second line
+
+       Body first line
+       Body second line
+       EOF
+       create_crlf_ref crlf-two-line-subject-no-body <<-\EOF &&
+       Subject first line
+       Subject second line
+       EOF
+       create_crlf_ref crlf-two-line-subject-no-body-trailing-newline <<-\EOF
+       Subject first line
+       Subject second line
+
+       EOF
+}
+
+test_crlf_subject_body_and_contents() {
+       command_and_args="$@" &&
+       command=$1 &&
+       if test ${command} = "branch" || test ${command} = "for-each-ref" || test ${command} = "tag"
+       then
+               atoms="(contents:subject) (contents:body) (contents)"
+       elif test ${command} = "log" || test ${command} = "show"
+       then
+               atoms="s b B"
+       fi &&
+       files="subject body message" &&
+       while test -n "${atoms}"
+       do
+               set ${atoms} && atom=$1 && shift && atoms="$*" &&
+               set ${files} && file=$1 && shift && files="$*" &&
+               test_expect_success "${command}: --format='%${atom}' works with messages using CRLF" "
+                       rm -f expect &&
+                       for ref in ${LIB_CRLF_BRANCHES}
+                       do
+                               cat .crlf-${file}-\"\${ref}\".txt >>expect &&
+                               printf \"\n\" >>expect
+                       done &&
+                       git $command_and_args --format=\"%${atom}\" >actual &&
+                       test_cmp expect actual
+               "
+       done
+}
+
+
+test_expect_success 'Setup refs with commit and tag messages using CRLF' '
+       test_commit inital &&
+       create_crlf_refs
+'
+
+test_expect_success 'branch: --verbose works with messages using CRLF' '
+       rm -f expect &&
+       for branch in $LIB_CRLF_BRANCHES
+       do
+               printf "  " >>expect &&
+               cat .crlf-subject-${branch}.txt >>expect &&
+               printf "\n" >>expect
+       done &&
+       git branch -v >tmp &&
+       # Remove first two columns, and the line for the currently checked out branch
+       current=$(git branch --show-current) &&
+       grep -v $current <tmp | awk "{\$1=\$2=\"\"}1"  >actual &&
+       test_cmp expect actual
+'
+
+test_crlf_subject_body_and_contents branch --list crlf*
+
+test_crlf_subject_body_and_contents tag --list tag-crlf*
+
+test_crlf_subject_body_and_contents for-each-ref refs/heads/crlf*
+
+test_expect_success 'log: --oneline works with messages using CRLF' '
+       for branch in $LIB_CRLF_BRANCHES
+       do
+               cat .crlf-subject-${branch}.txt >expect &&
+               printf "\n" >>expect &&
+               git log --oneline -1 ${branch} >tmp-branch &&
+               git log --oneline -1 tag-${branch} >tmp-tag &&
+               cut -d" " -f2- <tmp-branch >actual-branch &&
+               cut -d" " -f2- <tmp-tag >actual-tag &&
+               test_cmp expect actual-branch &&
+               test_cmp expect actual-tag || return 1
+       done
+'
+
+test_crlf_subject_body_and_contents log --all --reverse --grep Subject
+
+test_crlf_subject_body_and_contents show $LIB_CRLF_BRANCHES
+
+test_done
index 5c7b0122b4f194d327d488d4b5dd6b8ad28e7673..f72d456d3bc32a18222a96790894648ec858f968 100755 (executable)
@@ -6,6 +6,7 @@
 test_description='Various diff formatting options'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/diff-lib.sh
 
 test_expect_success setup '
 
@@ -333,6 +334,7 @@ log -SF master --max-count=2
 log -GF master
 log -GF -p master
 log -GF -p --pickaxe-all master
+log -IA -IB -I1 -I2 -p master
 log --decorate --all
 log --decorate=full --all
 
@@ -473,4 +475,43 @@ test_expect_success 'diff-tree --stdin with log formatting' '
        test_cmp expect actual
 '
 
+test_expect_success 'diff -I<regex>: setup' '
+       git checkout master &&
+       test_seq 50 >file0 &&
+       git commit -m "Set up -I<regex> test file" file0 &&
+       test_seq 50 | sed -e "s/13/ten and three/" -e "/7\$/d" >file0 &&
+       echo >>file0
+'
+test_expect_success 'diff -I<regex>' '
+       git diff --ignore-blank-lines -I"ten.*e" -I"^[124-9]" >actual &&
+       cat >expect <<-\EOF &&
+       diff --git a/file0 b/file0
+       --- a/file0
+       +++ b/file0
+       @@ -34,7 +31,6 @@
+        34
+        35
+        36
+       -37
+        38
+        39
+        40
+       EOF
+       compare_diff_patch expect actual
+'
+
+test_expect_success 'diff -I<regex> --stat' '
+       git diff --stat --ignore-blank-lines -I"ten.*e" -I"^[124-9]" >actual &&
+       cat >expect <<-\EOF &&
+        file0 | 1 -
+        1 file changed, 1 deletion(-)
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'diff -I<regex>: detect malformed regex' '
+       test_expect_code 129 git diff --ignore-matching-lines="^[124-9" 2>error &&
+       test_i18ngrep "invalid regex given to -I: " error
+'
+
 test_done
diff --git a/t/t4013/diff.log_-IA_-IB_-I1_-I2_-p_master b/t/t4013/diff.log_-IA_-IB_-I1_-I2_-p_master
new file mode 100644 (file)
index 0000000..929f35a
--- /dev/null
@@ -0,0 +1,99 @@
+$ git log -IA -IB -I1 -I2 -p master
+commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
+Merge: 9a6d494 c7a2ab9
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:04:00 2006 +0000
+
+    Merge branch 'side'
+
+commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:03:00 2006 +0000
+
+    Side
+
+diff --git a/file0 b/file0
+index 01e79c3..f4615da 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++A
++B
++C
+diff --git a/file3 b/file3
+new file mode 100644
+index 0000000..7289e35
+
+commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:02:00 2006 +0000
+
+    Third
+
+diff --git a/dir/sub b/dir/sub
+index 8422d40..cead32e 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -2,3 +2,5 @@ A
+ B
+ C
+ D
++E
++F
+diff --git a/file1 b/file1
+new file mode 100644
+index 0000000..b1e6722
+--- /dev/null
++++ b/file1
+@@ -0,0 +1,3 @@
++A
++B
++C
+
+commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:01:00 2006 +0000
+
+    Second
+    
+    This is the second commit.
+
+diff --git a/dir/sub b/dir/sub
+index 35d242b..8422d40 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -1,2 +1,4 @@
+ A
+ B
++C
++D
+diff --git a/file0 b/file0
+index 01e79c3..b414108 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++4
++5
++6
+diff --git a/file2 b/file2
+deleted file mode 100644
+index 01e79c3..0000000
+--- a/file2
++++ /dev/null
+@@ -1,3 +0,0 @@
+-1
+-2
+-3
+
+commit 444ac553ac7612cc88969031b02b3767fb8a353a
+Author: A U Thor <author@example.com>
+Date:   Mon Jun 26 00:00:00 2006 +0000
+
+    Initial
+$
index 294e76c860cf29103422657f5840ef4ce0723812..c5e5e0da3feef439415dbf9cfd235140eba7d0d9 100755 (executable)
@@ -313,6 +313,60 @@ test_expect_success 'multiple files' '
        ls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch
 '
 
+test_expect_success 'filename length limit' '
+       test_when_finished "rm -f 000*" &&
+       rm -rf 000[1-9]-*.patch &&
+       for len in 15 25 35
+       do
+               git format-patch --filename-max-length=$len -3 side &&
+               max=$(
+                       for patch in 000[1-9]-*.patch
+                       do
+                               echo "$patch" | wc -c
+                       done |
+                       sort -nr |
+                       head -n 1
+               ) &&
+               test $max -le $len || return 1
+       done
+'
+
+test_expect_success 'filename length limit from config' '
+       test_when_finished "rm -f 000*" &&
+       rm -rf 000[1-9]-*.patch &&
+       for len in 15 25 35
+       do
+               git -c format.filenameMaxLength=$len format-patch -3 side &&
+               max=$(
+                       for patch in 000[1-9]-*.patch
+                       do
+                               echo "$patch" | wc -c
+                       done |
+                       sort -nr |
+                       head -n 1
+               ) &&
+               test $max -le $len || return 1
+       done
+'
+
+test_expect_success 'filename limit applies only to basename' '
+       test_when_finished "rm -rf patches/" &&
+       rm -rf patches/ &&
+       for len in 15 25 35
+       do
+               git format-patch -o patches --filename-max-length=$len -3 side &&
+               max=$(
+                       for patch in patches/000[1-9]-*.patch
+                       do
+                               echo "${patch#patches/}" | wc -c
+                       done |
+                       sort -nr |
+                       head -n 1
+               ) &&
+               test $max -le $len || return 1
+       done
+'
+
 test_expect_success 'reroll count' '
        rm -fr patches &&
        git format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&
@@ -1919,6 +1973,39 @@ test_expect_success 'format-patch -o overrides format.outputDirectory' '
        test_path_is_dir patchset
 '
 
+test_expect_success 'format-patch forbids multiple outputs' '
+       rm -fr outfile outdir &&
+       test_must_fail \
+               git format-patch --stdout --output-directory=outdir &&
+       test_must_fail \
+               git format-patch --stdout --output=outfile &&
+       test_must_fail \
+               git format-patch --output=outfile --output-directory=outdir
+'
+
+test_expect_success 'configured outdir does not conflict with output options' '
+       rm -fr outfile outdir &&
+       test_config format.outputDirectory outdir &&
+       git format-patch --stdout &&
+       test_path_is_missing outdir &&
+       git format-patch --output=outfile &&
+       test_path_is_missing outdir
+'
+
+test_expect_success 'format-patch --output' '
+       rm -fr outfile &&
+       git format-patch -3 --stdout HEAD >expect &&
+       git format-patch -3 --output=outfile HEAD &&
+       test_cmp expect outfile
+'
+
+test_expect_success 'format-patch --cover-letter --output' '
+       rm -fr outfile &&
+       git format-patch --cover-letter -3 --stdout HEAD >expect &&
+       git format-patch --cover-letter -3 --output=outfile HEAD &&
+       test_cmp expect outfile
+'
+
 test_expect_success 'format-patch --base' '
        git checkout patchid &&
 
index 8bdaa0a693fa52adf2314d5777a195d035d6009c..47f0e2889dade09889aa84558ac6567748799cdb 100755 (executable)
@@ -877,13 +877,13 @@ test_expect_success 'rename empty' '
 test_expect_success 'combined diff with autocrlf conversion' '
 
        git reset --hard &&
-       echo >x hello &&
-       git commit -m "one side" x &&
+       test_commit "one side" x hello one-side &&
        git checkout HEAD^ &&
        echo >x goodbye &&
        git commit -m "the other side" x &&
        git config core.autocrlf true &&
-       test_must_fail git merge master &&
+       test_must_fail git merge one-side >actual &&
+       test_i18ngrep "Automatic merge failed" actual &&
 
        git diff >actual.raw &&
        sed -e "1,/^@@@/d" actual.raw >actual &&
index 9d077975791c1c002b4a927dfae71de594c8855f..9675bc17db276a51b1c5dc1b64ff1e94e1b0fc09 100755 (executable)
@@ -27,6 +27,7 @@ test_expect_success 'setup' '
 
 diffpatterns="
        ada
+       bash
        bibtex
        cpp
        csharp
diff --git a/t/t4018/bash-arithmetic-function b/t/t4018/bash-arithmetic-function
new file mode 100644 (file)
index 0000000..c0b276c
--- /dev/null
@@ -0,0 +1,4 @@
+RIGHT() ((
+
+    ChangeMe = "$x" + "$y"
+))
diff --git a/t/t4018/bash-bashism-style-compact b/t/t4018/bash-bashism-style-compact
new file mode 100644 (file)
index 0000000..1ca3126
--- /dev/null
@@ -0,0 +1,6 @@
+function RIGHT {
+    function InvalidSyntax{
+        :
+        echo 'ChangeMe'
+    }
+}
diff --git a/t/t4018/bash-bashism-style-function b/t/t4018/bash-bashism-style-function
new file mode 100644 (file)
index 0000000..f1de4fa
--- /dev/null
@@ -0,0 +1,4 @@
+function RIGHT {
+    :
+    echo 'ChangeMe'
+}
diff --git a/t/t4018/bash-bashism-style-whitespace b/t/t4018/bash-bashism-style-whitespace
new file mode 100644 (file)
index 0000000..ade85dd
--- /dev/null
@@ -0,0 +1,4 @@
+        function       RIGHT   (       )       {
+
+           ChangeMe
+        }
diff --git a/t/t4018/bash-conditional-function b/t/t4018/bash-conditional-function
new file mode 100644 (file)
index 0000000..c5949e8
--- /dev/null
@@ -0,0 +1,4 @@
+RIGHT() [[ \
+
+    "$a" > "$ChangeMe"
+]]
diff --git a/t/t4018/bash-missing-parentheses b/t/t4018/bash-missing-parentheses
new file mode 100644 (file)
index 0000000..8c8a05d
--- /dev/null
@@ -0,0 +1,6 @@
+function RIGHT {
+    functionInvalidSyntax {
+        :
+        echo 'ChangeMe'
+    }
+}
diff --git a/t/t4018/bash-mixed-style-compact b/t/t4018/bash-mixed-style-compact
new file mode 100644 (file)
index 0000000..d9364cb
--- /dev/null
@@ -0,0 +1,4 @@
+function RIGHT(){
+    :
+    echo 'ChangeMe'
+}
diff --git a/t/t4018/bash-mixed-style-function b/t/t4018/bash-mixed-style-function
new file mode 100644 (file)
index 0000000..555f9b2
--- /dev/null
@@ -0,0 +1,4 @@
+function RIGHT() {
+
+    ChangeMe
+}
diff --git a/t/t4018/bash-nested-functions b/t/t4018/bash-nested-functions
new file mode 100644 (file)
index 0000000..2c9237e
--- /dev/null
@@ -0,0 +1,6 @@
+outer() {
+    RIGHT() {
+        :
+        echo 'ChangeMe'
+    }
+}
diff --git a/t/t4018/bash-other-characters b/t/t4018/bash-other-characters
new file mode 100644 (file)
index 0000000..a3f390d
--- /dev/null
@@ -0,0 +1,4 @@
+_RIGHT_0n() {
+
+    ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-compact b/t/t4018/bash-posix-style-compact
new file mode 100644 (file)
index 0000000..045bd20
--- /dev/null
@@ -0,0 +1,4 @@
+RIGHT(){
+
+    ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-function b/t/t4018/bash-posix-style-function
new file mode 100644 (file)
index 0000000..a4d1448
--- /dev/null
@@ -0,0 +1,4 @@
+RIGHT() {
+
+    ChangeMe
+}
diff --git a/t/t4018/bash-posix-style-whitespace b/t/t4018/bash-posix-style-whitespace
new file mode 100644 (file)
index 0000000..4d984f0
--- /dev/null
@@ -0,0 +1,4 @@
+        RIGHT  (       )       {
+
+           ChangeMe
+        }
diff --git a/t/t4018/bash-subshell-function b/t/t4018/bash-subshell-function
new file mode 100644 (file)
index 0000000..80baa09
--- /dev/null
@@ -0,0 +1,4 @@
+RIGHT() (
+
+    ChangeMe=2
+)
diff --git a/t/t4018/bash-trailing-comment b/t/t4018/bash-trailing-comment
new file mode 100644 (file)
index 0000000..f1edbed
--- /dev/null
@@ -0,0 +1,4 @@
+RIGHT() { # Comment
+
+    ChangeMe
+}
diff --git a/t/t4018/css-attribute-value-selector b/t/t4018/css-attribute-value-selector
new file mode 100644 (file)
index 0000000..918256b
--- /dev/null
@@ -0,0 +1,4 @@
+[class*="RIGHT"] {
+    background : #000;
+    border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/css-block-level-@-statements b/t/t4018/css-block-level-@-statements
new file mode 100644 (file)
index 0000000..d6755f2
--- /dev/null
@@ -0,0 +1,10 @@
+@keyframes RIGHT {
+    from {
+        background : #000;
+        border : 10px ChangeMe #C6C6C6;
+    }
+    to {
+        background : #fff;
+        border : 10px solid #C6C6C6;
+    }
+}
diff --git a/t/t4018/css-class-selector b/t/t4018/css-class-selector
new file mode 100644 (file)
index 0000000..f790a00
--- /dev/null
@@ -0,0 +1,4 @@
+.RIGHT {
+    background : #000;
+    border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/css-id-selector b/t/t4018/css-id-selector
new file mode 100644 (file)
index 0000000..17c5111
--- /dev/null
@@ -0,0 +1,4 @@
+#RIGHT {
+    background : #000;
+    border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/css-root-selector b/t/t4018/css-root-selector
new file mode 100644 (file)
index 0000000..22b958e
--- /dev/null
@@ -0,0 +1,4 @@
+:RIGHT {
+    background : #000;
+    border : 10px ChangeMe #C6C6C6;
+}
diff --git a/t/t4018/php-abstract-method b/t/t4018/php-abstract-method
new file mode 100644 (file)
index 0000000..ce215df
--- /dev/null
@@ -0,0 +1,7 @@
+abstract class Klass
+{
+    abstract public function RIGHT(): ?string
+    {
+        return 'ChangeMe';
+    }
+}
diff --git a/t/t4018/php-final-method b/t/t4018/php-final-method
new file mode 100644 (file)
index 0000000..537fb8a
--- /dev/null
@@ -0,0 +1,7 @@
+class Klass
+{
+    final public function RIGHT(): string
+    {
+        return 'ChangeMe';
+    }
+}
diff --git a/t/t4018/rust-macro-rules b/t/t4018/rust-macro-rules
new file mode 100644 (file)
index 0000000..ec610c5
--- /dev/null
@@ -0,0 +1,6 @@
+macro_rules! RIGHT {
+    () => {
+        // a comment
+        let x = ChangeMe;
+    };
+}
diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh
new file mode 100755 (executable)
index 0000000..03487cc
--- /dev/null
@@ -0,0 +1,193 @@
+#!/bin/sh
+
+test_description='behavior of diff with symmetric-diff setups and --merge-base'
+
+. ./test-lib.sh
+
+# build these situations:
+#  - normal merge with one merge base (br1...b2r);
+#  - criss-cross merge ie 2 merge bases (br1...master);
+#  - disjoint subgraph (orphan branch, br3...master).
+#
+#     B---E   <-- master
+#    / \ /
+#   A   X
+#    \ / \
+#     C---D--G   <-- br1
+#      \    /
+#       ---F   <-- br2
+#
+#  H  <-- br3
+#
+# We put files into a few commits so that we can verify the
+# output as well.
+
+test_expect_success setup '
+       git commit --allow-empty -m A &&
+       echo b >b &&
+       git add b &&
+       git commit -m B &&
+       git checkout -b br1 HEAD^ &&
+       echo c >c &&
+       git add c &&
+       git commit -m C &&
+       git tag commit-C &&
+       git merge -m D master &&
+       git tag commit-D &&
+       git checkout master &&
+       git merge -m E commit-C &&
+       git checkout -b br2 commit-C &&
+       echo f >f &&
+       git add f &&
+       git commit -m F &&
+       git checkout br1 &&
+       git merge -m G br2 &&
+       git checkout --orphan br3 &&
+       git commit -m H
+'
+
+test_expect_success 'diff with one merge base' '
+       git diff commit-D...br1 >tmp &&
+       tail -n 1 tmp >actual &&
+       echo +f >expect &&
+       test_cmp expect actual
+'
+
+# The output (in tmp) can have +b or +c depending
+# on which merge base (commit B or C) is picked.
+# It should have one of those two, which comes out
+# to seven lines.
+test_expect_success 'diff with two merge bases' '
+       git diff br1...master >tmp 2>err &&
+       test_line_count = 7 tmp &&
+       test_line_count = 1 err
+'
+
+test_expect_success 'diff with no merge bases' '
+       test_must_fail git diff br2...br3 2>err &&
+       test_i18ngrep "fatal: br2...br3: no merge base" err
+'
+
+test_expect_success 'diff with too many symmetric differences' '
+       test_must_fail git diff br1...master br2...br3 2>err &&
+       test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff with symmetric difference and extraneous arg' '
+       test_must_fail git diff master br1...master 2>err &&
+       test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff with two ranges' '
+       test_must_fail git diff master br1..master br2..br3 2>err &&
+       test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff with ranges and extra arg' '
+       test_must_fail git diff master br1..master commit-D 2>err &&
+       test_i18ngrep "usage" err
+'
+
+test_expect_success 'diff --merge-base with no commits' '
+       test_must_fail git diff --merge-base
+'
+
+test_expect_success 'diff --merge-base with three commits' '
+       test_must_fail git diff --merge-base br1 br2 master 2>err &&
+       test_i18ngrep "usage" err
+'
+
+for cmd in diff-index diff
+do
+       test_expect_success "$cmd --merge-base with one commit" '
+               git checkout master &&
+               git $cmd commit-C >expect &&
+               git $cmd --merge-base br2 >actual &&
+               test_cmp expect actual
+       '
+
+       test_expect_success "$cmd --merge-base with one commit and unstaged changes" '
+               git checkout master &&
+               test_when_finished git reset --hard &&
+               echo unstaged >>c &&
+               git $cmd commit-C >expect &&
+               git $cmd --merge-base br2 >actual &&
+               test_cmp expect actual
+       '
+
+       test_expect_success "$cmd --merge-base with one commit and staged and unstaged changes" '
+               git checkout master &&
+               test_when_finished git reset --hard &&
+               echo staged >>c &&
+               git add c &&
+               echo unstaged >>c &&
+               git $cmd commit-C >expect &&
+               git $cmd --merge-base br2 >actual &&
+               test_cmp expect actual
+       '
+
+       test_expect_success "$cmd --merge-base --cached with one commit and staged and unstaged changes" '
+               git checkout master &&
+               test_when_finished git reset --hard &&
+               echo staged >>c &&
+               git add c &&
+               echo unstaged >>c &&
+               git $cmd --cached commit-C >expect &&
+               git $cmd --cached --merge-base br2 >actual &&
+               test_cmp expect actual
+       '
+
+       test_expect_success "$cmd --merge-base with non-commit" '
+               git checkout master &&
+               test_must_fail git $cmd --merge-base master^{tree} 2>err &&
+               test_i18ngrep "fatal: --merge-base only works with commits" err
+       '
+
+       test_expect_success "$cmd --merge-base with no merge bases and one commit" '
+               git checkout master &&
+               test_must_fail git $cmd --merge-base br3 2>err &&
+               test_i18ngrep "fatal: no merge base found" err
+       '
+
+       test_expect_success "$cmd --merge-base with multiple merge bases and one commit" '
+               git checkout master &&
+               test_must_fail git $cmd --merge-base br1 2>err &&
+               test_i18ngrep "fatal: multiple merge bases found" err
+       '
+done
+
+for cmd in diff-tree diff
+do
+       test_expect_success "$cmd --merge-base with two commits" '
+               git $cmd commit-C master >expect &&
+               git $cmd --merge-base br2 master >actual &&
+               test_cmp expect actual
+       '
+
+       test_expect_success "$cmd --merge-base commit and non-commit" '
+               test_must_fail git $cmd --merge-base br2 master^{tree} 2>err &&
+               test_i18ngrep "fatal: --merge-base only works with commits" err
+       '
+
+       test_expect_success "$cmd --merge-base with no merge bases and two commits" '
+               test_must_fail git $cmd --merge-base br2 br3 2>err &&
+               test_i18ngrep "fatal: no merge base found" err
+       '
+
+       test_expect_success "$cmd --merge-base with multiple merge bases and two commits" '
+               test_must_fail git $cmd --merge-base master br1 2>err &&
+               test_i18ngrep "fatal: multiple merge bases found" err
+       '
+done
+
+test_expect_success 'diff-tree --merge-base with one commit' '
+       test_must_fail git diff-tree --merge-base master 2>err &&
+       test_i18ngrep "fatal: --merge-base only works with two commits" err
+'
+
+test_expect_success 'diff --merge-base with range' '
+       test_must_fail git diff --merge-base br2..br3 2>err &&
+       test_i18ngrep "fatal: --merge-base does not work with ranges" err
+'
+
+test_done
diff --git a/t/t4068-diff-symmetric.sh b/t/t4068-diff-symmetric.sh
deleted file mode 100755 (executable)
index 31d17a5..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-test_description='behavior of diff with symmetric-diff setups'
-
-. ./test-lib.sh
-
-# build these situations:
-#  - normal merge with one merge base (br1...b2r);
-#  - criss-cross merge ie 2 merge bases (br1...master);
-#  - disjoint subgraph (orphan branch, br3...master).
-#
-#     B---E   <-- master
-#    / \ /
-#   A   X
-#    \ / \
-#     C---D--G   <-- br1
-#      \    /
-#       ---F   <-- br2
-#
-#  H  <-- br3
-#
-# We put files into a few commits so that we can verify the
-# output as well.
-
-test_expect_success setup '
-       git commit --allow-empty -m A &&
-       echo b >b &&
-       git add b &&
-       git commit -m B &&
-       git checkout -b br1 HEAD^ &&
-       echo c >c &&
-       git add c &&
-       git commit -m C &&
-       git tag commit-C &&
-       git merge -m D master &&
-       git tag commit-D &&
-       git checkout master &&
-       git merge -m E commit-C &&
-       git checkout -b br2 commit-C &&
-       echo f >f &&
-       git add f &&
-       git commit -m F &&
-       git checkout br1 &&
-       git merge -m G br2 &&
-       git checkout --orphan br3 &&
-       git commit -m H
-'
-
-test_expect_success 'diff with one merge base' '
-       git diff commit-D...br1 >tmp &&
-       tail -n 1 tmp >actual &&
-       echo +f >expect &&
-       test_cmp expect actual
-'
-
-# The output (in tmp) can have +b or +c depending
-# on which merge base (commit B or C) is picked.
-# It should have one of those two, which comes out
-# to seven lines.
-test_expect_success 'diff with two merge bases' '
-       git diff br1...master >tmp 2>err &&
-       test_line_count = 7 tmp &&
-       test_line_count = 1 err
-'
-
-test_expect_success 'diff with no merge bases' '
-       test_must_fail git diff br2...br3 >tmp 2>err &&
-       test_i18ngrep "fatal: br2...br3: no merge base" err
-'
-
-test_expect_success 'diff with too many symmetric differences' '
-       test_must_fail git diff br1...master br2...br3 >tmp 2>err &&
-       test_i18ngrep "usage" err
-'
-
-test_expect_success 'diff with symmetric difference and extraneous arg' '
-       test_must_fail git diff master br1...master >tmp 2>err &&
-       test_i18ngrep "usage" err
-'
-
-test_expect_success 'diff with two ranges' '
-       test_must_fail git diff master br1..master br2..br3 >tmp 2>err &&
-       test_i18ngrep "usage" err
-'
-
-test_expect_success 'diff with ranges and extra arg' '
-       test_must_fail git diff master br1..master commit-D >tmp 2>err &&
-       test_i18ngrep "usage" err
-'
-
-test_done
index ebadbc347fc4fd9d435a366e46e3e1cebba81b83..da3e64f8110d54d7243c017a9a614baa7098142f 100755 (executable)
@@ -88,6 +88,13 @@ test_expect_success 'symlink becomes file' '
        '
 test_debug 'cat patch'
 
+test_expect_success 'symlink becomes file, in reverse' '
+       git checkout -f foo-symlinked-to-bar &&
+       git diff-tree -p HEAD foo-back-to-file > patch &&
+       git checkout foo-back-to-file &&
+       git apply -R --index < patch
+       '
+
 test_expect_success 'binary file becomes symlink' '
        git checkout -f foo-becomes-binary &&
        git diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&
index 972946c174c18ee831d8595068c6ffa235c8a538..305b7e649eb7a123556d89deae0c34ec91265905 100755 (executable)
@@ -32,6 +32,10 @@ test_expect_success 'apply same filename with independent changes' '
 
 test_expect_success 'apply same filename with overlapping changes' '
        git reset --hard &&
+
+       # Store same_fn so that we can check apply -R in next test
+       cp same_fn same_fn1 &&
+
        modify "s/^d/z/" same_fn &&
        git diff > patch0 &&
        git add same_fn &&
@@ -43,6 +47,11 @@ test_expect_success 'apply same filename with overlapping changes' '
        test_cmp same_fn same_fn2
 '
 
+test_expect_success 'apply same filename with overlapping changes, in reverse' '
+       git apply -R patch0 &&
+       test_cmp same_fn same_fn1
+'
+
 test_expect_success 'apply same new filename after rename' '
        git reset --hard &&
        git mv same_fn new_fn &&
index 5cdd76dfa726d32226b1dd625d21d6280125afb7..41818d8315f32359b0eabd1cb91684c90c070098 100755 (executable)
@@ -73,4 +73,30 @@ test_expect_success FILEMODE 'bogus mode is rejected' '
        test_i18ngrep "invalid mode" err
 '
 
+test_expect_success POSIXPERM 'do not use core.sharedRepository for working tree files' '
+       git reset --hard &&
+       test_config core.sharedRepository 0666 &&
+       (
+               # Remove a default ACL if possible.
+               (setfacl -k newdir 2>/dev/null || true) &&
+               umask 0077 &&
+
+               # Test both files (f1) and leading dirs (d)
+               mkdir d &&
+               touch f1 d/f2 &&
+               git add f1 d/f2 &&
+               git diff --staged >patch-f1-and-f2.txt &&
+
+               rm -rf d f1 &&
+               git apply patch-f1-and-f2.txt &&
+
+               echo "-rw-------" >f1_mode.expected &&
+               echo "drwx------" >d_mode.expected &&
+               test_modebits f1 >f1_mode.actual &&
+               test_modebits d >d_mode.actual &&
+               test_cmp f1_mode.expected f1_mode.actual &&
+               test_cmp d_mode.expected d_mode.actual
+       )
+'
+
 test_done
index 2d1d7b5d1938a05daa6a98359a2dfd5e1be645e2..85d151423dedc363c83d6e168e33e0a612e70a6e 100755 (executable)
@@ -8,6 +8,28 @@ test_expect_success 'setup (import history)' '
        git reset --hard
 '
 
+test_expect_success 'basic command line parsing' '
+       # This may fail due to "no such path a.c in commit", or
+       # "-L is incompatible with pathspec", depending on the
+       # order the error is checked.  Either is acceptable.
+       test_must_fail git log -L1,1:a.c -- a.c &&
+
+       # -L requires there is no pathspec
+       test_must_fail git log -L1,1:b.c -- b.c 2>error &&
+       test_i18ngrep "cannot be used with pathspec" error &&
+
+       # This would fail because --follow wants a single path, but
+       # we may fail due to incompatibility between -L/--follow in
+       # the future.  Either is acceptable.
+       test_must_fail git log -L1,1:b.c --follow &&
+       test_must_fail git log --follow -L1,1:b.c &&
+
+       # This would fail because -L wants no pathspec, but
+       # we may fail due to incompatibility between -L/--follow in
+       # the future.  Either is acceptable.
+       test_must_fail git log --follow -L1,1:b.c -- b.c
+'
+
 canned_test_1 () {
        test_expect_$1 "$2" "
                git log $2 >actual &&
index 8318781d2bbf6c345cda1fab26848771918f8a5a..1d40fcad3901c2c58b8e562fb596b34785671f5f 100755 (executable)
@@ -277,7 +277,7 @@ test_expect_success 'pack with missing parent' '
        git pack-objects --stdout --revs <revs >/dev/null
 '
 
-test_expect_success JGIT 'we can read jgit bitmaps' '
+test_expect_success JGIT,SHA1 'we can read jgit bitmaps' '
        git clone --bare . compat-jgit.git &&
        (
                cd compat-jgit.git &&
@@ -287,7 +287,7 @@ test_expect_success JGIT 'we can read jgit bitmaps' '
        )
 '
 
-test_expect_success JGIT 'jgit can read our bitmaps' '
+test_expect_success JGIT,SHA1 'jgit can read our bitmaps' '
        git clone --bare . compat-us.git &&
        (
                cd compat-us.git &&
index df970d75845e782980835d853176acb580ab70d4..8bacd96275b0ac881b9202ecaff83394ca562dd2 100755 (executable)
@@ -4,12 +4,6 @@ test_description='pack-object compression configuration'
 
 . ./test-lib.sh
 
-# This should be moved to test-lib.sh together with the
-# copy in t0021 after both topics have graduated to 'master'.
-file_size () {
-       test-tool path-utils file-size "$1"
-}
-
 test_expect_success setup '
        printf "%2000000s" X |
        git hash-object -w --stdin >object-name &&
@@ -24,7 +18,7 @@ do
        test_expect_success "pack-objects with $config" '
                test_when_finished "rm -f pack-*.*" &&
                git $config pack-objects pack <object-name &&
-               sz=$(file_size pack-*.pack) &&
+               sz=$(test_file_size pack-*.pack) &&
                case "$expect" in
                small) test "$sz" -le 100000 ;;
                large) test "$sz" -ge 100000 ;;
index f340b376bca55f0aa7af191f91527f8da076bf19..297de502a94fdfc255e9e3de4db801e2f15d02f2 100755 (executable)
@@ -3,6 +3,7 @@
 test_description='multi-pack-indexes'
 . ./test-lib.sh
 
+GIT_TEST_MULTI_PACK_INDEX=0
 objdir=.git/objects
 
 HASH_LEN=$(test_oid rawsz)
@@ -137,7 +138,7 @@ test_expect_success 'write midx with one v2 pack' '
 
 compare_results_with_midx "one v2 pack"
 
-test_expect_success 'corrupt idx not opened' '
+test_expect_success 'corrupt idx reports errors' '
        idx=$(test-tool read-midx $objdir | grep "\.idx\$") &&
        mv $objdir/pack/$idx backup-$idx &&
        test_when_finished "mv backup-\$idx \$objdir/pack/\$idx" &&
@@ -148,7 +149,7 @@ test_expect_success 'corrupt idx not opened' '
        test_copy_bytes 1064 <backup-$idx >$objdir/pack/$idx &&
 
        git -c core.multiPackIndex=true rev-list --objects --all 2>err &&
-       test_must_be_empty err
+       grep "index unavailable" err
 '
 
 test_expect_success 'add more objects' '
@@ -173,12 +174,12 @@ test_expect_success 'write progress off for redirected stderr' '
 '
 
 test_expect_success 'write force progress on for stderr' '
-       git multi-pack-index --object-dir=$objdir --progress write 2>err &&
+       GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --progress write 2>err &&
        test_file_not_empty err
 '
 
 test_expect_success 'write with the --no-progress option' '
-       git multi-pack-index --object-dir=$objdir --no-progress write 2>err &&
+       GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --no-progress write 2>err &&
        test_line_count = 0 err
 '
 
@@ -368,17 +369,17 @@ test_expect_success 'git-fsck incorrect offset' '
 '
 
 test_expect_success 'repack progress off for redirected stderr' '
-       git multi-pack-index --object-dir=$objdir repack 2>err &&
+       GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir repack 2>err &&
        test_line_count = 0 err
 '
 
 test_expect_success 'repack force progress on for stderr' '
-       git multi-pack-index --object-dir=$objdir --progress repack 2>err &&
+       GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --progress repack 2>err &&
        test_file_not_empty err
 '
 
 test_expect_success 'repack with the --no-progress option' '
-       git multi-pack-index --object-dir=$objdir --no-progress repack 2>err &&
+       GIT_PROGRESS_DELAY=0 git multi-pack-index --object-dir=$objdir --no-progress repack 2>err &&
        test_line_count = 0 err
 '
 
@@ -562,7 +563,7 @@ test_expect_success 'expire progress off for redirected stderr' '
 test_expect_success 'expire force progress on for stderr' '
        (
                cd dup &&
-               git multi-pack-index --progress expire 2>err &&
+               GIT_PROGRESS_DELAY=0 git multi-pack-index --progress expire 2>err &&
                test_file_not_empty err
        )
 '
@@ -570,7 +571,7 @@ test_expect_success 'expire force progress on for stderr' '
 test_expect_success 'expire with the --no-progress option' '
        (
                cd dup &&
-               git multi-pack-index --no-progress expire 2>err &&
+               GIT_PROGRESS_DELAY=0 git multi-pack-index --no-progress expire 2>err &&
                test_line_count = 0 err
        )
 '
@@ -754,4 +755,30 @@ test_expect_success 'repack --batch-size=<large> repacks everything' '
        )
 '
 
+test_expect_success 'load reverse index when missing .idx, .pack' '
+       git init repo &&
+       test_when_finished "rm -fr repo" &&
+       (
+               cd repo &&
+
+               git config core.multiPackIndex true &&
+
+               test_commit base &&
+               git repack -ad &&
+               git multi-pack-index write &&
+
+               git rev-parse HEAD >tip &&
+               pack=$(ls .git/objects/pack/pack-*.pack) &&
+               idx=$(ls .git/objects/pack/pack-*.idx) &&
+
+               mv $idx $idx.bak &&
+               git cat-file --batch-check="%(objectsize:disk)" <tip &&
+
+               mv $idx.bak $idx &&
+
+               mv $pack $pack.bak &&
+               git cat-file --batch-check="%(objectsize:disk)" <tip
+       )
+'
+
 test_done
index c334ee9155b12c91b41ac86722e8f666e7b62d0e..4d3842b83b9456362a08842ebc10614d02f0943d 100755 (executable)
@@ -440,4 +440,17 @@ test_expect_success '--split=replace with partial Bloom data' '
        verify_chain_files_exist $graphdir
 '
 
+test_expect_success 'prevent regression for duplicate commits across layers' '
+       git init dup &&
+       git -C dup commit --allow-empty -m one &&
+       git -C dup -c core.commitGraph=false commit-graph write --split=no-merge --reachable 2>err &&
+       test_i18ngrep "attempting to write a commit-graph" err &&
+       git -C dup commit-graph write --split=no-merge --reachable &&
+       git -C dup commit --allow-empty -m two &&
+       git -C dup commit-graph write --split=no-merge --reachable &&
+       git -C dup commit --allow-empty -m three &&
+       git -C dup commit-graph write --split --reachable &&
+       git -C dup commit-graph verify
+'
+
 test_done
index b84618c925fe014c1cf277da8825ec0a104c18ef..cc86ef213ed0f146986aae3a33f526475d5e9b31 100755 (executable)
@@ -21,14 +21,15 @@ test_expect_success setup '
        i=0 &&
        while test $i -le $cnt
        do
-           i=$(($i+1)) &&
-           test_tick &&
-           echo "Commit #$i" >mozart/is/pink &&
-           git update-index --add mozart/is/pink &&
-           tree=$(git write-tree) &&
-           commit=$(echo "Commit #$i" | git commit-tree $tree -p $parent) &&
-           git update-ref refs/tags/commit$i $commit &&
-           parent=$commit || return 1
+               i=$(($i+1)) &&
+               test_tick &&
+               echo "Commit #$i" >mozart/is/pink &&
+               git update-index --add mozart/is/pink &&
+               tree=$(git write-tree) &&
+               commit=$(echo "Commit #$i" |
+                        git commit-tree $tree -p $parent) &&
+               git update-ref refs/tags/commit$i $commit &&
+               parent=$commit || return 1
        done &&
        git update-ref HEAD "$commit" &&
        git clone ./. victim &&
@@ -38,14 +39,14 @@ test_expect_success setup '
        i=0 &&
        while test $i -le $cnt
        do
-           i=$(($i+1)) &&
-           test_tick &&
-           echo "Rebase #$i" >mozart/is/pink &&
-           git update-index --add mozart/is/pink &&
-           tree=$(git write-tree) &&
-           commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
-           git update-ref refs/tags/rebase$i $commit &&
-           parent=$commit || return 1
+               i=$(($i+1)) &&
+               test_tick &&
+               echo "Rebase #$i" >mozart/is/pink &&
+               git update-index --add mozart/is/pink &&
+               tree=$(git write-tree) &&
+               commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
+               git update-ref refs/tags/rebase$i $commit &&
+               parent=$commit || return 1
        done &&
        git update-ref HEAD "$commit" &&
        echo Rebase &&
@@ -57,11 +58,11 @@ test_expect_success 'pack the source repository' '
 '
 
 test_expect_success 'pack the destination repository' '
-    (
-       cd victim &&
-       git repack -a -d &&
-       git prune
-    )
+       (
+               cd victim &&
+               git repack -a -d &&
+               git prune
+       )
 '
 
 test_expect_success 'refuse pushing rewound head without --force' '
@@ -85,10 +86,10 @@ test_expect_success 'push can be used to delete a ref' '
 
 test_expect_success 'refuse deleting push with denyDeletes' '
        (
-           cd victim &&
-           test_might_fail git branch -D extra &&
-           git config receive.denyDeletes true &&
-           git branch extra master
+               cd victim &&
+               test_might_fail git branch -D extra &&
+               git config receive.denyDeletes true &&
+               git branch extra master
        ) &&
        test_must_fail git send-pack ./victim :extra master
 '
@@ -118,9 +119,9 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
 
 test_expect_success 'denyNonFastforwards trumps --force' '
        (
-           cd victim &&
-           test_might_fail git branch -D extra &&
-           git config receive.denyNonFastforwards true
+               cd victim &&
+               test_might_fail git branch -D extra &&
+               git config receive.denyNonFastforwards true
        ) &&
        victim_orig=$(cd victim && git rev-parse --verify master) &&
        test_must_fail git send-pack --force ./victim master^:master &&
@@ -143,16 +144,16 @@ test_expect_success 'send-pack --all sends all branches' '
 test_expect_success 'push --all excludes remote-tracking hierarchy' '
        mkdir parent &&
        (
-           cd parent &&
-           git init && : >file && git add file && git commit -m add
+               cd parent &&
+               git init && : >file && git add file && git commit -m add
        ) &&
        git clone parent child &&
        (
-           cd child && git push --all
+               cd child && git push --all
        ) &&
        (
-           cd parent &&
-           test -z "$(git for-each-ref refs/remotes/origin)"
+               cd parent &&
+               test -z "$(git for-each-ref refs/remotes/origin)"
        )
 '
 
@@ -160,33 +161,33 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
        rm -rf parent child &&
        git init parent &&
        (
-           # Setup a repo with 2 packs
-           cd parent &&
-           echo "Some text" >file.txt &&
-           git add . &&
-           git commit -m "Initial commit" &&
-           git repack -adl &&
-           echo "Some more text" >>file.txt &&
-           git commit -a -m "Second commit" &&
-           git repack
+               # Setup a repo with 2 packs
+               cd parent &&
+               echo "Some text" >file.txt &&
+               git add . &&
+               git commit -m "Initial commit" &&
+               git repack -adl &&
+               echo "Some more text" >>file.txt &&
+               git commit -a -m "Second commit" &&
+               git repack
        ) &&
        cp -R parent child &&
        (
-           # Set the child to auto-pack if more than one pack exists
-           cd child &&
-           git config gc.autopacklimit 1 &&
-           git config gc.autodetach false &&
-           git branch test_auto_gc &&
-           # And create a file that follows the temporary object naming
-           # convention for the auto-gc to remove
-           : >.git/objects/tmp_test_object &&
-           test-tool chmtime =-1209601 .git/objects/tmp_test_object
+               # Set the child to auto-pack if more than one pack exists
+               cd child &&
+               git config gc.autopacklimit 1 &&
+               git config gc.autodetach false &&
+               git branch test_auto_gc &&
+               # And create a file that follows the temporary object naming
+               # convention for the auto-gc to remove
+               : >.git/objects/tmp_test_object &&
+               test-tool chmtime =-1209601 .git/objects/tmp_test_object
        ) &&
        (
-           cd parent &&
-           echo "Even more text" >>file.txt &&
-           git commit -a -m "Third commit" &&
-           git send-pack ../child HEAD:refs/heads/test_auto_gc
+               cd parent &&
+               echo "Even more text" >>file.txt &&
+               git commit -a -m "Third commit" &&
+               git send-pack ../child HEAD:refs/heads/test_auto_gc
        ) &&
        test ! -e child/.git/objects/tmp_test_object
 '
@@ -195,15 +196,15 @@ rewound_push_setup() {
        rm -rf parent child &&
        mkdir parent &&
        (
-           cd parent &&
-           git init &&
-           echo one >file && git add file && git commit -m one &&
-           git config receive.denyCurrentBranch warn &&
-           echo two >file && git commit -a -m two
+               cd parent &&
+               git init &&
+               echo one >file && git add file && git commit -m one &&
+               git config receive.denyCurrentBranch warn &&
+               echo two >file && git commit -a -m two
        ) &&
        git clone parent child &&
        (
-           cd child && git reset --hard HEAD^
+               cd child && git reset --hard HEAD^
        )
 }
 
@@ -211,16 +212,16 @@ test_expect_success 'pushing explicit refspecs respects forcing' '
        rewound_push_setup &&
        parent_orig=$(cd parent && git rev-parse --verify master) &&
        (
-           cd child &&
-           test_must_fail git send-pack ../parent \
-               refs/heads/master:refs/heads/master
+               cd child &&
+               test_must_fail git send-pack ../parent \
+                       refs/heads/master:refs/heads/master
        ) &&
        parent_head=$(cd parent && git rev-parse --verify master) &&
        test "$parent_orig" = "$parent_head" &&
        (
-           cd child &&
-           git send-pack ../parent \
-               +refs/heads/master:refs/heads/master
+               cd child &&
+               git send-pack ../parent \
+                       +refs/heads/master:refs/heads/master
        ) &&
        parent_head=$(cd parent && git rev-parse --verify master) &&
        child_head=$(cd child && git rev-parse --verify master) &&
@@ -231,16 +232,16 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
        rewound_push_setup &&
        parent_orig=$(cd parent && git rev-parse --verify master) &&
        (
-           cd child &&
-           test_must_fail git send-pack ../parent \
-               "refs/heads/*:refs/heads/*"
+               cd child &&
+               test_must_fail git send-pack ../parent \
+                       "refs/heads/*:refs/heads/*"
        ) &&
        parent_head=$(cd parent && git rev-parse --verify master) &&
        test "$parent_orig" = "$parent_head" &&
        (
-           cd child &&
-           git send-pack ../parent \
-               "+refs/heads/*:refs/heads/*"
+               cd child &&
+               git send-pack ../parent \
+                       "+refs/heads/*:refs/heads/*"
        ) &&
        parent_head=$(cd parent && git rev-parse --verify master) &&
        child_head=$(cd child && git rev-parse --verify master) &&
@@ -250,8 +251,8 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
 test_expect_success 'deny pushing to delete current branch' '
        rewound_push_setup &&
        (
-           cd child &&
-           test_must_fail git send-pack ../parent :refs/heads/master 2>errs
+               cd child &&
+               test_must_fail git send-pack ../parent :refs/heads/master 2>errs
        )
 '
 
@@ -289,7 +290,7 @@ test_expect_success 'receive-pack de-dupes .have lines' '
        EOF
 
        GIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION=0 \
-           git push \
+       git push \
                --receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \
                fork HEAD:foo &&
        extract_ref_advertisement <trace >refs &&
index 6eb2ffd6ecabb9125d06e76a17d0821d7e907dfd..4aeea8f5b7ef0644c5944f13dd37544c6f9c00cc 100755 (executable)
@@ -15,7 +15,7 @@ test_expect_success setup '
        git update-index a &&
        tree1=$(git write-tree) &&
        commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
-        git update-ref refs/heads/master $commit0 &&
+       git update-ref refs/heads/master $commit0 &&
        git clone ./. clone1 &&
        GIT_DIR=clone1/.git git update-index --add a &&
        git clone ./. clone2 &&
@@ -23,34 +23,34 @@ test_expect_success setup '
 '
 
 for clone in 1 2; do
-    cat >clone${clone}/.git/hooks/post-merge <<'EOF'
+       cat >clone${clone}/.git/hooks/post-merge <<'EOF'
 #!/bin/sh
 echo $@ >> $GIT_DIR/post-merge.args
 EOF
-    chmod u+x clone${clone}/.git/hooks/post-merge
+       chmod u+x clone${clone}/.git/hooks/post-merge
 done
 
 test_expect_success 'post-merge does not run for up-to-date ' '
-        GIT_DIR=clone1/.git git merge $commit0 &&
+       GIT_DIR=clone1/.git git merge $commit0 &&
        ! test -f clone1/.git/post-merge.args
 '
 
 test_expect_success 'post-merge runs as expected ' '
-        GIT_DIR=clone1/.git git merge $commit1 &&
+       GIT_DIR=clone1/.git git merge $commit1 &&
        test -e clone1/.git/post-merge.args
 '
 
 test_expect_success 'post-merge from normal merge receives the right argument ' '
-        grep 0 clone1/.git/post-merge.args
+       grep 0 clone1/.git/post-merge.args
 '
 
 test_expect_success 'post-merge from squash merge runs as expected ' '
-        GIT_DIR=clone2/.git git merge --squash $commit1 &&
+       GIT_DIR=clone2/.git git merge --squash $commit1 &&
        test -e clone2/.git/post-merge.args
 '
 
 test_expect_success 'post-merge from squash merge receives the right argument ' '
-        grep 1 clone2/.git/post-merge.args
+       grep 1 clone2/.git/post-merge.args
 '
 
 test_done
index 746487286f5d0824b33f7a1056afd3ec11f1f71a..98b0e81208293b10a57cf8e20a8f3a621ae1f4d1 100755 (executable)
@@ -5,13 +5,16 @@
 
 test_description='Test proc-receive hook'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 . "$TEST_DIRECTORY"/t5411/common-functions.sh
 
 setup_upstream_and_workbench () {
-       # Refs of upstream : master(A)
-       # Refs of workbench: master(A)  tags/v123
+       # Refs of upstream : main(A)
+       # Refs of workbench: main(A)  tags/v123
        test_expect_success "setup upstream and workbench" '
                rm -rf upstream.git &&
                rm -rf workbench &&
@@ -25,10 +28,10 @@ setup_upstream_and_workbench () {
                        git config core.abbrev 7 &&
                        git tag -m "v123" v123 $A &&
                        git remote add origin ../upstream.git &&
-                       git push origin master &&
-                       git update-ref refs/heads/master $A $B &&
+                       git push origin main &&
+                       git update-ref refs/heads/main $A $B &&
                        git -C ../upstream.git update-ref \
-                               refs/heads/master $A $B
+                               refs/heads/main $A $B
                ) &&
                TAG=$(git -C workbench rev-parse v123) &&
 
@@ -99,8 +102,8 @@ start_httpd
 # Re-initialize the upstream repository and local workbench.
 setup_upstream_and_workbench
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "setup for HTTP protocol" '
        git -C upstream.git config http.receivepack true &&
        upstream="$HTTPD_DOCUMENT_ROOT_PATH/upstream.git" &&
index 6580bebd8e4b81acf1a4410743370b8e62e4911c..344d13f61a55cb57615bd56a1ada6e22b955829c 100644 (file)
@@ -28,7 +28,7 @@ create_commits_in () {
                shift ||
                return 1
        done &&
-       git -C "$repo" update-ref refs/heads/master $oid
+       git -C "$repo" update-ref refs/heads/main $oid
 }
 
 # Format the output of git-push, git-show-ref and other commands to make a
@@ -42,7 +42,7 @@ create_commits_in () {
 make_user_friendly_and_stable_output () {
        sed \
                -e "s/  *\$//" \
-               -e "s/   */ /g" \
+               -e "s/  */ /g" \
                -e "s/'/\"/g" \
                -e "s/  /    /g" \
                -e "s/$A/<COMMIT-A>/g" \
@@ -54,3 +54,8 @@ make_user_friendly_and_stable_output () {
                -e "s#To $URL_PREFIX/upstream.git#To <URL/of/upstream.git>#" \
                -e "/^error: / d"
 }
+
+filter_out_user_friendly_and_stable_output () {
+       make_user_friendly_and_stable_output |
+               sed -n ${1+"$@"}
+}
index dc2cf4a522c5c47b4524106bc531fced9407fdba..cb431a9c91d7182f192f5bf8f5a5d6b6da2f0a5b 100644 (file)
@@ -6,12 +6,12 @@ test_expect_success "setup proc-receive hook" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic1" \
+               -r "ok refs/for/main/topic1" \
                -r "option fall-through" \
-               -r "ok refs/for/master/topic2" \
+               -r "ok refs/for/main/topic2" \
                -r "option refname refs/for/changes/23/123/1" \
                -r "option new-oid $A" \
-               -r "ok refs/for/master/topic2" \
+               -r "ok refs/for/main/topic2" \
                -r "option refname refs/for/changes/24/124/2" \
                -r "option old-oid $B" \
                -r "option new-oid $A" \
@@ -20,26 +20,26 @@ test_expect_success "setup proc-receive hook" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         : (B)                   refs/for/master/topic1(A)  foo(A)  refs/for/next/topic(A)  refs/for/master/topic2(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         : (B)                   refs/for/main/topic1(A)  foo(A)  refs/for/next/topic(A)  refs/for/main/topic2(A)
 test_expect_success "proc-receive: report status v1" '
        {
                if test -z "$GIT_DEFAULT_HASH" || test "$GIT_DEFAULT_HASH" = "sha1"
                then
-                       printf "%s %s refs/heads/master\0report-status\n" \
+                       printf "%s %s refs/heads/main\0report-status\n" \
                                $A $B | packetize
                else
-                       printf "%s %s refs/heads/master\0report-status object-format=$GIT_DEFAULT_HASH\n" \
+                       printf "%s %s refs/heads/main\0report-status object-format=$GIT_DEFAULT_HASH\n" \
                                $A $B | packetize
                fi &&
-               printf "%s %s refs/for/master/topic1\n" \
+               printf "%s %s refs/for/main/topic1\n" \
                        $ZERO_OID $A | packetize &&
                printf "%s %s refs/heads/foo\n" \
                        $ZERO_OID $A | packetize &&
                printf "%s %s refs/for/next/topic\n" \
                        $ZERO_OID $A | packetize &&
-               printf "%s %s refs/for/master/topic2\n" \
+               printf "%s %s refs/for/main/topic2\n" \
                        $ZERO_OID $A | packetize &&
                printf 0000 &&
                printf "" | git -C "$upstream" pack-objects --stdout
@@ -48,35 +48,35 @@ test_expect_success "proc-receive: report status v1" '
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        # pre-receive hook
-       pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
-       pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
+       pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+       pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
        pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
        pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
-       pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic2
+       pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic2
        # proc-receive hook
-       proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
+       proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
        proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
-       proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic2
-       proc-receive> ok refs/for/master/topic1
+       proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic2
+       proc-receive> ok refs/for/main/topic1
        proc-receive> option fall-through
-       proc-receive> ok refs/for/master/topic2
+       proc-receive> ok refs/for/main/topic2
        proc-receive> option refname refs/for/changes/23/123/1
        proc-receive> option new-oid <COMMIT-A>
-       proc-receive> ok refs/for/master/topic2
+       proc-receive> ok refs/for/main/topic2
        proc-receive> option refname refs/for/changes/24/124/2
        proc-receive> option old-oid <COMMIT-B>
        proc-receive> option new-oid <COMMIT-A>
        proc-receive> option forced-update
        proc-receive> ng refs/for/next/topic target branch not exist
        000eunpack ok
-       0019ok refs/heads/master
-       001eok refs/for/master/topic1
+       0017ok refs/heads/main
+       001cok refs/for/main/topic1
        0016ok refs/heads/foo
        0033ng refs/for/next/topic target branch not exist
-       001eok refs/for/master/topic2
+       001cok refs/for/main/topic2
        0000# post-receive hook
-       post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
-       post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic1
+       post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+       post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic1
        post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
        post-receive< <ZERO-OID> <COMMIT-A> refs/for/changes/23/123/1
        post-receive< <COMMIT-B> <COMMIT-A> refs/for/changes/24/124/2
@@ -86,9 +86,9 @@ test_expect_success "proc-receive: report status v1" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/for/master/topic1
+       <COMMIT-A> refs/for/main/topic1
        <COMMIT-A> refs/heads/foo
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        EOF
        test_cmp expect actual
 '
index e206587348aa720bfdc299188ec3c418865fa0c0..47b058af7ede47e7c8c3bdc2a5238c24e9edbec4 100644 (file)
@@ -1,70 +1,69 @@
-# Refs of upstream : master(A)  
-# Refs of workbench: master(A)  tags/v123
-# git-push         : master(B)             next(A)
+# Refs of upstream : main(A)  
+# Refs of workbench: main(A)  tags/v123
+# git-push         : main(B)             next(A)
 test_expect_success "git-push ($PROTOCOL)" '
        git -C workbench push origin \
-               $B:refs/heads/master \
+               $B:refs/heads/main \
                HEAD:refs/heads/next \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        To <URL/of/upstream.git>
-        <OID-A>..<OID-B> <COMMIT-B> -> master
+        <OID-A>..<OID-B> <COMMIT-B> -> main
         * [new branch] HEAD -> next
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)  next(A)
-# Refs of workbench: master(A)           tags/v123
-# git-push --atomic: master(A)  next(B)
+# Refs of upstream : main(B)  next(A)
+# Refs of workbench: main(A)           tags/v123
+# git-push --atomic: main(A)  next(B)
 test_expect_success "git-push --atomic ($PROTOCOL)" '
        test_must_fail git -C workbench push --atomic origin \
-               master \
+               main \
                $B:refs/heads/next \
                >out 2>&1 &&
-       make_user_friendly_and_stable_output <out |
-               sed -n \
-                       -e "/^To / { s/   */ /g; p; }" \
-                       -e "/^ ! / { s/   */ /g; p; }" \
-                       >actual &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; }" \
+               -e "/^ ! / { p; }" \
+               <out >actual &&
        cat >expect <<-EOF &&
        To <URL/of/upstream.git>
-        ! [rejected] master -> master (non-fast-forward)
+        ! [rejected] main -> main (non-fast-forward)
         ! [rejected] <COMMIT-B> -> next (atomic push failed)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)  next(A)
-# Refs of workbench: master(A)           tags/v123
-# git-push         : master(A)  next(B)
+# Refs of upstream : main(B)  next(A)
+# Refs of workbench: main(A)           tags/v123
+# git-push         : main(A)  next(B)
 test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
        test_must_fail git \
                -C workbench \
                -c advice.pushUpdateRejected=false \
                push origin \
-               master \
+               main \
                $B:refs/heads/next \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
@@ -75,48 +74,48 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL)" '
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next
        To <URL/of/upstream.git>
         <OID-A>..<OID-B> <COMMIT-B> -> next
-        ! [rejected] master -> master (non-fast-forward)
+        ! [rejected] main -> main (non-fast-forward)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        <COMMIT-B> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)  next(B)
-# Refs of workbench: master(A)           tags/v123
-# git-push -f      : master(A)  NULL     tags/v123  refs/review/master/topic(A)  a/b/c(A)
+# Refs of upstream : main(B)  next(B)
+# Refs of workbench: main(A)           tags/v123
+# git-push -f      : main(A)  NULL     tags/v123  refs/review/main/topic(A)  a/b/c(A)
 test_expect_success "git-push -f ($PROTOCOL)" '
        git -C workbench push -f origin \
                refs/tags/v123 \
                :refs/heads/next \
-               master \
-               master:refs/review/master/topic \
+               main \
+               main:refs/review/main/topic \
                HEAD:refs/heads/a/b/c \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
        remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
        remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
        remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
        remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
-       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
        To <URL/of/upstream.git>
-        + <OID-B>...<OID-A> master -> master (forced update)
+        + <OID-B>...<OID-A> main -> main (forced update)
         - [deleted] next
         * [new tag] v123 -> v123
-        * [new reference] master -> refs/review/master/topic
+        * [new reference] main -> refs/review/main/topic
         * [new branch] HEAD -> a/b/c
        EOF
        test_cmp expect actual &&
@@ -124,19 +123,19 @@ test_expect_success "git-push -f ($PROTOCOL)" '
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        <COMMIT-A> refs/heads/a/b/c
-       <COMMIT-A> refs/heads/master
-       <COMMIT-A> refs/review/master/topic
+       <COMMIT-A> refs/heads/main
+       <COMMIT-A> refs/review/main/topic
        <TAG-v123> refs/tags/v123
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)  tags/v123  refs/review/master/topic(A)  a/b/c(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)  tags/v123  refs/review/main/topic(A)  a/b/c(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
        (
                cd "$upstream" &&
-               git update-ref -d refs/review/master/topic &&
+               git update-ref -d refs/review/main/topic &&
                git update-ref -d refs/tags/v123 &&
                git update-ref -d refs/heads/a/b/c
        )
index 48f6fcc8466151c38212d772bb65e232a516b99d..bbead12bbb48f5701d041e24954113795e2b90a2 100644 (file)
@@ -1,21 +1,21 @@
-# Refs of upstream : master(A)  
-# Refs of workbench: master(A)  tags/v123
-# git-push         : master(B)             next(A)
+# Refs of upstream : main(A)  
+# Refs of workbench: main(A)  tags/v123
+# git-push         : main(B)             next(A)
 test_expect_success "git-push ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               $B:refs/heads/master \
+               $B:refs/heads/main \
                HEAD:refs/heads/next \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        To <URL/of/upstream.git>
-            <COMMIT-B>:refs/heads/master    <OID-A>..<OID-B>
+            <COMMIT-B>:refs/heads/main    <OID-A>..<OID-B>
        *    HEAD:refs/heads/next    [new branch]
        Done
        EOF
@@ -23,50 +23,49 @@ test_expect_success "git-push ($PROTOCOL/porcelain)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)  next(A)
-# Refs of workbench: master(A)           tags/v123
-# git-push --atomic: master(A)  next(B)
+# Refs of upstream : main(B)  next(A)
+# Refs of workbench: main(A)           tags/v123
+# git-push --atomic: main(A)  next(B)
 test_expect_success "git-push --atomic ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --atomic --porcelain origin \
-               master \
+               main \
                $B:refs/heads/next \
                >out 2>&1 &&
-       make_user_friendly_and_stable_output <out |
-               sed -n \
-                       -e "s/^# GETTEXT POISON #//" \
-                       -e "/^To / { s/   */ /g; p; }" \
-                       -e "/^! / { s/   */ /g; p; }" \
-                       >actual &&
+       filter_out_user_friendly_and_stable_output \
+               -e "s/^# GETTEXT POISON #//" \
+               -e "/^To / { p; }" \
+               -e "/^! / { p; }" \
+               <out >actual &&
        cat >expect <<-EOF &&
        To <URL/of/upstream.git>
-       ! refs/heads/master:refs/heads/master [rejected] (non-fast-forward)
-       ! <COMMIT-B>:refs/heads/next [rejected] (atomic push failed)
+       !    refs/heads/main:refs/heads/main    [rejected] (non-fast-forward)
+       !    <COMMIT-B>:refs/heads/next    [rejected] (atomic push failed)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)  next(A)
-# Refs of workbench: master(A)           tags/v123
-# git-push         : master(A)  next(B)
+# Refs of upstream : main(B)  next(A)
+# Refs of workbench: main(A)           tags/v123
+# git-push         : main(A)  next(B)
 test_expect_success "non-fast-forward git-push ($PROTOCOL/porcelain)" '
        test_must_fail git \
                -C workbench \
                -c advice.pushUpdateRejected=false \
                push --porcelain origin \
-               master \
+               main \
                $B:refs/heads/next \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
@@ -77,49 +76,49 @@ test_expect_success "non-fast-forward git-push ($PROTOCOL/porcelain)" '
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next
        To <URL/of/upstream.git>
             <COMMIT-B>:refs/heads/next    <OID-A>..<OID-B>
-       !    refs/heads/master:refs/heads/master    [rejected] (non-fast-forward)
+       !    refs/heads/main:refs/heads/main    [rejected] (non-fast-forward)
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        <COMMIT-B> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)  next(B)
-# Refs of workbench: master(A)           tags/v123
-# git-push -f      : master(A)  NULL     tags/v123  refs/review/master/topic(A)  a/b/c(A)
+# Refs of upstream : main(B)  next(B)
+# Refs of workbench: main(A)           tags/v123
+# git-push -f      : main(A)  NULL     tags/v123  refs/review/main/topic(A)  a/b/c(A)
 test_expect_success "git-push -f ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain -f origin \
                refs/tags/v123 \
                :refs/heads/next \
-               master \
-               master:refs/review/master/topic \
+               main \
+               main:refs/review/main/topic \
                HEAD:refs/heads/a/b/c \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
        remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
        remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
        remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next
        remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
-       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c
        To <URL/of/upstream.git>
-       +    refs/heads/master:refs/heads/master    <OID-B>...<OID-A> (forced update)
+       +    refs/heads/main:refs/heads/main    <OID-B>...<OID-A> (forced update)
        -    :refs/heads/next    [deleted]
        *    refs/tags/v123:refs/tags/v123    [new tag]
-       *    refs/heads/master:refs/review/master/topic    [new reference]
+       *    refs/heads/main:refs/review/main/topic    [new reference]
        *    HEAD:refs/heads/a/b/c    [new branch]
        Done
        EOF
@@ -128,19 +127,19 @@ test_expect_success "git-push -f ($PROTOCOL/porcelain)" '
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        <COMMIT-A> refs/heads/a/b/c
-       <COMMIT-A> refs/heads/master
-       <COMMIT-A> refs/review/master/topic
+       <COMMIT-A> refs/heads/main
+       <COMMIT-A> refs/review/main/topic
        <TAG-v123> refs/tags/v123
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)  tags/v123  refs/review/master/topic(A)  a/b/c(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)  tags/v123  refs/review/main/topic(A)  a/b/c(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
        (
                cd "$upstream" &&
-               git update-ref -d refs/review/master/topic &&
+               git update-ref -d refs/review/main/topic &&
                git update-ref -d refs/tags/v123 &&
                git update-ref -d refs/heads/a/b/c
        )
index c246f7e68e4905c925f36ae208db9e4a8470010b..e7d113a1587bbb2734e0850ba2341eb452eac090 100644 (file)
@@ -5,25 +5,25 @@ test_expect_success "setup pre-receive hook ($PROTOCOL)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git-push         : master(B)             next(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git-push         : main(B)             next(A)
 test_expect_success "git-push is declined ($PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               $B:refs/heads/master \
+               $B:refs/heads/main \
                HEAD:refs/heads/next \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        To <URL/of/upstream.git>
-        ! [remote rejected] <COMMIT-B> -> master (pre-receive hook declined)
+        ! [remote rejected] <COMMIT-B> -> main (pre-receive hook declined)
         ! [remote rejected] HEAD -> next (pre-receive hook declined)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index b14894de81f14ada10bc19f162cc95ec71f0063e..cc0cca6a4721d6a96669b629c713208434b6a26f 100644 (file)
@@ -5,18 +5,18 @@ test_expect_success "setup pre-receive hook ($PROTOCOL/porcelain)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git-push         : master(B)             next(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git-push         : main(B)             next(A)
 test_expect_success "git-push is declined ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               $B:refs/heads/master \
+               $B:refs/heads/main \
                HEAD:refs/heads/next \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        To <URL/of/upstream.git>
-       !    <COMMIT-B>:refs/heads/master    [remote rejected] (pre-receive hook declined)
+       !    <COMMIT-B>:refs/heads/main    [remote rejected] (pre-receive hook declined)
        !    HEAD:refs/heads/next    [remote rejected] (pre-receive hook declined)
        Done
        EOF
@@ -24,7 +24,7 @@ test_expect_success "git-push is declined ($PROTOCOL/porcelain)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index bb6ec92a920f26648970a8677db20adaf1284d5b..c50830982f73564a727125f85de512cfc24e3e73 100644 (file)
@@ -1,64 +1,64 @@
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       next(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       next(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: no hook, fail to push special ref ($PROTOCOL)" '
        test_must_fail git -C workbench push origin \
                HEAD:next \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: error: cannot find hook "proc-receive"
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        To <URL/of/upstream.git>
         * [new branch] HEAD -> next
-        ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             next(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
        git -C "$upstream" update-ref -d refs/heads/next
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push --atomic: (B)                   next(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push --atomic: (B)                   next(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: no hook, all failed for atomic push ($PROTOCOL)" '
        test_must_fail git -C workbench push --atomic origin \
-               $B:master \
+               $B:main \
                HEAD:next \
-               HEAD:refs/for/master/topic >out 2>&1 &&
+               HEAD:refs/for/main/topic >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: error: cannot find hook "proc-receive"
        To <URL/of/upstream.git>
-        ! [remote rejected] <COMMIT-B> -> master (fail to run proc-receive hook)
+        ! [remote rejected] <COMMIT-B> -> main (fail to run proc-receive hook)
         ! [remote rejected] HEAD -> next (fail to run proc-receive hook)
-        ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index 4814f74dc21fcba0d48166275d98bf3e11c0c3fa..14ea43348110100fa896009a7781d32585f51568 100644 (file)
@@ -1,66 +1,66 @@
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       next(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       next(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: no hook, fail to push special ref ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
                HEAD:next \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: error: cannot find hook "proc-receive"
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        To <URL/of/upstream.git>
        *    HEAD:refs/heads/next    [new branch]
-       !    HEAD:refs/for/master/topic    [remote rejected] (fail to run proc-receive hook)
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             next(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
        git -C "$upstream" update-ref -d refs/heads/next
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push --atomic: (B)                   next(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push --atomic: (B)                   next(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: no hook, all failed for atomic push ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain --atomic origin \
-               $B:master \
+               $B:main \
                HEAD:next \
-               HEAD:refs/for/master/topic >out 2>&1 &&
+               HEAD:refs/for/main/topic >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: error: cannot find hook "proc-receive"
        To <URL/of/upstream.git>
-       !    <COMMIT-B>:refs/heads/master    [remote rejected] (fail to run proc-receive hook)
+       !    <COMMIT-B>:refs/heads/main    [remote rejected] (fail to run proc-receive hook)
        !    HEAD:refs/heads/next    [remote rejected] (fail to run proc-receive hook)
-       !    HEAD:refs/for/master/topic    [remote rejected] (fail to run proc-receive hook)
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index c5fe4cb37b009891b2166b6424cb143527b03845..b9be12be773bb4fa14d226202357afe08818b15b 100644 (file)
@@ -5,22 +5,23 @@ test_expect_success "setup proc-receive hook (unknown version, $PROTOCOL)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
 
        # Check status report for git-push
        sed -n \
-               -e "/^To / { p; n; p; }" \
+               -e "/^To / { p; }" \
+               -e "/^ ! / { p; }" \
                <actual >actual-report &&
        cat >expect <<-EOF &&
        To <URL/of/upstream.git>
-        ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
        EOF
        test_cmp expect actual-report &&
 
@@ -36,68 +37,176 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-test_expect_success "setup proc-receive hook (hook --die-version, $PROTOCOL)" '
+test_expect_success "setup proc-receive hook (hook --die-read-version, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
-       test-tool proc-receive -v --die-version
+       test-tool proc-receive -v --die-read-version
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
-test_expect_success "proc-receive: bad protocol (hook --die-version, $PROTOCOL)" '
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-read-version, $PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; }" \
+               -e "/^ ! / { p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-read-version option" out &&
+       grep "remote: error: fail to negotiate version with proc-receive hook" out &&
+
+       git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "setup proc-receive hook (hook --die-write-version, $PROTOCOL)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-write-version
+       EOF
+'
 
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-write-version, $PROTOCOL)" '
+       test_must_fail git -C workbench push origin \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; }" \
+               -e "/^ ! / { p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-write-version option" out &&
+       grep "remote: error: fail to negotiate version with proc-receive hook" out &&
+
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "setup proc-receive hook (hook --die-read-commands, $PROTOCOL)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-read-commands
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-read-commands, $PROTOCOL)" '
+       test_must_fail git -C workbench push origin \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; }" \
+               -e "/^ ! / { p; }" \
+               <out >actual &&
        cat >expect <<-EOF &&
-       remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: # proc-receive hook
-       remote: fatal: bad protocol version: 1
-       remote: error: proc-receive version "0" is not supported
        To <URL/of/upstream.git>
-        ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
        EOF
        test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-read-commands option" out &&
 
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-test_expect_success "setup proc-receive hook (hook --die-readline, $PROTOCOL)" '
+test_expect_success "setup proc-receive hook (hook --die-read-push-options, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
-       test-tool proc-receive -v --die-readline
+       test-tool proc-receive -v --die-read-push-options
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
-test_expect_success "proc-receive: bad protocol (hook --die-readline, $PROTOCOL)" '
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-read-push-options, $PROTOCOL)" '
+       git -C "$upstream" config receive.advertisePushOptions true &&
        test_must_fail git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               -o reviewers=user1,user2 \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; }" \
+               -e "/^ ! / { p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-read-push-options option" out &&
+
+       git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
 
-       grep "remote: fatal: protocol error: expected \"old new ref\", got \"<ZERO-OID> <COMMIT-A> refs/for/master/topic\"" actual &&
+test_expect_success "setup proc-receive hook (hook --die-write-report, $PROTOCOL)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-write-report
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-write-report, $PROTOCOL)" '
+       test_must_fail git -C workbench push origin \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; }" \
+               -e "/^ ! / { p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+        ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook)
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-write-report option" out &&
 
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -109,38 +218,39 @@ test_expect_success "setup proc-receive hook (no report, $PROTOCOL)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       next(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       next(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: bad protocol (no report, $PROTOCOL)" '
        test_must_fail git -C workbench push origin \
                HEAD:refs/heads/next \
-               HEAD:refs/for/master/topic >out 2>&1 &&
+               HEAD:refs/for/main/topic >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        To <URL/of/upstream.git>
         * [new branch] HEAD -> next
-        ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+        ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
        EOF
        test_cmp expect actual &&
+
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             next(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
        git -C "$upstream" update-ref -d refs/heads/next
 
@@ -154,29 +264,30 @@ test_expect_success "setup proc-receive hook (no ref, $PROTOCOL)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: bad protocol (no ref, $PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               HEAD:refs/for/master/topic\
+               HEAD:refs/for/main/topic\
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive> ok
        remote: error: proc-receive reported incomplete status line: "ok"
        To <URL/of/upstream.git>
-        ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+        ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
        EOF
        test_cmp expect actual &&
+
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -185,33 +296,34 @@ test_expect_success "setup proc-receive hook (unknown status, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "xx refs/for/master/topic"
+               -r "xx refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: bad protocol (unknown status, $PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-                       HEAD:refs/for/master/topic \
+                       HEAD:refs/for/main/topic \
                        >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> xx refs/for/master/topic
-       remote: error: proc-receive reported bad status "xx" on ref "refs/for/master/topic"
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> xx refs/for/main/topic
+       remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic"
        To <URL/of/upstream.git>
-        ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+        ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
        EOF
        test_cmp expect actual &&
+
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index 53b47b01858532ba48270076cfc63bf61b6c704d..fdb4569109ab0192abedd736a45e262f3b3335cb 100644 (file)
@@ -5,12 +5,12 @@ test_expect_success "setup proc-receive hook (unknown version, $PROTOCOL/porcela
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
 
@@ -20,7 +20,7 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL/porc
                <actual >actual-report &&
        cat >expect <<-EOF &&
        To <URL/of/upstream.git>
-       !    HEAD:refs/for/master/topic    [remote rejected] (fail to run proc-receive hook)
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
        Done
        EOF
        test_cmp expect actual-report &&
@@ -37,7 +37,176 @@ test_expect_success "proc-receive: bad protocol (unknown version, $PROTOCOL/porc
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "setup proc-receive hook (hook --die-read-version, $PROTOCOL/porcelain)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-read-version
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-read-version, $PROTOCOL/porcelain)" '
+       test_must_fail git -C workbench push --porcelain origin \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; n; p; n; p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
+       Done
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-read-version option" out &&
+       grep "remote: error: fail to negotiate version with proc-receive hook" out &&
+
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "setup proc-receive hook (hook --die-write-version, $PROTOCOL/porcelain)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-write-version
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-write-version, $PROTOCOL/porcelain)" '
+       test_must_fail git -C workbench push --porcelain origin \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; n; p; n; p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
+       Done
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-write-version option" out &&
+       grep "remote: error: fail to negotiate version with proc-receive hook" out &&
+
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "setup proc-receive hook (hook --die-read-commands, $PROTOCOL/porcelain)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-read-commands
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-read-commands, $PROTOCOL/porcelain)" '
+       test_must_fail git -C workbench push --porcelain origin \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; n; p; n; p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
+       Done
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-read-commands option" out &&
+
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "setup proc-receive hook (hook --die-read-push-options, $PROTOCOL/porcelain)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-read-push-options
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-read-push-options, $PROTOCOL/porcelain)" '
+       git -C "$upstream" config receive.advertisePushOptions true &&
+       test_must_fail git -C workbench push --porcelain origin \
+               -o reviewers=user1,user2 \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; n; p; n; p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
+       Done
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-read-push-options option" out &&
+
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "setup proc-receive hook (hook --die-write-report, $PROTOCOL/porcelain)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v --die-write-report
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
+test_expect_success "proc-receive: bad protocol (hook --die-write-report, $PROTOCOL/porcelain)" '
+       test_must_fail git -C workbench push --porcelain origin \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       filter_out_user_friendly_and_stable_output \
+               -e "/^To / { p; n; p; n; p; }" \
+               <out >actual &&
+       cat >expect <<-EOF &&
+       To <URL/of/upstream.git>
+       !    HEAD:refs/for/main/topic    [remote rejected] (fail to run proc-receive hook)
+       Done
+       EOF
+       test_cmp expect actual &&
+       grep "remote: fatal: die with the --die-write-report option" out &&
+
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -49,42 +218,42 @@ test_expect_success "setup proc-receive hook (no report, $PROTOCOL/porcelain)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       next(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       next(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: bad protocol (no report, $PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
                HEAD:refs/heads/next \
-               HEAD:refs/for/master/topic >out 2>&1 &&
+               HEAD:refs/for/main/topic >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        To <URL/of/upstream.git>
        *    HEAD:refs/heads/next    [new branch]
-       !    HEAD:refs/for/master/topic    [remote rejected] (proc-receive failed to report status)
+       !    HEAD:refs/for/main/topic    [remote rejected] (proc-receive failed to report status)
        Done
        EOF
        test_cmp expect actual &&
+
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             next(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
        git -C "$upstream" update-ref -d refs/heads/next
-
 '
 
 test_expect_success "setup proc-receive hook (no ref, $PROTOCOL/porcelain)" '
@@ -95,30 +264,31 @@ test_expect_success "setup proc-receive hook (no ref, $PROTOCOL/porcelain)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: bad protocol (no ref, $PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic\
+               HEAD:refs/for/main/topic\
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive> ok
        remote: error: proc-receive reported incomplete status line: "ok"
        To <URL/of/upstream.git>
-       !    HEAD:refs/for/master/topic    [remote rejected] (proc-receive failed to report status)
+       !    HEAD:refs/for/main/topic    [remote rejected] (proc-receive failed to report status)
        Done
        EOF
        test_cmp expect actual &&
+
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -127,34 +297,35 @@ test_expect_success "setup proc-receive hook (unknown status, $PROTOCOL/porcelai
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "xx refs/for/master/topic"
+               -r "xx refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: bad protocol (unknown status, $PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-                       HEAD:refs/for/master/topic \
+                       HEAD:refs/for/main/topic \
                        >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> xx refs/for/master/topic
-       remote: error: proc-receive reported bad status "xx" on ref "refs/for/master/topic"
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> xx refs/for/main/topic
+       remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic"
        To <URL/of/upstream.git>
-       !    HEAD:refs/for/master/topic    [remote rejected] (proc-receive failed to report status)
+       !    HEAD:refs/for/main/topic    [remote rejected] (proc-receive failed to report status)
        Done
        EOF
        test_cmp expect actual &&
+
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index f726b7ca9c4420c10717750d7eb056210da9d2d8..5a9e0daf2d56829b9372a85b499ff1a815c8be62 100644 (file)
@@ -2,32 +2,32 @@ test_expect_success "setup proc-receive hook (ng, no message, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ng refs/for/master/topic"
+               -r "ng refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: fail to update (ng, no message, $PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ng refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ng refs/for/main/topic
        To <URL/of/upstream.git>
-        ! [remote rejected] HEAD -> refs/for/master/topic (failed)
+        ! [remote rejected] HEAD -> refs/for/main/topic (failed)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -36,32 +36,32 @@ test_expect_success "setup proc-receive hook (ng message, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ng refs/for/master/topic error msg"
+               -r "ng refs/for/main/topic error msg"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: fail to update (ng, with message, $PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ng refs/for/master/topic error msg
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ng refs/for/main/topic error msg
        To <URL/of/upstream.git>
-        ! [remote rejected] HEAD -> refs/for/master/topic (error msg)
+        ! [remote rejected] HEAD -> refs/for/main/topic (error msg)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index fbf55691031bd0d7f2ff20fbf587e95ede6c7616..93475a83cfcb9c9e0faeed7d94a4bec6cec3ffaa 100644 (file)
@@ -2,33 +2,33 @@ test_expect_success "setup proc-receive hook (ng, no message, $PROTOCOL/porcelai
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ng refs/for/master/topic"
+               -r "ng refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: fail to update (ng, no message, $PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ng refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ng refs/for/main/topic
        To <URL/of/upstream.git>
-       !    HEAD:refs/for/master/topic    [remote rejected] (failed)
+       !    HEAD:refs/for/main/topic    [remote rejected] (failed)
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -37,33 +37,33 @@ test_expect_success "setup proc-receive hook (ng message, $PROTOCOL/porcelain)"
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ng refs/for/master/topic error msg"
+               -r "ng refs/for/main/topic error msg"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: fail to update (ng, with message, $PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ng refs/for/master/topic error msg
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ng refs/for/main/topic error msg
        To <URL/of/upstream.git>
-       !    HEAD:refs/for/master/topic    [remote rejected] (error msg)
+       !    HEAD:refs/for/main/topic    [remote rejected] (error msg)
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index 92a415b929c90758b45e2429346c8ffa5b0a2700..f8be8a0ba1adcf08ba8564406999c1068f19a1c5 100644 (file)
@@ -2,44 +2,44 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/heads/master"
+               -r "ok refs/heads/main"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         : (B)                   refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         : (B)                   refs/for/main/topic
 test_expect_success "proc-receive: report unexpected ref ($PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               $B:refs/heads/master \
-               HEAD:refs/for/master/topic \
+               $B:refs/heads/main \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/heads/master
-       remote: error: proc-receive reported status on unexpected ref: refs/heads/master
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/heads/main
+       remote: error: proc-receive reported status on unexpected ref: refs/heads/main
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        To <URL/of/upstream.git>
-        <OID-A>..<OID-B> <COMMIT-B> -> master
-        ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+        <OID-A>..<OID-B> <COMMIT-B> -> main
+        ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(B)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
-       git -C "$upstream" update-ref refs/heads/master $A
+       git -C "$upstream" update-ref refs/heads/main $A
 '
index acbf93e40abfb49fe3df2bff67b7c06f0d3c2811..778150fa03257ae0e3213a3b86f2ab5da2d82ce4 100644 (file)
@@ -2,45 +2,45 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL/porcelai
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/heads/master"
+               -r "ok refs/heads/main"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         : (B)                   refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         : (B)                   refs/for/main/topic
 test_expect_success "proc-receive: report unexpected ref ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               $B:refs/heads/master \
-               HEAD:refs/for/master/topic \
+               $B:refs/heads/main \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/heads/master
-       remote: error: proc-receive reported status on unexpected ref: refs/heads/master
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/heads/main
+       remote: error: proc-receive reported status on unexpected ref: refs/heads/main
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        To <URL/of/upstream.git>
-            <COMMIT-B>:refs/heads/master    <OID-A>..<OID-B>
-       !    HEAD:refs/for/master/topic    [remote rejected] (proc-receive failed to report status)
+            <COMMIT-B>:refs/heads/main    <OID-A>..<OID-B>
+       !    HEAD:refs/for/main/topic    [remote rejected] (proc-receive failed to report status)
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(B)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
-       git -C "$upstream" update-ref refs/heads/master $A
+       git -C "$upstream" update-ref refs/heads/main $A
 '
index c3946f329adceb8822f763c348c91363dde75753..d4e74e46811ee880edf14277b49cb8443e075c9a 100644 (file)
@@ -2,12 +2,12 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic"
+               -r "ok refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
 # git push         :                       refs/for/a/b/c/my/topic
 test_expect_success "proc-receive: report unknown reference ($PROTOCOL)" '
        test_must_fail git -C workbench push origin \
@@ -19,8 +19,8 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL)" '
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
        remote: # proc-receive hook
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
-       remote: proc-receive> ok refs/for/master/topic
-       remote: error: proc-receive reported status on unknown ref: refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
+       remote: error: proc-receive reported status on unknown ref: refs/for/main/topic
        To <URL/of/upstream.git>
         ! [remote rejected] HEAD -> refs/for/a/b/c/my/topic (proc-receive failed to report status)
        EOF
@@ -28,7 +28,7 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index d093b1a5799c95fa5df063ec5b8afe5766301837..039e8b61637ce585c1f98fb03267e257132ed205 100644 (file)
@@ -2,12 +2,12 @@ test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL/porcelai
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic"
+               -r "ok refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
 # git push         :                       refs/for/a/b/c/my/topic
 test_expect_success "proc-receive: report unknown reference ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
@@ -19,8 +19,8 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL/porcelain
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
        remote: # proc-receive hook
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic
-       remote: proc-receive> ok refs/for/master/topic
-       remote: error: proc-receive reported status on unknown ref: refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
+       remote: error: proc-receive reported status on unknown ref: refs/for/main/topic
        To <URL/of/upstream.git>
        !    HEAD:refs/for/a/b/c/my/topic    [remote rejected] (proc-receive failed to report status)
        Done
@@ -29,7 +29,7 @@ test_expect_success "proc-receive: report unknown reference ($PROTOCOL/porcelain
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index d0c4da8b237284dd9d01ffe306da873f04dda85f..e88edb16a445c88f008f2b82aab8c61e4ff47d55 100644 (file)
@@ -3,19 +3,19 @@ test_expect_success "setup proc-receive hook and disable push-options ($PROTOCOL
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic"
+               -r "ok refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push -o ...  :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -o ...  :                       refs/for/main/topic
 test_expect_success "proc-receive: not support push options ($PROTOCOL)" '
        test_must_fail git -C workbench push \
                -o issue=123 \
                -o reviewer=user1 \
                origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        test_i18ngrep "fatal: the receiving end does not support push options" \
@@ -23,7 +23,7 @@ test_expect_success "proc-receive: not support push options ($PROTOCOL)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -32,9 +32,69 @@ test_expect_success "enable push options ($PROTOCOL)" '
        git -C "$upstream" config receive.advertisePushOptions true
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push -o ...  :                       next(A)  refs/for/master/topic
+test_expect_success "setup version=0 for proc-receive hook ($PROTOCOL)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v \
+               --version 0 \
+               -r "ok refs/for/main/topic"
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -o ...  :                       next(A)  refs/for/main/topic
+test_expect_success "proc-receive: ignore push-options for version 0 ($PROTOCOL)" '
+       git -C workbench push \
+               --atomic \
+               -o issue=123 \
+               -o reviewer=user1 \
+               origin \
+               HEAD:refs/heads/next \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       remote: # pre-receive hook
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: # proc-receive hook
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
+       remote: # post-receive hook
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       To <URL/of/upstream.git>
+        * [new branch] HEAD -> next
+        * [new reference] HEAD -> refs/for/main/topic
+       EOF
+       test_cmp expect actual &&
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       <COMMIT-A> refs/heads/next
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "restore proc-receive hook ($PROTOCOL)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v \
+               -r "ok refs/for/main/topic"
+       EOF
+'
+
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
+test_expect_success "cleanup ($PROTOCOL)" '
+       git -C "$upstream" update-ref -d refs/heads/next
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -o ...  :                       next(A)  refs/for/main/topic
 test_expect_success "proc-receive: push with options ($PROTOCOL)" '
        git -C workbench push \
                --atomic \
@@ -42,38 +102,38 @@ test_expect_success "proc-receive: push with options ($PROTOCOL)" '
                -o reviewer=user1 \
                origin \
                HEAD:refs/heads/next \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
        remote: proc-receive: atomic push_options
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive< issue=123
        remote: proc-receive< reviewer=user1
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        To <URL/of/upstream.git>
         * [new branch] HEAD -> next
-        * [new reference] HEAD -> refs/for/master/topic
+        * [new reference] HEAD -> refs/for/main/topic
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             next(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
        git -C "$upstream" update-ref -d refs/heads/next
 '
index c89a1e7c575a460f205d39594f55bf0e993a1805..3a6561b5eab465b3b9eab20e29a3c4fa992d6a7c 100644 (file)
@@ -3,20 +3,20 @@ test_expect_success "setup proc-receive hook and disable push-options ($PROTOCOL
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic"
+               -r "ok refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push -o ...  :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -o ...  :                       refs/for/main/topic
 test_expect_success "proc-receive: not support push options ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push \
                --porcelain \
                -o issue=123 \
                -o reviewer=user1 \
                origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        test_i18ngrep "fatal: the receiving end does not support push options" \
@@ -24,7 +24,7 @@ test_expect_success "proc-receive: not support push options ($PROTOCOL/porcelain
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -33,9 +33,71 @@ test_expect_success "enable push options ($PROTOCOL/porcelain)" '
        git -C "$upstream" config receive.advertisePushOptions true
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push -o ...  :                       next(A)  refs/for/master/topic
+test_expect_success "setup version=0 for proc-receive hook ($PROTOCOL/porcelain)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v \
+               --version 0 \
+               -r "ok refs/for/main/topic"
+       EOF
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -o ...  :                       next(A)  refs/for/main/topic
+test_expect_success "proc-receive: ignore push-options for version 0 ($PROTOCOL/porcelain)" '
+       git -C workbench push \
+               --porcelain \
+               --atomic \
+               -o issue=123 \
+               -o reviewer=user1 \
+               origin \
+               HEAD:refs/heads/next \
+               HEAD:refs/for/main/topic \
+               >out 2>&1 &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       remote: # pre-receive hook
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: # proc-receive hook
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
+       remote: # post-receive hook
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       To <URL/of/upstream.git>
+       *    HEAD:refs/heads/next    [new branch]
+       *    HEAD:refs/for/main/topic    [new reference]
+       Done
+       EOF
+       test_cmp expect actual &&
+       git -C "$upstream" show-ref >out &&
+       make_user_friendly_and_stable_output <out >actual &&
+       cat >expect <<-EOF &&
+       <COMMIT-A> refs/heads/main
+       <COMMIT-A> refs/heads/next
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success "restore proc-receive hook ($PROTOCOL/porcelain)" '
+       write_script "$upstream/hooks/proc-receive" <<-EOF
+       printf >&2 "# proc-receive hook\n"
+       test-tool proc-receive -v \
+               -r "ok refs/for/main/topic"
+       EOF
+'
+
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
+test_expect_success "cleanup ($PROTOCOL/porcelain)" '
+       git -C "$upstream" update-ref -d refs/heads/next
+'
+
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -o ...  :                       next(A)  refs/for/main/topic
 test_expect_success "proc-receive: push with options ($PROTOCOL/porcelain)" '
        git -C workbench push \
                --porcelain \
@@ -44,39 +106,39 @@ test_expect_success "proc-receive: push with options ($PROTOCOL/porcelain)" '
                -o reviewer=user1 \
                origin \
                HEAD:refs/heads/next \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
        remote: proc-receive: atomic push_options
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive< issue=123
        remote: proc-receive< reviewer=user1
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        To <URL/of/upstream.git>
        *    HEAD:refs/heads/next    [new branch]
-       *    HEAD:refs/for/master/topic    [new reference]
+       *    HEAD:refs/for/main/topic    [new reference]
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/heads/next
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             next(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             next(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
        git -C "$upstream" update-ref -d refs/heads/next
 '
index 44c99d38319ad7e28eb233e2874046a865e7f996..5d6feef118f7e4f4d25b7d9474528fe70b9f987d 100644 (file)
@@ -2,34 +2,34 @@ test_expect_success "setup proc-receive hook (ok, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic"
+               -r "ok refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: ok ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: # post-receive hook
-       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        To <URL/of/upstream.git>
-        * [new reference] HEAD -> refs/for/master/topic
+        * [new reference] HEAD -> refs/for/main/topic
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index 3223b26184f43f158b7e2ab6a8cbcc4ed0149bf6..91666d32df5fccd76c80cae4592ef6efb2532773 100644 (file)
@@ -2,35 +2,35 @@ test_expect_success "setup proc-receive hook (ok, $PROTOCOL/porcelain)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic"
+               -r "ok refs/for/main/topic"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic
 test_expect_success "proc-receive: ok ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: # post-receive hook
-       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        To <URL/of/upstream.git>
-       *    HEAD:refs/for/master/topic    [new reference]
+       *    HEAD:refs/for/main/topic    [new reference]
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index b77b78c49ff938efb9a48a36d31b6b465d13559f..a0faf5c7ff04d414f22e79e688bcc23a0452fff0 100644 (file)
@@ -7,24 +7,24 @@ test_expect_success "setup proc-receive hook (option without matching ok, $PROTO
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option without matching ok ($PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: error: proc-receive reported "option" without a matching "ok/ng" directive
        To <URL/of/upstream.git>
-        ! [remote rejected] HEAD -> refs/for/master/topic (proc-receive failed to report status)
+        ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status)
        EOF
        test_cmp expect actual
 '
@@ -33,25 +33,25 @@ test_expect_success "setup proc-receive hook (option refname, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option refname ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
@@ -65,25 +65,25 @@ test_expect_success "setup proc-receive hook (option refname and forced-update,
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head" \
                -r "option forced-update"
        EOF
 '
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option refname and forced-update ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option forced-update
        remote: # post-receive hook
@@ -98,26 +98,26 @@ test_expect_success "setup proc-receive hook (option refname and old-oid, $PROTO
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head" \
                -r "option old-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option refname and old-oid ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: # post-receive hook
@@ -132,30 +132,30 @@ test_expect_success "setup proc-receive hook (option old-oid, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option old-oid ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/master/topic
+       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic
        To <URL/of/upstream.git>
-        <OID-B>..<OID-A> HEAD -> refs/for/master/topic
+        <OID-B>..<OID-A> HEAD -> refs/for/main/topic
        EOF
        test_cmp expect actual
 '
@@ -164,32 +164,32 @@ test_expect_success "setup proc-receive hook (option old-oid and new-oid, $PROTO
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option old-oid and new-oid ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        To <URL/of/upstream.git>
-        <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+        <OID-A>..<OID-B> HEAD -> refs/for/main/topic
        EOF
        test_cmp expect actual
 '
@@ -201,7 +201,7 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
                -r "ok refs/for/a/b/c/topic" \
                -r "ok refs/for/next/topic" \
                -r "option refname refs/pull/123/head" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/124/head" \
                -r "option old-oid $B" \
                -r "option forced-update" \
@@ -209,29 +209,29 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL)" '
        git -C workbench push origin \
                HEAD:refs/for/next/topic \
                HEAD:refs/for/a/b/c/topic \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive> ok refs/for/a/b/c/topic
        remote: proc-receive> ok refs/for/next/topic
        remote: proc-receive> option refname refs/pull/123/head
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/124/head
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: proc-receive> option forced-update
@@ -250,7 +250,7 @@ test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index 1fe352b6860880f27f35218844f0118c00bba374..32ae26bcfb0e5b9b2ce106fe1443ecaed9fd0cb9 100644 (file)
@@ -7,24 +7,24 @@ test_expect_success "setup proc-receive hook (option without matching ok, $PROTO
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option without matching ok ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: error: proc-receive reported "option" without a matching "ok/ng" directive
        To <URL/of/upstream.git>
-       !    HEAD:refs/for/master/topic    [remote rejected] (proc-receive failed to report status)
+       !    HEAD:refs/for/main/topic    [remote rejected] (proc-receive failed to report status)
        Done
        EOF
        test_cmp expect actual
@@ -34,25 +34,25 @@ test_expect_success "setup proc-receive hook (option refname, $PROTOCOL/porcelai
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option refname ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
@@ -67,26 +67,26 @@ test_expect_success "setup proc-receive hook (option refname and forced-update,
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head" \
                -r "option forced-update"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option refname and forced-update ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option forced-update
        remote: # post-receive hook
@@ -102,26 +102,26 @@ test_expect_success "setup proc-receive hook (option refname and old-oid, $PROTO
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head" \
                -r "option old-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option refname and old-oid ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: # post-receive hook
@@ -137,30 +137,30 @@ test_expect_success "setup proc-receive hook (option old-oid, $PROTOCOL/porcelai
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option old-oid ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/master/topic
+       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic
        To <URL/of/upstream.git>
-            HEAD:refs/for/master/topic    <OID-B>..<OID-A>
+            HEAD:refs/for/main/topic    <OID-B>..<OID-A>
        Done
        EOF
        test_cmp expect actual
@@ -170,32 +170,32 @@ test_expect_success "setup proc-receive hook (option old-oid and new-oid, $PROTO
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report option old-oid and new-oid ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        To <URL/of/upstream.git>
-            HEAD:refs/for/master/topic    <OID-A>..<OID-B>
+            HEAD:refs/for/main/topic    <OID-A>..<OID-B>
        Done
        EOF
        test_cmp expect actual
@@ -208,7 +208,7 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
                -r "ok refs/for/a/b/c/topic" \
                -r "ok refs/for/next/topic" \
                -r "option refname refs/pull/123/head" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/124/head" \
                -r "option old-oid $B" \
                -r "option forced-update" \
@@ -217,29 +217,29 @@ test_expect_success "setup proc-receive hook (report with multiple rewrites, $PR
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/next/topic(A)  refs/for/a/b/c/topic(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
                HEAD:refs/for/next/topic \
                HEAD:refs/for/a/b/c/topic \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive> ok refs/for/a/b/c/topic
        remote: proc-receive> ok refs/for/next/topic
        remote: proc-receive> option refname refs/pull/123/head
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/124/head
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: proc-receive> option forced-update
@@ -259,7 +259,7 @@ test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL/porc
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index aca2b0676c4b6c77f7c26b9fa6f7b36eaaa8aee0..c355c290d2f0c56c7e7408902f5434f6908644e0 100644 (file)
@@ -2,43 +2,43 @@ test_expect_success "setup proc-receive hook (ft, $PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option fall-through"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(B)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(B)
 test_expect_success "proc-receive: fall throught, let receive-pack to execute ($PROTOCOL)" '
        git -C workbench push origin \
-               $B:refs/for/master/topic \
+               $B:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option fall-through
        remote: # post-receive hook
-       remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
        To <URL/of/upstream.git>
-        * [new reference] <COMMIT-B> -> refs/for/master/topic
+        * [new reference] <COMMIT-B> -> refs/for/main/topic
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/for/master/topic
-       <COMMIT-A> refs/heads/master
+       <COMMIT-B> refs/for/main/topic
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             refs/for/master/topic(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             refs/for/main/topic(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
-       git -C "$upstream" update-ref -d refs/for/master/topic
+       git -C "$upstream" update-ref -d refs/for/main/topic
 '
index 30ffffb352d65a1c46c016075f4e7d0c52b89a80..8ce4e58f2a5c483137946766a2d3ad8a7adab280 100644 (file)
@@ -2,44 +2,44 @@ test_expect_success "setup proc-receive hook (fall-through, $PROTOCOL/porcelain)
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option fall-through"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(B)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(B)
 test_expect_success "proc-receive: fall throught, let receive-pack to execute ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               $B:refs/for/master/topic \
+               $B:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option fall-through
        remote: # post-receive hook
-       remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic
        To <URL/of/upstream.git>
-       *    <COMMIT-B>:refs/for/master/topic    [new reference]
+       *    <COMMIT-B>:refs/for/main/topic    [new reference]
        Done
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-B> refs/for/master/topic
-       <COMMIT-A> refs/heads/master
+       <COMMIT-B> refs/for/main/topic
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             refs/for/master/topic(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             refs/for/main/topic(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
-       git -C "$upstream" update-ref -d refs/for/master/topic
+       git -C "$upstream" update-ref -d refs/for/main/topic
 '
index 73283d81e8a3312b3418c7b793c00d33ef2490f8..fad8eea8a060f640e76e6b93b076a95c95660982 100644 (file)
@@ -17,50 +17,50 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/24/124/1" \
                -r "option old-oid $ZERO_OID" \
                -r "option new-oid $A" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/25/125/1" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: multiple rewrite for one ref, no refname for the 1st rewrite ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/24/124/1
        remote: proc-receive> option old-oid <ZERO-OID>
        remote: proc-receive> option new-oid <COMMIT-A>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/25/125/1
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1
        To <URL/of/upstream.git>
-        <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+        <OID-A>..<OID-B> HEAD -> refs/for/main/topic
         * [new reference] HEAD -> refs/changes/24/124/1
         <OID-A>..<OID-B> HEAD -> refs/changes/25/125/1
        EOF
@@ -68,7 +68,7 @@ test_expect_success "proc-receive: multiple rewrite for one ref, no refname for
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -80,10 +80,10 @@ test_expect_success "proc-receive: check remote-tracking #1 ($PROTOCOL)" '
        cat >expect <<-EOF &&
        <COMMIT-A> refs/t/changes/24/124/1
        <COMMIT-B> refs/t/changes/25/125/1
-       <COMMIT-B> refs/t/for/master/topic
+       <COMMIT-B> refs/t/for/main/topic
        EOF
        test_cmp expect actual &&
-       git -C workbench update-ref -d refs/t/for/master/topic &&
+       git -C workbench update-ref -d refs/t/for/main/topic &&
        git -C workbench update-ref -d refs/t/changes/24/124/1 &&
        git -C workbench update-ref -d refs/t/changes/25/125/1
 '
@@ -92,14 +92,14 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/24/124/1" \
                -r "option old-oid $ZERO_OID" \
                -r "option new-oid $A" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/25/125/1" \
                -r "option old-oid $B" \
                -r "option new-oid $A" \
@@ -107,45 +107,45 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: multiple rewrites for one ref, no refname for the 2nd rewrite ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/24/124/1
        remote: proc-receive> option old-oid <ZERO-OID>
        remote: proc-receive> option new-oid <COMMIT-A>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/25/125/1
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: proc-receive> option new-oid <COMMIT-A>
        remote: proc-receive> option forced-update
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1
        To <URL/of/upstream.git>
         * [new reference] HEAD -> refs/changes/24/124/1
-        <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+        <OID-A>..<OID-B> HEAD -> refs/for/main/topic
         + <OID-B>...<OID-A> HEAD -> refs/changes/25/125/1 (forced update)
        EOF
        test_cmp expect actual &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -157,10 +157,10 @@ test_expect_success "proc-receive: check remote-tracking #2 ($PROTOCOL)" '
        cat >expect <<-EOF &&
        <COMMIT-A> refs/t/changes/24/124/1
        <COMMIT-A> refs/t/changes/25/125/1
-       <COMMIT-B> refs/t/for/master/topic
+       <COMMIT-B> refs/t/for/main/topic
        EOF
        test_cmp expect actual &&
-       git -C workbench update-ref -d refs/t/for/master/topic &&
+       git -C workbench update-ref -d refs/t/for/main/topic &&
        git -C workbench update-ref -d refs/t/changes/24/124/1 &&
        git -C workbench update-ref -d refs/t/changes/25/125/1
 '
@@ -169,31 +169,31 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, $PR
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/23/123/1" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/24/124/2" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL)" '
        git -C workbench push origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/23/123/1
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/24/124/2
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
@@ -208,7 +208,7 @@ test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index 77b5b22ed4e5faee47f5bd9bd94ae0c0ccb53d69..dc254d57eb0ddbe8aa6e2803bf86c58980600d70 100644 (file)
@@ -2,50 +2,50 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/24/124/1" \
                -r "option old-oid $ZERO_OID" \
                -r "option new-oid $A" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/25/125/1" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: multiple rewrite for one ref, no refname for the 1st rewrite ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/24/124/1
        remote: proc-receive> option old-oid <ZERO-OID>
        remote: proc-receive> option new-oid <COMMIT-A>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/25/125/1
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1
        To <URL/of/upstream.git>
-            HEAD:refs/for/master/topic    <OID-A>..<OID-B>
+            HEAD:refs/for/main/topic    <OID-A>..<OID-B>
        *    HEAD:refs/changes/24/124/1    [new reference]
             HEAD:refs/changes/25/125/1    <OID-A>..<OID-B>
        Done
@@ -54,7 +54,7 @@ test_expect_success "proc-receive: multiple rewrite for one ref, no refname for
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -63,14 +63,14 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/24/124/1" \
                -r "option old-oid $ZERO_OID" \
                -r "option new-oid $A" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/25/125/1" \
                -r "option old-oid $B" \
                -r "option new-oid $A" \
@@ -78,38 +78,38 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, no
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: multiple rewrites for one ref, no refname for the 2nd rewrite ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/24/124/1
        remote: proc-receive> option old-oid <ZERO-OID>
        remote: proc-receive> option new-oid <COMMIT-A>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/25/125/1
        remote: proc-receive> option old-oid <COMMIT-B>
        remote: proc-receive> option new-oid <COMMIT-A>
        remote: proc-receive> option forced-update
        remote: # post-receive hook
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1
        To <URL/of/upstream.git>
        *    HEAD:refs/changes/24/124/1    [new reference]
-            HEAD:refs/for/master/topic    <OID-A>..<OID-B>
+            HEAD:refs/for/main/topic    <OID-A>..<OID-B>
        +    HEAD:refs/changes/25/125/1    <OID-B>...<OID-A> (forced update)
        Done
        EOF
@@ -117,7 +117,7 @@ test_expect_success "proc-receive: multiple rewrites for one ref, no refname for
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
@@ -126,31 +126,31 @@ test_expect_success "setup proc-receive hook (multiple rewrites for one ref, $PR
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/23/123/1" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/changes/24/124/2" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         :                       refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         :                       refs/for/main/topic(A)
 test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain origin \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: # proc-receive hook
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/23/123/1
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/changes/24/124/2
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
@@ -166,7 +166,7 @@ test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL/porc
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
index a74a2cb4498951c008218de5eed578a2ddff4edc..0d071ebaa6c9dc8cd40bca37d8e4806d2b94cd6e 100644 (file)
@@ -4,63 +4,63 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
        test-tool proc-receive -v \
                -r "ok refs/for/next/topic2" \
                -r "ng refs/for/next/topic1 fail to call Web API" \
-               -r "ok refs/for/master/topic" \
-               -r "option refname refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
+               -r "option refname refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         : (B)                   bar(A)  baz(A)  refs/for/next/topic(A)  foo(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         : (B)                   bar(A)  baz(A)  refs/for/next/topic(A)  foo(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL)" '
        test_must_fail git -C workbench push origin \
-               $B:refs/heads/master \
+               $B:refs/heads/main \
                HEAD:refs/heads/bar \
                HEAD:refs/heads/baz \
                HEAD:refs/for/next/topic2 \
                HEAD:refs/for/next/topic1 \
                HEAD:refs/heads/foo \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                HEAD:refs/for/next/topic3 \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
        remote: # proc-receive hook
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
        remote: proc-receive> ok refs/for/next/topic2
        remote: proc-receive> ng refs/for/next/topic1 fail to call Web API
-       remote: proc-receive> ok refs/for/master/topic
-       remote: proc-receive> option refname refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
+       remote: proc-receive> option refname refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        To <URL/of/upstream.git>
-        <OID-A>..<OID-B> <COMMIT-B> -> master
+        <OID-A>..<OID-B> <COMMIT-B> -> main
         * [new branch] HEAD -> bar
         * [new branch] HEAD -> baz
         * [new reference] HEAD -> refs/for/next/topic2
         * [new branch] HEAD -> foo
-        <OID-A>..<OID-B> HEAD -> refs/for/master/topic
+        <OID-A>..<OID-B> HEAD -> refs/for/main/topic
         ! [remote rejected] HEAD -> refs/for/next/topic1 (fail to call Web API)
         ! [remote rejected] HEAD -> refs/for/next/topic3 (proc-receive failed to report status)
        EOF
@@ -71,17 +71,17 @@ test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL)" '
        <COMMIT-A> refs/heads/bar
        <COMMIT-A> refs/heads/baz
        <COMMIT-A> refs/heads/foo
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)             foo(A)  bar(A))  baz(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(B)             foo(A)  bar(A))  baz(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
        (
                cd "$upstream" &&
-               git update-ref refs/heads/master $A &&
+               git update-ref refs/heads/main $A &&
                git update-ref -d refs/heads/foo &&
                git update-ref -d refs/heads/bar &&
                git update-ref -d refs/heads/baz
index e4baa13ea3306f85dccbe56823df94350d1b4503..d8409912fd3af493f116a0ae735f0b5bd821552a 100644 (file)
@@ -4,63 +4,63 @@ test_expect_success "setup proc-receive hook ($PROTOCOL/porcelain)" '
        test-tool proc-receive -v \
                -r "ok refs/for/next/topic2" \
                -r "ng refs/for/next/topic1 fail to call Web API" \
-               -r "ok refs/for/master/topic" \
-               -r "option refname refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
+               -r "option refname refs/for/main/topic" \
                -r "option old-oid $A" \
                -r "option new-oid $B"
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         : (B)                   bar(A)  baz(A)  refs/for/next/topic(A)  foo(A)  refs/for/master/topic(A)
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         : (B)                   bar(A)  baz(A)  refs/for/next/topic(A)  foo(A)  refs/for/main/topic(A)
 test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL/porcelain)" '
        test_must_fail git -C workbench push --porcelain origin \
-               $B:refs/heads/master \
+               $B:refs/heads/main \
                HEAD:refs/heads/bar \
                HEAD:refs/heads/baz \
                HEAD:refs/for/next/topic2 \
                HEAD:refs/for/next/topic1 \
                HEAD:refs/heads/foo \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                HEAD:refs/for/next/topic3 \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
        remote: # proc-receive hook
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3
        remote: proc-receive> ok refs/for/next/topic2
        remote: proc-receive> ng refs/for/next/topic1 fail to call Web API
-       remote: proc-receive> ok refs/for/master/topic
-       remote: proc-receive> option refname refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
+       remote: proc-receive> option refname refs/for/main/topic
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
        remote: # post-receive hook
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
        remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
-       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+       remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic
        To <URL/of/upstream.git>
-            <COMMIT-B>:refs/heads/master    <OID-A>..<OID-B>
+            <COMMIT-B>:refs/heads/main    <OID-A>..<OID-B>
        *    HEAD:refs/heads/bar    [new branch]
        *    HEAD:refs/heads/baz    [new branch]
        *    HEAD:refs/for/next/topic2    [new reference]
        *    HEAD:refs/heads/foo    [new branch]
-            HEAD:refs/for/master/topic    <OID-A>..<OID-B>
+            HEAD:refs/for/main/topic    <OID-A>..<OID-B>
        !    HEAD:refs/for/next/topic1    [remote rejected] (fail to call Web API)
        !    HEAD:refs/for/next/topic3    [remote rejected] (proc-receive failed to report status)
        Done
@@ -72,17 +72,17 @@ test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL/porcel
        <COMMIT-A> refs/heads/bar
        <COMMIT-A> refs/heads/baz
        <COMMIT-A> refs/heads/foo
-       <COMMIT-B> refs/heads/master
+       <COMMIT-B> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(B)             foo(A)  bar(A))  baz(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(B)             foo(A)  bar(A))  baz(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
        (
                cd "$upstream" &&
-               git update-ref refs/heads/master $A &&
+               git update-ref refs/heads/main $A &&
                git update-ref -d refs/heads/foo &&
                git update-ref -d refs/heads/bar &&
                git update-ref -d refs/heads/baz
index b07c999f53926547302312260083c1bc30190eb2..2565302a1791efc131597c2160c3e574d6ea92a4 100644 (file)
@@ -3,12 +3,12 @@ test_expect_success "config receive.procReceiveRefs = refs ($PROTOCOL)" '
        git -C "$upstream" config --add receive.procReceiveRefs refs
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "setup upstream branches ($PROTOCOL)" '
        (
                cd "$upstream" &&
-               git update-ref refs/heads/master $B &&
+               git update-ref refs/heads/main $B &&
                git update-ref refs/heads/foo $A &&
                git update-ref refs/heads/bar $A &&
                git update-ref refs/heads/baz $A
@@ -20,13 +20,13 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/heads/master" \
+               -r "ok refs/heads/main" \
                -r "option fall-through" \
                -r "ok refs/heads/foo" \
                -r "option fall-through" \
                -r "ok refs/heads/bar" \
                -r "option fall-through" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head" \
                -r "option old-oid $A" \
                -r "option new-oid $B" \
@@ -38,15 +38,15 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
        EOF
 '
 
-# Refs of upstream : master(B)             foo(A)  bar(A))  baz(A)
-# Refs of workbench: master(A)  tags/v123
-# git push -f      : master(A)             (NULL)  (B)              refs/for/master/topic(A)  refs/for/next/topic(A)
+# Refs of upstream : main(B)             foo(A)  bar(A))  baz(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -f      : main(A)             (NULL)  (B)              refs/for/main/topic(A)  refs/for/next/topic(A)
 test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
        git -C workbench push -f origin \
-               HEAD:refs/heads/master \
+               HEAD:refs/heads/main \
                :refs/heads/foo \
                $B:refs/heads/bar \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                HEAD:refs/for/next/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
@@ -54,22 +54,22 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
        remote: # pre-receive hook
        remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
        remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
-       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
        remote: # proc-receive hook
        remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
        remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
-       remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
-       remote: proc-receive> ok refs/heads/master
+       remote: proc-receive> ok refs/heads/main
        remote: proc-receive> option fall-through
        remote: proc-receive> ok refs/heads/foo
        remote: proc-receive> option fall-through
        remote: proc-receive> ok refs/heads/bar
        remote: proc-receive> option fall-through
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
@@ -81,13 +81,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
        remote: # post-receive hook
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
        remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
-       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head
        remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head
        To <URL/of/upstream.git>
         <OID-A>..<OID-B> <COMMIT-B> -> bar
         - [deleted] foo
-        + <OID-B>...<OID-A> HEAD -> master (forced update)
+        + <OID-B>...<OID-A> HEAD -> main (forced update)
         <OID-A>..<OID-B> HEAD -> refs/pull/123/head
         + <OID-B>...<OID-A> HEAD -> refs/pull/124/head (forced update)
        EOF
@@ -97,13 +97,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL)" '
        cat >expect <<-EOF &&
        <COMMIT-B> refs/heads/bar
        <COMMIT-A> refs/heads/baz
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             bar(A)  baz(B)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             bar(A)  baz(B)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL)" '
        (
                cd "$upstream" &&
index 0dd982461668d11eb9da772f544cfcb86f56de14..e21420b60dd823a589c06e1885ea2276fbed573f 100644 (file)
@@ -3,12 +3,12 @@ test_expect_success "config receive.procReceiveRefs = refs ($PROTOCOL/porcelain)
        git -C "$upstream" config --add receive.procReceiveRefs refs
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "setup upstream branches ($PROTOCOL/porcelain)" '
        (
                cd "$upstream" &&
-               git update-ref refs/heads/master $B &&
+               git update-ref refs/heads/main $B &&
                git update-ref refs/heads/foo $A &&
                git update-ref refs/heads/bar $A &&
                git update-ref refs/heads/baz $A
@@ -20,13 +20,13 @@ test_expect_success "setup proc-receive hook ($PROTOCOL/porcelain)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/heads/master" \
+               -r "ok refs/heads/main" \
                -r "option fall-through" \
                -r "ok refs/heads/foo" \
                -r "option fall-through" \
                -r "ok refs/heads/bar" \
                -r "option fall-through" \
-               -r "ok refs/for/master/topic" \
+               -r "ok refs/for/main/topic" \
                -r "option refname refs/pull/123/head" \
                -r "option old-oid $A" \
                -r "option new-oid $B" \
@@ -38,15 +38,15 @@ test_expect_success "setup proc-receive hook ($PROTOCOL/porcelain)" '
        EOF
 '
 
-# Refs of upstream : master(B)             foo(A)  bar(A))  baz(A)
-# Refs of workbench: master(A)  tags/v123
-# git push -f      : master(A)             (NULL)  (B)              refs/for/master/topic(A)  refs/for/next/topic(A)
+# Refs of upstream : main(B)             foo(A)  bar(A))  baz(A)
+# Refs of workbench: main(A)  tags/v123
+# git push -f      : main(A)             (NULL)  (B)              refs/for/main/topic(A)  refs/for/next/topic(A)
 test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
        git -C workbench push --porcelain -f origin \
-               HEAD:refs/heads/master \
+               HEAD:refs/heads/main \
                :refs/heads/foo \
                $B:refs/heads/bar \
-               HEAD:refs/for/master/topic \
+               HEAD:refs/for/main/topic \
                HEAD:refs/for/next/topic \
                >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
@@ -54,22 +54,22 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
        remote: # pre-receive hook
        remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
        remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
-       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
-       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+       remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
        remote: # proc-receive hook
        remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
        remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
-       remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
-       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+       remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
+       remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
-       remote: proc-receive> ok refs/heads/master
+       remote: proc-receive> ok refs/heads/main
        remote: proc-receive> option fall-through
        remote: proc-receive> ok refs/heads/foo
        remote: proc-receive> option fall-through
        remote: proc-receive> ok refs/heads/bar
        remote: proc-receive> option fall-through
-       remote: proc-receive> ok refs/for/master/topic
+       remote: proc-receive> ok refs/for/main/topic
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
@@ -81,13 +81,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
        remote: # post-receive hook
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar
        remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo
-       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/master
+       remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main
        remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head
        remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head
        To <URL/of/upstream.git>
             <COMMIT-B>:refs/heads/bar    <OID-A>..<OID-B>
        -    :refs/heads/foo    [deleted]
-       +    HEAD:refs/heads/master    <OID-B>...<OID-A> (forced update)
+       +    HEAD:refs/heads/main    <OID-B>...<OID-A> (forced update)
             HEAD:refs/pull/123/head    <OID-A>..<OID-B>
        +    HEAD:refs/pull/124/head    <OID-B>...<OID-A> (forced update)
        Done
@@ -98,13 +98,13 @@ test_expect_success "proc-receive: process all refs ($PROTOCOL/porcelain)" '
        cat >expect <<-EOF &&
        <COMMIT-B> refs/heads/bar
        <COMMIT-A> refs/heads/baz
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)             bar(A)  baz(B)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)             bar(A)  baz(B)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "cleanup ($PROTOCOL/porcelain)" '
        (
                cd "$upstream" &&
index c22849cbe2feaa135deee07899812d1cbb30ec79..2e29518ec5fb737ac40940f52a3b50cc99d9ba17 100644 (file)
@@ -2,7 +2,7 @@ test_expect_success "config receive.procReceiveRefs with modifiers ($PROTOCOL)"
        (
                cd "$upstream" &&
                git config --unset-all receive.procReceiveRefs &&
-               git config --add receive.procReceiveRefs m:refs/heads/master &&
+               git config --add receive.procReceiveRefs m:refs/heads/main &&
                git config --add receive.procReceiveRefs ad:refs/heads &&
                git config --add receive.procReceiveRefs "a!:refs/heads"
        )
@@ -12,7 +12,7 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/heads/master" \
+               -r "ok refs/heads/main" \
                -r "option refname refs/pull/123/head" \
                -r "option old-oid $A" \
                -r "option new-oid $B" \
@@ -21,22 +21,22 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
        EOF
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
-# git push         : master(B)  tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
+# git push         : main(B)  tags/v123
 test_expect_success "proc-receive: update branch and new tag ($PROTOCOL)" '
        git -C workbench push origin \
-               $B:refs/heads/master \
+               $B:refs/heads/main \
                v123 >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
        remote: # proc-receive hook
-       remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/master
+       remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/main
        remote: proc-receive< <ZERO-OID> <TAG-v123> refs/tags/v123
-       remote: proc-receive> ok refs/heads/master
+       remote: proc-receive> ok refs/heads/main
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <COMMIT-B>
@@ -53,20 +53,20 @@ test_expect_success "proc-receive: update branch and new tag ($PROTOCOL)" '
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        EOF
        test_cmp expect actual
 '
 
-# Refs of upstream : master(A)
-# Refs of workbench: master(A)  tags/v123
+# Refs of upstream : main(A)
+# Refs of workbench: main(A)  tags/v123
 test_expect_success "setup upstream: create tags/v123 ($PROTOCOL)" '
        git -C "$upstream" update-ref refs/heads/topic $A &&
        git -C "$upstream" update-ref refs/tags/v123 $TAG &&
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-A> refs/heads/topic
        <TAG-v123> refs/tags/v123
        EOF
@@ -77,7 +77,7 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
        write_script "$upstream/hooks/proc-receive" <<-EOF
        printf >&2 "# proc-receive hook\n"
        test-tool proc-receive -v \
-               -r "ok refs/heads/master" \
+               -r "ok refs/heads/main" \
                -r "option refname refs/pull/123/head" \
                -r "option old-oid $A" \
                -r "option new-oid $ZERO_OID" \
@@ -87,26 +87,26 @@ test_expect_success "setup proc-receive hook ($PROTOCOL)" '
        EOF
 '
 
-# Refs of upstream : master(A)  topic(A)  tags/v123
-# Refs of workbench: master(A)            tags/v123
+# Refs of upstream : main(A)  topic(A)  tags/v123
+# Refs of workbench: main(A)            tags/v123
 # git push         : NULL       topic(B)  NULL       next(A)
 test_expect_success "proc-receive: create/delete branch, and delete tag ($PROTOCOL)" '
        git -C workbench push origin \
-               :refs/heads/master \
+               :refs/heads/main \
                $B:refs/heads/topic \
                $A:refs/heads/next \
                :refs/tags/v123 >out 2>&1 &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
        remote: # pre-receive hook
-       remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/master
+       remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/main
        remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/topic
        remote: pre-receive< <TAG-v123> <ZERO-OID> refs/tags/v123
        remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
        remote: # proc-receive hook
-       remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/master
+       remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/main
        remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
-       remote: proc-receive> ok refs/heads/master
+       remote: proc-receive> ok refs/heads/main
        remote: proc-receive> option refname refs/pull/123/head
        remote: proc-receive> option old-oid <COMMIT-A>
        remote: proc-receive> option new-oid <ZERO-OID>
@@ -128,7 +128,7 @@ test_expect_success "proc-receive: create/delete branch, and delete tag ($PROTOC
        git -C "$upstream" show-ref >out &&
        make_user_friendly_and_stable_output <out >actual &&
        cat >expect <<-EOF &&
-       <COMMIT-A> refs/heads/master
+       <COMMIT-A> refs/heads/main
        <COMMIT-B> refs/heads/topic
        EOF
        test_cmp expect actual
index 8d62edd98b5c87995f5f0697b4b7198c6da58c0d..eaa6e9022048ade20043abdbecc40ba78f51b5bf 100755 (executable)
@@ -145,8 +145,8 @@ test_expect_success 'remove remote protects local branches' '
 test_expect_success 'remove errors out early when deleting non-existent branch' '
        (
                cd test &&
-               echo "fatal: No such remote: '\''foo'\''" >expect &&
-               test_must_fail git remote rm foo 2>actual &&
+               echo "error: No such remote: '\''foo'\''" >expect &&
+               test_expect_code 2 git remote rm foo 2>actual &&
                test_i18ncmp expect actual
        )
 '
@@ -173,24 +173,37 @@ test_expect_success 'remove remote with a branch without configured merge' '
 test_expect_success 'rename errors out early when deleting non-existent branch' '
        (
                cd test &&
-               echo "fatal: No such remote: '\''foo'\''" >expect &&
-               test_must_fail git remote rename foo bar 2>actual &&
+               echo "error: No such remote: '\''foo'\''" >expect &&
+               test_expect_code 2 git remote rename foo bar 2>actual &&
                test_i18ncmp expect actual
        )
 '
 
+test_expect_success 'rename errors out early when when new name is invalid' '
+       test_config remote.foo.vcs bar &&
+       echo "fatal: '\''invalid...name'\'' is not a valid remote name" >expect &&
+       test_must_fail git remote rename foo invalid...name 2>actual &&
+       test_i18ncmp expect actual
+'
+
 test_expect_success 'add existing foreign_vcs remote' '
        test_config remote.foo.vcs bar &&
-       echo "fatal: remote foo already exists." >expect &&
-       test_must_fail git remote add foo bar 2>actual &&
+       echo "error: remote foo already exists." >expect &&
+       test_expect_code 3 git remote add foo bar 2>actual &&
        test_i18ncmp expect actual
 '
 
 test_expect_success 'add existing foreign_vcs remote' '
        test_config remote.foo.vcs bar &&
        test_config remote.bar.vcs bar &&
-       echo "fatal: remote bar already exists." >expect &&
-       test_must_fail git remote rename foo bar 2>actual &&
+       echo "error: remote bar already exists." >expect &&
+       test_expect_code 3 git remote rename foo bar 2>actual &&
+       test_i18ncmp expect actual
+'
+
+test_expect_success 'add invalid foreign_vcs remote' '
+       echo "fatal: '\''invalid...name'\'' is not a valid remote name" >expect &&
+       test_must_fail git remote add invalid...name bar 2>actual &&
        test_i18ncmp expect actual
 '
 
@@ -200,28 +213,28 @@ cat >test/expect <<EOF
   Push  URL: $(pwd)/one
   HEAD branch: master
   Remote branches:
-    master new (next fetch will store in remotes/origin)
-    side   tracked
+    main new (next fetch will store in remotes/origin)
+    side tracked
   Local branches configured for 'git pull':
-    ahead    merges with remote master
-    master   merges with remote master
+    ahead    merges with remote main
+    main     merges with remote main
     octopus  merges with remote topic-a
                 and with remote topic-b
                 and with remote topic-c
     rebase  rebases onto remote master
   Local refs configured for 'git push':
-    master pushes to master   (local out of date)
-    master pushes to upstream (create)
+    main pushes to main     (local out of date)
+    main pushes to upstream (create)
 * remote two
   Fetch URL: ../two
   Push  URL: ../three
   HEAD branch: master
   Local refs configured for 'git push':
-    ahead  forces to master  (fast-forwardable)
-    master pushes to another (up to date)
+    ahead forces to main    (fast-forwardable)
+    main  pushes to another (up to date)
 EOF
 
-test_expect_success 'show' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' '
        (
                cd test &&
                git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
@@ -264,15 +277,15 @@ cat >test/expect <<EOF
     master
     side
   Local branches configured for 'git pull':
-    ahead  merges with remote master
-    master merges with remote master
+    ahead merges with remote main
+    main  merges with remote main
   Local refs configured for 'git push' (status not queried):
     (matching)           pushes to (matching)
-    refs/heads/master    pushes to refs/heads/upstream
+    refs/heads/main      pushes to refs/heads/upstream
     refs/tags/lastbackup forces to refs/tags/lastbackup
 EOF
 
-test_expect_success 'show -n' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' '
        mv one one.unreachable &&
        (
                cd test &&
@@ -315,7 +328,7 @@ test_expect_success 'set-head --auto' '
        )
 '
 
-test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' '
        (
                cd test &&
                git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1335,7 +1348,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' '
        )
 '
 
-test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' '
        (
                cd two &&
                git tag -a -m "Some tag" my-tag master &&
index dbc724e4c05836cb7fef21fdfae0fddcb069a69c..5d673358f9b79cda723a7013542bd8e7704ceb9c 100755 (executable)
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' '
        )
 '
 
-test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' '
        git clone . full-output &&
        test_commit looooooooooooong-tag &&
        (
@@ -951,13 +951,13 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
                grep -e "->" actual | cut -c 22- >../actual
        ) &&
        cat >expect <<-\EOF &&
-       master               -> origin/master
+       main                 -> origin/main
        looooooooooooong-tag -> looooooooooooong-tag
        EOF
        test_cmp expect actual
 '
 
-test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' '
        git clone . compact &&
        test_commit extraaa &&
        (
@@ -966,7 +966,7 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
                grep -e "->" actual | cut -c 22- >../actual
        ) &&
        cat >expect <<-\EOF &&
-       master     -> origin/*
+       main       -> origin/*
        extraaa    -> *
        EOF
        test_cmp expect actual
index f541f30bc2f8745dad051bc10a0989be1f2b3ff0..f808649de4cb8f0a948d7e016f196bba2efe2cc7 100755 (executable)
@@ -58,6 +58,8 @@ test_refspec fetch 'HEAD~4:refs/remotes/frotz/new'            invalid
 
 test_refspec push 'HEAD'
 test_refspec fetch 'HEAD'
+test_refspec push '@'
+test_refspec fetch '@'
 test_refspec push 'refs/heads/ nitfol'                         invalid
 test_refspec fetch 'refs/heads/ nitfol'                                invalid
 
index 70a9d2d8abbfafd5430191867377f1a91b63f761..50f14101c532d67480cd9796c797df3932d33d56 100755 (executable)
@@ -11,11 +11,14 @@ test_description='Merge logic in fetch'
 GIT_TEST_PROTOCOL_VERSION=0
 export GIT_TEST_PROTOCOL_VERSION
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 build_script () {
        script="$1" &&
-       for i in one three_file master topic_2 one_tree three two two2 three2
+       for i in one three_file main topic_2 one_tree three two two2 three2
        do
                echo "s/$(test_oid --hash=sha1 "$i")/$(test_oid "$i")/g" >>"$script"
        done
@@ -40,8 +43,8 @@ test_expect_success setup '
        three_file sha1:0e3b14047d3ee365f4f2a1b673db059c3972589c
        three_file sha256:bc4447d50c07497a8bfe6eef817f2364ecca9d471452e43b52756cc1a908bd32
 
-       master sha1:6c9dec2b923228c9ff994c6cfe4ae16c12408dc5
-       master sha256:8521c3072461fcfe8f32d67f95cc6e6b832a2db2fa29769ffc788bce85ebcd75
+       main sha1:ecf3b3627b498bdcb735cc4343bf165f76964e9a
+       main sha256:fff666109892bb4b1c80cd1649d2d8762a0663db8b5d46c8be98360b64fbba5f
 
        one_tree sha1:22feea448b023a2d864ef94b013735af34d238ba
        one_tree sha256:6e4743f4ef2356b881dda5e91f5c7cdffe870faf350bf7b312f80a20935f5d83
@@ -52,8 +55,8 @@ test_expect_success setup '
        two sha1:525b7fb068d59950d185a8779dc957c77eed73ba
        two sha256:3b21de3440cd38c2a9e9b464adb923f7054949ed4c918e1a0ac4c95cd52774db
 
-       topic_2 sha1:754b754407bf032e9a2f9d5a9ad05ca79a6b228f
-       topic_2 sha256:6c7abaea8a6d8ef4d89877e68462758dc6774690fbbbb0e6d7dd57415c9abde0
+       topic_2 sha1:b4ab76b1a01ea602209932134a44f1e6bd610832
+       topic_2 sha256:380ebae0113f877ce46fcdf39d5bc33e4dc0928db5c5a4d5fdc78381c4d55ae3
 
        two2 sha1:6134ee8f857693b96ff1cc98d3e2fd62b199e5a8
        two2 sha256:87a2d3ee29c83a3dc7afd41c0606b11f67603120b910a7be7840accdc18344d4
@@ -80,9 +83,9 @@ test_expect_success setup '
        git tag -a -m "Tag Three file" tag-three-file HEAD^{tree}:file &&
        git branch three &&
 
-       echo master >> file &&
-       git commit -a -m Master &&
-       git tag -a -m "Tag Master" tag-master &&
+       echo main >> file &&
+       git commit -a -m Main &&
+       git tag -a -m "Tag Main" tag-main &&
 
        git checkout three &&
 
@@ -91,7 +94,7 @@ test_expect_success setup '
        git config remote.origin.url ../.git/ &&
 
        git config remote.config-explicit.url ../.git/ &&
-       git config remote.config-explicit.fetch refs/heads/master:remotes/rem/master &&
+       git config remote.config-explicit.fetch refs/heads/main:remotes/rem/main &&
        git config --add remote.config-explicit.fetch refs/heads/one:remotes/rem/one &&
        git config --add remote.config-explicit.fetch two:remotes/rem/two &&
        git config --add remote.config-explicit.fetch refs/heads/three:remotes/rem/three &&
@@ -104,7 +107,7 @@ test_expect_success setup '
        mkdir -p .git/remotes &&
        {
                echo "URL: ../.git/"
-               echo "Pull: refs/heads/master:remotes/rem/master"
+               echo "Pull: refs/heads/main:remotes/rem/main"
                echo "Pull: refs/heads/one:remotes/rem/one"
                echo "Pull: two:remotes/rem/two"
                echo "Pull: refs/heads/three:remotes/rem/three"
@@ -149,7 +152,7 @@ done > tests
 # but does depend on Pull: or fetch lines.
 # Use two branches completely unrelated from the arguments,
 # the clone default and one without branch properties
-for branch in master br-unconfig ; do
+for branch in main br-unconfig ; do
     echo $branch
     for remote in $remotes ; do
        echo $branch $remote
@@ -158,7 +161,7 @@ done >> tests
 
 # Merge logic does not depend on branch properties
 # neither in the Pull: or .fetch config
-for branch in master br-unconfig ; do
+for branch in main br-unconfig ; do
     cat <<EOF
 $branch ../.git
 $branch ../.git one
index a1bc3d53a606bb67eb5b808834c57a53e1b32fbe..0bed09cc12752d016ec3a06a8e923a6942ebfc10 100644 (file)
@@ -1,6 +1,6 @@
 # br-branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 12ab08e8acb1ec04ac0033fc5874cdf1cd94f1c7..59eef63527340091ad99142a4dce4a9153070a1b 100644 (file)
@@ -1,7 +1,7 @@
 # br-branches-default-merge
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 54427522dd5f350c11f7f160020cccc2060b7309..490186c158137524b232239b15ba56d47588af10 100644 (file)
@@ -1,7 +1,7 @@
 # br-branches-default-merge branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 498a761aae8f048dd82f577de5d7bc92d97fa8f1..d484138c27ce7da67e1df7845f14525493c178eb 100644 (file)
@@ -1,8 +1,8 @@
 # br-branches-default-octopus
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 0857f134e10d662e6712910bf273985fd4aa8471..b79a5fe2c348bfd695f270ce21dca4b93672255a 100644 (file)
@@ -1,8 +1,8 @@
 # br-branches-default-octopus branches-default
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 8cbd718936223fd7dec89638d5ad9a4933a37e9d..1c866d85e651d75221941847219716106f7f59c6 100644 (file)
@@ -1,6 +1,6 @@
 # br-branches-default branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index c98f67052638fd340b4c2069c85536b69e123b5c..6925a775b6d36108d6f1ac9d7b7c936d755c96f8 100644 (file)
@@ -1,6 +1,6 @@
 # br-branches-one
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 54a77420d5d05de53c59c63d10e4438f3ed2b4dc..85257031ce90469032b2f05d47eea5648dc6d2da 100644 (file)
@@ -1,7 +1,7 @@
 # br-branches-one-merge
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index b4d1bb0b0ba18a01ce5d0705b2822564e63c628c..3a63a7f450e32a347b68544a36f9f12a38fa3bb8 100644 (file)
@@ -1,7 +1,7 @@
 # br-branches-one-merge branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 97c4b544b8c2c4466ab62759533703896f31ca4c..46af763fecd3728e39f98ab1d4617b1042ce9586 100644 (file)
@@ -1,7 +1,7 @@
 # br-branches-one-octopus
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index df705f74c7d6e24577ae48f1e783706d7ec939eb..becfde9ddda6ea0c9065f801deaa8d1b95043110 100644 (file)
@@ -1,7 +1,7 @@
 # br-branches-one-octopus branches-one
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 96890e5bd9920bfe3ea27a7e992f689b01badc2f..9ba34c6754a88b9d6bc9bcb8586b7b73f0342cdf 100644 (file)
@@ -1,6 +1,6 @@
 # br-branches-one branches-one
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 68fc927263ed582621fe3385770603900e7ce841..7466a73214009e1c9bbd20d3f600492d3b2bb1a8 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 5ce764a06e421e0134b0f6710863d34e565ffb94..9375b7d21d5133de9f61339a78ca0814663322ec 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-explicit-merge
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index b1152b76dc2ea66a8d1dc4e5259362a34009fe49..6335e2b113ece163a58260414206e31a4df1da7e 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-explicit-merge config-explicit
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 110577bb67921bc061718aafa7c4194454e9acd5..c379aa9b31d3c21a79be210fc052a4d644b73457 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-explicit-octopus
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index a29dd8baba047bfea7e44735c902b3b4d0acc7ae..7fb3a3eef87e79e00550ad533a4042f1851423c9 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-explicit-octopus config-explicit
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index b19b0162e1f234965687acb5041c504258d5ab68..86045a79d4c28de9b35d35c4855bd47698a6cd0b 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-explicit config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 946d70ca0718e499d576772059060c5304d1e7f2..bfeef2b7161c8ecd69554a00f6cc5df6430f7c7a 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 89f2596cb9d7a9d586e4c51c4e232b2ddb48ce52..5376a4ac1d6050e79822facd61704fa1b2d00fa4 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-glob-merge
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 2ba4832160a3894f439d7d54105c32ba3c1b008b..7dfc2feb35503a5a52e21c191fca83425ce26b3f 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-glob-merge config-glob
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 64994df7e2561e18013d005d0918819b9eb1a87a..10840309ef2374d244d775152b1d76c4c8cb5c46 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-glob-octopus
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 681a725adc989b427afc134267e16d8f85e71334..839866daf3a77ad357e024dc5b7ca6bc0dbef2bc 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-glob-octopus config-glob
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 19daf0cb77e313f013fe89406cd989d0c12f7fd4..7b0cb91e5147b7455aa2965fcab5d86e02e7ec4a 100644 (file)
@@ -1,9 +1,9 @@
 # br-config-glob config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index ab44bc551969d358c32c6b99e79c5748df2ec669..d6619e7fc0e4b69ef95c7828b666107c847449bb 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index d018b3515f74acaa27c32022b865402d1e08ccd2..5b49b7c4c538cde4e900f342b6495849d6ae34c7 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-explicit-merge
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 0d3d780dd0ccd5f82401adb2124d54d214d9e0b5..417261d8ebb93a9bb37d85141ecca2c52bc8da51 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-explicit-merge remote-explicit
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 6f843044ede1ad776cb7b0a0769fe9aff8d5332c..2edef644733f6bbc78899550683021484843de56 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-explicit-octopus
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 3546a837136dfef38101faa79aabff89efbc42a9..ceb8752e1f024b3c465427378ba601c0006e9bb1 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-explicit-octopus remote-explicit
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 01e014e6a0219073abdd000bd46915acfa45559b..b7abbd227c800398bcfa29cfa81043ac5fc973e2 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-explicit remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 09bfcee00f9cae28660fc6be3fcddf5272c4a5b3..645412c73f3341fa278f2bb20a8edcc9595d5e45 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 7e1a433a64f38123b342333a91a87ffab5a2c3b1..8512cfd8d31bc3ed11d353c0d0e21bb459b94673 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-glob-merge
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 53571bb4ec64bd59a258e69ac1762e1ed73bc321..7394164d850624b425501b3b24fd124d29875e31 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-glob-merge remote-glob
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index c7c8b6d7f47df130b00a25ccb626496e55dd2ff4..0ca4719ef8c6ff9b7c64c4538e4a867a00cdf8a3 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-glob-octopus
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 36076fba0cc70f5df4879afff225dfb0e1145884..7e7b0ba5f500fdbf2aad2804280b53c5106ef270 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-glob-octopus remote-glob
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 20ba5cb1725d4b97a3bc9ac2c2f5a9abf207d063..7bae5ecfb729c4822d58dab26a0686ce3fe0031f 100644 (file)
@@ -1,9 +1,9 @@
 # br-remote-glob remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 887ccfc41f57fcf85f10a44deafa08fbd2c4d041..ccaa54fed2c8fb04cd70b43906c5705b0e3095d3 100644 (file)
@@ -1,9 +1,9 @@
 # br-unconfig
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 0f70f66c705dd6af9f9861ae2e33223d1b944d3a..3afb4f850de853baca62a255877d6d9cad789d28 100644 (file)
@@ -1,6 +1,6 @@
 # br-unconfig --tags ../.git
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 74115361ba00984ca2fd174ea2dd686e7ec2d7ae..525713a2ab976aff98354acea0b013e01cad7778 100644 (file)
@@ -2,7 +2,7 @@
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
 0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
 525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
index 7726983818f81aa230a91d5512b079f2b6b733a5..18c871f512e608c8493521cb211dd1bfb32068ba 100644 (file)
@@ -1,7 +1,7 @@
 # br-unconfig ../.git tag tag-one-tree tag tag-three-file
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
 525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
index 7b3750ce5c0136030fd8b50ad87c6b0231f1cffe..7328d30c676fb769a313deed2064970b5a7b6967 100644 (file)
@@ -1,7 +1,7 @@
 # br-unconfig ../.git tag tag-one tag tag-three
 8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899               tag 'tag-three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
 525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
index da30e3c62c269b8a94b29f9edcb4a24d26185463..3d82f943764e466978f42924100c1cffbe8846d6 100644 (file)
@@ -1,6 +1,6 @@
 # br-unconfig branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index e4614314c54e10b6abc285ad35b385de889b6cf4..948ed0c3d9d30b64a39dcfca7687d9e595c95069 100644 (file)
@@ -1,6 +1,6 @@
 # br-unconfig branches-one
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index ed323c98713c55658906f053517b9543eac7c5e6..65aaec8a7b487c7f19b01d7a118f489113e7e9e4 100644 (file)
@@ -1,9 +1,9 @@
 # br-unconfig config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 2372ed03c5c506300b233dc983475905c20d2499..1aa3d4598a41558c4761110530479a505265a163 100644 (file)
@@ -1,9 +1,9 @@
 # br-unconfig config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 6318dd11b4c2d62e89b3be7b32bafaccc18da301..16438d2085a38a487e378695a693ad4b3bfb7ee2 100644 (file)
@@ -1,9 +1,9 @@
 # br-unconfig remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
index 1d9afad7d841a7d300c7653b19334c35a33bcdf0..7a01d2e0f691b2727882d3bbb76d4dc57a48d949 100644 (file)
@@ -1,9 +1,9 @@
 # br-unconfig remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
similarity index 78%
rename from t/t5515/fetch.master
rename to t/t5515/fetch.main
index 9b29d6720002a3cd7fa19157762d26e908173d52..819ed33bf55cf7e45c99495f4375c67aa433a622 100644 (file)
@@ -1,9 +1,9 @@
-# master
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+# main
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
similarity index 81%
rename from t/t5515/fetch.master_--tags_.._.git
rename to t/t5515/fetch.main_--tags_.._.git
index ab473a6e1f76ddf0f10a78358097d5e3bf16bc02..ddf67a613b1267b502efb7acf7b1f0fc7c6564fc 100644 (file)
@@ -1,6 +1,6 @@
-# master --tags ../.git
+# main --tags ../.git
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
similarity index 73%
rename from t/t5515/fetch.master_.._.git
rename to t/t5515/fetch.main_.._.git
index 66d1aaddae6cb34d83bbd0e728fbe89fd26227b1..285e57eaf578b97bf9fd91dc3b5b67c793fb524b 100644 (file)
@@ -1,2 +1,2 @@
-# master ../.git
+# main ../.git
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b               ../
similarity index 74%
rename from t/t5515/fetch.master_.._.git_one
rename to t/t5515/fetch.main_.._.git_one
index 35deddbd2ca6c28c7a50dfc28c3da09b79b7b6a6..f9f511efbcc3db1909ffe75cba288ed6a05c7816 100644 (file)
@@ -1,2 +1,2 @@
-# master ../.git one
+# main ../.git one
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
similarity index 77%
rename from t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file
rename to t/t5515/fetch.main_.._.git_one_tag_tag-one_tag_tag-three-file
index 0672d1292f5fab7043842ac142fcdc5474a0cdcb..187643e2ce1a3e9a6db42ee4826839965221cd33 100644 (file)
@@ -1,8 +1,8 @@
-# master ../.git one tag tag-one tag tag-three-file
+# main ../.git one tag tag-one tag tag-three-file
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
 0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
 525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
similarity index 83%
rename from t/t5515/fetch.master_.._.git_one_two
rename to t/t5515/fetch.main_.._.git_one_two
index 35ec5782c8a6076a76cf314fb5021da8a641e782..048ad97a156671bf2ef73c8191ceb82f0283de4d 100644 (file)
@@ -1,3 +1,3 @@
-# master ../.git one two
+# main ../.git one two
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
similarity index 74%
rename from t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file
rename to t/t5515/fetch.main_.._.git_tag_tag-one-tree_tag_tag-three-file
index 0fd737cf81fd852d31346022c7e2b24545079fd2..df5f2a7d5f903b690b1b3b38a19d4b53f3ce5aa1 100644 (file)
@@ -1,7 +1,7 @@
-# master ../.git tag tag-one-tree tag tag-three-file
+# main ../.git tag tag-one-tree tag tag-three-file
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
 525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
similarity index 75%
rename from t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three
rename to t/t5515/fetch.main_.._.git_tag_tag-one_tag_tag-three
index e488986653714b1af47a2ed11f18eb05283d1d81..a40b72817b1c7cabea66284ddfaf19e86d2fa95f 100644 (file)
@@ -1,7 +1,7 @@
-# master ../.git tag tag-one tag tag-three
+# main ../.git tag tag-one tag tag-three
 8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899               tag 'tag-three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
 525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
similarity index 69%
rename from t/t5515/fetch.master_branches-default
rename to t/t5515/fetch.main_branches-default
index 2eedd3bfa4a5f4a14c911cd37e00d40e9b0d1171..e3466e83299e38b688db5e968d0f34235d0dafcb 100644 (file)
@@ -1,6 +1,6 @@
-# master branches-default
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+# main branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
similarity index 81%
rename from t/t5515/fetch.master_branches-one
rename to t/t5515/fetch.main_branches-one
index 901ce21d333c8c5a37bcc8953f81f93faf415563..a94f11af4c052e0315ec453578000b41606bfcec 100644 (file)
@@ -1,6 +1,6 @@
-# master branches-one
+# main branches-one
 8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
similarity index 78%
rename from t/t5515/fetch.master_config-explicit
rename to t/t5515/fetch.main_config-explicit
index 251c826aa9dea34ce01bdee293b7c35b02bf6228..16d04c14d2a62885d1c6e4c3f2d05e5ab0cf664d 100644 (file)
@@ -1,9 +1,9 @@
-# master config-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+# main config-explicit
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
similarity index 77%
rename from t/t5515/fetch.master_config-glob
rename to t/t5515/fetch.main_config-glob
index 27c158e332f291dcde9aa345807c3b077c28dfd7..f6a6f56991102136879789e5e6ce16c20403a862 100644 (file)
@@ -1,9 +1,9 @@
-# master config-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+# main config-glob
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
similarity index 78%
rename from t/t5515/fetch.master_remote-explicit
rename to t/t5515/fetch.main_remote-explicit
index b3cfe6b98b24f9ffb241d8cea37c70123c6f3273..bf4fd65e003f1b1988c77eb71737648cf3faacf8 100644 (file)
@@ -1,9 +1,9 @@
-# master remote-explicit
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+# main remote-explicit
+b4ab76b1a01ea602209932134a44f1e6bd610832               branch 'main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
 8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
 22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
 c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
diff --git a/t/t5515/fetch.main_remote-glob b/t/t5515/fetch.main_remote-glob
new file mode 100644 (file)
index 0000000..91dc2e2
--- /dev/null
@@ -0,0 +1,11 @@
+# main remote-glob
+b4ab76b1a01ea602209932134a44f1e6bd610832       not-for-merge   branch 'main' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+ecf3b3627b498bdcb735cc4343bf165f76964e9a       not-for-merge   tag 'tag-main' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_remote-glob b/t/t5515/fetch.master_remote-glob
deleted file mode 100644 (file)
index 118befd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# master remote-glob
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
-8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
-0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
-6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5       not-for-merge   tag 'tag-master' of ../
-8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
-22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
-c61a82b60967180544e3c19f819ddbd0c9f89899       not-for-merge   tag 'tag-three' of ../
-0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
-525b7fb068d59950d185a8779dc957c77eed73ba       not-for-merge   tag 'tag-two' of ../
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 70962eaac152f7063e965da7c6a61abee410e0bc..4a74b6802996b7665d7d0bc80a50b1225123097d 100644 (file)
@@ -1,5 +1,5 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
index 70962eaac152f7063e965da7c6a61abee410e0bc..4a74b6802996b7665d7d0bc80a50b1225123097d 100644 (file)
@@ -1,5 +1,5 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 70962eaac152f7063e965da7c6a61abee410e0bc..4a74b6802996b7665d7d0bc80a50b1225123097d 100644 (file)
@@ -1,5 +1,5 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 81%
rename from t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file
rename to t/t5515/refs.main
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 81%
rename from t/t5515/refs.master_--tags_.._.git
rename to t/t5515/refs.main_--tags_.._.git
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 79%
rename from t/t5515/refs.master_.._.git_one_two
rename to t/t5515/refs.main_.._.git
index 70962eaac152f7063e965da7c6a61abee410e0bc..4a74b6802996b7665d7d0bc80a50b1225123097d 100644 (file)
@@ -1,5 +1,5 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
similarity index 79%
rename from t/t5515/refs.master_.._.git_one
rename to t/t5515/refs.main_.._.git_one
index 70962eaac152f7063e965da7c6a61abee410e0bc..4a74b6802996b7665d7d0bc80a50b1225123097d 100644 (file)
@@ -1,5 +1,5 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
similarity index 81%
rename from t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file
rename to t/t5515/refs.main_.._.git_one_tag_tag-one_tag_tag-three-file
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 79%
rename from t/t5515/refs.master_.._.git
rename to t/t5515/refs.main_.._.git_one_two
index 70962eaac152f7063e965da7c6a61abee410e0bc..4a74b6802996b7665d7d0bc80a50b1225123097d 100644 (file)
@@ -1,5 +1,5 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
similarity index 81%
rename from t/t5515/refs.master
rename to t/t5515/refs.main_.._.git_tag_tag-one-tree_tag_tag-three-file
index 13e4ad2e4602154808a384fe298497b220ac9d6a..f2ab01f68b5965c6f61ad44aba5ae87a74d2b0cc 100644 (file)
@@ -1,9 +1,9 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.main_.._.git_tag_tag-one_tag_tag-three b/t/t5515/refs.main_.._.git_tag_tag-one_tag_tag-three
new file mode 100644 (file)
index 0000000..f2ab01f
--- /dev/null
@@ -0,0 +1,11 @@
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
+8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
+8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
+22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
+c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
+0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file
+525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two
similarity index 74%
rename from t/t5515/refs.master_branches-default
rename to t/t5515/refs.main_branches-default
index 21917c1e5dba7133d451403984f754f445657908..dc4f2b7a4eabbd354ae4789dceba03fdb51aba67 100644 (file)
@@ -1,10 +1,10 @@
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/heads/branches-default
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 83%
rename from t/t5515/refs.master_branches-one
rename to t/t5515/refs.main_branches-one
index 8a705a5df252f6f9d4cd32b1557a221ca4f7dc6f..e8f79bf4b1823aff8b647438ed55f6395241c3eb 100644 (file)
@@ -1,10 +1,10 @@
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 79%
rename from t/t5515/refs.master_config-explicit
rename to t/t5515/refs.main_config-explicit
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 79%
rename from t/t5515/refs.master_config-glob
rename to t/t5515/refs.main_config-glob
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 79%
rename from t/t5515/refs.master_remote-explicit
rename to t/t5515/refs.main_remote-explicit
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
similarity index 79%
rename from t/t5515/refs.master_remote-glob
rename to t/t5515/refs.main_remote-glob
index 9bbbfd9fc5332911f35826763b821d2eeb758d6f..a28fa5f56e545f0f70d31d45ef8a942933a91ba5 100644 (file)
@@ -1,13 +1,13 @@
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/origin/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master
+b4ab76b1a01ea602209932134a44f1e6bd610832 refs/remotes/rem/main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one
 0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three
 6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
+ecf3b3627b498bdcb735cc4343bf165f76964e9a refs/tags/tag-main
 8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
 22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
 c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
diff --git a/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three b/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three
deleted file mode 100644 (file)
index 13e4ad2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD
-754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master
-8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one
-0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three
-6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two
-6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master
-8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one
-22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree
-c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three
-0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file
-525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two
index d11382f769f6669aa1f95e83a45fd266d4b9e304..01004ff6802070ea5b06d82e13eb0350a0cf78f0 100755 (executable)
@@ -436,70 +436,76 @@ test_expect_success 'push ref expression with non-existent, incomplete dest' '
 
 '
 
-test_expect_success 'push with HEAD' '
+for head in HEAD @
+do
 
-       mk_test testrepo heads/master &&
-       git checkout master &&
-       git push testrepo HEAD &&
-       check_push_result testrepo $the_commit heads/master
+       test_expect_success "push with $head" '
 
-'
+               mk_test testrepo heads/master &&
+               git checkout master &&
+               git push testrepo $head &&
+               check_push_result testrepo $the_commit heads/master
 
-test_expect_success 'push with HEAD nonexisting at remote' '
+       '
 
-       mk_test testrepo heads/master &&
-       git checkout -b local master &&
-       git push testrepo HEAD &&
-       check_push_result testrepo $the_commit heads/local
-'
+       test_expect_success "push with $head nonexisting at remote" '
 
-test_expect_success 'push with +HEAD' '
+               mk_test testrepo heads/master &&
+               git checkout -b local master &&
+               test_when_finished "git checkout master; git branch -D local" &&
+               git push testrepo $head &&
+               check_push_result testrepo $the_commit heads/local
+       '
 
-       mk_test testrepo heads/master &&
-       git checkout master &&
-       git branch -D local &&
-       git checkout -b local &&
-       git push testrepo master local &&
-       check_push_result testrepo $the_commit heads/master &&
-       check_push_result testrepo $the_commit heads/local &&
+       test_expect_success "push with +$head" '
 
-       # Without force rewinding should fail
-       git reset --hard HEAD^ &&
-       test_must_fail git push testrepo HEAD &&
-       check_push_result testrepo $the_commit heads/local &&
+               mk_test testrepo heads/master &&
+               git checkout -b local master &&
+               test_when_finished "git checkout master; git branch -D local" &&
+               git push testrepo master local &&
+               check_push_result testrepo $the_commit heads/master &&
+               check_push_result testrepo $the_commit heads/local &&
 
-       # With force rewinding should succeed
-       git push testrepo +HEAD &&
-       check_push_result testrepo $the_first_commit heads/local
+               # Without force rewinding should fail
+               git reset --hard $head^ &&
+               test_must_fail git push testrepo $head &&
+               check_push_result testrepo $the_commit heads/local &&
 
-'
+               # With force rewinding should succeed
+               git push testrepo +$head &&
+               check_push_result testrepo $the_first_commit heads/local
 
-test_expect_success 'push HEAD with non-existent, incomplete dest' '
+       '
 
-       mk_test testrepo &&
-       git checkout master &&
-       git push testrepo HEAD:branch &&
-       check_push_result testrepo $the_commit heads/branch
+       test_expect_success "push $head with non-existent, incomplete dest" '
 
-'
+               mk_test testrepo &&
+               git checkout master &&
+               git push testrepo $head:branch &&
+               check_push_result testrepo $the_commit heads/branch
 
-test_expect_success 'push with config remote.*.push = HEAD' '
+       '
 
-       mk_test testrepo heads/local &&
-       git checkout master &&
-       git branch -f local $the_commit &&
-       (
-               cd testrepo &&
-               git checkout local &&
-               git reset --hard $the_first_commit
-       ) &&
-       test_config remote.there.url testrepo &&
-       test_config remote.there.push HEAD &&
-       test_config branch.master.remote there &&
-       git push &&
-       check_push_result testrepo $the_commit heads/master &&
-       check_push_result testrepo $the_first_commit heads/local
-'
+       test_expect_success "push with config remote.*.push = $head" '
+
+               mk_test testrepo heads/local &&
+               git checkout master &&
+               git branch -f local $the_commit &&
+               test_when_finished "git branch -D local" &&
+               (
+                       cd testrepo &&
+                       git checkout local &&
+                       git reset --hard $the_first_commit
+               ) &&
+               test_config remote.there.url testrepo &&
+               test_config remote.there.push $head &&
+               test_config branch.master.remote there &&
+               git push &&
+               check_push_result testrepo $the_commit heads/master &&
+               check_push_result testrepo $the_first_commit heads/local
+       '
+
+done
 
 test_expect_success 'push with remote.pushdefault' '
        mk_test up_repo heads/master &&
index 63205dfdf962dc31c9db5ba038674e12760a9909..a877dd145e24c56e7197251ebccaa5804ed40522 100755 (executable)
@@ -18,7 +18,7 @@ add_upstream_commit() {
                head2=$(git rev-parse --short HEAD) &&
                echo "Fetching submodule submodule" > ../expect.err &&
                echo "From $pwd/submodule" >> ../expect.err &&
-               echo "   $head1..$head2  master     -> origin/master" >> ../expect.err
+               echo "   $head1..$head2  sub        -> origin/sub" >> ../expect.err
        ) &&
        (
                cd deepsubmodule &&
@@ -30,7 +30,7 @@ add_upstream_commit() {
                head2=$(git rev-parse --short HEAD) &&
                echo "Fetching submodule submodule/subdir/deepsubmodule" >> ../expect.err
                echo "From $pwd/deepsubmodule" >> ../expect.err &&
-               echo "   $head1..$head2  master     -> origin/master" >> ../expect.err
+               echo "   $head1..$head2  deep       -> origin/deep" >> ../expect.err
        )
 }
 
@@ -41,7 +41,8 @@ test_expect_success setup '
                git init &&
                echo deepsubcontent > deepsubfile &&
                git add deepsubfile &&
-               git commit -m new deepsubfile
+               git commit -m new deepsubfile &&
+               git branch -M deep
        ) &&
        mkdir submodule &&
        (
@@ -50,10 +51,12 @@ test_expect_success setup '
                echo subcontent > subfile &&
                git add subfile &&
                git submodule add "$pwd/deepsubmodule" subdir/deepsubmodule &&
-               git commit -a -m new
+               git commit -a -m new &&
+               git branch -M sub
        ) &&
        git submodule add "$pwd/submodule" submodule &&
        git commit -am initial &&
+       git branch -M super &&
        git clone . downstream &&
        (
                cd downstream &&
@@ -245,7 +248,7 @@ test_expect_success "Recursion stops when no new submodule commits are fetched"
        git commit -m "new submodule" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err.sub &&
-       echo "   $head1..$head2  master     -> origin/master" >>expect.err.sub &&
+       echo "   $head1..$head2  super      -> origin/super" >>expect.err.sub &&
        head -3 expect.err >> expect.err.sub &&
        (
                cd downstream &&
@@ -263,7 +266,7 @@ test_expect_success "Recursion doesn't happen when new superproject commits don'
        git commit -m "new file" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err.file &&
-       echo "   $head1..$head2  master     -> origin/master" >> expect.err.file &&
+       echo "   $head1..$head2  super      -> origin/super" >> expect.err.file &&
        (
                cd downstream &&
                git fetch >../actual.out 2>../actual.err
@@ -287,7 +290,7 @@ test_expect_success "Recursion picks up config in submodule" '
        git commit -m "new submodule" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err.sub &&
-       echo "   $head1..$head2  master     -> origin/master" >> expect.err.sub &&
+       echo "   $head1..$head2  super      -> origin/super" >> expect.err.sub &&
        cat expect.err >> expect.err.sub &&
        (
                cd downstream &&
@@ -316,14 +319,14 @@ test_expect_success "Recursion picks up all submodules when necessary" '
                head2=$(git rev-parse --short HEAD) &&
                echo "Fetching submodule submodule" > ../expect.err.sub &&
                echo "From $pwd/submodule" >> ../expect.err.sub &&
-               echo "   $head1..$head2  master     -> origin/master" >> ../expect.err.sub
+               echo "   $head1..$head2  sub        -> origin/sub" >> ../expect.err.sub
        ) &&
        head1=$(git rev-parse --short HEAD) &&
        git add submodule &&
        git commit -m "new submodule" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err.2 &&
-       echo "   $head1..$head2  master     -> origin/master" >> expect.err.2 &&
+       echo "   $head1..$head2  super      -> origin/super" >> expect.err.2 &&
        cat expect.err.sub >> expect.err.2 &&
        tail -3 expect.err >> expect.err.2 &&
        (
@@ -349,7 +352,7 @@ test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no ne
                head2=$(git rev-parse --short HEAD) &&
                echo Fetching submodule submodule > ../expect.err.sub &&
                echo "From $pwd/submodule" >> ../expect.err.sub &&
-               echo "   $head1..$head2  master     -> origin/master" >> ../expect.err.sub
+               echo "   $head1..$head2  sub        -> origin/sub" >> ../expect.err.sub
        ) &&
        (
                cd downstream &&
@@ -368,7 +371,7 @@ test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necess
        head2=$(git rev-parse --short HEAD) &&
        tail -3 expect.err > expect.err.deepsub &&
        echo "From $pwd/." > expect.err &&
-       echo "   $head1..$head2  master     -> origin/master" >>expect.err &&
+       echo "   $head1..$head2  super      -> origin/super" >>expect.err &&
        cat expect.err.sub >> expect.err &&
        cat expect.err.deepsub >> expect.err &&
        (
@@ -397,7 +400,7 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
        git commit -m "new file" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err.file &&
-       echo "   $head1..$head2  master     -> origin/master" >> expect.err.file &&
+       echo "   $head1..$head2  super      -> origin/super" >> expect.err.file &&
        (
                cd downstream &&
                git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err
@@ -418,7 +421,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config
        git commit -m "new submodule" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err.2 &&
-       echo "   $head1..$head2  master     -> origin/master" >>expect.err.2 &&
+       echo "   $head1..$head2  super      -> origin/super" >>expect.err.2 &&
        head -3 expect.err >> expect.err.2 &&
        (
                cd downstream &&
@@ -446,7 +449,7 @@ test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' override
        git commit -m "new submodule" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err.2 &&
-       echo "   $head1..$head2  master     -> origin/master" >>expect.err.2 &&
+       echo "   $head1..$head2  super      -> origin/super" >>expect.err.2 &&
        head -3 expect.err >> expect.err.2 &&
        (
                cd downstream &&
@@ -472,7 +475,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
        git commit -m "submodule rewound" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." > expect.err &&
-       echo "   $head1..$head2  master     -> origin/master" >> expect.err &&
+       echo "   $head1..$head2  super      -> origin/super" >> expect.err &&
        (
                cd downstream &&
                git fetch >../actual.out 2>../actual.err
@@ -481,7 +484,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
        test_i18ncmp expect.err actual.err &&
        (
                cd submodule &&
-               git checkout -q master
+               git checkout -q sub
        )
 '
 
@@ -497,7 +500,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
        git commit -m "new submodule without .gitmodules" &&
        head2=$(git rev-parse --short HEAD) &&
        echo "From $pwd/." >expect.err.2 &&
-       echo "   $head1..$head2  master     -> origin/master" >>expect.err.2 &&
+       echo "   $head1..$head2  super      -> origin/super" >>expect.err.2 &&
        head -3 expect.err >>expect.err.2 &&
        (
                cd downstream &&
@@ -663,9 +666,9 @@ test_expect_success 'fetch new submodule commits on-demand without .gitmodules e
        git config -f .gitmodules --remove-section submodule.sub1 &&
        git add .gitmodules &&
        git commit -m "delete gitmodules file" &&
-       git checkout -B master &&
+       git checkout -B super &&
        git -C downstream fetch &&
-       git -C downstream checkout origin/master &&
+       git -C downstream checkout origin/super &&
 
        C=$(git -C submodule commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
        git -C submodule update-ref refs/changes/7 $C &&
index 205a2631e7f807a72259b27eb689a0b18439d7f9..9dd2d2457a3ea6c77a28bc31d1aabd87e118d9e3 100755 (executable)
@@ -88,6 +88,23 @@ test_expect_success 'upload-pack fails due to error in pack-objects enumeration'
        grep "pack-objects died" output.err
 '
 
+test_expect_success 'upload-pack tolerates EOF just after stateless client wants' '
+       test_commit initial &&
+       head=$(git rev-parse HEAD) &&
+
+       {
+               packetize "want $head" &&
+               packetize "shallow $head" &&
+               packetize "deepen 1" &&
+               printf "0000"
+       } >request &&
+
+       printf "0000" >expect &&
+
+       git upload-pack --stateless-rpc . <request >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'create empty repository' '
 
        mkdir foo &&
index 0b0eb1d0259f314261c131db8e089e6859a7f3ba..7813e8470e550a2eaf19943552fa69dfd4501747 100755 (executable)
@@ -13,6 +13,46 @@ setup_srcdst_basic () {
        )
 }
 
+# For tests with "--force-if-includes".
+setup_src_dup_dst () {
+       rm -fr src dup dst &&
+       git init --bare dst &&
+       git clone --no-local dst src &&
+       git clone --no-local dst dup
+       (
+               cd src &&
+               test_commit A &&
+               test_commit B &&
+               test_commit C &&
+               git push origin
+       ) &&
+       (
+               cd dup &&
+               git fetch &&
+               git merge origin/master &&
+               git switch -c branch master~2 &&
+               test_commit D &&
+               test_commit E &&
+               git push origin --all
+       ) &&
+       (
+               cd src &&
+               git switch master &&
+               git fetch --all &&
+               git branch branch --track origin/branch &&
+               git rebase origin/master
+       ) &&
+       (
+               cd dup &&
+               git switch master &&
+               test_commit F &&
+               test_commit G &&
+               git switch branch &&
+               test_commit H &&
+               git push origin --all
+       )
+}
+
 test_expect_success setup '
        # create template repository
        test_commit A &&
@@ -256,4 +296,101 @@ test_expect_success 'background updates of REMOTE can be mitigated with a non-up
        )
 '
 
+test_expect_success 'background updates to remote can be mitigated with "--force-if-includes"' '
+       setup_src_dup_dst &&
+       test_when_finished "rm -fr dst src dup" &&
+       git ls-remote dst refs/heads/master >expect.master &&
+       git ls-remote dst refs/heads/branch >expect.branch &&
+       (
+               cd src &&
+               git switch branch &&
+               test_commit I &&
+               git switch master &&
+               test_commit J &&
+               git fetch --all &&
+               test_must_fail git push --force-with-lease --force-if-includes --all
+       ) &&
+       git ls-remote dst refs/heads/master >actual.master &&
+       git ls-remote dst refs/heads/branch >actual.branch &&
+       test_cmp expect.master actual.master &&
+       test_cmp expect.branch actual.branch
+'
+
+test_expect_success 'background updates to remote can be mitigated with "push.useForceIfIncludes"' '
+       setup_src_dup_dst &&
+       test_when_finished "rm -fr dst src dup" &&
+       git ls-remote dst refs/heads/master >expect.master &&
+       (
+               cd src &&
+               git switch branch &&
+               test_commit I &&
+               git switch master &&
+               test_commit J &&
+               git fetch --all &&
+               git config --local push.useForceIfIncludes true &&
+               test_must_fail git push --force-with-lease=master origin master
+       ) &&
+       git ls-remote dst refs/heads/master >actual.master &&
+       test_cmp expect.master actual.master
+'
+
+test_expect_success '"--force-if-includes" should be disabled for --force-with-lease="<refname>:<expect>"' '
+       setup_src_dup_dst &&
+       test_when_finished "rm -fr dst src dup" &&
+       git ls-remote dst refs/heads/master >expect.master &&
+       (
+               cd src &&
+               git switch branch &&
+               test_commit I &&
+               git switch master &&
+               test_commit J &&
+               remote_head="$(git rev-parse refs/remotes/origin/master)" &&
+               git fetch --all &&
+               test_must_fail git push --force-if-includes --force-with-lease="master:$remote_head" 2>err &&
+               grep "stale info" err
+       ) &&
+       git ls-remote dst refs/heads/master >actual.master &&
+       test_cmp expect.master actual.master
+'
+
+test_expect_success '"--force-if-includes" should allow forced update after a rebase ("pull --rebase")' '
+       setup_src_dup_dst &&
+       test_when_finished "rm -fr dst src dup" &&
+       (
+               cd src &&
+               git switch branch &&
+               test_commit I &&
+               git switch master &&
+               test_commit J &&
+               git pull --rebase origin master &&
+               git push --force-if-includes --force-with-lease="master"
+       )
+'
+
+test_expect_success '"--force-if-includes" should allow forced update after a rebase ("pull --rebase", local rebase)' '
+       setup_src_dup_dst &&
+       test_when_finished "rm -fr dst src dup" &&
+       (
+               cd src &&
+               git switch branch &&
+               test_commit I &&
+               git switch master &&
+               test_commit J &&
+               git pull --rebase origin master &&
+               git rebase --onto HEAD~4 HEAD~1 &&
+               git push --force-if-includes --force-with-lease="master"
+       )
+'
+
+test_expect_success '"--force-if-includes" should allow deletes' '
+       setup_src_dup_dst &&
+       test_when_finished "rm -fr dst src dup" &&
+       (
+               cd src &&
+               git switch branch &&
+               git pull --rebase origin branch &&
+               git push --force-if-includes --force-with-lease="branch" origin :branch
+       )
+'
+
 test_done
index 34487bbb8ce3c4d2548e2898f69fac0e3e7c4045..8f69a7854fb3108e1301f4b90961b3f6a1dc9e98 100755 (executable)
@@ -147,18 +147,18 @@ test_remote_error()
 }
 
 msg="access denied or repository not exported"
-test_expect_success 'clone non-existent' "test_remote_error    '$msg' clone nowhere.git    "
+test_expect_success 'clone non-existent' "test_remote_error    '$msg' clone nowhere.git"
 test_expect_success 'push disabled'      "test_remote_error    '$msg' push  repo.git master"
-test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git       "
-test_expect_success 'not exported'       "test_remote_error -n '$msg' fetch repo.git       "
+test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git"
+test_expect_success 'not exported'       "test_remote_error -n '$msg' fetch repo.git"
 
 stop_git_daemon
 start_git_daemon --informative-errors
 
-test_expect_success 'clone non-existent' "test_remote_error    'no such repository'      clone nowhere.git    "
+test_expect_success 'clone non-existent' "test_remote_error    'no such repository'      clone nowhere.git"
 test_expect_success 'push disabled'      "test_remote_error    'service not enabled'     push  repo.git master"
-test_expect_success 'read access denied' "test_remote_error -x 'no such repository'      fetch repo.git       "
-test_expect_success 'not exported'       "test_remote_error -n 'repository not exported' fetch repo.git       "
+test_expect_success 'read access denied' "test_remote_error -x 'no such repository'      fetch repo.git"
+test_expect_success 'not exported'       "test_remote_error -n 'repository not exported' fetch repo.git"
 
 stop_git_daemon
 start_git_daemon --interpolated-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH/%H%D"
index 1d75e3b12ba1641d6bad4a8f76e84df9a9bf59f7..37fd06b0be8f488889554696fceb7d0be615f89f 100755 (executable)
@@ -101,7 +101,12 @@ test_expect_success " --[no-]recurse-submodule and submodule.recurse" '
        test_path_is_file super/sub/merge_strategy_4.t
 '
 
-test_expect_success 'recursive rebasing pull' '
+test_expect_success 'pull --rebase --recurse-submodules (remote superproject submodule changes, local submodule changes)' '
+       # This tests the following scenario :
+       # - local submodule has new commits
+       # - local superproject does not have new commits
+       # - upstream superproject has new commits that change the submodule pointer
+
        # change upstream
        test_commit -C child rebase_strategy &&
        git -C parent submodule update --remote &&
@@ -116,7 +121,10 @@ test_expect_success 'recursive rebasing pull' '
        test_path_is_file super/sub/local_stuff.t
 '
 
-test_expect_success 'pull rebase recursing fails with conflicts' '
+test_expect_success 'pull --rebase --recurse-submodules fails if both sides record submodule changes' '
+       # This tests the following scenario :
+       # - local superproject has new commits that change the submodule pointer
+       # - upstream superproject has new commits that change the submodule pointer
 
        # local changes in submodule recorded in superproject:
        test_commit -C super/sub local_stuff_2 &&
@@ -136,6 +144,50 @@ test_expect_success 'pull rebase recursing fails with conflicts' '
        test_i18ngrep "locally recorded submodule modifications" err
 '
 
+test_expect_success 'pull --rebase --recurse-submodules (no submodule changes, no fork-point)' '
+       # This tests the following scenario :
+       # - local submodule does not have new commits
+       # - local superproject has new commits that *do not* change the submodule pointer
+       # - upstream superproject has new commits that *do not* change the submodule pointer
+       # - local superproject branch has no fork-point with its remote-tracking counter-part
+
+       # create upstream superproject
+       test_create_repo submodule &&
+       test_commit -C submodule first_in_sub &&
+
+       test_create_repo superprojet &&
+       test_commit -C superprojet first_in_super &&
+       git -C superprojet submodule add ../submodule &&
+       git -C superprojet commit -m "add submodule" &&
+       test_commit -C superprojet third_in_super &&
+
+       # clone superproject
+       git clone --recurse-submodules superprojet superclone &&
+
+       # add commits upstream
+       test_commit -C superprojet fourth_in_super &&
+
+       # create topic branch in clone, not based on any remote-tracking branch
+       git -C superclone checkout -b feat HEAD~1 &&
+       test_commit -C superclone first_on_feat &&
+       git -C superclone pull --rebase --recurse-submodules origin master
+'
+
+# NOTE:
+#
+# This test is particular because there is only a single commit in the upstream superproject
+# 'parent' (which adds the submodule 'a-submodule'). The clone of the superproject
+# ('child') hard-resets its branch to a new root commit with the same tree as the one
+# from the upstream superproject, so that its branch has no merge-base with its
+# remote-tracking counterpart, and then calls 'git pull --recurse-submodules --rebase'.
+# The result is that the local branch is reset to the remote-tracking branch (as it was
+# originally before the hard-reset).
+
+# The only commit in the range generated by 'submodule.c::submodule_touches_in_range' and
+# passed to 'submodule.c::collect_changed_submodules' is the new (regenerated) initial commit,
+# which adds the submodule.
+# However, 'submodule_touches_in_range' does not error (even though this commit adds the submodule)
+# because 'combine-diff.c::diff_tree_combined' returns early, as the initial commit has no parents.
 test_expect_success 'branch has no merge base with remote-tracking counterpart' '
        rm -rf parent child &&
 
index e69427f8817a6e2170ce1175991e8badb0e78ecb..7f082fb23b6af9292b279f9db129b8eb23a6e94b 100755 (executable)
@@ -15,7 +15,73 @@ test_expect_success 'setup' '
 test_expect_success 'clone -o' '
 
        git clone -o foo parent clone-o &&
-       (cd clone-o && git rev-parse --verify refs/remotes/foo/master)
+       git -C clone-o rev-parse --verify refs/remotes/foo/master
+
+'
+
+test_expect_success 'rejects invalid -o/--origin' '
+
+       test_must_fail git clone -o "bad...name" parent clone-bad-name 2>err &&
+       test_i18ngrep "'\''bad...name'\'' is not a valid remote name" err
+
+'
+
+test_expect_success 'disallows --bare with --origin' '
+
+       test_must_fail git clone -o foo --bare parent clone-bare-o 2>err &&
+       test_debug "cat err" &&
+       test_i18ngrep -e "--bare and --origin foo options are incompatible" err
+
+'
+
+test_expect_success 'disallows --bare with --separate-git-dir' '
+
+       test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err &&
+       test_debug "cat err" &&
+       test_i18ngrep -e "--bare and --separate-git-dir are incompatible" err
+
+'
+
+test_expect_success 'uses "origin" for default remote name' '
+
+       git clone parent clone-default-origin &&
+       git -C clone-default-origin rev-parse --verify refs/remotes/origin/master
+
+'
+
+test_expect_success 'prefers --template config over normal config' '
+
+       template="$TRASH_DIRECTORY/template-with-config" &&
+       mkdir "$template" &&
+       git config --file "$template/config" foo.bar from_template &&
+       test_config_global foo.bar from_global &&
+       git clone "--template=$template" parent clone-template-config &&
+       test "$(git -C clone-template-config config --local foo.bar)" = "from_template"
+
+'
+
+test_expect_success 'prefers -c config over --template config' '
+
+       template="$TRASH_DIRECTORY/template-with-ignored-config" &&
+       mkdir "$template" &&
+       git config --file "$template/config" foo.bar from_template &&
+       git clone "--template=$template" -c foo.bar=inline parent clone-template-inline-config &&
+       test "$(git -C clone-template-inline-config config --local foo.bar)" = "inline"
+
+'
+
+test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
+
+       test_config_global clone.defaultRemoteName from_config &&
+       git clone parent clone-config-origin &&
+       git -C clone-config-origin rev-parse --verify refs/remotes/from_config/master
+
+'
+
+test_expect_success 'prefers --origin over -c config' '
+
+       git clone -c clone.defaultRemoteName=inline --origin from_option parent clone-o-and-inline-config &&
+       git -C clone-o-and-inline-config rev-parse --verify refs/remotes/from_option/master
 
 '
 
@@ -37,6 +103,7 @@ test_expect_success 'redirected clone -v does show progress' '
 
 test_expect_success 'chooses correct default initial branch name' '
        git init --bare empty &&
+       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
        git -c init.defaultBranch=up clone empty whats-up &&
        test refs/heads/up = $(git -C whats-up symbolic-ref HEAD) &&
        test refs/heads/up = $(git -C whats-up config branch.up.merge)
@@ -51,9 +118,11 @@ test_expect_success 'guesses initial branch name correctly' '
 
        git -c init.defaultBranch=none init --bare no-head &&
        git -C initial-branch push ../no-head guess abc &&
+       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
        git clone no-head is-it2 &&
        test_must_fail git -C is-it2 symbolic-ref refs/remotes/origin/HEAD &&
        git -C no-head update-ref --no-deref HEAD refs/heads/guess &&
+       GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
        git -c init.defaultBranch=guess clone no-head is-it3 &&
        test refs/remotes/origin/guess = \
                $(git -C is-it3 symbolic-ref refs/remotes/origin/HEAD)
index f4d49d833577c33f741adfb8e5ded0cdae2a4a8b..d98c550267159173cc0f609712054e48854ae1c0 100755 (executable)
@@ -251,6 +251,14 @@ test_expect_success 'implicitly construct combine: filter with repeated flags' '
        test_cmp unique_types.expected unique_types.actual
 '
 
+test_expect_success 'upload-pack complains of bogus filter config' '
+       printf 0000 |
+       test_must_fail git \
+               -c uploadpackfilter.tree.maxdepth \
+               upload-pack . >/dev/null 2>err &&
+       test_i18ngrep "unable to parse.*tree.maxdepth" err
+'
+
 test_expect_success 'upload-pack fails banned object filters' '
        test_config -C srv.bare uploadpackfilter.blob:none.allow false &&
        test_must_fail ok=sigpipe git clone --no-checkout --filter=blob:none \
@@ -281,7 +289,15 @@ test_expect_success 'upload-pack limits tree depth filters' '
        test_config -C srv.bare uploadpackfilter.tree.maxDepth 0 &&
        test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 \
                "file://$(pwd)/srv.bare" pc3 2>err &&
-       test_i18ngrep "tree filter allows max depth 0, but got 1" err
+       test_i18ngrep "tree filter allows max depth 0, but got 1" err &&
+
+       git clone --no-checkout --filter=tree:0 "file://$(pwd)/srv.bare" pc4 &&
+
+       test_config -C srv.bare uploadpackfilter.tree.maxDepth 5 &&
+       git clone --no-checkout --filter=tree:5 "file://$(pwd)/srv.bare" pc5 &&
+       test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:6 \
+               "file://$(pwd)/srv.bare" pc6 2>err &&
+       test_i18ngrep "tree filter allows max depth 5, but got 6" err
 '
 
 test_expect_success 'partial clone fetches blobs pointed to by refs even if normally filtered out' '
index d9ecf0f4a95e2ef2bb43ee7816ee83a5c23b0b03..b46940b725ba007102acc9a3046ba117beab56d4 100755 (executable)
@@ -383,14 +383,14 @@ test_expect_success 'server is initially behind - ref in want' '
        test_cmp expected actual
 '
 
-test_expect_success 'server loses a ref - ref in want' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' '
        git -C "$REPO" config uploadpack.allowRefInWant true &&
        rm -rf local &&
        cp -r "$LOCAL_PRISTINE" local &&
-       echo "s/master/raster/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
+       echo "s/main/rain/" >"$HTTPD_ROOT_PATH/one-time-perl" &&
        test_must_fail git -C local fetch 2>err &&
 
-       test_i18ngrep "fatal: remote error: unknown ref refs/heads/raster" err
+       test_i18ngrep "fatal: remote error: unknown ref refs/heads/rain" err
 '
 
 # DO NOT add non-httpd-specific tests here, because the last part of this
diff --git a/t/t5705-session-id-in-capabilities.sh b/t/t5705-session-id-in-capabilities.sh
new file mode 100755 (executable)
index 0000000..f1d189d
--- /dev/null
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+test_description='session ID in capabilities'
+
+. ./test-lib.sh
+
+REPO="$(pwd)/repo"
+LOCAL_PRISTINE="$(pwd)/local_pristine"
+
+test_expect_success 'setup repos for session ID capability tests' '
+       git init "$REPO" &&
+       test_commit -C "$REPO" a &&
+       git clone "file://$REPO" "$LOCAL_PRISTINE" &&
+       test_commit -C "$REPO" b
+'
+
+for PROTO in 0 1 2
+do
+       test_expect_success "session IDs not advertised by default (fetch v${PROTO})" '
+               test_when_finished "rm -rf local tr2-client-events tr2-server-events" &&
+               cp -r "$LOCAL_PRISTINE" local &&
+               GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
+               git -c protocol.version=$PROTO -C local fetch \
+                       --upload-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-upload-pack" \
+                       origin &&
+               test -z "$(grep \"key\":\"server-sid\" tr2-client-events)" &&
+               test -z "$(grep \"key\":\"client-sid\" tr2-server-events)"
+       '
+
+       test_expect_success "session IDs not advertised by default (push v${PROTO})" '
+               test_when_finished "rm -rf local tr2-client-events tr2-server-events" &&
+               test_when_finished "git -C local push --delete origin new-branch" &&
+               cp -r "$LOCAL_PRISTINE" local &&
+               git -C local pull --no-rebase origin &&
+               GIT_TRACE2_EVENT_NESTING=5 \
+               GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
+               git -c protocol.version=$PROTO -C local push \
+                       --receive-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-receive-pack" \
+                       origin HEAD:new-branch &&
+               test -z "$(grep \"key\":\"server-sid\" tr2-client-events)" &&
+               test -z "$(grep \"key\":\"client-sid\" tr2-server-events)"
+       '
+done
+
+test_expect_success 'enable SID advertisement' '
+       git -C "$REPO" config transfer.advertiseSID true &&
+       git -C "$LOCAL_PRISTINE" config transfer.advertiseSID true
+'
+
+for PROTO in 0 1 2
+do
+       test_expect_success "session IDs advertised (fetch v${PROTO})" '
+               test_when_finished "rm -rf local tr2-client-events tr2-server-events" &&
+               cp -r "$LOCAL_PRISTINE" local &&
+               GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
+               git -c protocol.version=$PROTO -C local fetch \
+                       --upload-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-upload-pack" \
+                       origin &&
+               grep \"key\":\"server-sid\" tr2-client-events &&
+               grep \"key\":\"client-sid\" tr2-server-events
+       '
+
+       test_expect_success "session IDs advertised (push v${PROTO})" '
+               test_when_finished "rm -rf local tr2-client-events tr2-server-events" &&
+               test_when_finished "git -C local push --delete origin new-branch" &&
+               cp -r "$LOCAL_PRISTINE" local &&
+               git -C local pull --no-rebase origin &&
+               GIT_TRACE2_EVENT_NESTING=5 \
+               GIT_TRACE2_EVENT="$(pwd)/tr2-client-events" \
+               git -c protocol.version=$PROTO -C local push \
+                       --receive-pack "GIT_TRACE2_EVENT=\"$(pwd)/tr2-server-events\" git-receive-pack" \
+                       origin HEAD:new-branch &&
+               grep \"key\":\"server-sid\" tr2-client-events &&
+               grep \"key\":\"client-sid\" tr2-server-events
+       '
+done
+
+test_done
index bc95da8a5f72c1b9a9e523f82ce4404f92679d5e..99a1eaf332db7120cd0e957a9316c30cd5c01594 100755 (executable)
@@ -339,7 +339,7 @@ commit $head1
 .. (hinzugef${added_utf8_part_iso88591}gt) foo
 EOF
 
-test_expect_success 'prepare expected messages (for test %b)' '
+test_expect_success 'setup expected messages (for test %b)' '
        cat <<-EOF >expected.utf-8 &&
        commit $head3
        This commit message is much longer than the others,
index 7fc10f85930c70e0527efc068dfb94658ca172c8..fd202fcb9433451c5f0df412114eace11259e3f4 100755 (executable)
@@ -168,7 +168,7 @@ test_expect_success '--full-diff is not affected by --parents' '
 #
 # This example is explained in Documentation/rev-list-options.txt
 
-test_expect_success 'rebuild repo' '
+test_expect_success 'setup rebuild repo' '
        rm -rf .git * &&
        git init &&
        git switch -c topic &&
index 7d549748ef3015aade772944603e7b8efe20137b..f3e66eaf9bfe55cfa72a97461b23965013aa3d92 100755 (executable)
@@ -556,7 +556,7 @@ test_expect_success 'merge.suppressDest configuration' '
        head -n1 full.2 >actual &&
        grep -e "Merge branch .side. into master$" actual &&
 
-       git -c merge.suppressDest="ma??er" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
+       git -c merge.suppressDest="ma?*[rn]" fmt-merge-msg <.git/FETCH_HEAD >full.3 &&
        head -n1 full.3 >actual &&
        grep -e "Merge branch .side." actual &&
        ! grep -e " into master$" actual
index b359023189933e3dab334f22fce3d3ea35fd3701..810cdbb6f884fea25fb54832d71eb7f017629345 100755 (executable)
@@ -28,12 +28,13 @@ test_expect_success setup '
        echo "Using $datestamp" > one &&
        git add one &&
        git commit -m "Initial" &&
+       git branch -M main &&
        setdate_and_increment &&
        git tag -a -m "Tagging at $datestamp" testtag &&
-       git update-ref refs/remotes/origin/master master &&
+       git update-ref refs/remotes/origin/main main &&
        git remote add origin nowhere &&
-       git config branch.master.remote origin &&
-       git config branch.master.merge refs/heads/master &&
+       git config branch.main.remote origin &&
+       git config branch.main.merge refs/heads/main &&
        git remote add myfork elsewhere &&
        git config remote.pushdefault myfork &&
        git config push.default current
@@ -41,7 +42,7 @@ test_expect_success setup '
 
 test_atom() {
        case "$1" in
-               head) ref=refs/heads/master ;;
+               head) ref=refs/heads/main ;;
                 tag) ref=refs/tags/testtag ;;
                 sym) ref=refs/heads/sym ;;
                   *) ref=$1 ;;
@@ -76,49 +77,49 @@ test_atom() {
 hexlen=$(test_oid hexsz)
 disklen=$(test_oid disklen)
 
-test_atom head refname refs/heads/master
-test_atom head refname: refs/heads/master
-test_atom head refname:short master
-test_atom head refname:lstrip=1 heads/master
-test_atom head refname:lstrip=2 master
-test_atom head refname:lstrip=-1 master
-test_atom head refname:lstrip=-2 heads/master
+test_atom head refname refs/heads/main
+test_atom head refname: refs/heads/main
+test_atom head refname:short main
+test_atom head refname:lstrip=1 heads/main
+test_atom head refname:lstrip=2 main
+test_atom head refname:lstrip=-1 main
+test_atom head refname:lstrip=-2 heads/main
 test_atom head refname:rstrip=1 refs/heads
 test_atom head refname:rstrip=2 refs
 test_atom head refname:rstrip=-1 refs
 test_atom head refname:rstrip=-2 refs/heads
-test_atom head refname:strip=1 heads/master
-test_atom head refname:strip=2 master
-test_atom head refname:strip=-1 master
-test_atom head refname:strip=-2 heads/master
-test_atom head upstream refs/remotes/origin/master
-test_atom head upstream:short origin/master
-test_atom head upstream:lstrip=2 origin/master
-test_atom head upstream:lstrip=-2 origin/master
+test_atom head refname:strip=1 heads/main
+test_atom head refname:strip=2 main
+test_atom head refname:strip=-1 main
+test_atom head refname:strip=-2 heads/main
+test_atom head upstream refs/remotes/origin/main
+test_atom head upstream:short origin/main
+test_atom head upstream:lstrip=2 origin/main
+test_atom head upstream:lstrip=-2 origin/main
 test_atom head upstream:rstrip=2 refs/remotes
 test_atom head upstream:rstrip=-2 refs/remotes
-test_atom head upstream:strip=2 origin/master
-test_atom head upstream:strip=-2 origin/master
-test_atom head push refs/remotes/myfork/master
-test_atom head push:short myfork/master
-test_atom head push:lstrip=1 remotes/myfork/master
-test_atom head push:lstrip=-1 master
+test_atom head upstream:strip=2 origin/main
+test_atom head upstream:strip=-2 origin/main
+test_atom head push refs/remotes/myfork/main
+test_atom head push:short myfork/main
+test_atom head push:lstrip=1 remotes/myfork/main
+test_atom head push:lstrip=-1 main
 test_atom head push:rstrip=1 refs/remotes/myfork
 test_atom head push:rstrip=-1 refs
-test_atom head push:strip=1 remotes/myfork/master
-test_atom head push:strip=-1 master
+test_atom head push:strip=1 remotes/myfork/main
+test_atom head push:strip=-1 main
 test_atom head objecttype commit
 test_atom head objectsize $((131 + hexlen))
 test_atom head objectsize:disk $disklen
 test_atom head deltabase $ZERO_OID
-test_atom head objectname $(git rev-parse refs/heads/master)
-test_atom head objectname:short $(git rev-parse --short refs/heads/master)
-test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/master)
-test_atom head objectname:short=10 $(git rev-parse --short=10 refs/heads/master)
-test_atom head tree $(git rev-parse refs/heads/master^{tree})
-test_atom head tree:short $(git rev-parse --short refs/heads/master^{tree})
-test_atom head tree:short=1 $(git rev-parse --short=1 refs/heads/master^{tree})
-test_atom head tree:short=10 $(git rev-parse --short=10 refs/heads/master^{tree})
+test_atom head objectname $(git rev-parse refs/heads/main)
+test_atom head objectname:short $(git rev-parse --short refs/heads/main)
+test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/main)
+test_atom head objectname:short=10 $(git rev-parse --short=10 refs/heads/main)
+test_atom head tree $(git rev-parse refs/heads/main^{tree})
+test_atom head tree:short $(git rev-parse --short refs/heads/main^{tree})
+test_atom head tree:short=1 $(git rev-parse --short=1 refs/heads/main^{tree})
+test_atom head tree:short=10 $(git rev-parse --short=10 refs/heads/main^{tree})
 test_atom head parent ''
 test_atom head parent:short ''
 test_atom head parent:short=1 ''
@@ -171,8 +172,8 @@ test_atom tag deltabase $ZERO_OID
 test_atom tag '*deltabase' $ZERO_OID
 test_atom tag objectname $(git rev-parse refs/tags/testtag)
 test_atom tag objectname:short $(git rev-parse --short refs/tags/testtag)
-test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/master)
-test_atom head objectname:short=10 $(git rev-parse --short=10 refs/heads/master)
+test_atom head objectname:short=1 $(git rev-parse --short=1 refs/heads/main)
+test_atom head objectname:short=10 $(git rev-parse --short=10 refs/heads/main)
 test_atom tag tree ''
 test_atom tag tree:short ''
 test_atom tag tree:short=1 ''
@@ -253,7 +254,7 @@ test_date () {
        author_date=$3 &&
        tagger_date=$4 &&
        cat >expected <<-EOF &&
-       'refs/heads/master' '$committer_date' '$author_date'
+       'refs/heads/main' '$committer_date' '$author_date'
        'refs/tags/testtag' '$tagger_date'
        EOF
        (
@@ -375,8 +376,8 @@ test_expect_success 'exercise strftime with odd fields' '
 '
 
 cat >expected <<\EOF
-refs/heads/master
-refs/remotes/origin/master
+refs/heads/main
+refs/remotes/origin/main
 refs/tags/testtag
 EOF
 
@@ -388,8 +389,8 @@ test_expect_success 'Verify ascending sort' '
 
 cat >expected <<\EOF
 refs/tags/testtag
-refs/remotes/origin/master
-refs/heads/master
+refs/remotes/origin/main
+refs/heads/main
 EOF
 
 test_expect_success 'Verify descending sort' '
@@ -424,8 +425,8 @@ test_expect_success 'exercise glob patterns with prefixes' '
 '
 
 cat >expected <<\EOF
-'refs/heads/master'
-'refs/remotes/origin/master'
+'refs/heads/main'
+'refs/remotes/origin/main'
 'refs/tags/testtag'
 EOF
 
@@ -445,8 +446,8 @@ test_expect_success 'Quoting style: python' '
 '
 
 cat >expected <<\EOF
-"refs/heads/master"
-"refs/remotes/origin/master"
+"refs/heads/main"
+"refs/remotes/origin/main"
 "refs/tags/testtag"
 EOF
 
@@ -473,8 +474,8 @@ test_atom head upstream:nobracket,track 'ahead 1'
 
 test_expect_success 'setup for push:track[short]' '
        test_commit third &&
-       git update-ref refs/remotes/myfork/master master &&
-       git reset master~1
+       git update-ref refs/remotes/myfork/main main &&
+       git reset main~1
 '
 
 test_atom head push:track '[behind 1]'
@@ -490,8 +491,8 @@ test_expect_success 'Check that :track[short] works when upstream is invalid' '
        [gone]
 
        EOF
-       test_when_finished "git config branch.master.merge refs/heads/master" &&
-       git config branch.master.merge refs/heads/does-not-exist &&
+       test_when_finished "git config branch.main.merge refs/heads/main" &&
+       git config branch.main.merge refs/heads/does-not-exist &&
        git for-each-ref \
                --format="%(upstream:track)$LF%(upstream:trackshort)" \
                refs/heads >actual &&
@@ -504,9 +505,9 @@ test_expect_success 'Check for invalid refname format' '
 
 test_expect_success 'set up color tests' '
        cat >expected.color <<-EOF &&
-       $(git rev-parse --short refs/heads/master) <GREEN>master<RESET>
-       $(git rev-parse --short refs/remotes/myfork/master) <GREEN>myfork/master<RESET>
-       $(git rev-parse --short refs/remotes/origin/master) <GREEN>origin/master<RESET>
+       $(git rev-parse --short refs/heads/main) <GREEN>main<RESET>
+       $(git rev-parse --short refs/remotes/myfork/main) <GREEN>myfork/main<RESET>
+       $(git rev-parse --short refs/remotes/origin/main) <GREEN>origin/main<RESET>
        $(git rev-parse --short refs/tags/testtag) <GREEN>testtag<RESET>
        $(git rev-parse --short refs/tags/third) <GREEN>third<RESET>
        $(git rev-parse --short refs/tags/two) <GREEN>two<RESET>
@@ -538,8 +539,8 @@ test_expect_success 'color.ui=always does not override tty check' '
 '
 
 cat >expected <<\EOF
-heads/master
-tags/master
+heads/main
+tags/main
 EOF
 
 test_expect_success 'Check ambiguous head and tag refs (strict)' '
@@ -549,19 +550,19 @@ test_expect_success 'Check ambiguous head and tag refs (strict)' '
        git add one &&
        git commit -m "Branch" &&
        setdate_and_increment &&
-       git tag -m "Tagging at $datestamp" master &&
-       git for-each-ref --format "%(refname:short)" refs/heads/master refs/tags/master >actual &&
+       git tag -m "Tagging at $datestamp" main &&
+       git for-each-ref --format "%(refname:short)" refs/heads/main refs/tags/main >actual &&
        test_cmp expected actual
 '
 
 cat >expected <<\EOF
-heads/master
-master
+heads/main
+main
 EOF
 
 test_expect_success 'Check ambiguous head and tag refs (loose)' '
        git config --bool core.warnambiguousrefs false &&
-       git for-each-ref --format "%(refname:short)" refs/heads/master refs/tags/master >actual &&
+       git for-each-ref --format "%(refname:short)" refs/heads/main refs/tags/main >actual &&
        test_cmp expected actual
 '
 
@@ -571,7 +572,7 @@ ambiguous
 EOF
 
 test_expect_success 'Check ambiguous head and tag refs II (loose)' '
-       git checkout master &&
+       git checkout main &&
        git tag ambiguous testtag^0 &&
        git branch ambiguous testtag^0 &&
        git for-each-ref --format "%(refname:short)" refs/heads/ambiguous refs/tags/ambiguous >actual &&
@@ -705,8 +706,8 @@ body contents
 $sig"
 
 test_expect_success 'set up refs pointing to tree and blob' '
-       git update-ref refs/mytrees/first refs/heads/master^{tree} &&
-       git update-ref refs/myblobs/first refs/heads/master:one
+       git update-ref refs/mytrees/first refs/heads/main^{tree} &&
+       git update-ref refs/myblobs/first refs/heads/main:one
 '
 
 test_atom refs/mytrees/first subject ""
@@ -778,7 +779,7 @@ test_expect_success 'equivalent sorts fall back on refname' '
 '
 
 test_expect_success 'do not dereference NULL upon %(HEAD) on unborn branch' '
-       test_when_finished "git checkout master" &&
+       test_when_finished "git checkout main" &&
        git for-each-ref --format="%(HEAD) %(refname:short)" refs/heads/ >actual &&
        sed -e "s/^\* /  /" actual >expect &&
        git checkout --orphan orphaned-branch &&
@@ -815,9 +816,9 @@ test_expect_success '%(trailers:unfold) unfolds trailers' '
                unfold <trailers
                echo
        } >expect &&
-       git for-each-ref --format="%(trailers:unfold)" refs/heads/master >actual &&
+       git for-each-ref --format="%(trailers:unfold)" refs/heads/main >actual &&
        test_cmp expect actual &&
-       git for-each-ref --format="%(contents:trailers:unfold)" refs/heads/master >actual &&
+       git for-each-ref --format="%(contents:trailers:unfold)" refs/heads/main >actual &&
        test_cmp expect actual
 '
 
@@ -826,9 +827,9 @@ test_expect_success '%(trailers:only) shows only "key: value" trailers' '
                grep -v patch.description <trailers &&
                echo
        } >expect &&
-       git for-each-ref --format="%(trailers:only)" refs/heads/master >actual &&
+       git for-each-ref --format="%(trailers:only)" refs/heads/main >actual &&
        test_cmp expect actual &&
-       git for-each-ref --format="%(contents:trailers:only)" refs/heads/master >actual &&
+       git for-each-ref --format="%(contents:trailers:only)" refs/heads/main >actual &&
        test_cmp expect actual
 '
 
@@ -837,13 +838,13 @@ test_expect_success '%(trailers:only) and %(trailers:unfold) work together' '
                grep -v patch.description <trailers | unfold &&
                echo
        } >expect &&
-       git for-each-ref --format="%(trailers:only,unfold)" refs/heads/master >actual &&
+       git for-each-ref --format="%(trailers:only,unfold)" refs/heads/main >actual &&
        test_cmp expect actual &&
-       git for-each-ref --format="%(trailers:unfold,only)" refs/heads/master >actual &&
+       git for-each-ref --format="%(trailers:unfold,only)" refs/heads/main >actual &&
        test_cmp actual actual &&
-       git for-each-ref --format="%(contents:trailers:only,unfold)" refs/heads/master >actual &&
+       git for-each-ref --format="%(contents:trailers:only,unfold)" refs/heads/main >actual &&
        test_cmp expect actual &&
-       git for-each-ref --format="%(contents:trailers:unfold,only)" refs/heads/master >actual &&
+       git for-each-ref --format="%(contents:trailers:unfold,only)" refs/heads/main >actual &&
        test_cmp actual actual
 '
 
@@ -867,7 +868,7 @@ test_expect_success 'if arguments, %(contents:trailers) shows error if colon is
 '
 
 test_expect_success 'basic atom: head contents:trailers' '
-       git for-each-ref --format="%(contents:trailers)" refs/heads/master >actual &&
+       git for-each-ref --format="%(contents:trailers)" refs/heads/main >actual &&
        sanitize_pgp <actual >actual.clean &&
        # git for-each-ref ends with a blank line
        cat >expect <<-EOF &&
@@ -896,16 +897,16 @@ test_expect_success 'trailer parsing not fooled by --- line' '
                echo "trailer: right" &&
                echo
        } >expect &&
-       git for-each-ref --format="%(trailers)" refs/heads/master >actual &&
+       git for-each-ref --format="%(trailers)" refs/heads/main >actual &&
        test_cmp expect actual
 '
 
 test_expect_success 'Add symbolic ref for the following tests' '
-       git symbolic-ref refs/heads/sym refs/heads/master
+       git symbolic-ref refs/heads/sym refs/heads/main
 '
 
 cat >expected <<EOF
-refs/heads/master
+refs/heads/main
 EOF
 
 test_expect_success 'Verify usage of %(symref) atom' '
@@ -914,7 +915,7 @@ test_expect_success 'Verify usage of %(symref) atom' '
 '
 
 cat >expected <<EOF
-heads/master
+heads/main
 EOF
 
 test_expect_success 'Verify usage of %(symref:short) atom' '
@@ -923,8 +924,8 @@ test_expect_success 'Verify usage of %(symref:short) atom' '
 '
 
 cat >expected <<EOF
-master
-heads/master
+main
+heads/main
 EOF
 
 test_expect_success 'Verify usage of %(symref:lstrip) atom' '
@@ -953,22 +954,23 @@ test_expect_success ':remotename and :remoteref' '
        (
                cd remote-tests &&
                test_commit initial &&
+               git branch -M main &&
                git remote add from fifth.coffee:blub &&
-               git config branch.master.remote from &&
-               git config branch.master.merge refs/heads/stable &&
+               git config branch.main.remote from &&
+               git config branch.main.merge refs/heads/stable &&
                git remote add to southridge.audio:repo &&
                git config remote.to.push "refs/heads/*:refs/heads/pushed/*" &&
-               git config branch.master.pushRemote to &&
+               git config branch.main.pushRemote to &&
                for pair in "%(upstream)=refs/remotes/from/stable" \
                        "%(upstream:remotename)=from" \
                        "%(upstream:remoteref)=refs/heads/stable" \
-                       "%(push)=refs/remotes/to/pushed/master" \
+                       "%(push)=refs/remotes/to/pushed/main" \
                        "%(push:remotename)=to" \
-                       "%(push:remoteref)=refs/heads/pushed/master"
+                       "%(push:remoteref)=refs/heads/pushed/main"
                do
                        echo "${pair#*=}" >expect &&
                        git for-each-ref --format="${pair%=*}" \
-                               refs/heads/master >actual &&
+                               refs/heads/main >actual &&
                        test_cmp expect actual
                done &&
                git branch push-simple &&
@@ -981,12 +983,12 @@ test_expect_success ':remotename and :remoteref' '
 '
 
 test_expect_success 'for-each-ref --ignore-case ignores case' '
-       git for-each-ref --format="%(refname)" refs/heads/MASTER >actual &&
+       git for-each-ref --format="%(refname)" refs/heads/MAIN >actual &&
        test_must_be_empty actual &&
 
-       echo refs/heads/master >expect &&
+       echo refs/heads/main >expect &&
        git for-each-ref --format="%(refname)" --ignore-case \
-               refs/heads/MASTER >actual &&
+               refs/heads/MAIN >actual &&
        test_cmp expect actual
 '
 
index 781e470aeafb32a0c79abc40a12e1f55175aaba2..0a21669f56d5706be75914f8e2ccaa754caf3040 100755 (executable)
@@ -113,9 +113,9 @@ test_expect_success '%(color) must fail' '
        test_must_fail git for-each-ref --format="%(color)%(refname)"
 '
 
-test_expect_success 'left alignment is default' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' '
        cat >expect <<-\EOF &&
-       refname is refs/heads/master  |refs/heads/master
+       refname is refs/heads/main    |refs/heads/main
        refname is refs/heads/side    |refs/heads/side
        refname is refs/odd/spot      |refs/odd/spot
        refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -131,9 +131,9 @@ test_expect_success 'left alignment is default' '
        test_cmp expect actual
 '
 
-test_expect_success 'middle alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' '
        cat >expect <<-\EOF &&
-       | refname is refs/heads/master |refs/heads/master
+       |  refname is refs/heads/main  |refs/heads/main
        |  refname is refs/heads/side  |refs/heads/side
        |   refname is refs/odd/spot   |refs/odd/spot
        |refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -149,9 +149,9 @@ test_expect_success 'middle alignment' '
        test_cmp expect actual
 '
 
-test_expect_success 'right alignment' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' '
        cat >expect <<-\EOF &&
-       |  refname is refs/heads/master|refs/heads/master
+       |    refname is refs/heads/main|refs/heads/main
        |    refname is refs/heads/side|refs/heads/side
        |      refname is refs/odd/spot|refs/odd/spot
        |refname is refs/tags/annotated-tag|refs/tags/annotated-tag
@@ -168,7 +168,7 @@ test_expect_success 'right alignment' '
 '
 
 cat >expect <<-\EOF
-|       refname is refs/heads/master       |refs/heads/master
+|        refname is refs/heads/main        |refs/heads/main
 |        refname is refs/heads/side        |refs/heads/side
 |         refname is refs/odd/spot         |refs/odd/spot
 |    refname is refs/tags/annotated-tag    |refs/tags/annotated-tag
@@ -184,7 +184,7 @@ EOF
 test_align_permutations() {
        while read -r option
        do
-               test_expect_success "align:$option" '
+               test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" '
                        git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual &&
                        test_cmp expect actual
                '
@@ -213,9 +213,9 @@ EOF
 
 # Individual atoms inside %(align:...) and %(end) must not be quoted.
 
-test_expect_success 'alignment with format quote' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' "
        cat >expect <<-\EOF &&
-       |'      '\''master| A U Thor'\''      '|
+       |'       '\''main| A U Thor'\''       '|
        |'       '\''side| A U Thor'\''       '|
        |'     '\''odd/spot| A U Thor'\''     '|
        |'      '\''annotated-tag| '\''       '|
@@ -231,9 +231,9 @@ test_expect_success 'alignment with format quote' "
        test_cmp expect actual
 "
 
-test_expect_success 'nested alignment with quote formatting' "
+test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' "
        cat >expect <<-\EOF &&
-       |'         master               '|
+       |'           main               '|
        |'           side               '|
        |'       odd/spot               '|
        |'  annotated-tag               '|
index f1b84617aff1b78e23b65a149e139cc3feea8577..9da08382164dd2c0fe9d9b8d84c6b8450d161917 100755 (executable)
@@ -81,7 +81,12 @@ test_expect_success 'modify/delete + directory/file conflict' '
 
        test 5 -eq $(git ls-files -s | wc -l) &&
        test 4 -eq $(git ls-files -u | wc -l) &&
-       test 1 -eq $(git ls-files -o | wc -l) &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 0 -eq $(git ls-files -o | wc -l)
+       else
+               test 1 -eq $(git ls-files -o | wc -l)
+       fi &&
 
        test_path_is_file letters/file &&
        test_path_is_file letters.txt &&
@@ -97,7 +102,12 @@ test_expect_success 'modify/delete + directory/file conflict; other way' '
 
        test 5 -eq $(git ls-files -s | wc -l) &&
        test 4 -eq $(git ls-files -u | wc -l) &&
-       test 1 -eq $(git ls-files -o | wc -l) &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 0 -eq $(git ls-files -o | wc -l)
+       else
+               test 1 -eq $(git ls-files -o | wc -l)
+       fi &&
 
        test_path_is_file letters/file &&
        test_path_is_file letters.txt &&
index bbbba3dcbf0de73a65f0c7258c6b5c5b3278e542..3f64f62224485fec4e192b90dfacacb2c78f3626 100755 (executable)
@@ -320,7 +320,12 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
 
        test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
        test_i18ngrep "Auto-merging dir" output &&
-       test_i18ngrep "Adding as dir~HEAD instead" output &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test_i18ngrep "moving it to dir~HEAD instead" output
+       else
+               test_i18ngrep "Adding as dir~HEAD instead" output
+       fi &&
 
        test 3 -eq "$(git ls-files -u | wc -l)" &&
        test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
@@ -342,7 +347,12 @@ test_expect_success 'Same as previous, but merged other way' '
        ! grep "error: refusing to lose untracked file at" errors &&
        test_i18ngrep "CONFLICT (modify/delete): dir/file-in-the-way" output &&
        test_i18ngrep "Auto-merging dir" output &&
-       test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test_i18ngrep "moving it to dir~renamed-file-has-no-conflicts instead" output
+       else
+               test_i18ngrep "Adding as dir~renamed-file-has-no-conflicts instead" output
+       fi &&
 
        test 3 -eq "$(git ls-files -u | wc -l)" &&
        test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
@@ -397,7 +407,12 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge and dir in t
        test_must_fail git merge --strategy=recursive dir-in-way &&
 
        test 5 -eq "$(git ls-files -u | wc -l)" &&
-       test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 3 -eq "$(git ls-files -u dir~HEAD | wc -l)"
+       else
+               test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)"
+       fi &&
        test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
 
        test_must_fail git diff --quiet &&
@@ -415,7 +430,12 @@ test_expect_success 'Same as previous, but merged other way' '
        test_must_fail git merge --strategy=recursive renamed-file-has-conflicts &&
 
        test 5 -eq "$(git ls-files -u | wc -l)" &&
-       test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)" &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 3 -eq "$(git ls-files -u dir~renamed-file-has-conflicts | wc -l)"
+       else
+               test 3 -eq "$(git ls-files -u dir | grep -v file-in-the-way | wc -l)"
+       fi &&
        test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" &&
 
        test_must_fail git diff --quiet &&
@@ -471,7 +491,12 @@ test_expect_success 'both rename source and destination involved in D/F conflict
        git checkout -q rename-dest^0 &&
        test_must_fail git merge --strategy=recursive source-conflict &&
 
-       test 1 -eq "$(git ls-files -u | wc -l)" &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 2 -eq "$(git ls-files -u | wc -l)"
+       else
+               test 1 -eq "$(git ls-files -u | wc -l)"
+       fi &&
 
        test_must_fail git diff --quiet &&
 
@@ -505,34 +530,63 @@ test_expect_success 'setup pair rename to parent of other (D/F conflicts)' '
        git commit -m "Rename one/file -> two"
 '
 
-test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
-       git checkout -q rename-one^0 &&
-       mkdir one &&
-       test_must_fail git merge --strategy=recursive rename-two &&
+if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+then
+       test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
+               git checkout -q rename-one^0 &&
+               mkdir one &&
+               test_must_fail git merge --strategy=recursive rename-two &&
 
-       test 2 -eq "$(git ls-files -u | wc -l)" &&
-       test 1 -eq "$(git ls-files -u one | wc -l)" &&
-       test 1 -eq "$(git ls-files -u two | wc -l)" &&
+               test 4 -eq "$(git ls-files -u | wc -l)" &&
+               test 2 -eq "$(git ls-files -u one | wc -l)" &&
+               test 2 -eq "$(git ls-files -u two | wc -l)" &&
 
-       test_must_fail git diff --quiet &&
+               test_must_fail git diff --quiet &&
 
-       test 4 -eq $(find . | grep -v .git | wc -l) &&
+               test 3 -eq $(find . | grep -v .git | wc -l) &&
 
-       test_path_is_dir one &&
-       test_path_is_file one~rename-two &&
-       test_path_is_file two &&
-       test "other" = $(cat one~rename-two) &&
-       test "stuff" = $(cat two)
-'
+               test_path_is_file one &&
+               test_path_is_file two &&
+               test "other" = $(cat one) &&
+               test "stuff" = $(cat two)
+       '
+else
+       test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked dir' '
+               git checkout -q rename-one^0 &&
+               mkdir one &&
+               test_must_fail git merge --strategy=recursive rename-two &&
+
+               test 2 -eq "$(git ls-files -u | wc -l)" &&
+               test 1 -eq "$(git ls-files -u one | wc -l)" &&
+               test 1 -eq "$(git ls-files -u two | wc -l)" &&
+
+               test_must_fail git diff --quiet &&
+
+               test 4 -eq $(find . | grep -v .git | wc -l) &&
+
+               test_path_is_dir one &&
+               test_path_is_file one~rename-two &&
+               test_path_is_file two &&
+               test "other" = $(cat one~rename-two) &&
+               test "stuff" = $(cat two)
+       '
+fi
 
 test_expect_success 'pair rename to parent of other (D/F conflicts) w/ clean start' '
        git reset --hard &&
        git clean -fdqx &&
        test_must_fail git merge --strategy=recursive rename-two &&
 
-       test 2 -eq "$(git ls-files -u | wc -l)" &&
-       test 1 -eq "$(git ls-files -u one | wc -l)" &&
-       test 1 -eq "$(git ls-files -u two | wc -l)" &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 4 -eq "$(git ls-files -u | wc -l)" &&
+               test 2 -eq "$(git ls-files -u one | wc -l)" &&
+               test 2 -eq "$(git ls-files -u two | wc -l)"
+       else
+               test 2 -eq "$(git ls-files -u | wc -l)" &&
+               test 1 -eq "$(git ls-files -u one | wc -l)" &&
+               test 1 -eq "$(git ls-files -u two | wc -l)"
+       fi &&
 
        test_must_fail git diff --quiet &&
 
@@ -572,12 +626,22 @@ test_expect_success 'check handling of differently renamed file with D/F conflic
        git checkout -q first-rename^0 &&
        test_must_fail git merge --strategy=recursive second-rename &&
 
-       test 5 -eq "$(git ls-files -s | wc -l)" &&
-       test 3 -eq "$(git ls-files -u | wc -l)" &&
-       test 1 -eq "$(git ls-files -u one | wc -l)" &&
-       test 1 -eq "$(git ls-files -u two | wc -l)" &&
-       test 1 -eq "$(git ls-files -u original | wc -l)" &&
-       test 2 -eq "$(git ls-files -o | wc -l)" &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 5 -eq "$(git ls-files -s | wc -l)" &&
+               test 3 -eq "$(git ls-files -u | wc -l)" &&
+               test 1 -eq "$(git ls-files -u one~HEAD | wc -l)" &&
+               test 1 -eq "$(git ls-files -u two~second-rename | wc -l)" &&
+               test 1 -eq "$(git ls-files -u original | wc -l)" &&
+               test 0 -eq "$(git ls-files -o | wc -l)"
+       else
+               test 5 -eq "$(git ls-files -s | wc -l)" &&
+               test 3 -eq "$(git ls-files -u | wc -l)" &&
+               test 1 -eq "$(git ls-files -u one | wc -l)" &&
+               test 1 -eq "$(git ls-files -u two | wc -l)" &&
+               test 1 -eq "$(git ls-files -u original | wc -l)" &&
+               test 2 -eq "$(git ls-files -o | wc -l)"
+       fi &&
 
        test_path_is_file one/file &&
        test_path_is_file two/file &&
index 332cfc53fd889328ef753e0775e5ca45eacd2a20..b1c3d4dda49fc3c7d08e472217614469c76e9b9b 100755 (executable)
@@ -118,12 +118,22 @@ test_expect_success 'mark rename/delete as unmerged' '
        test_tick &&
        git commit -m rename &&
        test_must_fail git merge delete &&
-       test 1 = $(git ls-files --unmerged | wc -l) &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 2 = $(git ls-files --unmerged | wc -l)
+       else
+               test 1 = $(git ls-files --unmerged | wc -l)
+       fi &&
        git rev-parse --verify :2:a2 &&
        test_must_fail git rev-parse --verify :3:a2 &&
        git checkout -f delete &&
        test_must_fail git merge rename &&
-       test 1 = $(git ls-files --unmerged | wc -l) &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test 2 = $(git ls-files --unmerged | wc -l)
+       else
+               test 1 = $(git ls-files --unmerged | wc -l)
+       fi &&
        test_must_fail git rev-parse --verify :2:a2 &&
        git rev-parse --verify :3:a2
 '
index fd98989b1476e4e1e35893350981d3a1f25a37fa..887c2195a968160be064621cddf54f762e739a63 100755 (executable)
@@ -3,6 +3,7 @@
 test_description='recursive merge corner cases involving criss-cross merges'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
 
 #
 #  L1  L2
@@ -537,9 +538,15 @@ test_expect_success 'setup differently handled merges of directory/file conflict
 
                git checkout B^0 &&
                test_must_fail git merge C^0 &&
-               git clean -fd &&
-               git rm -rf a/ &&
-               git rm a &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git rm -rf a/ &&
+                       git rm a~HEAD
+               else
+                       git clean -fd &&
+                       git rm -rf a/ &&
+                       git rm a
+               fi &&
                git cat-file -p B:a >a2 &&
                git add a2 &&
                git commit -m D2 &&
@@ -558,7 +565,12 @@ test_expect_success 'setup differently handled merges of directory/file conflict
 
                git checkout C^0 &&
                test_must_fail git merge B^0 &&
-               git clean -fd &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git rm a~B^0
+               else
+                       git clean -fd
+               fi &&
                git rm -rf a/ &&
                test_write_lines 1 2 3 4 5 6 7 8 >a &&
                git add a &&
@@ -567,9 +579,15 @@ test_expect_success 'setup differently handled merges of directory/file conflict
 
                git checkout C^0 &&
                test_must_fail git merge B^0 &&
-               git clean -fd &&
-               git rm -rf a/ &&
-               git rm a &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git rm -rf a/ &&
+                       git rm a~B^0
+               else
+                       git clean -fd &&
+                       git rm -rf a/ &&
+                       git rm a
+               fi &&
                test_write_lines 1 2 3 4 5 6 7 8 >a2 &&
                git add a2 &&
                git commit -m E4 &&
@@ -587,18 +605,34 @@ test_expect_success 'merge of D1 & E1 fails but has appropriate contents' '
 
                test_must_fail git merge -s recursive E1^0 &&
 
-               git ls-files -s >out &&
-               test_line_count = 2 out &&
-               git ls-files -u >out &&
-               test_line_count = 1 out &&
-               git ls-files -o >out &&
-               test_line_count = 1 out &&
-
-               git rev-parse >expect    \
-                       A:ignore-me  B:a &&
-               git rev-parse   >actual   \
-                       :0:ignore-me :2:a &&
-               test_cmp expect actual
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git ls-files -s >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >expect    \
+                               A:ignore-me  B:a  D1:a &&
+                       git rev-parse   >actual   \
+                               :0:ignore-me :1:a :2:a &&
+                       test_cmp expect actual
+               else
+                       git ls-files -s >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >expect    \
+                               A:ignore-me  B:a &&
+                       git rev-parse   >actual   \
+                               :0:ignore-me :2:a &&
+                       test_cmp expect actual
+               fi
        )
 '
 
@@ -612,18 +646,34 @@ test_expect_success 'merge of E1 & D1 fails but has appropriate contents' '
 
                test_must_fail git merge -s recursive D1^0 &&
 
-               git ls-files -s >out &&
-               test_line_count = 2 out &&
-               git ls-files -u >out &&
-               test_line_count = 1 out &&
-               git ls-files -o >out &&
-               test_line_count = 1 out &&
-
-               git rev-parse >expect    \
-                       A:ignore-me  B:a &&
-               git rev-parse   >actual   \
-                       :0:ignore-me :3:a &&
-               test_cmp expect actual
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git ls-files -s >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >expect    \
+                               A:ignore-me  B:a  D1:a &&
+                       git rev-parse   >actual   \
+                               :0:ignore-me :1:a :3:a &&
+                       test_cmp expect actual
+               else
+                       git ls-files -s >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >expect    \
+                               A:ignore-me  B:a &&
+                       git rev-parse   >actual   \
+                               :0:ignore-me :3:a &&
+                       test_cmp expect actual
+               fi
        )
 '
 
@@ -637,17 +687,32 @@ test_expect_success 'merge of D1 & E2 fails but has appropriate contents' '
 
                test_must_fail git merge -s recursive E2^0 &&
 
-               git ls-files -s >out &&
-               test_line_count = 4 out &&
-               git ls-files -u >out &&
-               test_line_count = 3 out &&
-               git ls-files -o >out &&
-               test_line_count = 2 out &&
-
-               git rev-parse >expect    \
-                       B:a   E2:a/file  C:a/file   A:ignore-me &&
-               git rev-parse   >actual   \
-                       :2:a  :3:a/file  :1:a/file  :0:ignore-me &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git ls-files -s >out &&
+                       test_line_count = 5 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >expect    \
+                               B:a       D1:a      E2:a/file  C:a/file   A:ignore-me &&
+                       git rev-parse   >actual   \
+                               :1:a~HEAD :2:a~HEAD :3:a/file  :1:a/file  :0:ignore-me
+               else
+                       git ls-files -s >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 2 out &&
+
+                       git rev-parse >expect    \
+                               B:a    E2:a/file  C:a/file   A:ignore-me &&
+                       git rev-parse   >actual   \
+                               :2:a   :3:a/file  :1:a/file  :0:ignore-me
+               fi &&
                test_cmp expect actual &&
 
                test_path_is_file a~HEAD
@@ -664,17 +729,32 @@ test_expect_success 'merge of E2 & D1 fails but has appropriate contents' '
 
                test_must_fail git merge -s recursive D1^0 &&
 
-               git ls-files -s >out &&
-               test_line_count = 4 out &&
-               git ls-files -u >out &&
-               test_line_count = 3 out &&
-               git ls-files -o >out &&
-               test_line_count = 2 out &&
-
-               git rev-parse >expect    \
-                       B:a   E2:a/file  C:a/file   A:ignore-me &&
-               git rev-parse   >actual   \
-                       :3:a  :2:a/file  :1:a/file  :0:ignore-me &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git ls-files -s >out &&
+                       test_line_count = 5 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >expect    \
+                               B:a       D1:a      E2:a/file  C:a/file   A:ignore-me &&
+                       git rev-parse   >actual   \
+                               :1:a~D1^0 :3:a~D1^0 :2:a/file  :1:a/file  :0:ignore-me
+               else
+                       git ls-files -s >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 2 out &&
+
+                       git rev-parse >expect    \
+                               B:a   E2:a/file  C:a/file   A:ignore-me &&
+                       git rev-parse   >actual   \
+                               :3:a  :2:a/file  :1:a/file  :0:ignore-me
+               fi &&
                test_cmp expect actual &&
 
                test_path_is_file a~D1^0
@@ -706,7 +786,7 @@ test_expect_success 'merge of D1 & E3 succeeds' '
        )
 '
 
-test_expect_success 'merge of D1 & E4 notifies user a and a2 are related' '
+test_expect_merge_algorithm failure success 'merge of D1 & E4 puts merge of a and a2 in both a and a2' '
        test_when_finished "git -C directory-file reset --hard" &&
        test_when_finished "git -C directory-file clean -fdqx" &&
        (
@@ -724,7 +804,7 @@ test_expect_success 'merge of D1 & E4 notifies user a and a2 are related' '
                test_line_count = 1 out &&
 
                git rev-parse >expect                  \
-                       A:ignore-me  B:a   D1:a  E4:a2 &&
+                       A:ignore-me  B:a   E4:a2  E4:a2 &&
                git rev-parse   >actual                \
                        :0:ignore-me :1:a~Temporary\ merge\ branch\ 2  :2:a  :3:a2 &&
                test_cmp expect actual
@@ -1069,7 +1149,7 @@ test_expect_success 'setup symlink modify/modify' '
        )
 '
 
-test_expect_failure 'check symlink modify/modify' '
+test_expect_merge_algorithm failure success 'check symlink modify/modify' '
        (
                cd symlink-modify-modify &&
 
@@ -1135,7 +1215,7 @@ test_expect_success 'setup symlink add/add' '
        )
 '
 
-test_expect_failure 'check symlink add/add' '
+test_expect_merge_algorithm failure success 'check symlink add/add' '
        (
                cd symlink-add-add &&
 
@@ -1223,7 +1303,7 @@ test_expect_success 'setup submodule modify/modify' '
        )
 '
 
-test_expect_failure 'check submodule modify/modify' '
+test_expect_merge_algorithm failure success 'check submodule modify/modify' '
        (
                cd submodule-modify-modify &&
 
@@ -1311,7 +1391,7 @@ test_expect_success 'setup submodule add/add' '
        )
 '
 
-test_expect_failure 'check submodule add/add' '
+test_expect_merge_algorithm failure success 'check submodule add/add' '
        (
                cd submodule-add-add &&
 
@@ -1386,7 +1466,7 @@ test_expect_success 'setup conflicting entry types (submodule vs symlink)' '
        )
 '
 
-test_expect_failure 'check conflicting entry types (submodule vs symlink)' '
+test_expect_merge_algorithm failure success 'check conflicting entry types (submodule vs symlink)' '
        (
                cd submodule-symlink-add-add &&
 
index 3375eaf4e76daa23c0a9e65fd6b7e060cc04f601..78bfaf17f077bba18bcd0525feec5620850528f2 100755 (executable)
@@ -4,6 +4,7 @@ test_description="recursive merge corner cases w/ renames but not criss-crosses"
 # t6036 has corner cases that involve both criss-cross merges and renames
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
 
 test_setup_rename_delete_untracked () {
        test_create_repo rename-delete-untracked &&
@@ -312,15 +313,18 @@ test_expect_success 'rename/directory conflict + clean content merge' '
                git ls-files -u >out &&
                test_line_count = 1 out &&
                git ls-files -o >out &&
-               test_line_count = 2 out &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_line_count = 1 out
+               else
+                       test_line_count = 2 out
+               fi &&
 
                echo 0 >expect &&
                git cat-file -p base:file >>expect &&
                echo 7 >>expect &&
                test_cmp expect newfile~HEAD &&
 
-               test $(git rev-parse :2:newfile) = $(git hash-object expect) &&
-
                test_path_is_file newfile/realfile &&
                test_path_is_file newfile~HEAD
        )
@@ -343,7 +347,12 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
                git ls-files -u >out &&
                test_line_count = 3 out &&
                git ls-files -o >out &&
-               test_line_count = 2 out &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_line_count = 1 out
+               else
+                       test_line_count = 2 out
+               fi &&
 
                git cat-file -p left-conflict:newfile >left &&
                git cat-file -p base:file    >base &&
@@ -355,10 +364,16 @@ test_expect_success 'rename/directory conflict + content merge conflict' '
                        left base right &&
                test_cmp left newfile~HEAD &&
 
-               git rev-parse >expect                                 \
-                       base:file   left-conflict:newfile  right:file &&
-               git rev-parse >actual                                 \
-                       :1:newfile  :2:newfile             :3:newfile &&
+               git rev-parse >expect   \
+                       base:file       left-conflict:newfile right:file &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git rev-parse >actual \
+                               :1:newfile~HEAD :2:newfile~HEAD :3:newfile~HEAD
+               else
+                       git rev-parse >actual \
+                               :1:newfile      :2:newfile      :3:newfile
+               fi &&
                test_cmp expect actual &&
 
                test_path_is_file newfile/realfile &&
@@ -878,7 +893,7 @@ test_setup_rad () {
        )
 }
 
-test_expect_failure 'rad-check: rename/add/delete conflict' '
+test_expect_merge_algorithm failure success 'rad-check: rename/add/delete conflict' '
        test_setup_rad &&
        (
                cd rad &&
@@ -951,7 +966,7 @@ test_setup_rrdd () {
        )
 }
 
-test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
+test_expect_merge_algorithm failure success 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
        test_setup_rrdd &&
        (
                cd rrdd &&
@@ -1040,7 +1055,7 @@ test_setup_mod6 () {
        )
 }
 
-test_expect_failure 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
+test_expect_merge_algorithm failure success 'mod6-check: chains of rename/rename(1to2) and rename/rename(2to1)' '
        test_setup_mod6 &&
        (
                cd mod6 &&
index f7ecbb886d6191c4bb2e8c1da8b23e0a1e22d47d..4ab133f489ca322a752599dc940e4c9c12461ad3 100755 (executable)
@@ -26,6 +26,7 @@ test_description="recursive merge with directory renames"
 #                     files that might be renamed into each other's paths.)
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
 
 
 ###########################################################################
@@ -301,11 +302,20 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
                git cat-file -p :2:x/wham >expect &&
                git cat-file -p :3:x/wham >other &&
                >empty &&
-               test_must_fail git merge-file \
-                       -L "HEAD" \
-                       -L "" \
-                       -L "B^0" \
-                       expect empty other &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_must_fail git merge-file \
+                               -L "HEAD:y/wham" \
+                               -L "" \
+                               -L "B^0:z/wham" \
+                               expect empty other
+               else
+                       test_must_fail git merge-file \
+                               -L "HEAD" \
+                               -L "" \
+                               -L "B^0" \
+                               expect empty other
+               fi &&
                test_cmp expect x/wham
        )
 '
@@ -1176,10 +1186,18 @@ test_expect_success '5d: Directory/file/file conflict due to directory rename' '
                git ls-files -u >out &&
                test_line_count = 1 out &&
                git ls-files -o >out &&
-               test_line_count = 2 out &&
-
-               git rev-parse >actual \
-                       :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d :0:y/d/e &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_line_count = 1 out &&
+
+                       git rev-parse >actual \
+                           :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d~HEAD :0:y/d/e
+               else
+                       test_line_count = 2 out &&
+
+                       git rev-parse >actual \
+                           :0:y/b :0:y/c :0:z/d :0:y/f :2:y/d      :0:y/d/e
+               fi &&
                git rev-parse >expect \
                         O:z/b  O:z/c  B:z/d  B:z/f  A:y/d  B:y/d/e &&
                test_cmp expect actual &&
@@ -1262,35 +1280,144 @@ test_expect_success '6a: Tricky rename/delete' '
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
                test_i18ngrep "CONFLICT (rename/delete).*z/c.*y/c" out &&
 
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git ls-files -s >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >actual \
+                               :0:y/b :1:y/c :3:y/c &&
+                       git rev-parse >expect \
+                                O:z/b  O:z/c  O:z/c
+               else
+                       git ls-files -s >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >actual \
+                               :0:y/b :3:y/c &&
+                       git rev-parse >expect \
+                                O:z/b  O:z/c
+               fi &&
+               test_cmp expect actual
+       )
+'
+
+# Testcase 6b1, Same rename done on both sides
+#   (Related to testcase 6b2 and 8e)
+#   Commit O: z/{b,c,d,e}
+#   Commit A: y/{b,c,d}, x/e
+#   Commit B: y/{b,c,d}, z/{e,f}
+#   Expected: y/{b,c,d,f}, x/e
+#   Note: Directory rename detection says A renamed z/ -> y/ (3 paths renamed
+#         to y/ and only 1 renamed to x/), therefore the new file 'z/f' in B
+#         should be moved to 'y/f'.
+#
+#         This is a bit of an edge case where any behavior might surprise users,
+#         whether that is treating A as renaming z/ -> y/, treating A as renaming
+#         z/ -> x/, or treating A as not doing any directory rename.  However, I
+#         think this answer is the least confusing and most consistent with the
+#         rules elsewhere.
+#
+#         A note about z/ -> x/, since it may not be clear how that could come
+#         about: If we were to ignore files renamed by both sides
+#         (i.e. z/{b,c,d}), as directory rename detection did in git-2.18 thru
+#         at least git-2.28, then we would note there are no renames from z/ to
+#         y/ and one rename from z/ to x/ and thus come to the conclusion that
+#         A renamed z/ -> x/.  This seems more confusing for end users than a
+#         rename of z/ to y/, it makes directory rename detection behavior
+#         harder for them to predict.  As such, we modified the rule, changed
+#         the behavior on testcases 6b2 and 8e, and introduced this 6b1 testcase.
+
+test_setup_6b1 () {
+       test_create_repo 6b1 &&
+       (
+               cd 6b1 &&
+
+               mkdir z &&
+               echo b >z/b &&
+               echo c >z/c &&
+               echo d >z/d &&
+               echo e >z/e &&
+               git add z &&
+               test_tick &&
+               git commit -m "O" &&
+
+               git branch O &&
+               git branch A &&
+               git branch B &&
+
+               git checkout A &&
+               git mv z y &&
+               mkdir x &&
+               git mv y/e x/e &&
+               test_tick &&
+               git commit -m "A" &&
+
+               git checkout B &&
+               git mv z y &&
+               mkdir z &&
+               git mv y/e z/e &&
+               echo f >z/f &&
+               git add z/f &&
+               test_tick &&
+               git commit -m "B"
+       )
+}
+
+test_expect_merge_algorithm failure success '6b1: Same renames done on both sides, plus another rename' '
+       test_setup_6b1 &&
+       (
+               cd 6b1 &&
+
+               git checkout A^0 &&
+
+               git -c merge.directoryRenames=true merge -s recursive B^0 &&
+
                git ls-files -s >out &&
-               test_line_count = 2 out &&
+               test_line_count = 5 out &&
                git ls-files -u >out &&
-               test_line_count = 1 out &&
+               test_line_count = 0 out &&
                git ls-files -o >out &&
                test_line_count = 1 out &&
 
                git rev-parse >actual \
-                       :0:y/b :3:y/c &&
+                       HEAD:y/b HEAD:y/c HEAD:y/d HEAD:x/e HEAD:y/f &&
                git rev-parse >expect \
-                        O:z/b  O:z/c &&
+                       O:z/b    O:z/c    O:z/d    O:z/e    B:z/f &&
                test_cmp expect actual
        )
 '
 
-# Testcase 6b, Same rename done on both sides
+# Testcase 6b2, Same rename done on both sides
 #   (Related to testcases 6c and 8e)
 #   Commit O: z/{b,c}
 #   Commit A: y/{b,c}
 #   Commit B: y/{b,c}, z/d
-#   Expected: y/{b,c}, z/d
-#   Note: If we did directory rename detection here, we'd move z/d into y/,
-#         but B did that rename and still decided to put the file into z/,
-#         so we probably shouldn't apply directory rename detection for it.
-
-test_setup_6b () {
-       test_create_repo 6b &&
+#   Expected: y/{b,c,d}
+#   Alternate: y/{b,c}, z/d
+#   Note: Directory rename detection says A renamed z/ -> y/, therefore the new
+#         file 'z/d' in B should be moved to 'y/d'.
+#
+#         We could potentially ignore the renames of z/{b,c} on side A since
+#         those were renamed on both sides.  However, it's a bit of a corner
+#         case because what if there was also a z/e that side A moved to x/e
+#         and side B left alone?  If we used the "ignore renames done on both
+#         sides" logic, then we'd compute that A renamed z/ -> x/, and move
+#         z/d to x/d.  That seems more surprising and uglier than allowing
+#         the z/ -> y/ rename.
+
+test_setup_6b2 () {
+       test_create_repo 6b2 &&
        (
-               cd 6b &&
+               cd 6b2 &&
 
                mkdir z &&
                echo b >z/b &&
@@ -1318,10 +1445,10 @@ test_setup_6b () {
        )
 }
 
-test_expect_success '6b: Same rename done on both sides' '
-       test_setup_6b &&
+test_expect_merge_algorithm failure success '6b2: Same rename done on both sides' '
+       test_setup_6b2 &&
        (
-               cd 6b &&
+               cd 6b2 &&
 
                git checkout A^0 &&
 
@@ -1335,7 +1462,7 @@ test_expect_success '6b: Same rename done on both sides' '
                test_line_count = 1 out &&
 
                git rev-parse >actual \
-                       HEAD:y/b HEAD:y/c HEAD:z/d &&
+                       HEAD:y/b HEAD:y/c HEAD:y/d &&
                git rev-parse >expect \
                        O:z/b    O:z/c    B:z/d &&
                test_cmp expect actual
@@ -1343,7 +1470,7 @@ test_expect_success '6b: Same rename done on both sides' '
 '
 
 # Testcase 6c, Rename only done on same side
-#   (Related to testcases 6b and 8e)
+#   (Related to testcases 6b1, 6b2, and 8e)
 #   Commit O: z/{b,c}
 #   Commit A: z/{b,c} (no change)
 #   Commit B: y/{b,c}, z/d
@@ -1705,11 +1832,20 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
                git cat-file -p :2:y/d >expect &&
                git cat-file -p :3:y/d >other &&
                >empty &&
-               test_must_fail git merge-file \
-                       -L "HEAD" \
-                       -L "" \
-                       -L "B^0" \
-                       expect empty other &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_must_fail git merge-file \
+                               -L "HEAD:y/d" \
+                               -L "" \
+                               -L "B^0:z/d" \
+                               expect empty other
+               else
+                       test_must_fail git merge-file \
+                               -L "HEAD" \
+                               -L "" \
+                               -L "B^0" \
+                               expect empty other
+               fi &&
                test_cmp expect y/d
        )
 '
@@ -1831,17 +1967,32 @@ test_expect_success '7d: transitive rename involved in rename/delete; how is it
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
                test_i18ngrep "CONFLICT (rename/delete).*x/d.*y/d" out &&
 
-               git ls-files -s >out &&
-               test_line_count = 3 out &&
-               git ls-files -u >out &&
-               test_line_count = 1 out &&
-               git ls-files -o >out &&
-               test_line_count = 1 out &&
-
-               git rev-parse >actual \
-                       :0:y/b :0:y/c :3:y/d &&
-               git rev-parse >expect \
-                        O:z/b  O:z/c  O:x/d &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git ls-files -s >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >actual \
+                               :0:y/b :0:y/c :1:y/d :3:y/d &&
+                       git rev-parse >expect \
+                                O:z/b  O:z/c  O:x/d  O:x/d
+               else
+                       git ls-files -s >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >actual \
+                               :0:y/b :0:y/c :3:y/d &&
+                       git rev-parse >expect \
+                                O:z/b  O:z/c  O:x/d
+               fi &&
                test_cmp expect actual
        )
 '
@@ -1922,17 +2073,32 @@ test_expect_success '7e: transitive rename in rename/delete AND dirs in the way'
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
                test_i18ngrep "CONFLICT (rename/delete).*x/d.*y/d" out &&
 
-               git ls-files -s >out &&
-               test_line_count = 5 out &&
-               git ls-files -u >out &&
-               test_line_count = 1 out &&
-               git ls-files -o >out &&
-               test_line_count = 2 out &&
-
-               git rev-parse >actual \
-                       :0:x/d/f :0:y/d/g :0:y/b :0:y/c :3:y/d &&
-               git rev-parse >expect \
-                        A:x/d/f  A:y/d/g  O:z/b  O:z/c  O:x/d &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       git ls-files -s >out &&
+                       test_line_count = 6 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 1 out &&
+
+                       git rev-parse >actual \
+                               :0:x/d/f :0:y/d/g :0:y/b :0:y/c :1:y/d~B^0 :3:y/d~B^0 &&
+                       git rev-parse >expect \
+                                A:x/d/f  A:y/d/g  O:z/b  O:z/c  O:x/d      O:x/d
+               else
+                       git ls-files -s >out &&
+                       test_line_count = 5 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 2 out &&
+
+                       git rev-parse >actual \
+                               :0:x/d/f :0:y/d/g :0:y/b :0:y/c :3:y/d &&
+                       git rev-parse >expect \
+                                A:x/d/f  A:y/d/g  O:z/b  O:z/c  O:x/d
+               fi &&
                test_cmp expect actual &&
 
                git hash-object y/d~B^0 >actual &&
@@ -2269,14 +2435,22 @@ test_expect_success '8d: rename/delete...or not?' '
 # Notes: In commit A, directory z got renamed to y.  In commit B, directory z
 #        did NOT get renamed; the directory is still present; instead it is
 #        considered to have just renamed a subset of paths in directory z
-#        elsewhere.  However, this is much like testcase 6b (where commit B
-#        moves all the original paths out of z/ but opted to keep d
-#        within z/).  This makes it hard to judge where d should end up.
+#        elsewhere.  This is much like testcase 6b2 (where commit B moves all
+#        the original paths out of z/ but opted to keep d within z/).
+#
+#        It was not clear in the past what should be done with this testcase;
+#        in fact, I noted that I "just picked one" previously.  However,
+#        following the new logic for testcase 6b2, we should take the rename
+#        and move z/d to y/d.
 #
-#        It's possible that users would get confused about this, but what
-#        should we do instead?  It's not at all clear to me whether z/d or
-#        y/d or something else is a better resolution here, and other cases
-#        start getting really tricky, so I just picked one.
+#        6b1, 6b2, and this case are definitely somewhat fuzzy in terms of
+#        whether they are optimal for end users, but (a) the default for
+#        directory rename detection is to mark these all as conflicts
+#        anyway, (b) it feels like this is less prone to higher order corner
+#        case confusion, and (c) the current algorithm requires less global
+#        knowledge (i.e. less coupling in the algorithm between renames done
+#        on both sides) which thus means users are better able to predict
+#        the behavior, and predict it without computing as many details.
 
 test_setup_8e () {
        test_create_repo 8e &&
@@ -3040,6 +3214,7 @@ test_expect_success '10a: Overwrite untracked with normal rename/delete' '
                echo important >z/d &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
+               test_path_is_missing .git/MERGE_HEAD &&
                test_i18ngrep "The following untracked working tree files would be overwritten by merge" err &&
 
                git ls-files -s >out &&
@@ -3109,21 +3284,34 @@ test_expect_success '10b: Overwrite untracked with dir rename + delete' '
                echo contents >y/e &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out &&
-               test_i18ngrep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out &&
-
-               git ls-files -s >out &&
-               test_line_count = 3 out &&
-               git ls-files -u >out &&
-               test_line_count = 2 out &&
-               git ls-files -o >out &&
-               test_line_count = 5 out &&
-
-               git rev-parse >actual \
-                       :0:y/b :3:y/d :3:y/e &&
-               git rev-parse >expect \
-                       O:z/b  O:z/c  B:z/e &&
-               test_cmp expect actual &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 0 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 5 out
+               else
+                       test_i18ngrep "CONFLICT (rename/delete).*Version B\^0 of y/d left in tree at y/d~B\^0" out &&
+                       test_i18ngrep "Error: Refusing to lose untracked file at y/e; writing to y/e~B\^0 instead" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 5 out &&
+
+                       git rev-parse >actual \
+                               :0:y/b :3:y/d :3:y/e &&
+                       git rev-parse >expect \
+                               O:z/b  O:z/c  B:z/e &&
+                       test_cmp expect actual
+               fi &&
 
                echo very >expect &&
                test_cmp expect y/c &&
@@ -3186,25 +3374,38 @@ test_expect_success '10c1: Overwrite untracked with dir rename/rename(1to2)' '
                echo important >y/c &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
-               test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out &&
-
-               git ls-files -s >out &&
-               test_line_count = 6 out &&
-               git ls-files -u >out &&
-               test_line_count = 3 out &&
-               git ls-files -o >out &&
-               test_line_count = 3 out &&
-
-               git rev-parse >actual \
-                       :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :3:y/c &&
-               git rev-parse >expect \
-                        O:z/a  O:z/b  O:x/d  O:x/c  O:x/c  O:x/c &&
-               test_cmp expect actual &&
-
-               git hash-object y/c~B^0 >actual &&
-               git rev-parse O:x/c >expect &&
-               test_cmp expect actual &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 0 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out
+               else
+                       test_i18ngrep "CONFLICT (rename/rename)" out &&
+                       test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~B\^0 instead" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 6 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out &&
+
+                       git rev-parse >actual \
+                               :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :3:y/c &&
+                       git rev-parse >expect \
+                                O:z/a  O:z/b  O:x/d  O:x/c  O:x/c  O:x/c &&
+                       test_cmp expect actual &&
+
+                       git hash-object y/c~B^0 >actual &&
+                       git rev-parse O:x/c >expect &&
+                       test_cmp expect actual
+               fi &&
 
                echo important >expect &&
                test_cmp expect y/c
@@ -3224,25 +3425,38 @@ test_expect_success '10c2: Overwrite untracked with dir rename/rename(1to2), oth
                echo important >y/c &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive A^0 >out 2>err &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
-               test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out &&
-
-               git ls-files -s >out &&
-               test_line_count = 6 out &&
-               git ls-files -u >out &&
-               test_line_count = 3 out &&
-               git ls-files -o >out &&
-               test_line_count = 3 out &&
-
-               git rev-parse >actual \
-                       :0:y/a :0:y/b :0:x/d :1:x/c :3:w/c :2:y/c &&
-               git rev-parse >expect \
-                        O:z/a  O:z/b  O:x/d  O:x/c  O:x/c  O:x/c &&
-               test_cmp expect actual &&
-
-               git hash-object y/c~HEAD >actual &&
-               git rev-parse O:x/c >expect &&
-               test_cmp expect actual &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 0 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out
+               else
+                       test_i18ngrep "CONFLICT (rename/rename)" out &&
+                       test_i18ngrep "Refusing to lose untracked file at y/c; adding as y/c~HEAD instead" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 6 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out &&
+
+                       git rev-parse >actual \
+                               :0:y/a :0:y/b :0:x/d :1:x/c :3:w/c :2:y/c &&
+                       git rev-parse >expect \
+                                O:z/a  O:z/b  O:x/d  O:x/c  O:x/c  O:x/c &&
+                       test_cmp expect actual &&
+
+                       git hash-object y/c~HEAD >actual &&
+                       git rev-parse O:x/c >expect &&
+                       test_cmp expect actual
+               fi &&
 
                echo important >expect &&
                test_cmp expect y/c
@@ -3300,37 +3514,50 @@ test_expect_success '10d: Delete untracked with dir rename/rename(2to1)' '
                echo important >y/wham &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
-               test_i18ngrep "Refusing to lose untracked file at y/wham" out &&
-
-               git ls-files -s >out &&
-               test_line_count = 6 out &&
-               git ls-files -u >out &&
-               test_line_count = 2 out &&
-               git ls-files -o >out &&
-               test_line_count = 3 out &&
-
-               git rev-parse >actual \
-                       :0:y/a :0:y/b :0:y/d :0:y/e :2:y/wham :3:y/wham &&
-               git rev-parse >expect \
-                        O:z/a  O:z/b  O:x/d  O:x/e  O:z/c     O:x/f &&
-               test_cmp expect actual &&
-
-               test_must_fail git rev-parse :1:y/wham &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: The following untracked working tree files would be overwritten by merge" err &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 6 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 0 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out
+               else
+                       test_i18ngrep "CONFLICT (rename/rename)" out &&
+                       test_i18ngrep "Refusing to lose untracked file at y/wham" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 6 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out &&
+
+                       git rev-parse >actual \
+                               :0:y/a :0:y/b :0:y/d :0:y/e :2:y/wham :3:y/wham &&
+                       git rev-parse >expect \
+                                O:z/a  O:z/b  O:x/d  O:x/e  O:z/c     O:x/f &&
+                       test_cmp expect actual &&
+
+                       test_must_fail git rev-parse :1:y/wham &&
+
+                       # Test that two-way merge in y/wham~merged is as expected
+                       git cat-file -p :2:y/wham >expect &&
+                       git cat-file -p :3:y/wham >other &&
+                       >empty &&
+                       test_must_fail git merge-file \
+                               -L "HEAD" \
+                               -L "" \
+                               -L "B^0" \
+                               expect empty other &&
+                       test_cmp expect y/wham~merged
+               fi &&
 
                echo important >expect &&
-               test_cmp expect y/wham &&
-
-               # Test that the two-way merge in y/wham~merged is as expected
-               git cat-file -p :2:y/wham >expect &&
-               git cat-file -p :3:y/wham >other &&
-               >empty &&
-               test_must_fail git merge-file \
-                       -L "HEAD" \
-                       -L "" \
-                       -L "B^0" \
-                       expect empty other &&
-               test_cmp expect y/wham~merged
+               test_cmp expect y/wham
        )
 '
 
@@ -3369,7 +3596,7 @@ test_setup_10e () {
        )
 }
 
-test_expect_failure '10e: Does git complain about untracked file that is not really in the way?' '
+test_expect_merge_algorithm failure success '10e: Does git complain about untracked file that is not really in the way?' '
        test_setup_10e &&
        (
                cd 10e &&
@@ -3460,28 +3687,35 @@ test_expect_success '11a: Avoid losing dirty contents with simple rename' '
                echo stuff >>z/c &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+               else
+                       test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out &&
+
+                       git rev-parse >actual \
+                               :0:z/a :2:z/c &&
+                       git rev-parse >expect \
+                                O:z/a  B:z/b &&
+                       test_cmp expect actual &&
+
+                       git hash-object z/c~HEAD >actual &&
+                       git rev-parse B:z/b >expect &&
+                       test_cmp expect actual
+               fi &&
 
                test_seq 1 10 >expected &&
                echo stuff >>expected &&
-               test_cmp expected z/c &&
-
-               git ls-files -s >out &&
-               test_line_count = 2 out &&
-               git ls-files -u >out &&
-               test_line_count = 1 out &&
-               git ls-files -o >out &&
-               test_line_count = 4 out &&
+               test_cmp expected z/c
 
-               git rev-parse >actual \
-                       :0:z/a :2:z/c &&
-               git rev-parse >expect \
-                        O:z/a  B:z/b &&
-               test_cmp expect actual &&
-
-               git hash-object z/c~HEAD >actual &&
-               git rev-parse B:z/b >expect &&
-               test_cmp expect actual
        )
 '
 
@@ -3532,32 +3766,39 @@ test_expect_success '11b: Avoid losing dirty file involved in directory rename'
                git checkout A^0 &&
                echo stuff >>z/c &&
 
-               git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+               else
+                       git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
+                       test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 3 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 0 out &&
+                       git ls-files -m >out &&
+                       test_line_count = 0 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out &&
+
+                       git rev-parse >actual \
+                               :0:x/b :0:y/a :0:y/c &&
+                       git rev-parse >expect \
+                                O:x/b  O:z/a  B:x/c &&
+                       test_cmp expect actual &&
+
+                       git hash-object y/c >actual &&
+                       git rev-parse B:x/c >expect &&
+                       test_cmp expect actual
+               fi &&
 
                grep -q stuff z/c &&
                test_seq 1 10 >expected &&
                echo stuff >>expected &&
-               test_cmp expected z/c &&
-
-               git ls-files -s >out &&
-               test_line_count = 3 out &&
-               git ls-files -u >out &&
-               test_line_count = 0 out &&
-               git ls-files -m >out &&
-               test_line_count = 0 out &&
-               git ls-files -o >out &&
-               test_line_count = 4 out &&
-
-               git rev-parse >actual \
-                       :0:x/b :0:y/a :0:y/c &&
-               git rev-parse >expect \
-                        O:x/b  O:z/a  B:x/c &&
-               test_cmp expect actual &&
-
-               git hash-object y/c >actual &&
-               git rev-parse B:x/c >expect &&
-               test_cmp expect actual
+               test_cmp expected z/c
        )
 '
 
@@ -3609,7 +3850,13 @@ test_expect_success '11c: Avoid losing not-uptodate with rename + D/F conflict'
                echo stuff >>y/c &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "following files would be overwritten by merge" err &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+               else
+                       test_i18ngrep "following files would be overwritten by merge" err
+               fi &&
 
                grep -q stuff y/c &&
                test_seq 1 10 >expected &&
@@ -3677,29 +3924,35 @@ test_expect_success '11d: Avoid losing not-uptodate with rename + D/F conflict'
                echo stuff >>z/c &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+               else
+                       test_i18ngrep "Refusing to lose dirty file at z/c" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 1 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 4 out &&
+
+                       git rev-parse >actual \
+                               :0:x/b :0:y/a :0:y/c/d :3:y/c &&
+                       git rev-parse >expect \
+                                O:x/b  O:z/a  B:y/c/d  B:x/c &&
+                       test_cmp expect actual &&
+
+                       git hash-object y/c~HEAD >actual &&
+                       git rev-parse B:x/c >expect &&
+                       test_cmp expect actual
+               fi &&
 
                grep -q stuff z/c &&
                test_seq 1 10 >expected &&
                echo stuff >>expected &&
-               test_cmp expected z/c &&
-
-               git ls-files -s >out &&
-               test_line_count = 4 out &&
-               git ls-files -u >out &&
-               test_line_count = 1 out &&
-               git ls-files -o >out &&
-               test_line_count = 5 out &&
-
-               git rev-parse >actual \
-                       :0:x/b :0:y/a :0:y/c/d :3:y/c &&
-               git rev-parse >expect \
-                        O:x/b  O:z/a  B:y/c/d  B:x/c &&
-               test_cmp expect actual &&
-
-               git hash-object y/c~HEAD >actual &&
-               git rev-parse B:x/c >expect &&
-               test_cmp expect actual
+               test_cmp expected z/c
        )
 '
 
@@ -3757,37 +4010,43 @@ test_expect_success '11e: Avoid deleting not-uptodate with dir rename/rename(1to
                echo mods >>y/c &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
-               test_i18ngrep "Refusing to lose dirty file at y/c" out &&
-
-               git ls-files -s >out &&
-               test_line_count = 7 out &&
-               git ls-files -u >out &&
-               test_line_count = 4 out &&
-               git ls-files -o >out &&
-               test_line_count = 3 out &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+               else
+                       test_i18ngrep "CONFLICT (rename/rename)" out &&
+                       test_i18ngrep "Refusing to lose dirty file at y/c" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 7 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out &&
+
+                       git rev-parse >actual \
+                               :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :2:y/c :3:y/c &&
+                       git rev-parse >expect \
+                                O:z/a  O:z/b  O:x/d  O:x/c  O:x/c  A:y/c  O:x/c &&
+                       test_cmp expect actual &&
+
+                       # See if y/c~merged has expected contents; requires manually
+                       # doing the expected file merge
+                       git cat-file -p A:y/c >c1 &&
+                       git cat-file -p B:z/c >c2 &&
+                       >empty &&
+                       test_must_fail git merge-file \
+                               -L "HEAD" \
+                               -L "" \
+                               -L "B^0" \
+                               c1 empty c2 &&
+                       test_cmp c1 y/c~merged
+               fi &&
 
                echo different >expected &&
                echo mods >>expected &&
-               test_cmp expected y/c &&
-
-               git rev-parse >actual \
-                       :0:y/a :0:y/b :0:x/d :1:x/c :2:w/c :2:y/c :3:y/c &&
-               git rev-parse >expect \
-                        O:z/a  O:z/b  O:x/d  O:x/c  O:x/c  A:y/c  O:x/c &&
-               test_cmp expect actual &&
-
-               # See if y/c~merged has expected contents; requires manually
-               # doing the expected file merge
-               git cat-file -p A:y/c >c1 &&
-               git cat-file -p B:z/c >c2 &&
-               >empty &&
-               test_must_fail git merge-file \
-                       -L "HEAD" \
-                       -L "" \
-                       -L "B^0" \
-                       c1 empty c2 &&
-               test_cmp c1 y/c~merged
+               test_cmp expected y/c
        )
 '
 
@@ -3840,38 +4099,44 @@ test_expect_success '11f: Avoid deleting not-uptodate with dir rename/rename(2to
                echo important >>y/wham &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out 2>err &&
-               test_i18ngrep "CONFLICT (rename/rename)" out &&
-               test_i18ngrep "Refusing to lose dirty file at y/wham" out &&
-
-               git ls-files -s >out &&
-               test_line_count = 4 out &&
-               git ls-files -u >out &&
-               test_line_count = 2 out &&
-               git ls-files -o >out &&
-               test_line_count = 3 out &&
+               if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+               then
+                       test_path_is_missing .git/MERGE_HEAD &&
+                       test_i18ngrep "error: Your local changes to the following files would be overwritten by merge" err
+               else
+                       test_i18ngrep "CONFLICT (rename/rename)" out &&
+                       test_i18ngrep "Refusing to lose dirty file at y/wham" out &&
+
+                       git ls-files -s >out &&
+                       test_line_count = 4 out &&
+                       git ls-files -u >out &&
+                       test_line_count = 2 out &&
+                       git ls-files -o >out &&
+                       test_line_count = 3 out &&
+
+                       test_must_fail git rev-parse :1:y/wham &&
+
+                       git rev-parse >actual \
+                               :0:y/a :0:y/b :2:y/wham :3:y/wham &&
+                       git rev-parse >expect \
+                                O:z/a  O:z/b  O:x/c     O:x/d &&
+                       test_cmp expect actual &&
+
+                       # Test that two-way merge in y/wham~merged is as expected
+                       git cat-file -p :2:y/wham >expect &&
+                       git cat-file -p :3:y/wham >other &&
+                       >empty &&
+                       test_must_fail git merge-file \
+                               -L "HEAD" \
+                               -L "" \
+                               -L "B^0" \
+                               expect empty other &&
+                       test_cmp expect y/wham~merged
+               fi &&
 
                test_seq 1 10 >expected &&
                echo important >>expected &&
-               test_cmp expected y/wham &&
-
-               test_must_fail git rev-parse :1:y/wham &&
-
-               git rev-parse >actual \
-                       :0:y/a :0:y/b :2:y/wham :3:y/wham &&
-               git rev-parse >expect \
-                        O:z/a  O:z/b  O:x/c     O:x/d &&
-               test_cmp expect actual &&
-
-               # Test that the two-way merge in y/wham~merged is as expected
-               git cat-file -p :2:y/wham >expect &&
-               git cat-file -p :3:y/wham >other &&
-               >empty &&
-               test_must_fail git merge-file \
-                       -L "HEAD" \
-                       -L "" \
-                       -L "B^0" \
-                       expect empty other &&
-               test_cmp expect y/wham~merged
+               test_cmp expected y/wham
        )
 '
 
@@ -3947,31 +4212,124 @@ test_expect_success '12a: Moving one directory hierarchy into another' '
        )
 '
 
-# Testcase 12b, Moving two directory hierarchies into each other
+# Testcase 12b1, Moving two directory hierarchies into each other
 #   (Related to testcases 1c and 12c)
 #   Commit O: node1/{leaf1, leaf2}, node2/{leaf3, leaf4}
 #   Commit A: node1/{leaf1, leaf2, node2/{leaf3, leaf4}}
 #   Commit B: node2/{leaf3, leaf4, node1/{leaf1, leaf2}}
-#   Expected: node1/node2/node1/{leaf1, leaf2},
+#   Expected: node1/node2/{leaf3, leaf4}
+#             node2/node1/{leaf1, leaf2}
+#   NOTE: If there were new files added to the old node1/ or node2/ directories,
+#         then we would need to detect renames for those directories and would
+#         find that:
+#             commit A renames node2/ -> node1/node2/
+#             commit B renames node1/ -> node2/node1/
+#         Applying those directory renames to the initial result (making all
+#         four paths experience a transitive renaming), yields
+#             node1/node2/node1/{leaf1, leaf2}
 #             node2/node1/node2/{leaf3, leaf4}
+#         as the result.  It may be really weird to have two directories
+#         rename each other, but simple rules give weird results when given
+#         weird inputs.  HOWEVER, the "If" at the beginning of those NOTE was
+#         false; there were no new files added and thus there is no directory
+#         rename detection to perform.  As such, we just have simple renames
+#         and the expected answer is:
+#             node1/node2/{leaf3, leaf4}
+#             node2/node1/{leaf1, leaf2}
+
+test_setup_12b1 () {
+       test_create_repo 12b1 &&
+       (
+               cd 12b1 &&
+
+               mkdir -p node1 node2 &&
+               echo leaf1 >node1/leaf1 &&
+               echo leaf2 >node1/leaf2 &&
+               echo leaf3 >node2/leaf3 &&
+               echo leaf4 >node2/leaf4 &&
+               git add node1 node2 &&
+               test_tick &&
+               git commit -m "O" &&
+
+               git branch O &&
+               git branch A &&
+               git branch B &&
+
+               git checkout A &&
+               git mv node2/ node1/ &&
+               test_tick &&
+               git commit -m "A" &&
+
+               git checkout B &&
+               git mv node1/ node2/ &&
+               test_tick &&
+               git commit -m "B"
+       )
+}
+
+test_expect_merge_algorithm failure success '12b1: Moving two directory hierarchies into each other' '
+       test_setup_12b1 &&
+       (
+               cd 12b1 &&
+
+               git checkout A^0 &&
+
+               git -c merge.directoryRenames=true merge -s recursive B^0 &&
+
+               git ls-files -s >out &&
+               test_line_count = 4 out &&
+
+               git rev-parse >actual \
+                       HEAD:node2/node1/leaf1 \
+                       HEAD:node2/node1/leaf2 \
+                       HEAD:node1/node2/leaf3 \
+                       HEAD:node1/node2/leaf4 &&
+               git rev-parse >expect \
+                       O:node1/leaf1 \
+                       O:node1/leaf2 \
+                       O:node2/leaf3 \
+                       O:node2/leaf4 &&
+               test_cmp expect actual
+       )
+'
+
+# Testcase 12b2, Moving two directory hierarchies into each other
+#   (Related to testcases 1c and 12c)
+#   Commit O: node1/{leaf1, leaf2}, node2/{leaf3, leaf4}
+#   Commit A: node1/{leaf1, leaf2, leaf5, node2/{leaf3, leaf4}}
+#   Commit B: node2/{leaf3, leaf4, leaf6, node1/{leaf1, leaf2}}
+#   Expected: node1/node2/{node1/{leaf1, leaf2}, leaf6}
+#             node2/node1/{node2/{leaf3, leaf4}, leaf5}
 #   NOTE: Without directory renames, we would expect
-#                   node2/node1/{leaf1, leaf2},
-#                   node1/node2/{leaf3, leaf4}
+#             A: node2/leaf3 -> node1/node2/leaf3
+#             A: node2/leaf1 -> node1/node2/leaf4
+#             A: Adds           node1/leaf5
+#             B: node1/leaf1 -> node2/node1/leaf1
+#             B: node1/leaf2 -> node2/node1/leaf2
+#             B: Adds           node2/leaf6
 #         with directory rename detection, we note that
 #             commit A renames node2/ -> node1/node2/
 #             commit B renames node1/ -> node2/node1/
-#         therefore, applying those directory renames to the initial result
-#         (making all four paths experience a transitive renaming), yields
-#         the expected result.
+#         therefore, applying A's directory rename to the paths added in B gives:
+#             B: node1/leaf1 -> node1/node2/node1/leaf1
+#             B: node1/leaf2 -> node1/node2/node1/leaf2
+#             B: Adds           node1/node2/leaf6
+#         and applying B's directory rename to the paths added in A gives:
+#             A: node2/leaf3 -> node2/node1/node2/leaf3
+#             A: node2/leaf1 -> node2/node1/node2/leaf4
+#             A: Adds           node2/node1/leaf5
+#         resulting in the expected
+#             node1/node2/{node1/{leaf1, leaf2}, leaf6}
+#             node2/node1/{node2/{leaf3, leaf4}, leaf5}
 #
 #         You may ask, is it weird to have two directories rename each other?
 #         To which, I can do no more than shrug my shoulders and say that
 #         even simple rules give weird results when given weird inputs.
 
-test_setup_12b () {
-       test_create_repo 12b &&
+test_setup_12b2 () {
+       test_create_repo 12b2 &&
        (
-               cd 12b &&
+               cd 12b2 &&
 
                mkdir -p node1 node2 &&
                echo leaf1 >node1/leaf1 &&
@@ -3988,43 +4346,51 @@ test_setup_12b () {
 
                git checkout A &&
                git mv node2/ node1/ &&
+               echo leaf5 >node1/leaf5 &&
+               git add node1/leaf5 &&
                test_tick &&
                git commit -m "A" &&
 
                git checkout B &&
                git mv node1/ node2/ &&
+               echo leaf6 >node2/leaf6 &&
+               git add node2/leaf6 &&
                test_tick &&
                git commit -m "B"
        )
 }
 
-test_expect_success '12b: Moving two directory hierarchies into each other' '
-       test_setup_12b &&
+test_expect_success '12b2: Moving two directory hierarchies into each other' '
+       test_setup_12b2 &&
        (
-               cd 12b &&
+               cd 12b2 &&
 
                git checkout A^0 &&
 
                git -c merge.directoryRenames=true merge -s recursive B^0 &&
 
                git ls-files -s >out &&
-               test_line_count = 4 out &&
+               test_line_count = 6 out &&
 
                git rev-parse >actual \
                        HEAD:node1/node2/node1/leaf1 \
                        HEAD:node1/node2/node1/leaf2 \
                        HEAD:node2/node1/node2/leaf3 \
-                       HEAD:node2/node1/node2/leaf4 &&
+                       HEAD:node2/node1/node2/leaf4 \
+                       HEAD:node2/node1/leaf5       \
+                       HEAD:node1/node2/leaf6       &&
                git rev-parse >expect \
                        O:node1/leaf1 \
                        O:node1/leaf2 \
                        O:node2/leaf3 \
-                       O:node2/leaf4 &&
+                       O:node2/leaf4 \
+                       A:node1/leaf5 \
+                       B:node2/leaf6 &&
                test_cmp expect actual
        )
 '
 
-# Testcase 12c, Moving two directory hierarchies into each other w/ content merge
+# Testcase 12c1, Moving two directory hierarchies into each other w/ content merge
 #   (Related to testcase 12b)
 #   Commit O: node1/{       leaf1_1, leaf2_1}, node2/{leaf3_1, leaf4_1}
 #   Commit A: node1/{       leaf1_2, leaf2_2,  node2/{leaf3_2, leaf4_2}}
@@ -4032,13 +4398,103 @@ test_expect_success '12b: Moving two directory hierarchies into each other' '
 #   Expected: Content merge conflicts for each of:
 #               node1/node2/node1/{leaf1, leaf2},
 #               node2/node1/node2/{leaf3, leaf4}
-#   NOTE: This is *exactly* like 12c, except that every path is modified on
+#   NOTE: This is *exactly* like 12b1, except that every path is modified on
 #         each side of the merge.
 
-test_setup_12c () {
-       test_create_repo 12c &&
+test_setup_12c1 () {
+       test_create_repo 12c1 &&
+       (
+               cd 12c1 &&
+
+               mkdir -p node1 node2 &&
+               printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf1\n" >node1/leaf1 &&
+               printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf2\n" >node1/leaf2 &&
+               printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf3\n" >node2/leaf3 &&
+               printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf4\n" >node2/leaf4 &&
+               git add node1 node2 &&
+               test_tick &&
+               git commit -m "O" &&
+
+               git branch O &&
+               git branch A &&
+               git branch B &&
+
+               git checkout A &&
+               git mv node2/ node1/ &&
+               for i in `git ls-files`; do echo side A >>$i; done &&
+               git add -u &&
+               test_tick &&
+               git commit -m "A" &&
+
+               git checkout B &&
+               git mv node1/ node2/ &&
+               for i in `git ls-files`; do echo side B >>$i; done &&
+               git add -u &&
+               test_tick &&
+               git commit -m "B"
+       )
+}
+
+test_expect_merge_algorithm failure success '12c1: Moving one directory hierarchy into another w/ content merge' '
+       test_setup_12c1 &&
+       (
+               cd 12c1 &&
+
+               git checkout A^0 &&
+
+               test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 &&
+
+               git ls-files -u >out &&
+               test_line_count = 12 out &&
+
+               git rev-parse >actual \
+                       :1:node2/node1/leaf1 \
+                       :1:node2/node1/leaf2 \
+                       :1:node1/node2/leaf3 \
+                       :1:node1/node2/leaf4 \
+                       :2:node2/node1/leaf1 \
+                       :2:node2/node1/leaf2 \
+                       :2:node1/node2/leaf3 \
+                       :2:node1/node2/leaf4 \
+                       :3:node2/node1/leaf1 \
+                       :3:node2/node1/leaf2 \
+                       :3:node1/node2/leaf3 \
+                       :3:node1/node2/leaf4 &&
+               git rev-parse >expect \
+                       O:node1/leaf1 \
+                       O:node1/leaf2 \
+                       O:node2/leaf3 \
+                       O:node2/leaf4 \
+                       A:node1/leaf1 \
+                       A:node1/leaf2 \
+                       A:node1/node2/leaf3 \
+                       A:node1/node2/leaf4 \
+                       B:node2/node1/leaf1 \
+                       B:node2/node1/leaf2 \
+                       B:node2/leaf3 \
+                       B:node2/leaf4 &&
+               test_cmp expect actual
+       )
+'
+
+# Testcase 12c2, Moving two directory hierarchies into each other w/ content merge
+#   (Related to testcase 12b)
+#   Commit O: node1/{       leaf1_1, leaf2_1}, node2/{leaf3_1, leaf4_1}
+#   Commit A: node1/{       leaf1_2, leaf2_2,  node2/{leaf3_2, leaf4_2}, leaf5}
+#   Commit B: node2/{node1/{leaf1_3, leaf2_3},        leaf3_3, leaf4_3,  leaf6}
+#   Expected: Content merge conflicts for each of:
+#               node1/node2/node1/{leaf1, leaf2}
+#               node2/node1/node2/{leaf3, leaf4}
+#             plus
+#               node2/node1/leaf5
+#               node1/node2/leaf6
+#   NOTE: This is *exactly* like 12b2, except that every path from O is modified
+#         on each side of the merge.
+
+test_setup_12c2 () {
+       test_create_repo 12c2 &&
        (
-               cd 12c &&
+               cd 12c2 &&
 
                mkdir -p node1 node2 &&
                printf "1\n2\n3\n4\n5\n6\n7\n8\nleaf1\n" >node1/leaf1 &&
@@ -4057,6 +4513,8 @@ test_setup_12c () {
                git mv node2/ node1/ &&
                for i in `git ls-files`; do echo side A >>$i; done &&
                git add -u &&
+               echo leaf5 >node1/leaf5 &&
+               git add node1/leaf5 &&
                test_tick &&
                git commit -m "A" &&
 
@@ -4064,20 +4522,24 @@ test_setup_12c () {
                git mv node1/ node2/ &&
                for i in `git ls-files`; do echo side B >>$i; done &&
                git add -u &&
+               echo leaf6 >node2/leaf6 &&
+               git add node2/leaf6 &&
                test_tick &&
                git commit -m "B"
        )
 }
 
-test_expect_success '12c: Moving one directory hierarchy into another w/ content merge' '
-       test_setup_12c &&
+test_expect_success '12c2: Moving one directory hierarchy into another w/ content merge' '
+       test_setup_12c2 &&
        (
-               cd 12c &&
+               cd 12c2 &&
 
                git checkout A^0 &&
 
                test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 &&
 
+               git ls-files -s >out &&
+               test_line_count = 14 out &&
                git ls-files -u >out &&
                test_line_count = 12 out &&
 
@@ -4093,7 +4555,9 @@ test_expect_success '12c: Moving one directory hierarchy into another w/ content
                        :3:node1/node2/node1/leaf1 \
                        :3:node1/node2/node1/leaf2 \
                        :3:node2/node1/node2/leaf3 \
-                       :3:node2/node1/node2/leaf4 &&
+                       :3:node2/node1/node2/leaf4 \
+                       :0:node2/node1/leaf5       \
+                       :0:node1/node2/leaf6       &&
                git rev-parse >expect \
                        O:node1/leaf1 \
                        O:node1/leaf2 \
@@ -4106,7 +4570,9 @@ test_expect_success '12c: Moving one directory hierarchy into another w/ content
                        B:node2/node1/leaf1 \
                        B:node2/node1/leaf2 \
                        B:node2/leaf3 \
-                       B:node2/leaf4 &&
+                       B:node2/leaf4 \
+                       A:node1/leaf5 \
+                       B:node2/leaf6 &&
                test_cmp expect actual
        )
 '
@@ -4227,6 +4693,208 @@ test_expect_success '12e: Rename/merge subdir into the root, variant 2' '
        )
 '
 
+# Testcase 12f, Rebase of patches with big directory rename
+#   Commit O:
+#              dir/subdir/{a,b,c,d,e_O,Makefile_TOP_O}
+#              dir/subdir/tweaked/{f,g,h,Makefile_SUB_O}
+#              dir/unchanged/<LOTS OF FILES>
+#   Commit A:
+#     (Remove f & g, move e into newsubdir, rename dir/->folder/, modify files)
+#              folder/subdir/{a,b,c,d,Makefile_TOP_A}
+#              folder/subdir/newsubdir/e_A
+#              folder/subdir/tweaked/{h,Makefile_SUB_A}
+#              folder/unchanged/<LOTS OF FILES>
+#   Commit B1:
+#     (add newfile.{c,py}, modify underscored files)
+#              dir/{a,b,c,d,e_B1,Makefile_TOP_B1,newfile.c}
+#              dir/tweaked/{f,g,h,Makefile_SUB_B1,newfile.py}
+#              dir/unchanged/<LOTS OF FILES>
+#   Commit B2:
+#     (Modify e further, add newfile.rs)
+#              dir/{a,b,c,d,e_B2,Makefile_TOP_B1,newfile.c,newfile.rs}
+#              dir/tweaked/{f,g,h,Makefile_SUB_B1,newfile.py}
+#              dir/unchanged/<LOTS OF FILES>
+#   Expected:
+#          B1-picked:
+#              folder/subdir/{a,b,c,d,Makefile_TOP_Merge1,newfile.c}
+#              folder/subdir/newsubdir/e_Merge1
+#              folder/subdir/tweaked/{h,Makefile_SUB_Merge1,newfile.py}
+#              folder/unchanged/<LOTS OF FILES>
+#          B2-picked:
+#              folder/subdir/{a,b,c,d,Makefile_TOP_Merge1,newfile.c,newfile.rs}
+#              folder/subdir/newsubdir/e_Merge2
+#              folder/subdir/tweaked/{h,Makefile_SUB_Merge1,newfile.py}
+#              folder/unchanged/<LOTS OF FILES>
+# Things being checked here:
+#   1. dir/subdir/newfile.c does not get pushed into folder/subdir/newsubdir/.
+#      dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d} looks like
+#          dir/ -> folder/,
+#      whereas dir/subdir/e -> folder/subdir/newsubdir/e looks like
+#          dir/subdir/ -> folder/subdir/newsubdir/
+#      and if we note that newfile.c is found in dir/subdir/, we might overlook
+#      the dir/ -> folder/ rule that has more weight.  Older git versions did
+#      this.
+#   2. The code to do trivial directory resolves.  Note that
+#      dir/subdir/unchanged/ is unchanged and can be deleted, and files in the
+#      new folder/subdir/unchanged/ are not needed as a target to any renames.
+#      Thus, in the second collect_merge_info_callback() we can just resolve
+#      these two directories trivially without recursing.)
+#   3. Exercising the codepaths for caching renames and deletes from one cherry
+#      pick and re-applying them in the subsequent one.
+
+test_setup_12f () {
+       test_create_repo 12f &&
+       (
+               cd 12f &&
+
+               mkdir -p dir/unchanged &&
+               mkdir -p dir/subdir/tweaked &&
+               echo a >dir/subdir/a &&
+               echo b >dir/subdir/b &&
+               echo c >dir/subdir/c &&
+               echo d >dir/subdir/d &&
+               test_seq 1 10 >dir/subdir/e &&
+               test_seq 10 20 >dir/subdir/Makefile &&
+               echo f >dir/subdir/tweaked/f &&
+               echo g >dir/subdir/tweaked/g &&
+               echo h >dir/subdir/tweaked/h &&
+               test_seq 20 30 >dir/subdir/tweaked/Makefile &&
+               for i in `test_seq 1 88`; do
+                       echo content $i >dir/unchanged/file_$i
+               done &&
+               git add . &&
+               git commit -m "O" &&
+
+               git branch O &&
+               git branch A &&
+               git branch B &&
+
+               git switch A &&
+               git rm dir/subdir/tweaked/f dir/subdir/tweaked/g &&
+               test_seq 2 10 >dir/subdir/e &&
+               test_seq 11 20 >dir/subdir/Makefile &&
+               test_seq 21 30 >dir/subdir/tweaked/Makefile &&
+               mkdir dir/subdir/newsubdir &&
+               git mv dir/subdir/e dir/subdir/newsubdir/ &&
+               git mv dir folder &&
+               git add . &&
+               git commit -m "A" &&
+
+               git switch B &&
+               mkdir dir/subdir/newsubdir/ &&
+               echo c code >dir/subdir/newfile.c &&
+               echo python code >dir/subdir/newsubdir/newfile.py &&
+               test_seq 1 11 >dir/subdir/e &&
+               test_seq 10 21 >dir/subdir/Makefile &&
+               test_seq 20 31 >dir/subdir/tweaked/Makefile &&
+               git add . &&
+               git commit -m "B1" &&
+
+               echo rust code >dir/subdir/newfile.rs &&
+               test_seq 1 12 >dir/subdir/e &&
+               git add . &&
+               git commit -m "B2"
+       )
+}
+
+test_expect_merge_algorithm failure success '12f: Trivial directory resolve, caching, all kinds of fun' '
+       test_setup_12f &&
+       (
+               cd 12f &&
+
+               git checkout A^0 &&
+               git branch Bmod B &&
+
+               GIT_TRACE2_PERF="$(pwd)/trace.output" git -c merge.directoryRenames=true rebase A Bmod &&
+
+               echo Checking the pick of B1... &&
+
+               test_must_fail git rev-parse Bmod~1:dir &&
+
+               git ls-tree -r Bmod~1 >out &&
+               test_line_count = 98 out &&
+
+               git diff --name-status A Bmod~1 >actual &&
+               q_to_tab >expect <<-\EOF &&
+               MQfolder/subdir/Makefile
+               AQfolder/subdir/newfile.c
+               MQfolder/subdir/newsubdir/e
+               AQfolder/subdir/newsubdir/newfile.py
+               MQfolder/subdir/tweaked/Makefile
+               EOF
+               test_cmp expect actual &&
+
+               # Three-way merged files
+               test_seq  2 11 >e_Merge1 &&
+               test_seq 11 21 >Makefile_TOP &&
+               test_seq 21 31 >Makefile_SUB &&
+               git hash-object >expect      \
+                       e_Merge1             \
+                       Makefile_TOP         \
+                       Makefile_SUB         &&
+               git rev-parse >actual              \
+                       Bmod~1:folder/subdir/newsubdir/e     \
+                       Bmod~1:folder/subdir/Makefile        \
+                       Bmod~1:folder/subdir/tweaked/Makefile &&
+               test_cmp expect actual &&
+
+               # New files showed up at the right location with right contents
+               git rev-parse >expect                \
+                       B~1:dir/subdir/newfile.c            \
+                       B~1:dir/subdir/newsubdir/newfile.py &&
+               git rev-parse >actual                      \
+                       Bmod~1:folder/subdir/newfile.c            \
+                       Bmod~1:folder/subdir/newsubdir/newfile.py &&
+               test_cmp expect actual &&
+
+               # Removed files
+               test_path_is_missing folder/subdir/tweaked/f &&
+               test_path_is_missing folder/subdir/tweaked/g &&
+
+               # Unchanged files or directories
+               git rev-parse >actual        \
+                       Bmod~1:folder/subdir/a          \
+                       Bmod~1:folder/subdir/b          \
+                       Bmod~1:folder/subdir/c          \
+                       Bmod~1:folder/subdir/d          \
+                       Bmod~1:folder/unchanged         \
+                       Bmod~1:folder/subdir/tweaked/h &&
+               git rev-parse >expect          \
+                       O:dir/subdir/a         \
+                       O:dir/subdir/b         \
+                       O:dir/subdir/c         \
+                       O:dir/subdir/d         \
+                       O:dir/unchanged        \
+                       O:dir/subdir/tweaked/h &&
+               test_cmp expect actual &&
+
+               echo Checking the pick of B2... &&
+
+               test_must_fail git rev-parse Bmod:dir &&
+
+               git ls-tree -r Bmod >out &&
+               test_line_count = 99 out &&
+
+               git diff --name-status Bmod~1 Bmod >actual &&
+               q_to_tab >expect <<-\EOF &&
+               AQfolder/subdir/newfile.rs
+               MQfolder/subdir/newsubdir/e
+               EOF
+               test_cmp expect actual &&
+
+               # Three-way merged file
+               test_seq  2 12 >e_Merge2 &&
+               git hash-object e_Merge2 >expect &&
+               git rev-parse Bmod:folder/subdir/newsubdir/e >actual &&
+               test_cmp expect actual &&
+
+               grep region_enter.*collect_merge_info trace.output >collect &&
+               test_line_count = 4 collect &&
+               grep region_enter.*process_entries$ trace.output >process &&
+               test_line_count = 2 process
+       )
+'
+
 ###########################################################################
 # SECTION 13: Checking informational and conflict messages
 #
index 699813671c8c1fb5e1624c46415b44711d44a89f..d7eeee431061c4195b91a86581fd8462551ceb42 100755 (executable)
@@ -23,6 +23,7 @@ test_description="merge cases"
 #                     files that might be renamed into each other's paths.)
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
 
 
 ###########################################################################
@@ -666,7 +667,7 @@ test_setup_4a () {
 #   correct requires doing the merge in-memory first, then realizing that no
 #   updates to the file are necessary, and thus that we can just leave the path
 #   alone.
-test_expect_failure '4a: Change on A, change on B subset of A, dirty mods present' '
+test_expect_merge_algorithm failure success '4a: Change on A, change on B subset of A, dirty mods present' '
        test_setup_4a &&
        (
                cd 4a &&
index a328260d4264f84b32bbeab0ee70b620d597af3e..9c08e63af250ddb8eb26d87ac10fafd080750311 100755 (executable)
@@ -3,6 +3,7 @@
 test_description='merge-recursive backend test'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-merge.sh
 
 test_expect_success 'setup 1' '
 
@@ -641,7 +642,7 @@ test_expect_success 'merge-recursive copy vs. rename' '
        test_cmp expected actual
 '
 
-test_expect_failure 'merge-recursive rename vs. rename/symlink' '
+test_expect_merge_algorithm failure success 'merge-recursive rename vs. rename/symlink' '
 
        git checkout -f rename &&
        git merge rename-ln &&
index dd8ab7ede182fc3c3da840fee083bf23a94ce13c..dd9376842fecf7ebd3706f0c79e5b9a1308b4ea7 100755 (executable)
@@ -97,11 +97,19 @@ test_expect_success 'will not overwrite unstaged changes in renamed file' '
        git mv c1.c other.c &&
        git commit -m rename &&
        cp important other.c &&
-       test_must_fail git merge c1a >out &&
-       test_i18ngrep "Refusing to lose dirty file at other.c" out &&
-       test_path_is_file other.c~HEAD &&
-       test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
-       test_cmp important other.c
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               test_must_fail git merge c1a >out 2>err &&
+               test_i18ngrep "would be overwritten by merge" err &&
+               test_cmp important other.c &&
+               test_path_is_missing .git/MERGE_HEAD
+       else
+               test_must_fail git merge c1a >out &&
+               test_i18ngrep "Refusing to lose dirty file at other.c" out &&
+               test_path_is_file other.c~HEAD &&
+               test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
+               test_cmp important other.c
+       fi
 '
 
 test_expect_success 'will not overwrite untracked subtree' '
index 6a1e5f82324877a774fba03e5657654510de994f..3ead2b726f4b3fac9060c53721471858d59c1e4a 100755 (executable)
@@ -127,7 +127,12 @@ test_expect_success 'merging should conflict for non fast-forward' '
         git checkout -b test-nonforward b &&
         (cd sub &&
          git rev-parse sub-d > ../expect) &&
-        test_must_fail git merge c 2> actual  &&
+         if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+         then
+               test_must_fail git merge c >actual
+         else
+               test_must_fail git merge c 2> actual
+         fi &&
         grep $(cat expect) actual > /dev/null &&
         git reset --hard)
 '
@@ -138,9 +143,21 @@ test_expect_success 'merging should fail for ambiguous common parent' '
        (cd sub &&
         git checkout -b ambiguous sub-b &&
         git merge sub-c &&
-        git rev-parse sub-d > ../expect1 &&
-        git rev-parse ambiguous > ../expect2) &&
-       test_must_fail git merge c 2> actual &&
+        if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+        then
+               git rev-parse --short sub-d >../expect1 &&
+               git rev-parse --short ambiguous >../expect2
+        else
+               git rev-parse sub-d > ../expect1 &&
+               git rev-parse ambiguous > ../expect2
+        fi
+        ) &&
+        if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+        then
+               test_must_fail git merge c >actual
+        else
+               test_must_fail git merge c 2> actual
+        fi &&
        grep $(cat expect1) actual > /dev/null &&
        grep $(cat expect2) actual > /dev/null &&
        git reset --hard)
index 00e09a375c2e6e3bfce2c2f8ce93493513082b2d..fdb450e446a987717d4565ef58cccfa332259927 100755 (executable)
@@ -19,7 +19,7 @@ test_expect_success 'setup' '
 test_expect_success TTY 'some commands use a pager' '
        rm -f paginated.out &&
        test_terminal git log &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_failure TTY 'pager runs from subdir' '
@@ -65,49 +65,49 @@ test_expect_success !MINGW,TTY 'LESS and LV envvars set by git-sh-setup' '
 test_expect_success TTY 'some commands do not use a pager' '
        rm -f paginated.out &&
        test_terminal git rev-list HEAD &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success 'no pager when stdout is a pipe' '
        rm -f paginated.out &&
        git log | cat &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success 'no pager when stdout is a regular file' '
        rm -f paginated.out &&
        git log >file &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git --paginate rev-list uses a pager' '
        rm -f paginated.out &&
        test_terminal git --paginate rev-list HEAD &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_success 'no pager even with --paginate when stdout is a pipe' '
        rm -f file paginated.out &&
        git --paginate log | cat &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'no pager with --no-pager' '
        rm -f paginated.out &&
        test_terminal git --no-pager log &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'configuration can disable pager' '
        rm -f paginated.out &&
        test_unconfig pager.grep &&
        test_terminal git grep initial &&
-       test -e paginated.out &&
+       test_path_is_file paginated.out &&
 
        rm -f paginated.out &&
        test_config pager.grep false &&
        test_terminal git grep initial &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'configuration can enable pager (from subdir)' '
@@ -122,107 +122,107 @@ test_expect_success TTY 'configuration can enable pager (from subdir)' '
                test_terminal git bundle unbundle ../test.bundle
        ) &&
        {
-               test -e paginated.out ||
-               test -e subdir/paginated.out
+               test_path_is_file paginated.out ||
+               test_path_is_file subdir/paginated.out
        }
 '
 
 test_expect_success TTY 'git tag -l defaults to paging' '
        rm -f paginated.out &&
        test_terminal git tag -l &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_success TTY 'git tag -l respects pager.tag' '
        rm -f paginated.out &&
        test_terminal git -c pager.tag=false tag -l &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git tag -l respects --no-pager' '
        rm -f paginated.out &&
        test_terminal git -c pager.tag --no-pager tag -l &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git tag with no args defaults to paging' '
        # no args implies -l so this should page like -l
        rm -f paginated.out &&
        test_terminal git tag &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_success TTY 'git tag with no args respects pager.tag' '
        # no args implies -l so this should page like -l
        rm -f paginated.out &&
        test_terminal git -c pager.tag=false tag &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git tag --contains defaults to paging' '
        # --contains implies -l so this should page like -l
        rm -f paginated.out &&
        test_terminal git tag --contains &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_success TTY 'git tag --contains respects pager.tag' '
        # --contains implies -l so this should page like -l
        rm -f paginated.out &&
        test_terminal git -c pager.tag=false tag --contains &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git tag -a defaults to not paging' '
        test_when_finished "git tag -d newtag" &&
        rm -f paginated.out &&
        test_terminal git tag -am message newtag &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git tag -a ignores pager.tag' '
        test_when_finished "git tag -d newtag" &&
        rm -f paginated.out &&
        test_terminal git -c pager.tag tag -am message newtag &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git tag -a respects --paginate' '
        test_when_finished "git tag -d newtag" &&
        rm -f paginated.out &&
        test_terminal git --paginate tag -am message newtag &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_success TTY 'git tag as alias ignores pager.tag with -a' '
        test_when_finished "git tag -d newtag" &&
        rm -f paginated.out &&
        test_terminal git -c pager.tag -c alias.t=tag t -am message newtag &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
        rm -f paginated.out &&
        test_terminal git -c pager.tag=false -c alias.t=tag t -l &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git branch defaults to paging' '
        rm -f paginated.out &&
        test_terminal git branch &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_success TTY 'git branch respects pager.branch' '
        rm -f paginated.out &&
        test_terminal git -c pager.branch=false branch &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git branch respects --no-pager' '
        rm -f paginated.out &&
        test_terminal git --no-pager branch &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git branch --edit-description ignores pager.branch' '
@@ -232,8 +232,8 @@ test_expect_success TTY 'git branch --edit-description ignores pager.branch' '
                touch editor.used
        EOF
        EDITOR=./editor test_terminal git -c pager.branch branch --edit-description &&
-       ! test -e paginated.out &&
-       test -e editor.used
+       test_path_is_missing paginated.out &&
+       test_path_is_file editor.used
 '
 
 test_expect_success TTY 'git branch --set-upstream-to ignores pager.branch' '
@@ -242,13 +242,13 @@ test_expect_success TTY 'git branch --set-upstream-to ignores pager.branch' '
        test_when_finished "git branch -D other" &&
        test_terminal git -c pager.branch branch --set-upstream-to=other &&
        test_when_finished "git branch --unset-upstream" &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git config ignores pager.config when setting' '
        rm -f paginated.out &&
        test_terminal git -c pager.config config foo.bar bar &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git config --edit ignores pager.config' '
@@ -257,33 +257,33 @@ test_expect_success TTY 'git config --edit ignores pager.config' '
                touch editor.used
        EOF
        EDITOR=./editor test_terminal git -c pager.config config --edit &&
-       ! test -e paginated.out &&
-       test -e editor.used
+       test_path_is_missing paginated.out &&
+       test_path_is_file editor.used
 '
 
 test_expect_success TTY 'git config --get ignores pager.config' '
        rm -f paginated.out &&
        test_terminal git -c pager.config config --get foo.bar &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git config --get-urlmatch defaults to paging' '
        rm -f paginated.out &&
        test_terminal git -c http."https://foo.com/".bar=foo \
                          config --get-urlmatch http https://foo.com &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 test_expect_success TTY 'git config --get-all respects pager.config' '
        rm -f paginated.out &&
        test_terminal git -c pager.config=false config --get-all foo.bar &&
-       ! test -e paginated.out
+       test_path_is_missing paginated.out
 '
 
 test_expect_success TTY 'git config --list defaults to paging' '
        rm -f paginated.out &&
        test_terminal git config --list &&
-       test -e paginated.out
+       test_path_is_file paginated.out
 '
 
 
@@ -392,7 +392,7 @@ test_default_pager() {
                        export PATH &&
                        $full_command
                ) &&
-               test -e default_pager_used
+               test_path_is_file default_pager_used
        "
 }
 
@@ -406,7 +406,7 @@ test_PAGER_overrides() {
                PAGER='wc >PAGER_used' &&
                export PAGER &&
                $full_command &&
-               test -e PAGER_used
+               test_path_is_file PAGER_used
        "
 }
 
@@ -432,7 +432,7 @@ test_core_pager() {
                export PAGER &&
                test_config core.pager 'wc >core.pager_used' &&
                $full_command &&
-               ${if_local_config}test -e core.pager_used
+               ${if_local_config}test_path_is_file core.pager_used
        "
 }
 
@@ -464,7 +464,7 @@ test_pager_subdir_helper() {
                        cd sub &&
                        $full_command
                ) &&
-               ${if_local_config}test -e core.pager_used
+               ${if_local_config}test_path_is_file core.pager_used
        "
 }
 
@@ -477,7 +477,7 @@ test_GIT_PAGER_overrides() {
                GIT_PAGER='wc >GIT_PAGER_used' &&
                export GIT_PAGER &&
                $full_command &&
-               test -e GIT_PAGER_used
+               test_path_is_file GIT_PAGER_used
        "
 }
 
@@ -489,7 +489,7 @@ test_doesnt_paginate() {
                GIT_PAGER='wc >GIT_PAGER_used' &&
                export GIT_PAGER &&
                $full_command &&
-               ! test -e GIT_PAGER_used
+               test_path_is_missing GIT_PAGER_used
        "
 }
 
index 537787e598b414886316d497c0076d517a654be8..601b47830bf520c90b72a5be4d9a0ca7e6883f1d 100755 (executable)
@@ -9,6 +9,7 @@ This test exercises porcelain V2 output for git status.'
 
 
 test_expect_success setup '
+       git checkout -f --orphan initial-branch &&
        test_tick &&
        git config core.autocrlf false &&
        echo x >file_x &&
@@ -22,7 +23,7 @@ test_expect_success setup '
 test_expect_success 'before initial commit, nothing added, only untracked' '
        cat >expect <<-EOF &&
        # branch.oid (initial)
-       # branch.head master
+       # branch.head initial-branch
        ? actual
        ? dir1/
        ? expect
@@ -45,7 +46,7 @@ test_expect_success 'before initial commit, things added' '
 
        cat >expect <<-EOF &&
        # branch.oid (initial)
-       # branch.head master
+       # branch.head initial-branch
        1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a
        1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b
        1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x
@@ -62,7 +63,7 @@ test_expect_success 'before initial commit, things added' '
 test_expect_success 'before initial commit, things added (-z)' '
        lf_to_nul >expect <<-EOF &&
        # branch.oid (initial)
-       # branch.head master
+       # branch.head initial-branch
        1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a
        1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b
        1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x
@@ -81,7 +82,7 @@ test_expect_success 'make first commit, comfirm HEAD oid and branch' '
        H0=$(git rev-parse HEAD) &&
        cat >expect <<-EOF &&
        # branch.oid $H0
-       # branch.head master
+       # branch.head initial-branch
        ? actual
        ? expect
        EOF
@@ -98,7 +99,7 @@ test_expect_success 'after first commit, create unstaged changes' '
 
        cat >expect <<-EOF &&
        # branch.oid $H0
-       # branch.head master
+       # branch.head initial-branch
        1 .M N... 100644 100644 100644 $OID_X $OID_X file_x
        1 .D N... 100644 100644 000000 $OID_Z $OID_Z file_z
        ? actual
@@ -126,7 +127,7 @@ test_expect_success 'after first commit, stage existing changes' '
 
        cat >expect <<-EOF &&
        # branch.oid $H0
-       # branch.head master
+       # branch.head initial-branch
        1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
        1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
        ? actual
@@ -143,7 +144,7 @@ test_expect_success 'rename causes 2 path lines' '
 
        q_to_tab >expect <<-EOF &&
        # branch.oid $H0
-       # branch.head master
+       # branch.head initial-branch
        1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
        1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
        2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y
@@ -161,7 +162,7 @@ test_expect_success 'rename causes 2 path lines (-z)' '
        ## Lines use NUL path separator and line terminator, so double transform here.
        q_to_nul <<-EOF | lf_to_nul >expect &&
        # branch.oid $H0
-       # branch.head master
+       # branch.head initial-branch
        1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
        1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
        2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y
@@ -179,7 +180,7 @@ test_expect_success 'make second commit, confirm clean and new HEAD oid' '
 
        cat >expect <<-EOF &&
        # branch.oid $H1
-       # branch.head master
+       # branch.head initial-branch
        ? actual
        ? expect
        EOF
@@ -231,7 +232,7 @@ test_expect_success 'create and commit permanent ignore file' '
 
        cat >expect <<-EOF &&
        # branch.oid $H1
-       # branch.head master
+       # branch.head initial-branch
        EOF
 
        git status --porcelain=v2 --branch >actual &&
@@ -257,14 +258,14 @@ test_expect_success 'verify --intent-to-add output' '
 test_expect_success 'verify AA (add-add) conflict' '
        test_when_finished "git reset --hard" &&
 
-       git branch AA_A master &&
+       git branch AA_A initial-branch &&
        git checkout AA_A &&
        echo "Branch AA_A" >conflict.txt &&
        OID_AA_A=$(git hash-object -t blob -- conflict.txt) &&
        git add conflict.txt &&
        git commit -m "branch aa_a" &&
 
-       git branch AA_B master &&
+       git branch AA_B initial-branch &&
        git checkout AA_B &&
        echo "Branch AA_B" >conflict.txt &&
        OID_AA_B=$(git hash-object -t blob -- conflict.txt) &&
@@ -290,7 +291,7 @@ test_expect_success 'verify AA (add-add) conflict' '
 test_expect_success 'verify UU (edit-edit) conflict' '
        test_when_finished "git reset --hard" &&
 
-       git branch UU_ANC master &&
+       git branch UU_ANC initial-branch &&
        git checkout UU_ANC &&
        echo "Ancestor" >conflict.txt &&
        OID_UU_ANC=$(git hash-object -t blob -- conflict.txt) &&
@@ -328,18 +329,18 @@ test_expect_success 'verify UU (edit-edit) conflict' '
 '
 
 test_expect_success 'verify upstream fields in branch header' '
-       git checkout master &&
+       git checkout initial-branch &&
        test_when_finished "rm -rf sub_repo" &&
        git clone . sub_repo &&
        (
-               ## Confirm local master tracks remote master.
+               ## Confirm local initial-branch tracks remote initial-branch.
                cd sub_repo &&
                HUF=$(git rev-parse HEAD) &&
 
                cat >expect <<-EOF &&
                # branch.oid $HUF
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                EOF
 
@@ -355,8 +356,8 @@ test_expect_success 'verify upstream fields in branch header' '
 
                cat >expect <<-EOF &&
                # branch.oid $HUF
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +1 -0
                EOF
 
@@ -367,9 +368,9 @@ test_expect_success 'verify upstream fields in branch header' '
                git status --porcelain=v2 --untracked-files=all >actual &&
                test_must_be_empty actual &&
 
-               ## Test upstream-gone case. Fake this by pointing origin/master at
-               ## a non-existing commit.
-               OLD=$(git rev-parse origin/master) &&
+               ## Test upstream-gone case. Fake this by pointing
+               ## origin/initial-branch at a non-existing commit.
+               OLD=$(git rev-parse origin/initial-branch) &&
                NEW=$ZERO_OID &&
                mv .git/packed-refs .git/old-packed-refs &&
                sed "s/$OLD/$NEW/g" <.git/old-packed-refs >.git/packed-refs &&
@@ -378,8 +379,8 @@ test_expect_success 'verify upstream fields in branch header' '
 
                cat >expect <<-EOF &&
                # branch.oid $HUF
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                EOF
 
                git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -388,19 +389,19 @@ test_expect_success 'verify upstream fields in branch header' '
 '
 
 test_expect_success 'verify --[no-]ahead-behind with V2 format' '
-       git checkout master &&
+       git checkout initial-branch &&
        test_when_finished "rm -rf sub_repo" &&
        git clone . sub_repo &&
        (
-               ## Confirm local master tracks remote master.
+               ## Confirm local initial-branch tracks remote initial-branch.
                cd sub_repo &&
                HUF=$(git rev-parse HEAD) &&
 
                # Confirm --no-ahead-behind reports traditional branch.ab with 0/0 for equal branches.
                cat >expect <<-EOF &&
                # branch.oid $HUF
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                EOF
 
@@ -410,8 +411,8 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
                # Confirm --ahead-behind reports traditional branch.ab with 0/0.
                cat >expect <<-EOF &&
                # branch.oid $HUF
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                EOF
 
@@ -428,8 +429,8 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
                # Confirm --no-ahead-behind reports branch.ab with ?/? for non-equal branches.
                cat >expect <<-EOF &&
                # branch.oid $HUF
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +? -?
                EOF
 
@@ -439,8 +440,8 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
                # Confirm --ahead-behind reports traditional branch.ab with 1/0.
                cat >expect <<-EOF &&
                # branch.oid $HUF
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +1 -0
                EOF
 
@@ -458,7 +459,7 @@ test_expect_success 'verify --[no-]ahead-behind with V2 format' '
 '
 
 test_expect_success 'create and add submodule, submodule appears clean (A. S...)' '
-       git checkout master &&
+       git checkout initial-branch &&
        git clone . sub_repo &&
        git clone . super_repo &&
        (       cd super_repo &&
@@ -471,8 +472,8 @@ test_expect_success 'create and add submodule, submodule appears clean (A. S...)
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
                1 A. S... 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -496,8 +497,8 @@ test_expect_success 'untracked changes in added submodule (AM S..U)' '
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
                1 AM S..U 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -521,8 +522,8 @@ test_expect_success 'staged changes in added submodule (AM S.M.)' '
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
                1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -548,8 +549,8 @@ test_expect_success 'staged and unstaged changes in added (AM S.M.)' '
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
                1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -575,8 +576,8 @@ test_expect_success 'staged and untracked changes in added submodule (AM S.MU)'
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
                1 AM S.MU 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -602,8 +603,8 @@ test_expect_success 'commit within the submodule appears as new commit in super
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +0 -0
                1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
                1 AM SC.. 000000 160000 160000 $ZERO_OID $HSUB sub1
@@ -625,8 +626,8 @@ test_expect_success 'stage submodule in super and commit' '
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +1 -0
                EOF
 
@@ -646,8 +647,8 @@ test_expect_success 'make unstaged changes in existing submodule (.M S.M.)' '
 
                cat >expect <<-EOF &&
                # branch.oid $HSUP
-               # branch.head master
-               # branch.upstream origin/master
+               # branch.head initial-branch
+               # branch.upstream origin/initial-branch
                # branch.ab +1 -0
                1 .M S.M. 160000 160000 160000 $HSUB $HSUB sub1
                EOF
index 96e163f084f471ea75e6d5b927a5edc6462e54d4..bfce05ac5dea71559e09f6023df2e5b6e1abdcbd 100755 (executable)
@@ -6,16 +6,15 @@
 test_description='git reset should cull empty subdirs'
 . ./test-lib.sh
 
-test_expect_success \
-    'creating initial files' \
-    'mkdir path0 &&
+test_expect_success 'creating initial files' '
+     mkdir path0 &&
      cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
      git add path0/COPYING &&
-     git commit -m add -a'
+     git commit -m add -a
+'
 
-test_expect_success \
-    'creating second files' \
-    'mkdir path1 &&
+test_expect_success 'creating second files' '
+     mkdir path1 &&
      mkdir path1/path2 &&
      cp "$TEST_DIRECTORY"/../COPYING path1/path2/COPYING &&
      cp "$TEST_DIRECTORY"/../COPYING path1/COPYING &&
@@ -25,39 +24,40 @@ test_expect_success \
      git add path1/COPYING &&
      git add COPYING &&
      git add path0/COPYING-TOO &&
-     git commit -m change -a'
+     git commit -m change -a
+'
 
-test_expect_success \
-    'resetting tree HEAD^' \
-    'git reset --hard HEAD^'
+test_expect_success 'resetting tree HEAD^' '
+     git reset --hard HEAD^
+'
 
-test_expect_success \
-    'checking initial files exist after rewind' \
-    'test -d path0 &&
-     test -f path0/COPYING'
+test_expect_success 'checking initial files exist after rewind' '
+     test -d path0 &&
+     test -f path0/COPYING
+'
 
-test_expect_success \
-    'checking lack of path1/path2/COPYING' \
-    '! test -f path1/path2/COPYING'
+test_expect_success 'checking lack of path1/path2/COPYING' '
+    ! test -f path1/path2/COPYING
+'
 
-test_expect_success \
-    'checking lack of path1/COPYING' \
-    '! test -f path1/COPYING'
+test_expect_success 'checking lack of path1/COPYING' '
+    ! test -f path1/COPYING
+'
 
-test_expect_success \
-    'checking lack of COPYING' \
-    '! test -f COPYING'
+test_expect_success 'checking lack of COPYING' '
+     ! test -f COPYING
+'
 
-test_expect_success \
-    'checking checking lack of path1/COPYING-TOO' \
-    '! test -f path0/COPYING-TOO'
+test_expect_success 'checking checking lack of path1/COPYING-TOO' '
+     ! test -f path0/COPYING-TOO
+'
 
-test_expect_success \
-    'checking lack of path1/path2' \
-    '! test -d path1/path2'
+test_expect_success 'checking lack of path1/path2' '
+     ! test -d path1/path2
+'
 
-test_expect_success \
-    'checking lack of path1' \
-    '! test -d path1'
+test_expect_success 'checking lack of path1' '
+     ! test -d path1
+'
 
 test_done
index 22161b3b2d5f7c42d827580802b00f97882b875f..b1affb001f599cbfdc074d2a19bf8816a76c4c32 100755 (executable)
@@ -70,27 +70,27 @@ check_changes () {
 
 test_expect_success 'reset --hard message' '
        hex=$(git log -1 --format="%h") &&
-       git reset --hard > .actual &&
-       echo HEAD is now at $hex $(commit_msg) > .expected &&
+       git reset --hard >.actual &&
+       echo HEAD is now at $hex $(commit_msg) >.expected &&
        test_i18ncmp .expected .actual
 '
 
 test_expect_success 'reset --hard message (ISO8859-1 logoutputencoding)' '
        hex=$(git log -1 --format="%h") &&
-       git -c "i18n.logOutputEncoding=$test_encoding" reset --hard > .actual &&
-       echo HEAD is now at $hex $(commit_msg $test_encoding) > .expected &&
+       git -c "i18n.logOutputEncoding=$test_encoding" reset --hard >.actual &&
+       echo HEAD is now at $hex $(commit_msg $test_encoding) >.expected &&
        test_i18ncmp .expected .actual
 '
 
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
-
 test_expect_success 'giving a non existing revision should fail' '
+       >.diff_expect &&
+       >.cached_expect &&
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       EOF
+
        test_must_fail git reset aaaaaa &&
        test_must_fail git reset --mixed aaaaaa &&
        test_must_fail git reset --soft aaaaaa &&
@@ -107,8 +107,7 @@ test_expect_success 'reset --soft with unmerged index should fail' '
        git rm --cached -- un
 '
 
-test_expect_success \
-       'giving paths with options different than --mixed should fail' '
+test_expect_success 'giving paths with options different than --mixed should fail' '
        test_must_fail git reset --soft -- first &&
        test_must_fail git reset --hard -- first &&
        test_must_fail git reset --soft HEAD^ -- first &&
@@ -128,8 +127,7 @@ test_expect_success 'giving unrecognized options should fail' '
        check_changes $head5
 '
 
-test_expect_success \
-       'trying to do reset --soft with pending merge should fail' '
+test_expect_success 'trying to do reset --soft with pending merge should fail' '
        git branch branch1 &&
        git branch branch2 &&
 
@@ -152,8 +150,7 @@ test_expect_success \
        check_changes $head5
 '
 
-test_expect_success \
-       'trying to do reset --soft with pending checkout merge should fail' '
+test_expect_success 'trying to do reset --soft with pending checkout merge should fail' '
        git branch branch3 &&
        git branch branch4 &&
 
@@ -175,8 +172,7 @@ test_expect_success \
        check_changes $head5
 '
 
-test_expect_success \
-       'resetting to HEAD with no changes should succeed and do nothing' '
+test_expect_success 'resetting to HEAD with no changes should succeed and do nothing' '
        git reset --hard &&
                check_changes $head5 &&
        git reset --hard HEAD &&
@@ -195,39 +191,38 @@ test_expect_success \
                check_changes $head5
 '
 
->.diff_expect
-cat >.cached_expect <<EOF
-diff --git a/secondfile b/secondfile
-index $head5p1s..$head5s 100644
---- a/secondfile
-+++ b/secondfile
-@@ -1 +1,2 @@
--2nd file
-+1st line 2nd file
-+2nd line 2nd file
-EOF
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
 test_expect_success '--soft reset only should show changes in diff --cached' '
+       >.diff_expect &&
+       cat >.cached_expect <<-EOF &&
+       diff --git a/secondfile b/secondfile
+       index $head5p1s..$head5s 100644
+       --- a/secondfile
+       +++ b/secondfile
+       @@ -1 +1,2 @@
+       -2nd file
+       +1st line 2nd file
+       +2nd line 2nd file
+       EOF
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       EOF
        git reset --soft HEAD^ &&
        check_changes $head5p1 &&
        test "$(git rev-parse ORIG_HEAD)" = \
                        $head5
 '
 
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-3rd line 2nd file
-EOF
-test_expect_success \
-       'changing files and redo the last commit should succeed' '
+test_expect_success 'changing files and redo the last commit should succeed' '
+       >.diff_expect &&
+       >.cached_expect &&
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       3rd line 2nd file
+       EOF
        echo "3rd line 2nd file" >>secondfile &&
        git commit -a -C ORIG_HEAD &&
        head4=$(git rev-parse --verify HEAD) &&
@@ -236,56 +231,54 @@ test_expect_success \
                        $head5
 '
 
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-first:
-1st file
-2nd line 1st file
-second:
-2nd file
-EOF
-test_expect_success \
-       '--hard reset should change the files and undo commits permanently' '
+test_expect_success '--hard reset should change the files and undo commits permanently' '
+       >.diff_expect &&
+       >.cached_expect &&
+       cat >.cat_expect <<-\EOF &&
+       first:
+       1st file
+       2nd line 1st file
+       second:
+       2nd file
+       EOF
        git reset --hard HEAD~2 &&
        check_changes $head5p2 &&
        test "$(git rev-parse ORIG_HEAD)" = \
                        $head4
 '
 
->.diff_expect
-cat >.cached_expect <<EOF
-diff --git a/first b/first
-deleted file mode 100644
-index $head5p2f..0000000
---- a/first
-+++ /dev/null
-@@ -1,2 +0,0 @@
--1st file
--2nd line 1st file
-diff --git a/second b/second
-deleted file mode 100644
-index $head5p1s..0000000
---- a/second
-+++ /dev/null
-@@ -1 +0,0 @@
--2nd file
-diff --git a/secondfile b/secondfile
-new file mode 100644
-index 0000000..$head5s
---- /dev/null
-+++ b/secondfile
-@@ -0,0 +1,2 @@
-+1st line 2nd file
-+2nd line 2nd file
-EOF
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
-test_expect_success \
-       'redoing changes adding them without commit them should succeed' '
+test_expect_success 'redoing changes adding them without commit them should succeed' '
+       >.diff_expect &&
+       cat >.cached_expect <<-EOF &&
+       diff --git a/first b/first
+       deleted file mode 100644
+       index $head5p2f..0000000
+       --- a/first
+       +++ /dev/null
+       @@ -1,2 +0,0 @@
+       -1st file
+       -2nd line 1st file
+       diff --git a/second b/second
+       deleted file mode 100644
+       index $head5p1s..0000000
+       --- a/second
+       +++ /dev/null
+       @@ -1 +0,0 @@
+       -2nd file
+       diff --git a/secondfile b/secondfile
+       new file mode 100644
+       index 0000000..$head5s
+       --- /dev/null
+       +++ b/secondfile
+       @@ -0,0 +1,2 @@
+       +1st line 2nd file
+       +2nd line 2nd file
+       EOF
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       EOF
        git rm first &&
        git mv second secondfile &&
 
@@ -295,46 +288,45 @@ test_expect_success \
        check_changes $head5p2
 '
 
-cat >.diff_expect <<EOF
-diff --git a/first b/first
-deleted file mode 100644
-index $head5p2f..0000000
---- a/first
-+++ /dev/null
-@@ -1,2 +0,0 @@
--1st file
--2nd line 1st file
-diff --git a/second b/second
-deleted file mode 100644
-index $head5p1s..0000000
---- a/second
-+++ /dev/null
-@@ -1 +0,0 @@
--2nd file
-EOF
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
 test_expect_success '--mixed reset to HEAD should unadd the files' '
+       cat >.diff_expect <<-EOF &&
+       diff --git a/first b/first
+       deleted file mode 100644
+       index $head5p2f..0000000
+       --- a/first
+       +++ /dev/null
+       @@ -1,2 +0,0 @@
+       -1st file
+       -2nd line 1st file
+       diff --git a/second b/second
+       deleted file mode 100644
+       index $head5p1s..0000000
+       --- a/second
+       +++ /dev/null
+       @@ -1 +0,0 @@
+       -2nd file
+       EOF
+       >.cached_expect &&
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       EOF
        git reset &&
        check_changes $head5p2 &&
        test "$(git rev-parse ORIG_HEAD)" = $head5p2
 '
 
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
 test_expect_success 'redoing the last two commits should succeed' '
+       >.diff_expect &&
+       >.cached_expect &&
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       EOF
        git add secondfile &&
        git reset --hard $head5p2 &&
-
        git rm first &&
        git mv second secondfile &&
        git commit -a -m "remove 1st and rename 2nd" &&
@@ -347,15 +339,15 @@ test_expect_success 'redoing the last two commits should succeed' '
        check_changes $head5
 '
 
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-3rd line in branch2
-EOF
 test_expect_success '--hard reset to HEAD should clear a failed merge' '
+       >.diff_expect &&
+       >.cached_expect &&
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       3rd line in branch2
+       EOF
        git branch branch1 &&
        git branch branch2 &&
 
@@ -373,15 +365,14 @@ test_expect_success '--hard reset to HEAD should clear a failed merge' '
        check_changes $head3
 '
 
->.diff_expect
->.cached_expect
-cat >.cat_expect <<EOF
-secondfile:
-1st line 2nd file
-2nd line 2nd file
-EOF
-test_expect_success \
-       '--hard reset to ORIG_HEAD should clear a fast-forward merge' '
+test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge' '
+       >.diff_expect &&
+       >.cached_expect &&
+       cat >.cat_expect <<-\EOF &&
+       secondfile:
+       1st line 2nd file
+       2nd line 2nd file
+       EOF
        git reset --hard HEAD^ &&
        check_changes $head5 &&
 
@@ -395,25 +386,25 @@ test_expect_success \
 '
 
 test_expect_success 'test --mixed <paths>' '
-       echo 1 > file1 &&
-       echo 2 > file2 &&
+       echo 1 >file1 &&
+       echo 2 >file2 &&
        git add file1 file2 &&
        test_tick &&
        git commit -m files &&
        before1=$(git rev-parse --short HEAD:file1) &&
        before2=$(git rev-parse --short HEAD:file2) &&
        git rm file2 &&
-       echo 3 > file3 &&
-       echo 4 > file4 &&
-       echo 5 > file1 &&
+       echo 3 >file3 &&
+       echo 4 >file4 &&
+       echo 5 >file1 &&
        after1=$(git rev-parse --short $(git hash-object file1)) &&
        after4=$(git rev-parse --short $(git hash-object file4)) &&
        git add file1 file3 file4 &&
        git reset HEAD -- file1 file2 file3 &&
        test_must_fail git diff --quiet &&
-       git diff > output &&
+       git diff >output &&
 
-       cat > expect <<-EOF &&
+       cat >expect <<-EOF &&
        diff --git a/file1 b/file1
        index $before1..$after1 100644
        --- a/file1
@@ -431,9 +422,9 @@ test_expect_success 'test --mixed <paths>' '
        EOF
 
        test_cmp expect output &&
-       git diff --cached > output &&
+       git diff --cached >output &&
 
-       cat > cached_expect <<-EOF &&
+       cat >cached_expect <<-EOF &&
        diff --git a/file4 b/file4
        new file mode 100644
        index 0000000..$after4
@@ -447,7 +438,6 @@ test_expect_success 'test --mixed <paths>' '
 '
 
 test_expect_success 'test resetting the index at give paths' '
-
        mkdir sub &&
        >sub/file1 &&
        >sub/file2 &&
@@ -460,7 +450,6 @@ test_expect_success 'test resetting the index at give paths' '
        echo "$U" &&
        test_must_fail git diff-index --cached --exit-code "$T" &&
        test "$T" != "$U"
-
 '
 
 test_expect_success 'resetting an unmodified path is a no-op' '
@@ -470,14 +459,13 @@ test_expect_success 'resetting an unmodified path is a no-op' '
        git diff-index --cached --exit-code HEAD
 '
 
-cat > expect << EOF
-Unstaged changes after reset:
-M      file2
-EOF
-
 test_expect_success '--mixed refreshes the index' '
-       echo 123 >> file2 &&
-       git reset --mixed HEAD > output &&
+       cat >expect <<-\EOF &&
+       Unstaged changes after reset:
+       M       file2
+       EOF
+       echo 123 >>file2 &&
+       git reset --mixed HEAD >output &&
        test_i18ncmp expect output
 '
 
@@ -498,7 +486,6 @@ test_expect_success 'resetting specific path that is unmerged' '
 '
 
 test_expect_success 'disambiguation (1)' '
-
        git reset --hard &&
        >secondfile &&
        git add secondfile &&
@@ -507,11 +494,9 @@ test_expect_success 'disambiguation (1)' '
        test -z "$(git diff --cached --name-only)" &&
        test -f secondfile &&
        test_must_be_empty secondfile
-
 '
 
 test_expect_success 'disambiguation (2)' '
-
        git reset --hard &&
        >secondfile &&
        git add secondfile &&
@@ -519,11 +504,9 @@ test_expect_success 'disambiguation (2)' '
        test_must_fail git reset secondfile &&
        test -n "$(git diff --cached --name-only -- secondfile)" &&
        test ! -f secondfile
-
 '
 
 test_expect_success 'disambiguation (3)' '
-
        git reset --hard &&
        >secondfile &&
        git add secondfile &&
@@ -532,11 +515,9 @@ test_expect_success 'disambiguation (3)' '
        test_must_fail git diff --quiet &&
        test -z "$(git diff --cached --name-only)" &&
        test ! -f secondfile
-
 '
 
 test_expect_success 'disambiguation (4)' '
-
        git reset --hard &&
        >secondfile &&
        git add secondfile &&
index 4d62b9b00fa919c2ec29872438d7a170a5605ee3..b36a93056fd8ea5b0fc489d92c3bacf3633c3498 100755 (executable)
@@ -33,8 +33,7 @@ fill () {
 
 
 test_expect_success setup '
-
-       fill x y z > same &&
+       fill x y z >same &&
        fill 1 2 3 4 5 6 7 8 >one &&
        fill a b c d e >two &&
        git add same one two &&
@@ -56,14 +55,13 @@ test_expect_success setup '
 
        git checkout -b simple master &&
        rm -f one &&
-       fill a c e > two &&
+       fill a c e >two &&
        git commit -a -m "Simple D one, M two" &&
 
        git checkout master
 '
 
-test_expect_success "checkout from non-existing branch" '
-
+test_expect_success 'checkout from non-existing branch' '
        git checkout -b delete-me master &&
        git update-ref -d --no-deref refs/heads/delete-me &&
        test refs/heads/delete-me = "$(git symbolic-ref HEAD)" &&
@@ -71,8 +69,7 @@ test_expect_success "checkout from non-existing branch" '
        test refs/heads/master = "$(git symbolic-ref HEAD)"
 '
 
-test_expect_success "checkout with dirty tree without -m" '
-
+test_expect_success 'checkout with dirty tree without -m' '
        fill 0 1 2 3 4 5 6 7 8 >one &&
        if git checkout side
        then
@@ -81,11 +78,9 @@ test_expect_success "checkout with dirty tree without -m" '
        else
                echo "happy - failed correctly"
        fi
-
 '
 
-test_expect_success "checkout with unrelated dirty tree without -m" '
-
+test_expect_success 'checkout with unrelated dirty tree without -m' '
        git checkout -f master &&
        fill 0 1 2 3 4 5 6 7 8 >same &&
        cp same kept &&
@@ -95,13 +90,12 @@ test_expect_success "checkout with unrelated dirty tree without -m" '
        test_cmp messages.expect messages
 '
 
-test_expect_success "checkout -m with dirty tree" '
-
+test_expect_success 'checkout -m with dirty tree' '
        git checkout -f master &&
        git clean -f &&
 
        fill 0 1 2 3 4 5 6 7 8 >one &&
-       git checkout -m side > messages &&
+       git checkout -m side >messages &&
 
        test "$(git symbolic-ref HEAD)" = "refs/heads/side" &&
 
@@ -120,8 +114,7 @@ test_expect_success "checkout -m with dirty tree" '
        test_must_be_empty current.index
 '
 
-test_expect_success "checkout -m with dirty tree, renamed" '
-
+test_expect_success 'checkout -m with dirty tree, renamed' '
        git checkout -f master && git clean -f &&
 
        fill 1 2 3 4 5 7 8 >one &&
@@ -139,11 +132,9 @@ test_expect_success "checkout -m with dirty tree, renamed" '
        ! test -f one &&
        git diff --cached >current &&
        test_must_be_empty current
-
 '
 
 test_expect_success 'checkout -m with merge conflict' '
-
        git checkout -f master && git clean -f &&
 
        fill 1 T 3 4 5 6 S 8 >one &&
@@ -166,10 +157,10 @@ test_expect_success 'checkout -m with merge conflict' '
 '
 
 test_expect_success 'format of merge conflict from checkout -m' '
+       git checkout -f master &&
+       git clean -f &&
 
-       git checkout -f master && git clean -f &&
-
-       fill b d > two &&
+       fill b d >two &&
        git checkout -m simple &&
 
        git ls-files >current &&
@@ -190,10 +181,11 @@ test_expect_success 'format of merge conflict from checkout -m' '
 '
 
 test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
+       git checkout -f master &&
+       git reset --hard &&
+       git clean -f &&
 
-       git checkout -f master && git reset --hard && git clean -f &&
-
-       fill b d > two &&
+       fill b d >two &&
        git checkout --merge --conflict=diff3 simple &&
 
        cat <<-EOF >expect &&
@@ -216,8 +208,9 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
 '
 
 test_expect_success 'switch to another branch while carrying a deletion' '
-
-       git checkout -f master && git reset --hard && git clean -f &&
+       git checkout -f master &&
+       git reset --hard &&
+       git clean -f &&
        git rm two &&
 
        test_must_fail git checkout simple 2>errs &&
@@ -228,10 +221,10 @@ test_expect_success 'switch to another branch while carrying a deletion' '
 '
 
 test_expect_success 'checkout to detach HEAD (with advice declined)' '
-
        git config advice.detachedHead false &&
        rev=$(git rev-parse --short renamer^) &&
-       git checkout -f renamer && git clean -f &&
+       git checkout -f renamer &&
+       git clean -f &&
        git checkout renamer^ 2>messages &&
        test_i18ngrep "HEAD is now at $rev" messages &&
        test_line_count = 1 messages &&
@@ -250,7 +243,8 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
 test_expect_success 'checkout to detach HEAD' '
        git config advice.detachedHead true &&
        rev=$(git rev-parse --short renamer^) &&
-       git checkout -f renamer && git clean -f &&
+       git checkout -f renamer &&
+       git clean -f &&
        GIT_TEST_GETTEXT_POISON=false git checkout renamer^ 2>messages &&
        grep "HEAD is now at $rev" messages &&
        test_line_count -gt 1 messages &&
@@ -267,8 +261,8 @@ test_expect_success 'checkout to detach HEAD' '
 '
 
 test_expect_success 'checkout to detach HEAD with branchname^' '
-
-       git checkout -f master && git clean -f &&
+       git checkout -f master &&
+       git clean -f &&
        git checkout renamer^ &&
        H=$(git rev-parse --verify HEAD) &&
        M=$(git show-ref -s --verify refs/heads/master) &&
@@ -283,8 +277,8 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
 '
 
 test_expect_success 'checkout to detach HEAD with :/message' '
-
-       git checkout -f master && git clean -f &&
+       git checkout -f master &&
+       git clean -f &&
        git checkout ":/Initial" &&
        H=$(git rev-parse --verify HEAD) &&
        M=$(git show-ref -s --verify refs/heads/master) &&
@@ -299,8 +293,8 @@ test_expect_success 'checkout to detach HEAD with :/message' '
 '
 
 test_expect_success 'checkout to detach HEAD with HEAD^0' '
-
-       git checkout -f master && git clean -f &&
+       git checkout -f master &&
+       git clean -f &&
        git checkout HEAD^0 &&
        H=$(git rev-parse --verify HEAD) &&
        M=$(git show-ref -s --verify refs/heads/master) &&
@@ -315,7 +309,6 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' '
 '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
-
        git tag both side &&
        git branch both master &&
        git reset --hard &&
@@ -327,11 +320,9 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
        test "z$H" = "z$M" &&
        name=$(git symbolic-ref HEAD 2>/dev/null) &&
        test "z$name" = zrefs/heads/both
-
 '
 
 test_expect_success 'checkout with ambiguous tag/branch names' '
-
        git reset --hard &&
        git checkout master &&
 
@@ -351,26 +342,19 @@ test_expect_success 'checkout with ambiguous tag/branch names' '
        else
                : happy
        fi
-
 '
 
 test_expect_success 'switch branches while in subdirectory' '
-
        git reset --hard &&
        git checkout master &&
 
        mkdir subs &&
-       (
-               cd subs &&
-               git checkout side
-       ) &&
+       git -C subs checkout side &&
        ! test -f subs/one &&
        rm -fr subs
-
 '
 
 test_expect_success 'checkout specific path while in subdirectory' '
-
        git reset --hard &&
        git checkout side &&
        mkdir subs &&
@@ -380,30 +364,26 @@ test_expect_success 'checkout specific path while in subdirectory' '
 
        git checkout master &&
        mkdir -p subs &&
-       (
-               cd subs &&
-               git checkout side -- bero
-       ) &&
+       git -C subs checkout side -- bero &&
        test -f subs/bero
-
 '
 
-test_expect_success \
-    'checkout w/--track sets up tracking' '
+test_expect_success 'checkout w/--track sets up tracking' '
     git config branch.autosetupmerge false &&
     git checkout master &&
     git checkout --track -b track1 &&
     test "$(git config branch.track1.remote)" &&
-    test "$(git config branch.track1.merge)"'
+    test "$(git config branch.track1.merge)"
+'
 
-test_expect_success \
-    'checkout w/autosetupmerge=always sets up tracking' '
+test_expect_success 'checkout w/autosetupmerge=always sets up tracking' '
     test_when_finished git config branch.autosetupmerge false &&
     git config branch.autosetupmerge always &&
     git checkout master &&
     git checkout -b track2 &&
     test "$(git config branch.track2.remote)" &&
-    test "$(git config branch.track2.merge)"'
+    test "$(git config branch.track2.merge)"
+'
 
 test_expect_success 'checkout w/--track from non-branch HEAD fails' '
     git checkout master^0 &&
@@ -435,8 +415,7 @@ test_expect_success 'detach a symbolic link HEAD' '
     test "z$(git rev-parse --verify refs/heads/master)" = "z$here"
 '
 
-test_expect_success \
-    'checkout with --track fakes a sensible -b <name>' '
+test_expect_success 'checkout with --track fakes a sensible -b <name>' '
     git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" &&
     git update-ref refs/remotes/origin/koala/bear renamer &&
 
@@ -457,9 +436,9 @@ test_expect_success \
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"
 '
 
-test_expect_success \
-    'checkout with --track, but without -b, fails with too short tracked name' '
-    test_must_fail git checkout --track renamer'
+test_expect_success 'checkout with --track, but without -b, fails with too short tracked name' '
+    test_must_fail git checkout --track renamer
+'
 
 setup_conflicting_index () {
        rm -f .git/index &&
@@ -609,7 +588,6 @@ test_expect_success 'failing checkout -b should not break working tree' '
        test $(git symbolic-ref HEAD) = refs/heads/master &&
        git diff --exit-code &&
        git diff --cached --exit-code
-
 '
 
 test_expect_success 'switch out of non-branch' '
index dc3e9c8c88b1d1037e355155b9325b4d4ded27db..905957bd0a1681265f6064a65b319c1c3fa95484 100755 (executable)
@@ -13,7 +13,7 @@ test_expect_success 'empty name and missing email' '
                sane_unset GIT_AUTHOR_EMAIL &&
                GIT_AUTHOR_NAME= &&
                test_must_fail git commit --allow-empty -m foo 2>err &&
-               test_i18ngrep ! null err
+               test_i18ngrep ! "(null)" err
        )
 '
 
index c5c4ea5fc09e335b41e021f04206c4328326c811..6774e9d86fa04c901b3833127e72f63a60028236 100755 (executable)
@@ -29,8 +29,11 @@ test_expect_success 'setup' '
 
 test_expect_success 'pull.rebase not set' '
        git reset --hard c0 &&
-       git pull . c1 2>err &&
-       test_i18ngrep "Pulling without specifying how to reconcile" err
+       git -c color.advice=always pull . c1 2>err &&
+       test_decode_color <err >decoded &&
+       test_i18ngrep "<YELLOW>hint: " decoded &&
+       test_i18ngrep "Pulling without specifying how to reconcile" decoded
+
 '
 
 test_expect_success 'pull.rebase not set and pull.ff=true' '
index 6abe441ae3611906143a76ac2b4acca7ab5ff671..13859ec8595f7f5abc32cc5322e83328a4556319 100755 (executable)
@@ -77,6 +77,12 @@ Merge made by the 'recursive' strategy.
 EOF
 
 test_expect_success 'merge reduces irrelevant remote heads' '
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               mv expected expected.tmp &&
+               sed s/recursive/ort/ expected.tmp >expected &&
+               rm expected.tmp
+       fi &&
        GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual &&
        test_i18ncmp expected actual
 '
index ad288ddc695f7cce0990e3f2bab696f3aff09eb1..70afdd06fa7208a20ac66f1eb6e9e3690d5fe528 100755 (executable)
@@ -532,7 +532,14 @@ test_expect_success 'file vs modified submodule' '
        yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
        yes "" | git mergetool both &&
        yes "d" | git mergetool file11 file12 &&
-       yes "l" | git mergetool submod &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               yes "c" | git mergetool submod~HEAD &&
+               git rm submod &&
+               git mv submod~HEAD submod
+       else
+               yes "l" | git mergetool submod
+       fi &&
        git submodule update -N &&
        echo "not a submodule" >expect &&
        test_cmp expect submod &&
@@ -549,7 +556,15 @@ test_expect_success 'file vs modified submodule' '
        yes "" | git mergetool file1 file2 spaced\ name subdir/file3 &&
        yes "" | git mergetool both &&
        yes "d" | git mergetool file11 file12 &&
-       yes "r" | git mergetool submod &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               mv submod submod.orig &&
+               git rm --cached submod &&
+               yes "c" | git mergetool submod~test19 &&
+               git mv submod~test19 submod
+       else
+               yes "r" | git mergetool submod
+       fi &&
        test -d submod.orig &&
        git submodule update -N &&
        echo "not a submodule" >expect &&
@@ -567,6 +582,10 @@ test_expect_success 'file vs modified submodule' '
        yes "" | git mergetool both &&
        yes "d" | git mergetool file11 file12 &&
        yes "l" | git mergetool submod &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               yes "d" | git mergetool submod~test19
+       fi &&
        echo "master submodule" >expect &&
        test_cmp expect submod/bar &&
        git submodule update -N &&
@@ -664,7 +683,14 @@ test_expect_success 'directory vs modified submodule' '
        test_must_fail git merge master &&
        test -n "$(git ls-files -u)" &&
        test ! -e submod.orig &&
-       yes "r" | git mergetool submod &&
+       if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+       then
+               yes "r" | git mergetool submod~master &&
+               git mv submod submod.orig &&
+               git mv submod~master submod
+       else
+               yes "r" | git mergetool submod
+       fi &&
        test -d submod.orig &&
        echo "not a submodule" >expect &&
        test_cmp expect submod.orig/file16 &&
index 524f30f7dc7c2388bad3885303541d4a72ed4470..a578b35761f2e97177dd8342ff5d949e719b64d3 100755 (executable)
@@ -728,6 +728,19 @@ test_expect_success 'add -N and difftool -d' '
        git difftool --dir-diff --extcmd ls
 '
 
+test_expect_success 'difftool --cached with unmerged files' '
+       test_when_finished git reset --hard &&
+
+       test_commit conflicting &&
+       test_commit conflict-a conflict.t a &&
+       git reset --hard conflicting &&
+       test_commit conflict-b conflict.t b &&
+       test_must_fail git merge conflict-a &&
+
+       git difftool --cached --no-prompt >output &&
+       test_must_be_empty output
+'
+
 test_expect_success 'outside worktree' '
        echo 1 >1 &&
        echo 2 >2 &&
index 53c883531e440c0d55db95134bab5a17e96a71e1..d1e0c8f8301d12b28130ecc747f0d3cf44ba7034 100755 (executable)
@@ -5,10 +5,11 @@ test_description='git maintenance builtin'
 . ./test-lib.sh
 
 GIT_TEST_COMMIT_GRAPH=0
+GIT_TEST_MULTI_PACK_INDEX=0
 
 test_expect_success 'help text' '
        test_expect_code 129 git maintenance -h 2>err &&
-       test_i18ngrep "usage: git maintenance run" err &&
+       test_i18ngrep "usage: git maintenance <subcommand>" err &&
        test_expect_code 128 git maintenance barf 2>err &&
        test_i18ngrep "invalid subcommand: barf" err &&
        test_expect_code 129 git maintenance 2>err &&
@@ -27,6 +28,19 @@ test_expect_success 'run [--auto|--quiet]' '
        test_subcommand git gc --no-quiet <run-no-quiet.txt
 '
 
+test_expect_success 'maintenance.auto config option' '
+       GIT_TRACE2_EVENT="$(pwd)/default" git commit --quiet --allow-empty -m 1 &&
+       test_subcommand git maintenance run --auto --quiet <default &&
+       GIT_TRACE2_EVENT="$(pwd)/true" \
+               git -c maintenance.auto=true \
+               commit --quiet --allow-empty -m 2 &&
+       test_subcommand git maintenance run --auto --quiet  <true &&
+       GIT_TRACE2_EVENT="$(pwd)/false" \
+               git -c maintenance.auto=false \
+               commit --quiet --allow-empty -m 3 &&
+       test_subcommand ! git maintenance run --auto --quiet  <false
+'
+
 test_expect_success 'maintenance.<task>.enabled' '
        git config maintenance.gc.enabled false &&
        git config maintenance.commit-graph.enabled true &&
@@ -52,6 +66,43 @@ test_expect_success 'run --task=<task>' '
        test_subcommand git commit-graph write --split --reachable --no-progress <run-both.txt
 '
 
+test_expect_success 'core.commitGraph=false prevents write process' '
+       GIT_TRACE2_EVENT="$(pwd)/no-commit-graph.txt" \
+               git -c core.commitGraph=false maintenance run \
+               --task=commit-graph 2>/dev/null &&
+       test_subcommand ! git commit-graph write --split --reachable --no-progress \
+               <no-commit-graph.txt
+'
+
+test_expect_success 'commit-graph auto condition' '
+       COMMAND="maintenance run --task=commit-graph --auto --quiet" &&
+
+       GIT_TRACE2_EVENT="$(pwd)/cg-no.txt" \
+               git -c maintenance.commit-graph.auto=1 $COMMAND &&
+       GIT_TRACE2_EVENT="$(pwd)/cg-negative-means-yes.txt" \
+               git -c maintenance.commit-graph.auto="-1" $COMMAND &&
+
+       test_commit first &&
+
+       GIT_TRACE2_EVENT="$(pwd)/cg-zero-means-no.txt" \
+               git -c maintenance.commit-graph.auto=0 $COMMAND &&
+       GIT_TRACE2_EVENT="$(pwd)/cg-one-satisfied.txt" \
+               git -c maintenance.commit-graph.auto=1 $COMMAND &&
+
+       git commit --allow-empty -m "second" &&
+       git commit --allow-empty -m "third" &&
+
+       GIT_TRACE2_EVENT="$(pwd)/cg-two-satisfied.txt" \
+               git -c maintenance.commit-graph.auto=2 $COMMAND &&
+
+       COMMIT_GRAPH_WRITE="git commit-graph write --split --reachable --no-progress" &&
+       test_subcommand ! $COMMIT_GRAPH_WRITE <cg-no.txt &&
+       test_subcommand $COMMIT_GRAPH_WRITE <cg-negative-means-yes.txt &&
+       test_subcommand ! $COMMIT_GRAPH_WRITE <cg-zero-means-no.txt &&
+       test_subcommand $COMMIT_GRAPH_WRITE <cg-one-satisfied.txt &&
+       test_subcommand $COMMIT_GRAPH_WRITE <cg-two-satisfied.txt
+'
+
 test_expect_success 'run --task=bogus' '
        test_must_fail git maintenance run --task=bogus 2>err &&
        test_i18ngrep "is not a valid task" err
@@ -62,4 +113,354 @@ test_expect_success 'run --task duplicate' '
        test_i18ngrep "cannot be selected multiple times" err
 '
 
+test_expect_success 'run --task=prefetch with no remotes' '
+       git maintenance run --task=prefetch 2>err &&
+       test_must_be_empty err
+'
+
+test_expect_success 'prefetch multiple remotes' '
+       git clone . clone1 &&
+       git clone . clone2 &&
+       git remote add remote1 "file://$(pwd)/clone1" &&
+       git remote add remote2 "file://$(pwd)/clone2" &&
+       git -C clone1 switch -c one &&
+       git -C clone2 switch -c two &&
+       test_commit -C clone1 one &&
+       test_commit -C clone2 two &&
+       GIT_TRACE2_EVENT="$(pwd)/run-prefetch.txt" git maintenance run --task=prefetch 2>/dev/null &&
+       fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" &&
+       test_subcommand git fetch remote1 $fetchargs +refs/heads/\\*:refs/prefetch/remote1/\\* <run-prefetch.txt &&
+       test_subcommand git fetch remote2 $fetchargs +refs/heads/\\*:refs/prefetch/remote2/\\* <run-prefetch.txt &&
+       test_path_is_missing .git/refs/remotes &&
+       git log prefetch/remote1/one &&
+       git log prefetch/remote2/two &&
+       git fetch --all &&
+       test_cmp_rev refs/remotes/remote1/one refs/prefetch/remote1/one &&
+       test_cmp_rev refs/remotes/remote2/two refs/prefetch/remote2/two
+'
+
+test_expect_success 'loose-objects task' '
+       # Repack everything so we know the state of the object dir
+       git repack -adk &&
+
+       # Hack to stop maintenance from running during "git commit"
+       echo in use >.git/objects/maintenance.lock &&
+
+       # Assuming that "git commit" creates at least one loose object
+       test_commit create-loose-object &&
+       rm .git/objects/maintenance.lock &&
+
+       ls .git/objects >obj-dir-before &&
+       test_file_not_empty obj-dir-before &&
+       ls .git/objects/pack/*.pack >packs-before &&
+       test_line_count = 1 packs-before &&
+
+       # The first run creates a pack-file
+       # but does not delete loose objects.
+       git maintenance run --task=loose-objects &&
+       ls .git/objects >obj-dir-between &&
+       test_cmp obj-dir-before obj-dir-between &&
+       ls .git/objects/pack/*.pack >packs-between &&
+       test_line_count = 2 packs-between &&
+       ls .git/objects/pack/loose-*.pack >loose-packs &&
+       test_line_count = 1 loose-packs &&
+
+       # The second run deletes loose objects
+       # but does not create a pack-file.
+       git maintenance run --task=loose-objects &&
+       ls .git/objects >obj-dir-after &&
+       cat >expect <<-\EOF &&
+       info
+       pack
+       EOF
+       test_cmp expect obj-dir-after &&
+       ls .git/objects/pack/*.pack >packs-after &&
+       test_cmp packs-between packs-after
+'
+
+test_expect_success 'maintenance.loose-objects.auto' '
+       git repack -adk &&
+       GIT_TRACE2_EVENT="$(pwd)/trace-lo1.txt" \
+               git -c maintenance.loose-objects.auto=1 maintenance \
+               run --auto --task=loose-objects 2>/dev/null &&
+       test_subcommand ! git prune-packed --quiet <trace-lo1.txt &&
+       printf data-A | git hash-object -t blob --stdin -w &&
+       GIT_TRACE2_EVENT="$(pwd)/trace-loA" \
+               git -c maintenance.loose-objects.auto=2 \
+               maintenance run --auto --task=loose-objects 2>/dev/null &&
+       test_subcommand ! git prune-packed --quiet <trace-loA &&
+       printf data-B | git hash-object -t blob --stdin -w &&
+       GIT_TRACE2_EVENT="$(pwd)/trace-loB" \
+               git -c maintenance.loose-objects.auto=2 \
+               maintenance run --auto --task=loose-objects 2>/dev/null &&
+       test_subcommand git prune-packed --quiet <trace-loB &&
+       GIT_TRACE2_EVENT="$(pwd)/trace-loC" \
+               git -c maintenance.loose-objects.auto=2 \
+               maintenance run --auto --task=loose-objects 2>/dev/null &&
+       test_subcommand git prune-packed --quiet <trace-loC
+'
+
+test_expect_success 'incremental-repack task' '
+       packDir=.git/objects/pack &&
+       for i in $(test_seq 1 5)
+       do
+               test_commit $i || return 1
+       done &&
+
+       # Create three disjoint pack-files with size BIG, small, small.
+       echo HEAD~2 | git pack-objects --revs $packDir/test-1 &&
+       test_tick &&
+       git pack-objects --revs $packDir/test-2 <<-\EOF &&
+       HEAD~1
+       ^HEAD~2
+       EOF
+       test_tick &&
+       git pack-objects --revs $packDir/test-3 <<-\EOF &&
+       HEAD
+       ^HEAD~1
+       EOF
+       rm -f $packDir/pack-* &&
+       rm -f $packDir/loose-* &&
+       ls $packDir/*.pack >packs-before &&
+       test_line_count = 3 packs-before &&
+
+       # the job repacks the two into a new pack, but does not
+       # delete the old ones.
+       git maintenance run --task=incremental-repack &&
+       ls $packDir/*.pack >packs-between &&
+       test_line_count = 4 packs-between &&
+
+       # the job deletes the two old packs, and does not write
+       # a new one because the batch size is not high enough to
+       # pack the largest pack-file.
+       git maintenance run --task=incremental-repack &&
+       ls .git/objects/pack/*.pack >packs-after &&
+       test_line_count = 2 packs-after
+'
+
+test_expect_success EXPENSIVE 'incremental-repack 2g limit' '
+       test_config core.compression 0 &&
+
+       for i in $(test_seq 1 5)
+       do
+               test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
+               return 1
+       done &&
+       git add big &&
+       git commit -qm "Add big file (1)" &&
+
+       # ensure any possible loose objects are in a pack-file
+       git maintenance run --task=loose-objects &&
+
+       rm big &&
+       for i in $(test_seq 6 10)
+       do
+               test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big ||
+               return 1
+       done &&
+       git add big &&
+       git commit -qm "Add big file (2)" &&
+
+       # ensure any possible loose objects are in a pack-file
+       git maintenance run --task=loose-objects &&
+
+       # Now run the incremental-repack task and check the batch-size
+       GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \
+               --task=incremental-repack 2>/dev/null &&
+       test_subcommand git multi-pack-index repack \
+                --no-progress --batch-size=2147483647 <run-2g.txt
+'
+
+test_expect_success 'maintenance.incremental-repack.auto' '
+       git repack -adk &&
+       git config core.multiPackIndex true &&
+       git multi-pack-index write &&
+       GIT_TRACE2_EVENT="$(pwd)/midx-init.txt" git \
+               -c maintenance.incremental-repack.auto=1 \
+               maintenance run --auto --task=incremental-repack 2>/dev/null &&
+       test_subcommand ! git multi-pack-index write --no-progress <midx-init.txt &&
+       test_commit A &&
+       git pack-objects --revs .git/objects/pack/pack <<-\EOF &&
+       HEAD
+       ^HEAD~1
+       EOF
+       GIT_TRACE2_EVENT=$(pwd)/trace-A git \
+               -c maintenance.incremental-repack.auto=2 \
+               maintenance run --auto --task=incremental-repack 2>/dev/null &&
+       test_subcommand ! git multi-pack-index write --no-progress <trace-A &&
+       test_commit B &&
+       git pack-objects --revs .git/objects/pack/pack <<-\EOF &&
+       HEAD
+       ^HEAD~1
+       EOF
+       GIT_TRACE2_EVENT=$(pwd)/trace-B git \
+               -c maintenance.incremental-repack.auto=2 \
+               maintenance run --auto --task=incremental-repack 2>/dev/null &&
+       test_subcommand git multi-pack-index write --no-progress <trace-B
+'
+
+test_expect_success '--auto and --schedule incompatible' '
+       test_must_fail git maintenance run --auto --schedule=daily 2>err &&
+       test_i18ngrep "at most one" err
+'
+
+test_expect_success 'invalid --schedule value' '
+       test_must_fail git maintenance run --schedule=annually 2>err &&
+       test_i18ngrep "unrecognized --schedule" err
+'
+
+test_expect_success '--schedule inheritance weekly -> daily -> hourly' '
+       git config maintenance.loose-objects.enabled true &&
+       git config maintenance.loose-objects.schedule hourly &&
+       git config maintenance.commit-graph.enabled true &&
+       git config maintenance.commit-graph.schedule daily &&
+       git config maintenance.incremental-repack.enabled true &&
+       git config maintenance.incremental-repack.schedule weekly &&
+
+       GIT_TRACE2_EVENT="$(pwd)/hourly.txt" \
+               git maintenance run --schedule=hourly 2>/dev/null &&
+       test_subcommand git prune-packed --quiet <hourly.txt &&
+       test_subcommand ! git commit-graph write --split --reachable \
+               --no-progress <hourly.txt &&
+       test_subcommand ! git multi-pack-index write --no-progress <hourly.txt &&
+
+       GIT_TRACE2_EVENT="$(pwd)/daily.txt" \
+               git maintenance run --schedule=daily 2>/dev/null &&
+       test_subcommand git prune-packed --quiet <daily.txt &&
+       test_subcommand git commit-graph write --split --reachable \
+               --no-progress <daily.txt &&
+       test_subcommand ! git multi-pack-index write --no-progress <daily.txt &&
+
+       GIT_TRACE2_EVENT="$(pwd)/weekly.txt" \
+               git maintenance run --schedule=weekly 2>/dev/null &&
+       test_subcommand git prune-packed --quiet <weekly.txt &&
+       test_subcommand git commit-graph write --split --reachable \
+               --no-progress <weekly.txt &&
+       test_subcommand git multi-pack-index write --no-progress <weekly.txt
+'
+
+test_expect_success 'maintenance.strategy inheritance' '
+       for task in commit-graph loose-objects incremental-repack
+       do
+               git config --unset maintenance.$task.schedule || return 1
+       done &&
+
+       test_when_finished git config --unset maintenance.strategy &&
+       git config maintenance.strategy incremental &&
+
+       GIT_TRACE2_EVENT="$(pwd)/incremental-hourly.txt" \
+               git maintenance run --schedule=hourly --quiet &&
+       GIT_TRACE2_EVENT="$(pwd)/incremental-daily.txt" \
+               git maintenance run --schedule=daily --quiet &&
+
+       test_subcommand git commit-graph write --split --reachable \
+               --no-progress <incremental-hourly.txt &&
+       test_subcommand ! git prune-packed --quiet <incremental-hourly.txt &&
+       test_subcommand ! git multi-pack-index write --no-progress \
+               <incremental-hourly.txt &&
+
+       test_subcommand git commit-graph write --split --reachable \
+               --no-progress <incremental-daily.txt &&
+       test_subcommand git prune-packed --quiet <incremental-daily.txt &&
+       test_subcommand git multi-pack-index write --no-progress \
+               <incremental-daily.txt &&
+
+       # Modify defaults
+       git config maintenance.commit-graph.schedule daily &&
+       git config maintenance.loose-objects.schedule hourly &&
+       git config maintenance.incremental-repack.enabled false &&
+
+       GIT_TRACE2_EVENT="$(pwd)/modified-hourly.txt" \
+               git maintenance run --schedule=hourly --quiet &&
+       GIT_TRACE2_EVENT="$(pwd)/modified-daily.txt" \
+               git maintenance run --schedule=daily --quiet &&
+
+       test_subcommand ! git commit-graph write --split --reachable \
+               --no-progress <modified-hourly.txt &&
+       test_subcommand git prune-packed --quiet <modified-hourly.txt &&
+       test_subcommand ! git multi-pack-index write --no-progress \
+               <modified-hourly.txt &&
+
+       test_subcommand git commit-graph write --split --reachable \
+               --no-progress <modified-daily.txt &&
+       test_subcommand git prune-packed --quiet <modified-daily.txt &&
+       test_subcommand ! git multi-pack-index write --no-progress \
+               <modified-daily.txt
+'
+
+test_expect_success 'register and unregister' '
+       test_when_finished git config --global --unset-all maintenance.repo &&
+       git config --global --add maintenance.repo /existing1 &&
+       git config --global --add maintenance.repo /existing2 &&
+       git config --global --get-all maintenance.repo >before &&
+
+       git maintenance register &&
+       test_cmp_config false maintenance.auto &&
+       git config --global --get-all maintenance.repo >between &&
+       cp before expect &&
+       pwd >>expect &&
+       test_cmp expect between &&
+
+       git maintenance unregister &&
+       git config --global --get-all maintenance.repo >actual &&
+       test_cmp before actual
+'
+
+test_expect_success !MINGW 'register and unregister with regex metacharacters' '
+       META="a+b*c" &&
+       git init "$META" &&
+       git -C "$META" maintenance register &&
+       git config --get-all --show-origin maintenance.repo &&
+       git config --get-all --global --fixed-value \
+               maintenance.repo "$(pwd)/$META" &&
+       git -C "$META" maintenance unregister &&
+       test_must_fail git config --get-all --global --fixed-value \
+               maintenance.repo "$(pwd)/$META"
+'
+
+test_expect_success 'start from empty cron table' '
+       GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance start &&
+
+       # start registers the repo
+       git config --get --global --fixed-value maintenance.repo "$(pwd)" &&
+
+       grep "for-each-repo --config=maintenance.repo maintenance run --schedule=daily" cron.txt &&
+       grep "for-each-repo --config=maintenance.repo maintenance run --schedule=hourly" cron.txt &&
+       grep "for-each-repo --config=maintenance.repo maintenance run --schedule=weekly" cron.txt
+'
+
+test_expect_success 'stop from existing schedule' '
+       GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance stop &&
+
+       # stop does not unregister the repo
+       git config --get --global --fixed-value maintenance.repo "$(pwd)" &&
+
+       # Operation is idempotent
+       GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance stop &&
+       test_must_be_empty cron.txt
+'
+
+test_expect_success 'start preserves existing schedule' '
+       echo "Important information!" >cron.txt &&
+       GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance start &&
+       grep "Important information!" cron.txt
+'
+
+test_expect_success 'register preserves existing strategy' '
+       git config maintenance.strategy none &&
+       git maintenance register &&
+       test_config maintenance.strategy none &&
+       git config --unset maintenance.strategy &&
+       git maintenance register &&
+       test_config maintenance.strategy incremental
+'
+
+test_expect_success 'fails when running outside of a repository' '
+       nongit test_must_fail git maintenance run &&
+       nongit test_must_fail git maintenance stop &&
+       nongit test_must_fail git maintenance start &&
+       nongit test_must_fail git maintenance register &&
+       nongit test_must_fail git maintenance unregister
+'
+
 test_done
index 24ae5018e8850d065da1ce0c6c33d81533ce0240..b18633dee1bfb2339033f1d0ab708979e98da018 100755 (executable)
@@ -39,10 +39,10 @@ test_expect_success 'validate --ignore-rev' '
        test_must_fail git blame --ignore-rev X^{tree} file
 '
 
-# Ensure bogus --ignore-revs-file requests are caught
+# Ensure bogus --ignore-revs-file requests are silently accepted
 test_expect_success 'validate --ignore-revs-file' '
        git rev-parse X^{tree} >ignore_x &&
-       test_must_fail git blame --ignore-revs-file ignore_x file
+       git blame --ignore-revs-file ignore_x file
 '
 
 for I in X XT
index b1c7919c4afa4180a00be6b8f80a130495358649..03cd5c5423627fa7c5162fb84ad41cdb1960a645 100755 (executable)
@@ -37,16 +37,30 @@ test_expect_success 'autocorrect showing candidates' '
        grep "^ distimdistim" actual
 '
 
-test_expect_success 'autocorrect running commands' '
-       git config help.autocorrect -1 &&
+for immediate in -1 immediate
+do
+       test_expect_success 'autocorrect running commands' '
+               git config help.autocorrect $immediate &&
 
-       git lfg >actual &&
-       echo "a single log entry" >expect &&
-       test_cmp expect actual &&
+               git lfg >actual &&
+               echo "a single log entry" >expect &&
+               test_cmp expect actual &&
 
-       git distimdist >actual &&
-       echo "distimdistim was called" >expect &&
-       test_cmp expect actual
+               git distimdist >actual &&
+               echo "distimdistim was called" >expect &&
+               test_cmp expect actual
+       '
+done
+
+test_expect_success 'autocorrect can be declined altogether' '
+       git config help.autocorrect never &&
+
+       test_must_fail git lfg 2>actual &&
+       if test_have_prereq C_LOCALE_OUTPUT
+       then
+               grep "is not a git command" actual &&
+               test_line_count = 1 actual
+       fi
 '
 
 test_done
index 5045f02a5331fcf4cb3973e81cff22620f0ad628..57d916524ecd4125717f8b70b310e965b765571e 100755 (executable)
@@ -3,12 +3,6 @@
 test_description='compression setting of fast-import utility'
 . ./test-lib.sh
 
-# This should be moved to test-lib.sh together with the
-# copy in t0021 after both topics have graduated to 'master'.
-file_size () {
-       test-tool path-utils file-size "$1"
-}
-
 import_large () {
        (
                echo blob
@@ -24,7 +18,7 @@ do
                test_when_finished "rm -f .git/objects/pack/pack-*.*" &&
                test_when_finished "rm -rf .git/objects/??" &&
                import_large -c fastimport.unpacklimit=0 $config &&
-               sz=$(file_size .git/objects/pack/pack-*.pack) &&
+               sz=$(test_file_size .git/objects/pack/pack-*.pack) &&
                case "$expect" in
                small) test "$sz" -le 100000 ;;
                large) test "$sz" -ge 100000 ;;
@@ -47,7 +41,7 @@ do
                test_when_finished "rm -f .git/objects/pack/pack-*.*" &&
                test_when_finished "rm -rf .git/objects/??" &&
                import_large -c fastimport.unpacklimit=9 $config &&
-               sz=$(file_size .git/objects/??/????*) &&
+               sz=$(test_file_size .git/objects/??/????*) &&
                case "$expect" in
                small) test "$sz" -le 100000 ;;
                large) test "$sz" -ge 100000 ;;
diff --git a/t/t9304-fast-import-marks.sh b/t/t9304-fast-import-marks.sh
new file mode 100755 (executable)
index 0000000..d4359db
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+test_description='test exotic situations with marks'
+. ./test-lib.sh
+
+test_expect_success 'setup dump of basic history' '
+       test_commit one &&
+       git fast-export --export-marks=marks HEAD >dump
+'
+
+test_expect_success 'setup large marks file' '
+       # normally a marks file would have a lot of useful, unique
+       # marks. But for our purposes, just having a lot of nonsense
+       # ones is fine. Start at 1024 to avoid clashing with marks
+       # legitimately used in our tiny dump.
+       blob=$(git rev-parse HEAD:one.t) &&
+       for i in $(test_seq 1024 16384)
+       do
+               echo ":$i $blob"
+       done >>marks
+'
+
+test_expect_success 'import with large marks file' '
+       git fast-import --import-marks=marks <dump
+'
+
+test_expect_success 'setup dump with submodule' '
+       git submodule add "$PWD" sub &&
+       git commit -m "add submodule" &&
+       git fast-export HEAD >dump
+'
+
+test_expect_success 'setup submodule mapping with large id' '
+       old=$(git rev-parse HEAD:sub) &&
+       new=$(echo $old | sed s/./a/g) &&
+       echo ":12345 $old" >from &&
+       echo ":12345 $new" >to
+'
+
+test_expect_success 'import with submodule mapping' '
+       git init dst &&
+       git -C dst fast-import \
+               --rewrite-submodules-from=sub:../from \
+               --rewrite-submodules-to=sub:../to \
+               <dump &&
+       git -C dst rev-parse HEAD:sub >actual &&
+       echo "$new" >expect &&
+       test_cmp expect actual
+'
+
+test_done
index 3e64b11eac5ebb7b0c01487c5f11bf39cd9855c0..e7a91611dcf1ad6a30b7a4b3421f204e12497f32 100755 (executable)
@@ -17,23 +17,23 @@ test_description='git cvsimport testing for correct patchset estimation'
 setup_cvs_test_repository t9603
 
 test_expect_failure PERL 'import with criss cross times on revisions' '
-
-    git cvsimport -p"-x" -C module-git module &&
-    (cd module-git &&
-        git log --pretty=format:%s > ../actual-master &&
-        git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
-        echo "" >> ../actual-master &&
-       echo "" >> ../actual-A
-    ) &&
-    echo "Rev 4
+       git cvsimport -p"-x" -C module-git module &&
+       (
+               cd module-git &&
+               git log --pretty=format:%s > ../actual-master &&
+               git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
+               echo "" >> ../actual-master &&
+               echo "" >> ../actual-A
+       ) &&
+       echo "Rev 4
 Rev 3
 Rev 2
 Rev 1" > expect-master &&
-    test_cmp expect-master actual-master &&
+       test_cmp expect-master actual-master &&
 
-    echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
+       echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000
 Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
-    test_cmp expect-A actual-A
+       test_cmp expect-A actual-A
 '
 
 test_done
index 67ff2711f5f5fd9ab95cbf05df8f38868e24bbec..a3abd778f93164ed35d169d8cbb37d9ab82b628a 100755 (executable)
@@ -67,7 +67,7 @@ test_expect_success 'import main, no branch detection' '
        (
                cd "$git" &&
                git log --oneline --graph --decorate --all &&
-               git rev-list master >wc &&
+               git rev-list master -- >wc &&
                test_line_count = 4 wc
        )
 '
@@ -78,7 +78,7 @@ test_expect_success 'import branch1, no branch detection' '
        (
                cd "$git" &&
                git log --oneline --graph --decorate --all &&
-               git rev-list master >wc &&
+               git rev-list master -- >wc &&
                test_line_count = 2 wc
        )
 '
@@ -89,7 +89,7 @@ test_expect_success 'import branch2, no branch detection' '
        (
                cd "$git" &&
                git log --oneline --graph --decorate --all &&
-               git rev-list master >wc &&
+               git rev-list master -- >wc &&
                test_line_count = 2 wc
        )
 '
@@ -100,7 +100,7 @@ test_expect_success 'import depot, no branch detection' '
        (
                cd "$git" &&
                git log --oneline --graph --decorate --all &&
-               git rev-list master >wc &&
+               git rev-list master -- >wc &&
                test_line_count = 8 wc
        )
 '
@@ -114,7 +114,7 @@ test_expect_success 'import depot, branch detection' '
                git log --oneline --graph --decorate --all &&
 
                # 4 main commits
-               git rev-list master >wc &&
+               git rev-list master -- >wc &&
                test_line_count = 4 wc &&
 
                # 3 main, 1 integrate, 1 on branch2
@@ -137,7 +137,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio
                git log --oneline --graph --decorate --all &&
 
                # 4 main commits
-               git rev-list master >wc &&
+               git rev-list master -- >wc &&
                test_line_count = 4 wc &&
 
                # 3 main, 1 integrate, 1 on branch2
index 7194fb285566d7863668f8a3c66f7e55536ccb74..6b3cb0414aa08cb62817ba9f0710e6db4d282787 100755 (executable)
@@ -68,7 +68,8 @@ EOF
                cd "$git" &&
                change=$(last_shelved_change) &&
                git p4 unshelve $change &&
-               git show refs/remotes/p4-unshelved/$change | grep -q "Further description" &&
+               git show refs/remotes/p4-unshelved/$change >actual &&
+               grep -q "Further description" actual &&
                git cherry-pick refs/remotes/p4-unshelved/$change &&
                test_path_is_file file2 &&
                test_cmp file1 "$cli"/file1 &&
index 7b7bc6e4bd86a39e5d0eeede2eb566efe434e239..81a728c74336a37861a93218154cd56f020e2c65 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2012 Felipe Contreras
+# Copyright (c) 2012-2020 Felipe Contreras
 #
 
 test_description='test bash completion'
@@ -906,7 +906,7 @@ test_expect_success '__git_refs - after --opt= - full refs' '
        test_cmp expected "$actual"
 '
 
-test_expect_success '__git refs - exluding refs' '
+test_expect_success '__git refs - excluding refs' '
        cat >expected <<-EOF &&
        ^HEAD
        ^master
@@ -922,7 +922,7 @@ test_expect_success '__git refs - exluding refs' '
        test_cmp expected "$actual"
 '
 
-test_expect_success '__git refs - exluding full refs' '
+test_expect_success '__git refs - excluding full refs' '
        cat >expected <<-EOF &&
        ^refs/heads/master
        ^refs/heads/matching-branch
@@ -1055,13 +1055,13 @@ test_expect_success 'teardown after filtering matching refs' '
        git -C otherrepo branch -D matching/branch-in-other
 '
 
-test_expect_success '__git_refs - for-each-ref format specifiers in prefix' '
+test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format specifiers in prefix' '
        cat >expected <<-EOF &&
        evil-%%-%42-%(refname)..master
        EOF
        (
-               cur="evil-%%-%42-%(refname)..mas" &&
-               __git_refs "" "" "evil-%%-%42-%(refname).." mas >"$actual"
+               cur="evil-%%-%42-%(refname)..mai" &&
+               __git_refs "" "" "evil-%%-%42-%(refname).." mai >"$actual"
        ) &&
        test_cmp expected "$actual"
 '
@@ -1360,6 +1360,58 @@ test_expect_success 'git checkout - a later --no-guess overrides previous --gues
        EOF
 '
 
+test_expect_success 'git checkout - with checkout.guess = false, only completes refs' '
+       test_config checkout.guess false &&
+       test_completion "git checkout " <<-\EOF
+       HEAD Z
+       master Z
+       matching-branch Z
+       matching-tag Z
+       other/branch-in-other Z
+       other/master-in-other Z
+       EOF
+'
+
+test_expect_success 'git checkout - with checkout.guess = true, completes refs and unique remote branches for DWIM' '
+       test_config checkout.guess true &&
+       test_completion "git checkout " <<-\EOF
+       HEAD Z
+       branch-in-other Z
+       master Z
+       master-in-other Z
+       matching-branch Z
+       matching-tag Z
+       other/branch-in-other Z
+       other/master-in-other Z
+       EOF
+'
+
+test_expect_success 'git checkout - a later --guess overrides previous checkout.guess = false, complete refs and unique remote branches for DWIM' '
+       test_config checkout.guess false &&
+       test_completion "git checkout --guess " <<-\EOF
+       HEAD Z
+       branch-in-other Z
+       master Z
+       master-in-other Z
+       matching-branch Z
+       matching-tag Z
+       other/branch-in-other Z
+       other/master-in-other Z
+       EOF
+'
+
+test_expect_success 'git checkout - a later --no-guess overrides previous checkout.guess = true, complete only refs' '
+       test_config checkout.guess true &&
+       test_completion "git checkout --no-guess " <<-\EOF
+       HEAD Z
+       master Z
+       matching-branch Z
+       matching-tag Z
+       other/branch-in-other Z
+       other/master-in-other Z
+       EOF
+'
+
 test_expect_success 'git switch - with --detach, complete all references' '
        test_completion "git switch --detach " <<-\EOF
        HEAD Z
@@ -2143,6 +2195,25 @@ test_expect_success 'complete files' '
        test_completion "git add mom" "momified"
 '
 
+test_expect_success "simple alias" '
+       test_config alias.co checkout &&
+       test_completion "git co m" <<-\EOF
+       master Z
+       mybranch Z
+       mytag Z
+       EOF
+'
+
+test_expect_success "recursive alias" '
+       test_config alias.co checkout &&
+       test_config alias.cod "co --detached" &&
+       test_completion "git cod m" <<-\EOF
+       master Z
+       mybranch Z
+       mytag Z
+       EOF
+'
+
 test_expect_success "completion uses <cmd> completion for alias: !sh -c 'git <cmd> ...'" '
        test_config alias.co "!sh -c '"'"'git checkout ...'"'"'" &&
        test_completion "git co m" <<-\EOF
index 8d59b90348ea898ca983e8bbd0742de495a8d36d..999982fe4a9bd6714bf466c59f3627bafe142405 100644 (file)
@@ -367,9 +367,9 @@ test_chmod () {
        git update-index --add "--chmod=$@"
 }
 
-# Get the modebits from a file.
+# Get the modebits from a file or directory.
 test_modebits () {
-       ls -l "$1" | sed -e 's|^\(..........\).*|\1|'
+       ls -ld "$1" | sed -e 's|^\(..........\).*|\1|'
 }
 
 # Unset a configuration variable, but don't fail if it doesn't exist.
@@ -423,7 +423,7 @@ write_script () {
 # - Explicitly using test_have_prereq.
 #
 # - Implicitly by specifying the prerequisite tag in the calls to
-#   test_expect_{success,failure,code}.
+#   test_expect_{success,failure} and test_external{,_without_stderr}.
 #
 # The single parameter is the prerequisite tag (a simple word, in all
 # capital letters by convention).
@@ -474,15 +474,15 @@ test_lazy_prereq () {
 
 test_run_lazy_prereq_ () {
        script='
-mkdir -p "$TRASH_DIRECTORY/prereq-test-dir" &&
+mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-'"$1"'" &&
 (
-       cd "$TRASH_DIRECTORY/prereq-test-dir" &&'"$2"'
+       cd "$TRASH_DIRECTORY/prereq-test-dir-'"$1"'" &&'"$2"'
 )'
        say >&3 "checking prerequisite: $1"
        say >&3 "$script"
        test_eval_ "$script"
        eval_ret=$?
-       rm -rf "$TRASH_DIRECTORY/prereq-test-dir"
+       rm -rf "$TRASH_DIRECTORY/prereq-test-dir-$1"
        if test "$eval_ret" = 0; then
                say >&3 "prerequisite $1 ok"
        else
@@ -783,6 +783,10 @@ test_line_count () {
        fi
 }
 
+test_file_size () {
+       test-tool path-utils file-size "$1"
+}
+
 # Returns success if a comma separated string of keywords ($1) contains a
 # given keyword ($2).
 # Examples:
@@ -951,14 +955,8 @@ test_expect_code () {
 # - cmp's output is not nearly as easy to read as diff -u
 # - not all diff versions understand "-u"
 
-test_cmp() {
-       test $# -eq 2 || BUG "test_cmp requires two arguments"
-       if ! eval "$GIT_TEST_CMP" '"$@"'
-       then
-               test "x$1" = x- || test -e "$1" || BUG "test_cmp '$1' missing"
-               test "x$2" = x- || test -e "$2" || BUG "test_cmp '$2' missing"
-               return 1
-       fi
+test_cmp () {
+       eval "$GIT_TEST_CMP" '"$@"'
 }
 
 # Check that the given config key has the expected value.
@@ -970,7 +968,7 @@ test_cmp() {
 #
 #    test_cmp_config foo core.bar
 #
-test_cmp_config() {
+test_cmp_config () {
        local GD &&
        if test "$1" = "-C"
        then
@@ -986,14 +984,8 @@ test_cmp_config() {
 
 # test_cmp_bin - helper to compare binary files
 
-test_cmp_bin() {
-       test $# -eq 2 || BUG "test_cmp_bin requires two arguments"
-       if ! cmp "$@"
-       then
-               test "x$1" = x- || test -e "$1" || BUG "test_cmp_bin '$1' missing"
-               test "x$2" = x- || test -e "$2" || BUG "test_cmp_bin '$2' missing"
-               return 1
-       fi
+test_cmp_bin () {
+       cmp "$@"
 }
 
 # Use this instead of test_cmp to compare files that contain expected and
@@ -1210,7 +1202,9 @@ test_create_repo () {
        mkdir -p "$repo"
        (
                cd "$repo" || error "Cannot setup test environment"
-               "${GIT_TEST_INSTALLED:-$GIT_EXEC_PATH}/git$X" init \
+               "${GIT_TEST_INSTALLED:-$GIT_EXEC_PATH}/git$X" -c \
+                       init.defaultBranch="${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}" \
+                       init \
                        "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
                error "cannot run git init -- have you built things yet?"
                mv .git/hooks .git/hooks-disabled
@@ -1426,7 +1420,7 @@ nongit () {
 # whitespace and put in a single packet. Note that data containing NULs must be
 # given on stdin, and that empty input becomes an empty packet, not a flush
 # packet (for that you can just print 0000 yourself).
-packetize() {
+packetize () {
        if test $# -gt 0
        then
                packet="$*"
index ef31f400374755015ccec300bdb450021aeccc17..a863ccee7e9a6a24183cdaa8e5bdc07b20fa24ee 100644 (file)
@@ -499,6 +499,12 @@ then
        export GIT_INDEX_VERSION
 fi
 
+if test -n "$GIT_TEST_PERL_FATAL_WARNINGS"
+then
+       GIT_PERL_FATAL_WARNINGS=1
+       export GIT_PERL_FATAL_WARNINGS
+fi
+
 # Add libc MALLOC and MALLOC_PERTURB test
 # only if we are not executing the test with valgrind
 if test -n "$valgrind" ||
@@ -769,15 +775,17 @@ match_pattern_list () {
 }
 
 match_test_selector_list () {
+       operation="$1"
+       shift
        title="$1"
        shift
        arg="$1"
        shift
        test -z "$1" && return 0
 
-       # Both commas and whitespace are accepted as separators.
+       # Commas are accepted as separators.
        OLDIFS=$IFS
-       IFS='   ,'
+       IFS=','
        set -- $1
        IFS=$OLDIFS
 
@@ -805,13 +813,13 @@ match_test_selector_list () {
                        *-*)
                                if expr "z${selector%%-*}" : "z[0-9]*[^0-9]" >/dev/null
                                then
-                                       echo "error: $title: invalid non-numeric in range" \
+                                       echo "error: $operation: invalid non-numeric in range" \
                                                "start: '$orig_selector'" >&2
                                        exit 1
                                fi
                                if expr "z${selector#*-}" : "z[0-9]*[^0-9]" >/dev/null
                                then
-                                       echo "error: $title: invalid non-numeric in range" \
+                                       echo "error: $operation: invalid non-numeric in range" \
                                                "end: '$orig_selector'" >&2
                                        exit 1
                                fi
@@ -819,9 +827,11 @@ match_test_selector_list () {
                        *)
                                if expr "z$selector" : "z[0-9]*[^0-9]" >/dev/null
                                then
-                                       echo "error: $title: invalid non-numeric in test" \
-                                               "selector: '$orig_selector'" >&2
-                                       exit 1
+                                       case "$title" in *${selector}*)
+                                               include=$positive
+                                               ;;
+                                       esac
+                                       continue
                                fi
                esac
 
@@ -1031,7 +1041,7 @@ test_skip () {
                skipped_reason="GIT_SKIP_TESTS"
        fi
        if test -z "$to_skip" && test -n "$run_list" &&
-          ! match_test_selector_list '--run' $test_count "$run_list"
+          ! match_test_selector_list '--run' "$1" $test_count "$run_list"
        then
                to_skip=t
                skipped_reason="--run"
@@ -1058,7 +1068,6 @@ test_skip () {
                                "      <skipped message=\"$message\" />"
                fi
 
-               say_color skip >&3 "skipping test: $@"
                say_color skip "ok $test_count # skip $1 ($skipped_reason)"
                : true
                ;;
@@ -1702,3 +1711,17 @@ test_lazy_prereq SHA1 '
 test_lazy_prereq REBASE_P '
        test -z "$GIT_TEST_SKIP_REBASE_P"
 '
+
+# Special-purpose prereq for transitioning to a new default branch name:
+# Some tests need more than just a mindless (case-preserving) s/master/main/g
+# replacement. The non-trivial adjustments are guarded behind this
+# prerequisite, acting kind of as a feature flag
+test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
+       test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
+'
+
+# Ensure that no test accidentally triggers a Git command
+# that runs 'crontab', affecting a user's cron schedule.
+# Tests that verify the cron integration must set this locally
+# to avoid errors.
+GIT_TEST_CRONTAB="exit 1"
diff --git a/templates/hooks--push-to-checkout.sample b/templates/hooks--push-to-checkout.sample
new file mode 100755 (executable)
index 0000000..af5a0c0
--- /dev/null
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+# An example hook script to update a checked-out tree on a git push.
+#
+# This hook is invoked by git-receive-pack(1) when it reacts to git
+# push and updates reference(s) in its repository, and when the push
+# tries to update the branch that is currently checked out and the
+# receive.denyCurrentBranch configuration variable is set to
+# updateInstead.
+#
+# By default, such a push is refused if the working tree and the index
+# of the remote repository has any difference from the currently
+# checked out commit; when both the working tree and the index match
+# the current commit, they are updated to match the newly pushed tip
+# of the branch. This hook is to be used to override the default
+# behaviour; however the code below reimplements the default behaviour
+# as a starting point for convenient modification.
+#
+# The hook receives the commit with which the tip of the current
+# branch is going to be updated:
+commit=$1
+
+# It can exit with a non-zero status to refuse the push (when it does
+# so, it must not modify the index or the working tree).
+die () {
+       echo >&2 "$*"
+       exit 1
+}
+
+# Or it can make any necessary changes to the working tree and to the
+# index to bring them to the desired state when the tip of the current
+# branch is updated to the new commit, and exit with a zero status.
+#
+# For example, the hook can simply run git read-tree -u -m HEAD "$1"
+# in order to emulate git fetch that is run in the reverse direction
+# with git push, as the two-tree form of git read-tree -u -m is
+# essentially the same as git switch or git checkout that switches
+# branches while keeping the local changes in the working tree that do
+# not interfere with the difference between the branches.
+
+# The below is a more-or-less exact translation to shell of the C code
+# for the default behaviour for git's push-to-checkout hook defined in
+# the push_to_deploy() function in builtin/receive-pack.c.
+#
+# Note that the hook will be executed from the repository directory,
+# not from the working tree, so if you want to perform operations on
+# the working tree, you will have to adapt your code accordingly, e.g.
+# by adding "cd .." or using relative paths.
+
+if ! git update-index -q --ignore-submodules --refresh
+then
+       die "Up-to-date check failed"
+fi
+
+if ! git diff-files --quiet --ignore-submodules --
+then
+       die "Working directory has unstaged changes"
+fi
+
+# This is a rough translation of:
+#
+#   head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX
+if git cat-file -e HEAD 2>/dev/null
+then
+       head=HEAD
+else
+       head=$(git hash-object -t tree --stdin </dev/null)
+fi
+
+if ! git diff-index --quiet --cached --ignore-submodules $head --
+then
+       die "Working directory has staged changes"
+fi
+
+if ! git read-tree -u -m "$commit"
+then
+       die "Could not update working tree to new HEAD"
+fi
index 2c6b570077b3980e9ecfeb088d49a125362610f7..256120c7fd553e81d82a1a6e1c883af6213e46b6 100644 (file)
--- a/trace2.c
+++ b/trace2.c
@@ -792,3 +792,8 @@ void trace2_printf(const char *fmt, ...)
        va_end(ap);
 }
 #endif
+
+const char *trace2_session_id(void)
+{
+       return tr2_sid_get();
+}
index b18bc5529c6e9a4692f30005ec1ca3d1803821b5..ede18c2e06373f30679a6c0ecf77b794225edbc5 100644 (file)
--- a/trace2.h
+++ b/trace2.h
@@ -500,4 +500,6 @@ void trace2_collect_process_info(enum trace2_process_info_reason reason);
        } while (0)
 #endif
 
+const char *trace2_session_id(void);
+
 #endif /* TRACE2_H */
index b573b6c730ccf49d2805a27b14957504f2218f41..5f6e0b3bd874dba714c107dffebd423ef25d10b4 100644 (file)
@@ -827,6 +827,10 @@ static int push_update_ref_status(struct strbuf *buf,
                        status = REF_STATUS_REJECT_STALE;
                        FREE_AND_NULL(msg);
                }
+               else if (!strcmp(msg, "remote ref updated since checkout")) {
+                       status = REF_STATUS_REJECT_REMOTE_UPDATED;
+                       FREE_AND_NULL(msg);
+               }
                else if (!strcmp(msg, "forced update")) {
                        forced = 1;
                        FREE_AND_NULL(msg);
@@ -934,6 +938,11 @@ static void set_common_push_options(struct transport *transport,
                if (set_helper_option(transport, TRANS_OPT_ATOMIC, "true") != 0)
                        die(_("helper %s does not support --atomic"), name);
 
+       if (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES)
+               if (set_helper_option(transport, TRANS_OPT_FORCE_IF_INCLUDES, "true") != 0)
+                       die(_("helper %s does not support --%s"),
+                           name, TRANS_OPT_FORCE_IF_INCLUDES);
+
        if (flags & TRANSPORT_PUSH_OPTIONS) {
                struct string_list_item *item;
                for_each_string_list_item(item, transport->push_options)
@@ -967,6 +976,7 @@ static int push_refs_with_push(struct transport *transport,
                case REF_STATUS_REJECT_NONFASTFORWARD:
                case REF_STATUS_REJECT_STALE:
                case REF_STATUS_REJECT_ALREADY_EXISTS:
+               case REF_STATUS_REJECT_REMOTE_UPDATED:
                        if (atomic) {
                                reject_atomic_push(remote_refs, mirror);
                                string_list_clear(&cas_options, 0);
index ffe21158455116972dd8b0cf77167948fb6e66e6..679a35e7c1b6168d3b8fc93f72ec9a50178d894c 100644 (file)
@@ -286,6 +286,8 @@ static struct ref *handshake(struct transport *transport, int for_push,
        struct git_transport_data *data = transport->data;
        struct ref *refs = NULL;
        struct packet_reader reader;
+       int sid_len;
+       const char *server_sid;
 
        connect_setup(transport, for_push);
 
@@ -297,6 +299,8 @@ static struct ref *handshake(struct transport *transport, int for_push,
        data->version = discover_version(&reader);
        switch (data->version) {
        case protocol_v2:
+               if (server_feature_v2("session-id", &server_sid))
+                       trace2_data_string("transfer", NULL, "server-sid", server_sid);
                if (must_list_refs)
                        get_remote_refs(data->fd[1], &reader, &refs, for_push,
                                        ref_prefixes,
@@ -310,6 +314,12 @@ static struct ref *handshake(struct transport *transport, int for_push,
                                 for_push ? REF_NORMAL : 0,
                                 &data->extra_have,
                                 &data->shallow);
+               server_sid = server_feature_value("session-id", &sid_len);
+               if (server_sid) {
+                       char *sid = xstrndup(server_sid, sid_len);
+                       trace2_data_string("transfer", NULL, "server-sid", sid);
+                       free(sid);
+               }
                break;
        case protocol_unknown_version:
                BUG("unknown protocol version");
@@ -633,6 +643,11 @@ static int print_one_push_report(struct ref *ref, const char *dest, int count,
                                 "stale info",
                                 report, porcelain, summary_width);
                break;
+       case REF_STATUS_REJECT_REMOTE_UPDATED:
+               print_ref_status('!', "[rejected]", ref, ref->peer_ref,
+                                "remote ref updated since checkout",
+                                report, porcelain, summary_width);
+               break;
        case REF_STATUS_REJECT_SHALLOW:
                print_ref_status('!', "[rejected]", ref, ref->peer_ref,
                                 "new shallow roots not allowed",
@@ -743,6 +758,8 @@ void transport_print_push_status(const char *dest, struct ref *refs,
                        *reject_reasons |= REJECT_FETCH_FIRST;
                } else if (ref->status == REF_STATUS_REJECT_NEEDS_FORCE) {
                        *reject_reasons |= REJECT_NEEDS_FORCE;
+               } else if (ref->status == REF_STATUS_REJECT_REMOTE_UPDATED) {
+                       *reject_reasons |= REJECT_REF_NEEDS_UPDATE;
                }
        }
        free(head);
@@ -1185,6 +1202,7 @@ static int run_pre_push_hook(struct transport *transport,
                if (!r->peer_ref) continue;
                if (r->status == REF_STATUS_REJECT_NONFASTFORWARD) continue;
                if (r->status == REF_STATUS_REJECT_STALE) continue;
+               if (r->status == REF_STATUS_REJECT_REMOTE_UPDATED) continue;
                if (r->status == REF_STATUS_UPTODATE) continue;
 
                strbuf_reset(&buf);
index ca409ea1e407c1c67e70e764e734946f7e22372e..24558c027d61bba1dd99b17a1c9d1cd484b1cb8a 100644 (file)
@@ -136,6 +136,7 @@ struct transport {
 #define TRANSPORT_PUSH_ATOMIC                  (1<<13)
 #define TRANSPORT_PUSH_OPTIONS                 (1<<14)
 #define TRANSPORT_RECURSE_SUBMODULES_ONLY      (1<<15)
+#define TRANSPORT_PUSH_FORCE_IF_INCLUDES       (1<<16)
 
 int transport_summary_width(const struct ref *refs);
 
@@ -208,6 +209,9 @@ void transport_check_allowed(const char *type);
 /* Request atomic (all-or-nothing) updates when pushing */
 #define TRANS_OPT_ATOMIC "atomic"
 
+/* Require remote changes to be integrated locally. */
+#define TRANS_OPT_FORCE_IF_INCLUDES "force-if-includes"
+
 /**
  * Returns 0 if the option was used, non-zero otherwise. Prints a
  * message to stderr if the option is not used.
@@ -217,11 +221,12 @@ int transport_set_option(struct transport *transport, const char *name,
 void transport_set_verbosity(struct transport *transport, int verbosity,
        int force_progress);
 
-#define REJECT_NON_FF_HEAD     0x01
-#define REJECT_NON_FF_OTHER    0x02
-#define REJECT_ALREADY_EXISTS  0x04
-#define REJECT_FETCH_FIRST     0x08
-#define REJECT_NEEDS_FORCE     0x10
+#define REJECT_NON_FF_HEAD      0x01
+#define REJECT_NON_FF_OTHER     0x02
+#define REJECT_ALREADY_EXISTS   0x04
+#define REJECT_FETCH_FIRST      0x08
+#define REJECT_NEEDS_FORCE      0x10
+#define REJECT_REF_NEEDS_UPDATE 0x20
 
 int transport_push(struct repository *repo,
                   struct transport *connection,
index 3b858eb457e557592dada080f95f3fe7e218b24b..3b66bf92ba8ec074aea13e21d630cbce4a605aea 100644 (file)
@@ -110,6 +110,7 @@ struct upload_pack_data {
        unsigned done : 1;                                      /* v2 only */
        unsigned allow_ref_in_want : 1;                         /* v2 only */
        unsigned allow_sideband_all : 1;                        /* v2 only */
+       unsigned advertise_sid : 1;
 };
 
 static void upload_pack_data_init(struct upload_pack_data *data)
@@ -141,6 +142,7 @@ static void upload_pack_data_init(struct upload_pack_data *data)
        packet_writer_init(&data->writer, 1);
 
        data->keepalive = 5;
+       data->advertise_sid = 0;
 }
 
 static void upload_pack_data_clear(struct upload_pack_data *data)
@@ -154,7 +156,7 @@ static void upload_pack_data_clear(struct upload_pack_data *data)
        string_list_clear(&data->deepen_not, 0);
        object_array_clear(&data->extra_edge_obj);
        list_objects_filter_release(&data->filter_options);
-       string_list_clear(&data->allowed_filters, 1);
+       string_list_clear(&data->allowed_filters, 0);
 
        free((char *)data->pack_objects_hook);
 }
@@ -321,6 +323,7 @@ static void create_pack_file(struct upload_pack_data *pack_data,
        pack_objects.in = -1;
        pack_objects.out = -1;
        pack_objects.err = -1;
+       pack_objects.clean_on_exit = 1;
 
        if (start_command(&pack_objects))
                die("git upload-pack: unable to fork git-pack-objects");
@@ -1056,6 +1059,7 @@ static void receive_needs(struct upload_pack_data *data,
                const char *features;
                struct object_id oid_buf;
                const char *arg;
+               int feature_len;
 
                reset_timeout(data->timeout);
                if (packet_reader_read(reader) != PACKET_READ_NORMAL)
@@ -1108,6 +1112,13 @@ static void receive_needs(struct upload_pack_data *data,
                    parse_feature_request(features, "filter"))
                        data->filter_capability_requested = 1;
 
+               arg = parse_feature_value(features, "session-id", &feature_len, NULL);
+               if (arg) {
+                       char *client_sid = xstrndup(arg, feature_len);
+                       trace2_data_string("transfer", NULL, "client-sid", client_sid);
+                       free(client_sid);
+               }
+
                o = parse_object(the_repository, &oid_buf);
                if (!o) {
                        packet_writer_error(&data->writer,
@@ -1178,6 +1189,11 @@ static void format_symref_info(struct strbuf *buf, struct string_list *symref)
                strbuf_addf(buf, " symref=%s:%s", item->string, (char *)item->util);
 }
 
+static void format_session_id(struct strbuf *buf, struct upload_pack_data *d) {
+       if (d->advertise_sid)
+               strbuf_addf(buf, " session-id=%s", trace2_session_id());
+}
+
 static int send_ref(const char *refname, const struct object_id *oid,
                    int flag, void *cb_data)
 {
@@ -1193,9 +1209,11 @@ static int send_ref(const char *refname, const struct object_id *oid,
 
        if (capabilities) {
                struct strbuf symref_info = STRBUF_INIT;
+               struct strbuf session_id = STRBUF_INIT;
 
                format_symref_info(&symref_info, &data->symref);
-               packet_write_fmt(1, "%s %s%c%s%s%s%s%s%s object-format=%s agent=%s\n",
+               format_session_id(&session_id, data);
+               packet_write_fmt(1, "%s %s%c%s%s%s%s%s%s%s object-format=%s agent=%s\n",
                             oid_to_hex(oid), refname_nons,
                             0, capabilities,
                             (data->allow_uor & ALLOW_TIP_SHA1) ?
@@ -1205,9 +1223,11 @@ static int send_ref(const char *refname, const struct object_id *oid,
                             data->stateless_rpc ? " no-done" : "",
                             symref_info.buf,
                             data->allow_filter ? " filter" : "",
+                            session_id.buf,
                             the_hash_algo->name,
                             git_user_agent_sanitized());
                strbuf_release(&symref_info);
+               strbuf_release(&session_id);
        } else {
                packet_write_fmt(1, "%s %s\n", oid_to_hex(oid), refname_nons);
        }
@@ -1299,15 +1319,18 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
                data->allow_sideband_all = git_config_bool(var, value);
        } else if (!strcmp("core.precomposeunicode", var)) {
                precomposed_unicode = git_config_bool(var, value);
+       } else if (!strcmp("transfer.advertisesid", var)) {
+               data->advertise_sid = git_config_bool(var, value);
        }
 
        if (current_config_scope() != CONFIG_SCOPE_LOCAL &&
-       current_config_scope() != CONFIG_SCOPE_WORKTREE) {
+           current_config_scope() != CONFIG_SCOPE_WORKTREE) {
                if (!strcmp("uploadpack.packobjectshook", var))
                        return git_config_string(&data->pack_objects_hook, var, value);
        }
 
-       parse_object_filter_config(var, value, data);
+       if (parse_object_filter_config(var, value, data) < 0)
+               return -1;
 
        return parse_hide_refs_config(var, value, "uploadpack");
 }
@@ -1344,7 +1367,18 @@ void upload_pack(struct upload_pack_options *options)
                                   PACKET_READ_DIE_ON_ERR_PACKET);
 
                receive_needs(&data, &reader);
-               if (data.want_obj.nr) {
+
+               /*
+                * An EOF at this exact point in negotiation should be
+                * acceptable from stateless clients as they will consume the
+                * shallow list before doing subsequent rpc with haves/etc.
+                */
+               if (data.stateless_rpc)
+                       reader.options |= PACKET_READ_GENTLE_ON_EOF;
+
+               if (data.want_obj.nr &&
+                   packet_reader_peek(&reader) != PACKET_READ_EOF) {
+                       reader.options &= ~PACKET_READ_GENTLE_ON_EOF;
                        get_common_commits(&data, &reader);
                        create_pack_file(&data, NULL);
                }
diff --git a/usage.c b/usage.c
index 58fb5fff5f245c33898e27c85296a4a47325c34e..1868a24f7a5148b1714dc4a9730f343339e61dce 100644 (file)
--- a/usage.c
+++ b/usage.c
@@ -81,6 +81,12 @@ static void error_builtin(const char *err, va_list params)
 
 static void warn_builtin(const char *warn, va_list params)
 {
+       /*
+        * We call this trace2 function first and expect it to va_copy 'params'
+        * before using it (because an 'ap' can only be walked once).
+        */
+       trace2_cmd_error_va(warn, params);
+
        vreportf("warning: ", warn, params);
 }
 
@@ -108,33 +114,33 @@ static int die_is_recursing_builtin(void)
 
 /* If we are in a dlopen()ed .so write to a global variable would segfault
  * (ugh), so keep things static. */
-static NORETURN_PTR void (*usage_routine)(const char *err, va_list params) = usage_builtin;
-static NORETURN_PTR void (*die_routine)(const char *err, va_list params) = die_builtin;
-static void (*error_routine)(const char *err, va_list params) = error_builtin;
-static void (*warn_routine)(const char *err, va_list params) = warn_builtin;
+static NORETURN_PTR report_fn usage_routine = usage_builtin;
+static NORETURN_PTR report_fn die_routine = die_builtin;
+static report_fn error_routine = error_builtin;
+static report_fn warn_routine = warn_builtin;
 static int (*die_is_recursing)(void) = die_is_recursing_builtin;
 
-void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params))
+void set_die_routine(NORETURN_PTR report_fn routine)
 {
        die_routine = routine;
 }
 
-void set_error_routine(void (*routine)(const char *err, va_list params))
+void set_error_routine(report_fn routine)
 {
        error_routine = routine;
 }
 
-void (*get_error_routine(void))(const char *err, va_list params)
+report_fn get_error_routine(void)
 {
        return error_routine;
 }
 
-void set_warn_routine(void (*routine)(const char *warn, va_list params))
+void set_warn_routine(report_fn routine)
 {
        warn_routine = routine;
 }
 
-void (*get_warn_routine(void))(const char *warn, va_list params)
+report_fn get_warn_routine(void)
 {
        return warn_routine;
 }
index fde02f225b2b9ed17a8246913c3bddfa6483c98b..3f81a2261c5e97e5cf50c1dc45ed196da8759f69 100644 (file)
@@ -23,6 +23,27 @@ IPATTERN("ada",
         "[a-zA-Z][a-zA-Z0-9_]*"
         "|[-+]?[0-9][0-9#_.aAbBcCdDeEfF]*([eE][+-]?[0-9_]+)?"
         "|=>|\\.\\.|\\*\\*|:=|/=|>=|<=|<<|>>|<>"),
+PATTERNS("bash",
+        /* Optional leading indentation */
+        "^[ \t]*"
+        /* Start of captured text */
+        "("
+        "("
+            /* POSIX identifier with mandatory parentheses */
+            "[a-zA-Z_][a-zA-Z0-9_]*[ \t]*\\([ \t]*\\))"
+        "|"
+            /* Bashism identifier with optional parentheses */
+            "(function[ \t]+[a-zA-Z_][a-zA-Z0-9_]*(([ \t]*\\([ \t]*\\))|([ \t]+))"
+        ")"
+        /* Optional whitespace */
+        "[ \t]*"
+        /* Compound command starting with `{`, `(`, `((` or `[[` */
+        "(\\{|\\(\\(?|\\[\\[)"
+        /* End of captured text */
+        ")",
+        /* -- */
+        /* Characters not in the default $IFS value */
+        "[^ \t]+"),
 PATTERNS("dts",
         "!;\n"
         "!=\n"
@@ -147,7 +168,7 @@ PATTERNS("perl",
         "|=~|!~"
         "|<<|<>|<=>|>>"),
 PATTERNS("php",
-        "^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
+        "^[\t ]*(((public|protected|private|static|abstract|final)[\t ]+)*function.*)$\n"
         "^[\t ]*((((final|abstract)[\t ]+)?class|interface|trait).*)$",
         /* -- */
         "[a-zA-Z_][a-zA-Z0-9_]*"
@@ -165,7 +186,7 @@ PATTERNS("ruby", "^[ \t]*((class|module|def)[ \t].*)$",
         "|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."
         "|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\.{1,3}|::|[!=]~"),
 PATTERNS("rust",
-        "^[\t ]*((pub(\\([^\\)]+\\))?[\t ]+)?((async|const|unsafe|extern([\t ]+\"[^\"]+\"))[\t ]+)?(struct|enum|union|mod|trait|fn|impl)[< \t]+[^;]*)$",
+        "^[\t ]*((pub(\\([^\\)]+\\))?[\t ]+)?((async|const|unsafe|extern([\t ]+\"[^\"]+\"))[\t ]+)?(struct|enum|union|mod|trait|fn|impl|macro_rules!)[< \t]+[^;]*)$",
         /* -- */
         "[a-zA-Z_][a-zA-Z0-9_]*"
         "|[0-9][0-9_a-fA-Fiosuxz]*(\\.([0-9]*[eE][+-]?)?[0-9_fF]*)?"
@@ -200,7 +221,7 @@ PATTERNS("csharp",
         "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
 IPATTERN("css",
         "![:;][[:space:]]*$\n"
-        "^[_a-z0-9].*$",
+        "^[:[@.#]?[_a-z0-9].*$",
         /* -- */
         /*
          * This regex comes from W3C CSS specs. Should theoretically also
index 032e3a9f41a2f79eaab78ae36666b8b6218b3899..7a046051468f9e7e804d9eb7f0bd7eeeba6727db 100644 (file)
@@ -79,6 +79,10 @@ typedef struct s_mmbuffer {
 typedef struct s_xpparam {
        unsigned long flags;
 
+       /* -I<regex> */
+       regex_t **ignore_regex;
+       size_t ignore_regex_nr;
+
        /* See Documentation/diff-options.txt. */
        char **anchors;
        size_t anchors_nr;
index bd035139f954a61b5f3dc30d9fdedfbdb2a7972b..380eb728ed4ea579678195b66b856fb297b892cf 100644 (file)
@@ -998,7 +998,7 @@ static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
        return 0;
 }
 
-static void xdl_mark_ignorable(xdchange_t *xscr, xdfenv_t *xe, long flags)
+static void xdl_mark_ignorable_lines(xdchange_t *xscr, xdfenv_t *xe, long flags)
 {
        xdchange_t *xch;
 
@@ -1019,6 +1019,46 @@ static void xdl_mark_ignorable(xdchange_t *xscr, xdfenv_t *xe, long flags)
        }
 }
 
+static int record_matches_regex(xrecord_t *rec, xpparam_t const *xpp) {
+       regmatch_t regmatch;
+       int i;
+
+       for (i = 0; i < xpp->ignore_regex_nr; i++)
+               if (!regexec_buf(xpp->ignore_regex[i], rec->ptr, rec->size, 1,
+                                &regmatch, 0))
+                       return 1;
+
+       return 0;
+}
+
+static void xdl_mark_ignorable_regex(xdchange_t *xscr, const xdfenv_t *xe,
+                                    xpparam_t const *xpp)
+{
+       xdchange_t *xch;
+
+       for (xch = xscr; xch; xch = xch->next) {
+               xrecord_t **rec;
+               int ignore = 1;
+               long i;
+
+               /*
+                * Do not override --ignore-blank-lines.
+                */
+               if (xch->ignore)
+                       continue;
+
+               rec = &xe->xdf1.recs[xch->i1];
+               for (i = 0; i < xch->chg1 && ignore; i++)
+                       ignore = record_matches_regex(rec[i], xpp);
+
+               rec = &xe->xdf2.recs[xch->i2];
+               for (i = 0; i < xch->chg2 && ignore; i++)
+                       ignore = record_matches_regex(rec[i], xpp);
+
+               xch->ignore = ignore;
+       }
+}
+
 int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
             xdemitconf_t const *xecfg, xdemitcb_t *ecb) {
        xdchange_t *xscr;
@@ -1038,7 +1078,10 @@ int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
        }
        if (xscr) {
                if (xpp->flags & XDF_IGNORE_BLANK_LINES)
-                       xdl_mark_ignorable(xscr, &xe, xpp->flags);
+                       xdl_mark_ignorable_lines(xscr, &xe, xpp->flags);
+
+               if (xpp->ignore_regex)
+                       xdl_mark_ignorable_regex(xscr, &xe, xpp);
 
                if (ef(&xe, xscr, ecb, xecfg) < 0) {
 
index c7b35a9667f322c151bc8de276654ecd38974aef..e694bfd9e31d54f1925a730a75b0ef6d9a4e6d95 100644 (file)
@@ -235,6 +235,8 @@ static int fall_back_to_classic_diff(xpparam_t const *xpp, xdfenv_t *env,
                int line1, int count1, int line2, int count2)
 {
        xpparam_t xpparam;
+
+       memset(&xpparam, 0, sizeof(xpparam));
        xpparam.flags = xpp->flags & ~XDF_DIFF_ALGORITHM_MASK;
 
        return xdl_fall_back_diff(env, &xpparam,
index 3c5601b602a24cb6cd6e063466369b1a90a14f9f..20699a6f60547a88b5f07df0ab6651ccef5bff60 100644 (file)
@@ -318,6 +318,8 @@ static int fall_back_to_classic_diff(struct hashmap *map,
                int line1, int count1, int line2, int count2)
 {
        xpparam_t xpp;
+
+       memset(&xpp, 0, sizeof(xpp));
        xpp.flags = map->xpp->flags & ~XDF_DIFF_ALGORITHM_MASK;
 
        return xdl_fall_back_diff(map->env, &xpp,