]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tl/notes-separator'
authorJunio C Hamano <gitster@pobox.com>
Thu, 17 Aug 2023 22:50:05 +0000 (15:50 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Aug 2023 22:50:05 +0000 (15:50 -0700)
Typo/grammofix to documentation added during this cycle.

* tl/notes-separator:
  notes doc: tidy up `--no-stripspace` paragraph
  notes doc: split up run-on sentences

782 files changed:
.github/workflows/main.yml
.gitignore
.mailmap
Documentation/CodingGuidelines
Documentation/Makefile
Documentation/MyFirstContribution.txt
Documentation/MyFirstObjectWalk.txt
Documentation/RelNotes/2.30.9.txt [new file with mode: 0644]
Documentation/RelNotes/2.31.8.txt [new file with mode: 0644]
Documentation/RelNotes/2.32.7.txt [new file with mode: 0644]
Documentation/RelNotes/2.33.8.txt [new file with mode: 0644]
Documentation/RelNotes/2.34.8.txt [new file with mode: 0644]
Documentation/RelNotes/2.35.8.txt [new file with mode: 0644]
Documentation/RelNotes/2.36.6.txt [new file with mode: 0644]
Documentation/RelNotes/2.37.7.txt [new file with mode: 0644]
Documentation/RelNotes/2.38.5.txt [new file with mode: 0644]
Documentation/RelNotes/2.39.3.txt
Documentation/RelNotes/2.40.1.txt [new file with mode: 0644]
Documentation/RelNotes/2.41.0.txt
Documentation/RelNotes/2.42.0.txt [new file with mode: 0644]
Documentation/SubmittingPatches
Documentation/blame-options.txt
Documentation/config.txt
Documentation/config/advice.txt
Documentation/config/feature.txt
Documentation/config/gc.txt
Documentation/config/http.txt
Documentation/config/pack.txt
Documentation/config/sendemail.txt
Documentation/diff-options.txt
Documentation/doc-diff
Documentation/fetch-options.txt
Documentation/git-bisect.txt
Documentation/git-cat-file.txt
Documentation/git-checkout.txt
Documentation/git-credential.txt
Documentation/git-cvsserver.txt
Documentation/git-describe.txt
Documentation/git-diff.txt
Documentation/git-fetch.txt
Documentation/git-for-each-ref.txt
Documentation/git-format-patch.txt
Documentation/git-gc.txt
Documentation/git-hash-object.txt
Documentation/git-interpret-trailers.txt
Documentation/git-ls-files.txt
Documentation/git-ls-remote.txt
Documentation/git-ls-tree.txt
Documentation/git-merge.txt
Documentation/git-mktag.txt
Documentation/git-name-rev.txt
Documentation/git-pack-refs.txt
Documentation/git-push.txt
Documentation/git-send-email.txt
Documentation/git-show-branch.txt
Documentation/git-show-ref.txt
Documentation/git-sparse-checkout.txt
Documentation/git-stash.txt
Documentation/git-submodule.txt
Documentation/git-tag.txt
Documentation/git-var.txt
Documentation/git-worktree.txt
Documentation/git.txt
Documentation/gitattributes.txt
Documentation/gitcredentials.txt
Documentation/gitformat-pack.txt
Documentation/githooks.txt
Documentation/gitignore.txt
Documentation/gitmodules.txt
Documentation/gittutorial.txt
Documentation/gitweb.txt
Documentation/manpage-normal.xsl
Documentation/object-format-disclaimer.txt
Documentation/rev-list-options.txt
Documentation/revisions.txt
Documentation/technical/api-merge.txt
Documentation/technical/remembering-renames.txt
Documentation/urls-remotes.txt
Documentation/user-manual.txt
GIT-VERSION-GEN
Makefile
RelNotes
abspath.c
abspath.h
add-interactive.c
add-patch.c
advice.c
advice.h
alias.c
alloc.c
alloc.h
apply.c
apply.h
archive-tar.c
archive-zip.c
archive.c
archive.h
attr.c
attr.h
banned.h
base85.c
base85.h [new file with mode: 0644]
bisect.c
blame.c
blame.h
bloom.c
branch.c
branch.h
builtin.h
builtin/add.c
builtin/am.c
builtin/apply.c
builtin/archive.c
builtin/bisect.c
builtin/blame.c
builtin/branch.c
builtin/bugreport.c
builtin/bundle.c
builtin/cat-file.c
builtin/check-attr.c
builtin/check-ignore.c
builtin/check-mailmap.c
builtin/check-ref-format.c
builtin/checkout--worker.c
builtin/checkout-index.c
builtin/checkout.c
builtin/clean.c
builtin/clone.c
builtin/column.c
builtin/commit-graph.c
builtin/commit-tree.c
builtin/commit.c
builtin/config.c
builtin/count-objects.c
builtin/credential-cache--daemon.c
builtin/credential-cache.c
builtin/credential-store.c
builtin/describe.c
builtin/diagnose.c
builtin/diff-files.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-pack.c
builtin/fetch.c
builtin/fmt-merge-msg.c
builtin/for-each-ref.c
builtin/for-each-repo.c
builtin/fsck.c
builtin/fsmonitor--daemon.c
builtin/gc.c
builtin/get-tar-commit-id.c
builtin/grep.c
builtin/hash-object.c
builtin/help.c
builtin/hook.c
builtin/index-pack.c
builtin/init-db.c
builtin/interpret-trailers.c
builtin/log.c
builtin/ls-files.c
builtin/ls-remote.c
builtin/ls-tree.c
builtin/mailinfo.c
builtin/mailsplit.c
builtin/merge-base.c
builtin/merge-file.c
builtin/merge-index.c
builtin/merge-ours.c
builtin/merge-recursive.c
builtin/merge-tree.c
builtin/merge.c
builtin/mktag.c
builtin/mktree.c
builtin/multi-pack-index.c
builtin/mv.c
builtin/name-rev.c
builtin/notes.c
builtin/pack-objects.c
builtin/pack-redundant.c
builtin/pack-refs.c
builtin/patch-id.c
builtin/prune.c
builtin/pull.c
builtin/push.c
builtin/range-diff.c
builtin/read-tree.c
builtin/rebase.c
builtin/receive-pack.c
builtin/reflog.c
builtin/remote.c
builtin/repack.c
builtin/replace.c
builtin/rerere.c
builtin/reset.c
builtin/rev-list.c
builtin/rev-parse.c
builtin/revert.c
builtin/rm.c
builtin/send-pack.c
builtin/shortlog.c
builtin/show-branch.c
builtin/show-index.c
builtin/show-ref.c
builtin/sparse-checkout.c
builtin/stash.c
builtin/stripspace.c
builtin/submodule--helper.c
builtin/symbolic-ref.c
builtin/tag.c
builtin/unpack-file.c
builtin/unpack-objects.c
builtin/update-index.c
builtin/update-ref.c
builtin/update-server-info.c
builtin/upload-archive.c
builtin/upload-pack.c
builtin/var.c
builtin/verify-commit.c
builtin/verify-pack.c
builtin/verify-tag.c
builtin/worktree.c
builtin/write-tree.c
bulk-checkin.c
bundle-uri.c
bundle.c
cache-tree.c
cache.h [deleted file]
chdir-notify.c
checkout.c
checkout.h
chunk-format.c
chunk-format.h
ci/lib.sh
ci/run-build-and-tests.sh
color.c
color.h
column.c
combine-diff.c
commit-graph.c
commit-graph.h
commit-reach.c
commit.c
commit.h
common-main.c
compat/fsmonitor/fsm-health-darwin.c
compat/fsmonitor/fsm-health-win32.c
compat/fsmonitor/fsm-ipc-darwin.c
compat/fsmonitor/fsm-ipc-win32.c
compat/fsmonitor/fsm-listen-darwin.c
compat/fsmonitor/fsm-listen-win32.c
compat/fsmonitor/fsm-path-utils-darwin.c
compat/fsmonitor/fsm-path-utils-win32.c
compat/fsmonitor/fsm-settings-darwin.c
compat/fsmonitor/fsm-settings-win32.c
compat/mingw.c
compat/mingw.h
compat/pread.c
compat/precompose_utf8.c
compat/sha1-chunked.c
compat/simple-ipc/ipc-unix-socket.c
compat/simple-ipc/ipc-win32.c
compat/terminal.c
compat/win32/headless.c [new file with mode: 0644]
compat/win32/trace2_win32_process_info.c
config.c
config.h
config.mak.uname
configure.ac
connect.c
connect.h
connected.c
contrib/buildsystems/CMakeLists.txt
contrib/buildsystems/Generators/Vcxproj.pm
contrib/buildsystems/engine.pl
contrib/coccinelle/README
contrib/coccinelle/config_fn_ctx.pending.cocci [new file with mode: 0644]
contrib/coccinelle/git_config_number.cocci [new file with mode: 0644]
contrib/coccinelle/tests/unused.c [deleted file]
contrib/coccinelle/tests/unused.res [deleted file]
contrib/coccinelle/unused.cocci [deleted file]
contrib/completion/git-completion.bash
contrib/completion/git-prompt.sh
contrib/credential/gnome-keyring/.gitignore [deleted file]
contrib/credential/gnome-keyring/Makefile [deleted file]
contrib/credential/gnome-keyring/git-credential-gnome-keyring.c [deleted file]
contrib/credential/libsecret/.gitignore [new file with mode: 0644]
contrib/credential/libsecret/git-credential-libsecret.c
contrib/credential/osxkeychain/git-credential-osxkeychain.c
contrib/credential/wincred/git-credential-wincred.c
contrib/subtree/git-subtree.sh
convert.c
convert.h
copy.c
copy.h [new file with mode: 0644]
credential.c
credential.h
csum-file.c
csum-file.h
ctype.c
daemon.c
date.c
decorate.c
delta-islands.c
detect-compiler
diagnose.c
diff-lib.c
diff-no-index.c
diff.c
diff.h
diffcore-break.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h
dir-iterator.c
dir.c
dir.h
editor.c
editor.h [new file with mode: 0644]
entry.c
environment.c
environment.h
ewah/bitmap.c
ewah/ewah_bitmap.c
exec-cmd.c
fetch-pack.c
fmt-merge-msg.c
fmt-merge-msg.h
fsck.c
fsck.h
fsmonitor--daemon.h
fsmonitor-ipc.c
fsmonitor-ll.h [new file with mode: 0644]
fsmonitor.c
fsmonitor.h
gettext.c
gettext.h
git-compat-util.h
git-send-email.perl
git-zlib.c [moved from zlib.c with 99% similarity]
git-zlib.h [new file with mode: 0644]
git.c
gitk-git/gitk
gpg-interface.c
grep.c
grep.h
hash-ll.h [new file with mode: 0644]
hash-lookup.c
hash.h
hashmap.h
help.c
hex.c
hex.h
hook.c
http-backend.c
http-fetch.c
http-push.c
http-walker.c
http.c
http.h
ident.c
ident.h
imap-send.c
khash.h
kwset.c
kwset.h
line-log.c
list-objects-filter-options.c
list-objects-filter-options.h
list-objects-filter.c
list-objects.c
log-tree.c
log-tree.h
ls-refs.c
mailinfo.c
mailmap.c
mailmap.h
match-trees.c
match-trees.h [new file with mode: 0644]
merge-blobs.c
merge-ll.c [moved from ll-merge.c with 91% similarity]
merge-ll.h [moved from ll-merge.h with 100% similarity]
merge-ort-wrappers.c
merge-ort.c
merge-ort.h
merge-recursive.c
merge.c
merge.h [new file with mode: 0644]
midx.c
name-hash.c
name-hash.h [new file with mode: 0644]
negotiator/default.c
negotiator/skipping.c
notes-cache.c
notes-merge.c
notes-utils.c
notes.c
notes.h
object-file.c
object-file.h [new file with mode: 0644]
object-name.c
object-name.h [new file with mode: 0644]
object-store-ll.h [new file with mode: 0644]
object-store.h
object.c
object.h
oid-array.c
oidmap.c
oidmap.h
oidtree.c
oidtree.h
oss-fuzz/fuzz-pack-idx.c
pack-bitmap-write.c
pack-bitmap.c
pack-bitmap.h
pack-check.c
pack-mtimes.c
pack-objects.c
pack-objects.h
pack-revindex.c
pack-revindex.h
pack-write.c
packfile.c
packfile.h
pager.c
pager.h [new file with mode: 0644]
parallel-checkout.c
parse-options-cb.c
parse-options.c
parse-options.h
patch-ids.c
path.c
path.h
pathspec.c
pathspec.h
pkt-line.c
pkt-line.h
po/TEAMS
po/bg.po
po/ca.po
po/de.po
po/fr.po
po/id.po
po/sv.po
po/tr.po
po/uk.po [new file with mode: 0644]
po/zh_CN.po
po/zh_TW.po
preload-index.c
preload-index.h [new file with mode: 0644]
pretty.c
prio-queue.c
progress.c
promisor-remote.c
protocol-caps.c
protocol.c
protocol.h
prune-packed.c
quote.c
quote.h
range-diff.c
reachable.c
read-cache-ll.h [new file with mode: 0644]
read-cache.c
read-cache.h [new file with mode: 0644]
rebase-interactive.c
ref-filter.c
ref-filter.h
reflog-walk.c
reflog.c
refs.c
refs.h
refs/debug.c
refs/files-backend.c
refs/packed-backend.c
refs/ref-cache.c
refs/ref-cache.h
refs/refs-internal.h
refspec.c
reftable/dump.c
reftable/error.c
reftable/publicbasics.c
reftable/system.h
reftable/tree.c
reftable/tree_test.c
remote-curl.c
remote.c
remote.h
replace-object.c
replace-object.h
repo-settings.c
repository.c
repository.h
rerere.c
reset.c
reset.h
resolve-undo.c
resolve-undo.h
revision.c
revision.h
run-command.c
run-command.h
sane-ctype.h [new file with mode: 0644]
scalar.c
send-pack.c
sequencer.c
serve.c
server-info.c
server-info.h [new file with mode: 0644]
setup.c
setup.h
sha1/openssl.h [new file with mode: 0644]
sha256/gcrypt.h
sha256/openssl.h [new file with mode: 0644]
shallow.c
sideband.c
sigchain.c
sparse-index.c
sparse-index.h
split-index.c
split-index.h
statinfo.c [new file with mode: 0644]
statinfo.h
strbuf.c
strbuf.h
streaming.c
string-list.c
string-list.h
strvec.c
submodule-config.c
submodule-config.h
submodule.c
symlinks.c
symlinks.h [new file with mode: 0644]
t/.gitattributes
t/README
t/annotate-tests.sh
t/helper/test-bloom.c
t/helper/test-cache-tree.c
t/helper/test-chmtime.c
t/helper/test-config.c
t/helper/test-ctype.c
t/helper/test-date.c
t/helper/test-delta.c
t/helper/test-dump-cache-tree.c
t/helper/test-dump-fsmonitor.c
t/helper/test-dump-split-index.c
t/helper/test-dump-untracked-cache.c
t/helper/test-example-decorate.c
t/helper/test-fast-rebase.c
t/helper/test-fsmonitor-client.c
t/helper/test-hash-speed.c
t/helper/test-hashmap.c
t/helper/test-index-version.c
t/helper/test-json-writer.c
t/helper/test-lazy-init-name-hash.c
t/helper/test-match-trees.c
t/helper/test-mergesort.c
t/helper/test-oid-array.c
t/helper/test-oidmap.c
t/helper/test-oidtree.c
t/helper/test-pack-mtimes.c
t/helper/test-parse-options.c
t/helper/test-partial-clone.c
t/helper/test-path-utils.c
t/helper/test-reach.c
t/helper/test-read-cache.c
t/helper/test-read-graph.c
t/helper/test-read-midx.c
t/helper/test-ref-store.c
t/helper/test-reftable.c
t/helper/test-repository.c
t/helper/test-revision-walking.c
t/helper/test-scrap-cache-tree.c
t/helper/test-sha1.c
t/helper/test-sha256.c
t/helper/test-strcmp-offset.c
t/helper/test-string-list.c
t/helper/test-submodule-config.c
t/helper/test-submodule-nested-repo-config.c
t/helper/test-submodule.c
t/helper/test-trace2.c
t/helper/test-userdiff.c
t/helper/test-wildmatch.c
t/helper/test-write-cache.c
t/lib-commit-graph.sh
t/lib-credential.sh
t/lib-diff-alternative.sh
t/lib-gpg.sh
t/lib-httpd.sh
t/lib-httpd/apache.conf
t/lib-submodule-update.sh
t/perf/p2000-sparse-operations.sh
t/perf/p5312-pack-bitmaps-revs.sh
t/t0000-basic.sh
t/t0003-attributes.sh
t/t0007-git-var.sh
t/t0020-crlf.sh
t/t0030-stripspace.sh
t/t0035-safe-bare-repository.sh
t/t0040-parse-options.sh
t/t0041-usage.sh
t/t0063-string-list.sh
t/t0091-bugreport.sh
t/t0211-trace2-perf.sh
t/t0300-credentials.sh
t/t0301-credential-cache.sh
t/t1001-read-tree-m-2way.sh
t/t1002-read-tree-m-u-2way.sh
t/t1006-cat-file.sh
t/t1092-sparse-checkout-compatibility.sh
t/t1300-config.sh
t/t1301-shared-repo.sh
t/t1419-exclude-refs.sh [new file with mode: 0755]
t/t1450-fsck.sh
t/t1502-rev-parse-parseopt.sh
t/t1507-rev-parse-upstream.sh
t/t1508-at-combinations.sh
t/t1514-rev-parse-push.sh
t/t1800-hook.sh
t/t2019-checkout-ambiguous-ref.sh
t/t2021-checkout-overwrite.sh
t/t2027-checkout-track.sh
t/t2200-add-update.sh
t/t2400-worktree-add.sh
t/t2407-worktree-heads.sh
t/t3007-ls-files-recurse-submodules.sh
t/t3013-ls-files-format.sh
t/t3101-ls-tree-dirname.sh
t/t3200-branch.sh
t/t3202-show-branch.sh
t/t3203-branch-output.sh
t/t3204-branch-name-interpretation.sh
t/t3210-pack-refs.sh
t/t3402-rebase-merge.sh
t/t3404-rebase-interactive.sh
t/t3418-rebase-continue.sh
t/t3427-rebase-subtree.sh
t/t3430-rebase-merges.sh
t/t3437-rebase-fixup-options.sh
t/t3500-cherry.sh
t/t3501-revert-cherry-pick.sh
t/t3700-add.sh
t/t3701-add-interactive.sh
t/t3903-stash.sh
t/t4000-diff-format.sh
t/t4002-diff-basic.sh
t/t4003-diff-rename-1.sh
t/t4004-diff-rename-symlink.sh
t/t4018-diff-funcname.sh
t/t4022-diff-rewrite.sh
t/t4047-diff-dirstat.sh
t/t4053-diff-no-index.sh
t/t4062-diff-pickaxe.sh
t/t4067-diff-partial-clone.sh
t/t4115-apply-symlink.sh
t/t4141-apply-too-large.sh
t/t4202-log.sh
t/t4203-mailmap.sh
t/t4205-log-pretty-formats.sh
t/t4206-log-follow-harder-copies.sh
t/t4212-log-corrupt.sh
t/t4300-merge-tree.sh
t/t5300-pack-object.sh
t/t5301-sliding-window.sh
t/t5303-pack-corruption-resilience.sh
t/t5304-prune.sh
t/t5306-pack-nobase.sh
t/t5310-pack-bitmaps.sh
t/t5318-commit-graph.sh
t/t5319-multi-pack-index.sh
t/t5324-split-commit-graph.sh
t/t5325-reverse-index.sh
t/t5326-multi-pack-bitmaps.sh
t/t5328-commit-graph-64bit-time.sh
t/t5329-pack-objects-cruft.sh
t/t5331-pack-objects-stdin.sh [new file with mode: 0755]
t/t5351-unpack-large-objects.sh
t/t5404-tracking-branches.sh
t/t5510-fetch.sh
t/t5512-ls-remote.sh
t/t5516-fetch-push.sh
t/t5517-push-mirror.sh
t/t5523-push-upstream.sh
t/t5525-fetch-tagopt.sh
t/t5526-fetch-submodules.sh
t/t5543-atomic-push.sh
t/t5551-http-fetch-smart.sh
t/t5563-simple-http-auth.sh
t/t5572-pull-submodule.sh
t/t5574-fetch-output.sh [new file with mode: 0755]
t/t5583-push-branches.sh [new file with mode: 0755]
t/t5606-clone-options.sh
t/t5616-partial-clone.sh
t/t5700-protocol-v1.sh
t/t6006-rev-list-format.sh
t/t6017-rev-list-stdin.sh
t/t6020-bundle-misc.sh
t/t6040-tracking-info.sh
t/t6050-replace.sh
t/t6120-describe.sh
t/t6135-pathspec-with-attrs.sh
t/t6300-for-each-ref.sh
t/t6302-for-each-ref-filter.sh
t/t6406-merge-attr.sh
t/t6500-gc.sh
t/t6501-freshen-objects.sh
t/t7001-mv.sh
t/t7004-tag.sh
t/t7101-reset-empty-subdirs.sh
t/t7102-reset.sh
t/t7110-reset-merge.sh
t/t7111-reset-table.sh
t/t7201-co.sh
t/t7300-clean.sh
t/t7400-submodule-basic.sh
t/t7406-submodule-update.sh
t/t7502-commit-porcelain.sh
t/t7508-status.sh
t/t7510-signed-commit.sh
t/t7512-status-help.sh
t/t7518-ident-corner-cases.sh
t/t7600-merge.sh
t/t7700-repack.sh
t/t7701-repack-unpack-unreachable.sh
t/t7703-repack-geometric.sh
t/t7814-grep-recurse-submodules.sh
t/t9001-send-email.sh
t/t9100-git-svn-basic.sh
t/t9104-git-svn-follow-parent.sh
t/t9200-git-cvsexportcommit.sh
t/t9300-fast-import.sh
t/t9400-git-cvsserver-server.sh
t/t9800-git-p4-basic.sh
t/t9902-completion.sh
t/test-lib-functions.sh
tag.c
tempfile.c
templates/hooks--sendemail-validate.sample [new file with mode: 0755]
tmp-objdir.c
trace.c
trace2.c
trace2.h
trace2/tr2_cfg.c
trace2/tr2_ctr.c
trace2/tr2_sysenv.c
trace2/tr2_tgt.h
trace2/tr2_tgt_event.c
trace2/tr2_tgt_normal.c
trace2/tr2_tgt_perf.c
trace2/tr2_tls.c
trailer.c
transport-helper.c
transport.c
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unpack-trees.c
unpack-trees.h
upload-pack.c
urlmatch.c
urlmatch.h
usage.c
userdiff.c
versioncmp.c
versioncmp.h [new file with mode: 0644]
walker.c
worktree.c
wrapper.c
wrapper.h
write-or-die.c
ws.c
ws.h [new file with mode: 0644]
wt-status.c
xdiff-interface.c
xdiff-interface.h

index 30492eacddfc7db484e9c73af3ba49960d77f5cb..079645b7760887af4cf93b821270f7368c8e5f50 100644 (file)
@@ -246,9 +246,6 @@ jobs:
       fail-fast: false
       matrix:
         vector:
-          - jobname: linux-clang
-            cc: clang
-            pool: ubuntu-latest
           - jobname: linux-sha256
             cc: clang
             pool: ubuntu-latest
@@ -273,11 +270,8 @@ jobs:
           - jobname: linux-leaks
             cc: gcc
             pool: ubuntu-latest
-          - jobname: linux-asan
-            cc: gcc
-            pool: ubuntu-latest
-          - jobname: linux-ubsan
-            cc: gcc
+          - jobname: linux-asan-ubsan
+            cc: clang
             pool: ubuntu-latest
     env:
       CC: ${{matrix.vector.cc}}
index e875c5905455885b174a4591aa5bb3cc2fd0bae2..5e56e471b344ef45e026847a6865645d61908be7 100644 (file)
 /TAGS
 /cscope*
 /compile_commands.json
+/.cache/
 *.hcc
 *.obj
 *.lib
index 733e047aa82507d28b525dc7a08f3239c70f8ecb..dc31d70b8c1e98b14a4e76d5fa0e35cfd0bccc34 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -80,6 +80,7 @@ Frank Lichtenheld <frank@lichtenheld.de> <flichtenheld@astaro.com>
 Fredrik Kuivinen <frekui@gmail.com> <freku045@student.liu.se>
 Frédéric Heitzmann <frederic.heitzmann@gmail.com>
 Garry Dolley <gdolley@ucla.edu> <gdolley@arpnetworks.com>
+Glen Choo <glencbz@gmail.com> <chooglen@google.com>
 Greg Price <price@mit.edu> <price@MIT.EDU>
 Greg Price <price@mit.edu> <price@ksplice.com>
 Heiko Voigt <hvoigt@hvoigt.net> <git-list@hvoigt.net>
index 003393ed161dab04a5c73269d49fa2e2f2fdd1f6..65af8d82cedd5fdfd46005d4b4e75114a74810fb 100644 (file)
@@ -188,6 +188,10 @@ For shell scripts specifically (not exhaustive):
    hopefully nobody starts using "local" before they are reimplemented
    in C ;-)
 
+ - Use octal escape sequences (e.g. "\302\242"), not hexadecimal (e.g.
+   "\xc2\xa2") in printf format strings, since hexadecimal escape
+   sequences are not portable.
+
 
 For C programs:
 
@@ -444,7 +448,7 @@ For C programs:
  - The first #include in C files, except in platform specific compat/
    implementations and sha1dc/, must be either "git-compat-util.h" or
    one of the approved headers that includes it first for you.  (The
-   approved headers currently include "cache.h", "builtin.h",
+   approved headers currently include "builtin.h",
    "t/helper/test-tool.h", "xdiff/xinclude.h", or
    "reftable/system.h").  You do not have to include more than one of
    these.
@@ -687,7 +691,7 @@ Writing Documentation:
    Do: [-q | --quiet]
    Don't: [-q|--quiet]
 
- Don't use spacing around "|" tokens when they're used to seperate the
+ Don't use spacing around "|" tokens when they're used to separate the
  alternate arguments of an option:
     Do: --track[=(direct|inherit)]
     Don't: --track[=(direct | inherit)]
index 3133ea31829ec3c1107e6075362d499f1f4a657c..b629176d7d2d6776e0a66fbda466915219f32bc2 100644 (file)
@@ -144,13 +144,16 @@ man5dir = $(mandir)/man5
 man7dir = $(mandir)/man7
 # DESTDIR =
 
+GIT_DATE := $(shell git show --quiet --pretty='%as')
+
 ASCIIDOC = asciidoc
 ASCIIDOC_EXTRA =
 ASCIIDOC_HTML = xhtml11
 ASCIIDOC_DOCBOOK = docbook
 ASCIIDOC_CONF = -f asciidoc.conf
 ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \
-               -amanmanual='Git Manual' -amansource='Git $(GIT_VERSION)'
+               -amanmanual='Git Manual' -amansource='Git $(GIT_VERSION)' \
+               -arevdate='$(GIT_DATE)'
 ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS
 TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)
 TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)
index 56130e4becf68f14a4f5de2c12e4fc0556bb2d91..62d11a5cd7f909e2e038e1f768bafddc82be210d 100644 (file)
@@ -1256,6 +1256,38 @@ index 88f126184c..38da593a60 100644
 [[now-what]]
 == My Patch Got Emailed - Now What?
 
+Please give reviewers enough time to process your initial patch before
+sending an updated version. That is, resist the temptation to send a new
+version immediately, because others may have already started reviewing
+your initial version.
+
+While waiting for review comments, you may find mistakes in your initial
+patch, or perhaps realize a different and better way to achieve the goal
+of the patch. In this case you may communicate your findings to other
+reviewers as follows:
+
+ - If the mistakes you found are minor, send a reply to your patch as if
+   you were a reviewer and mention that you will fix them in an
+   updated version.
+
+ - On the other hand, if you think you want to change the course so
+   drastically that reviews on the initial patch would be a waste of
+   time (for everyone involved), retract the patch immediately with
+   a reply like "I am working on a much better approach, so please
+   ignore this patch and wait for the updated version."
+
+Now, the above is a good practice if you sent your initial patch
+prematurely without polish.  But a better approach of course is to avoid
+sending your patch prematurely in the first place.
+
+Please be considerate of the time needed by reviewers to examine each
+new version of your patch. Rather than seeing the initial version right
+now (followed by several "oops, I like this version better than the
+previous one" patches over 2 days), reviewers would strongly prefer if a
+single polished version came 2 days later instead, and that version with
+fewer mistakes were the only one they would need to review.
+
+
 [[reviewing]]
 === Responding to Reviews
 
index eee513e86f4d645a47afcae4921de89b413fc1be..c68cdb11b9d5a53ddc11361d0f1c889edeb24536 100644 (file)
@@ -41,6 +41,7 @@ Open up a new file `builtin/walken.c` and set up the command handler:
  */
 
 #include "builtin.h"
+#include "trace.h"
 
 int cmd_walken(int argc, const char **argv, const char *prefix)
 {
@@ -49,12 +50,13 @@ int cmd_walken(int argc, const char **argv, const char *prefix)
 }
 ----
 
-NOTE: `trace_printf()` differs from `printf()` in that it can be turned on or
-off at runtime. For the purposes of this tutorial, we will write `walken` as
-though it is intended for use as a "plumbing" command: that is, a command which
-is used primarily in scripts, rather than interactively by humans (a "porcelain"
-command). So we will send our debug output to `trace_printf()` instead. When
-running, enable trace output by setting the environment variable `GIT_TRACE`.
+NOTE: `trace_printf()`, defined in `trace.h`, differs from `printf()` in
+that it can be turned on or off at runtime. For the purposes of this
+tutorial, we will write `walken` as though it is intended for use as
+a "plumbing" command: that is, a command which is used primarily in
+scripts, rather than interactively by humans (a "porcelain" command).
+So we will send our debug output to `trace_printf()` instead.
+When running, enable trace output by setting the environment variable `GIT_TRACE`.
 
 Add usage text and `-h` handling, like all subcommands should consistently do
 (our test suite will notice and complain if you fail to do so).
@@ -124,7 +126,7 @@ parameters provided by the user over the CLI.
 
 `nr` represents the number of `rev_cmdline_entry` present in the array.
 
-`alloc` is used by the `ALLOC_GROW` macro. Check `cache.h` - this variable is
+`alloc` is used by the `ALLOC_GROW` macro. Check `alloc.h` - this variable is
 used to track the allocated size of the list.
 
 Per entry, we find:
@@ -341,6 +343,10 @@ the walk loop below the `prepare_revision_walk()` call within your
 `walken_commit_walk()`:
 
 ----
+#include "pretty.h"
+
+...
+
 static void walken_commit_walk(struct rev_info *rev)
 {
        struct commit *commit;
@@ -754,6 +760,10 @@ reachable objects are walked in order to populate the list.
 First, add the `struct oidset` and related items we will use to iterate it:
 
 ----
+#include "oidset.h"
+
+...
+
 static void walken_object_walk(
        ...
 
@@ -805,6 +815,10 @@ just walks of commits. First, we'll make our handlers chattier - modify
 go:
 
 ----
+#include "hex.h"
+
+...
+
 static void walken_show_commit(struct commit *cmt, void *buf)
 {
        trace_printf("commit: %s\n", oid_to_hex(&cmt->object.oid));
diff --git a/Documentation/RelNotes/2.30.9.txt b/Documentation/RelNotes/2.30.9.txt
new file mode 100644 (file)
index 0000000..708d626
--- /dev/null
@@ -0,0 +1,43 @@
+Git v2.30.9 Release Notes
+=========================
+
+This release addresses the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007.
+
+
+Fixes since v2.30.8
+-------------------
+
+ * CVE-2023-25652:
+
+   By feeding specially crafted input to `git apply --reject`, a
+   path outside the working tree can be overwritten with partially
+   controlled contents (corresponding to the rejected hunk(s) from
+   the given patch).
+
+ * CVE-2023-25815:
+
+   When Git is compiled with runtime prefix support and runs without
+   translated messages, it still used the gettext machinery to
+   display messages, which subsequently potentially looked for
+   translated messages in unexpected places. This allowed for
+   malicious placement of crafted messages.
+
+ * CVE-2023-29007:
+
+   When renaming or deleting a section from a configuration file,
+   certain malicious configuration values may be misinterpreted as
+   the beginning of a new configuration section, leading to arbitrary
+   configuration injection.
+
+Credit for finding CVE-2023-25652 goes to Ry0taK, and the fix was
+developed by Taylor Blau, Junio C Hamano and Johannes Schindelin,
+with the help of Linus Torvalds.
+
+Credit for finding CVE-2023-25815 goes to Maxime Escourbiac and
+Yassine BENGANA of Michelin, and the fix was developed by Johannes
+Schindelin.
+
+Credit for finding CVE-2023-29007 goes to André Baptista and Vítor Pinho
+of Ethiack, and the fix was developed by Taylor Blau, and Johannes
+Schindelin, with help from Jeff King, and Patrick Steinhardt.
diff --git a/Documentation/RelNotes/2.31.8.txt b/Documentation/RelNotes/2.31.8.txt
new file mode 100644 (file)
index 0000000..0aa3080
--- /dev/null
@@ -0,0 +1,6 @@
+Git v2.31.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9 to address the
+security issues CVE-2023-25652, CVE-2023-25815, and CVE-2023-29007;
+see the release notes for that version for details.
diff --git a/Documentation/RelNotes/2.32.7.txt b/Documentation/RelNotes/2.32.7.txt
new file mode 100644 (file)
index 0000000..7bb3538
--- /dev/null
@@ -0,0 +1,7 @@
+Git v2.32.7 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9 and v2.31.8 to
+address the security issues CVE-2023-25652, CVE-2023-25815, and
+CVE-2023-29007; see the release notes for these versions for
+details.
diff --git a/Documentation/RelNotes/2.33.8.txt b/Documentation/RelNotes/2.33.8.txt
new file mode 100644 (file)
index 0000000..d8cf4c7
--- /dev/null
@@ -0,0 +1,7 @@
+Git v2.33.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8 and
+v2.32.7 to address the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007; see the release notes for these
+versions for details.
diff --git a/Documentation/RelNotes/2.34.8.txt b/Documentation/RelNotes/2.34.8.txt
new file mode 100644 (file)
index 0000000..2b5bd7d
--- /dev/null
@@ -0,0 +1,7 @@
+Git v2.34.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8,
+v2.32.7 and v2.33.8 to address the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007; see the release notes for these
+versions for details.
diff --git a/Documentation/RelNotes/2.35.8.txt b/Documentation/RelNotes/2.35.8.txt
new file mode 100644 (file)
index 0000000..3c9c094
--- /dev/null
@@ -0,0 +1,7 @@
+Git v2.35.8 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8 and v2.34.8 to address the security issues
+CVE-2023-25652, CVE-2023-25815, and CVE-2023-29007; see the release
+notes for these versions for details.
diff --git a/Documentation/RelNotes/2.36.6.txt b/Documentation/RelNotes/2.36.6.txt
new file mode 100644 (file)
index 0000000..e1edebc
--- /dev/null
@@ -0,0 +1,7 @@
+Git v2.36.6 Release Notes
+=========================
+
+This release merges the fixes that appear in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8 and v2.35.8 to address the security issues
+CVE-2023-25652, CVS-2023-25815, and CVE-2023-29007; see the release
+notes for these versions for details.
diff --git a/Documentation/RelNotes/2.37.7.txt b/Documentation/RelNotes/2.37.7.txt
new file mode 100644 (file)
index 0000000..4b8165f
--- /dev/null
@@ -0,0 +1,7 @@
+Git v2.37.7 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8 and v2.36.6 to address the
+security issues CVE-2023-25652, CVE-2023-25815, and CVE-2023-29007;
+see the release notes for these versions for details.
diff --git a/Documentation/RelNotes/2.38.5.txt b/Documentation/RelNotes/2.38.5.txt
new file mode 100644 (file)
index 0000000..2d1f3b1
--- /dev/null
@@ -0,0 +1,8 @@
+Git v2.38.5 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8, v2.36.6 and v2.37.7 to address
+the security issues CVE-2023-25652, CVE-2023-25815, and
+CVE-2023-29007; see the release notes for these versions for
+details.
index dddff53627765dc2b795949fbfc51e5b2c26fe2b..66351b65c219a9a53c19c78cf2d76c05a2f104a7 100644 (file)
@@ -1,9 +1,15 @@
 Git v2.39.3 Release Notes
 =========================
 
-This release is primarily to merge fixes accumulated on the 'master'
-front to prepare for 2.40 release that are still relevant to 2.39.x
-maintenance track.
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8, v2.36.6, v2.37.7 and v2.38.5 to
+address the security issues CVE-2023-25652, CVE-2023-25815, and
+CVE-2023-29007; see the release notes for these versions for
+details.
+
+This release also merges fixes that have accumulated on the 'master'
+front to prepare for the 2.40 release that are still relevant to
+2.39.x maintenance track.
 
 Fixes since v2.39.2
 -------------------
diff --git a/Documentation/RelNotes/2.40.1.txt b/Documentation/RelNotes/2.40.1.txt
new file mode 100644 (file)
index 0000000..e72f6b1
--- /dev/null
@@ -0,0 +1,8 @@
+Git v2.40.1 Release Notes
+=========================
+
+This release merges up the fix that appears in v2.30.9, v2.31.8,
+v2.32.7, v2.33.8, v2.34.8, v2.35.8, v2.36.6, v2.37.7, v2.38.5
+and v2.39.3 to address the security issues CVE-2023-25652,
+CVE-2023-25815, and CVE-2023-29007; see the release notes for these
+versions for details.
index abbaff30957d383595e635564ed3ad4b9414074b..8a9e17016e45ee0ec6a579b231c0184043eee0e7 100644 (file)
@@ -3,7 +3,7 @@ Git v2.41 Release Notes
 
 UI, Workflows & Features
 
- * Allow information carried on the WWW-AUthenticate header to be
+ * Allow information carried on the WWW-Authenticate header to be
    passed to the credential helpers.
 
  * A new "fetch.hideRefs" option can be used to exclude specified refs
@@ -48,7 +48,7 @@ UI, Workflows & Features
 
  * "git clone" from an empty repository learned to propagate the
    choice of the hash algorithm from the source repository to the
-   newly created repository.
+   newly created repository over any one of the v0/v1/v2 protocol.
 
  * "git mergetool" and "git difftool" learns a new configuration
    guiDefault to optionally favor configured guitool over non-gui-tool
@@ -65,9 +65,57 @@ UI, Workflows & Features
    has symbolic links inside its $GIT_DIR; an error message when that
    happens has been updated.
 
- * "git branch --format=..." and "git format-patch --format=..."
-   learns "--omit-empty" to hide refs that whose formatting result
-   becomes an empty string from the output.
+ * The "--format=..." option of "git for-each-ref", "git branch", and
+   "git tag" commands learn "--omit-empty" to hide refs whose
+   formatting results in an empty string from the output.
+
+ * The sendemail-validate validate hook learned to pass the total
+   number of input files and where in the sequence each invocation is
+   via environment variables.
+
+ * When "gc" needs to retain unreachable objects, packing them into
+   cruft packs (instead of exploding them into loose object files) has
+   been offered as a more efficient option for some time.  Now the use
+   of cruft packs has been made the default and no longer considered
+   an experimental feature.
+
+ * The output given by "git blame" that attributes a line to contents
+   taken from the file specified by the "--contents" option shows it
+   differently from a line attributed to the working tree file.
+
+ * "git send-email" learned to give the e-mail headers to the validate
+   hook by passing an extra argument from the command line.
+
+ * The credential subsystem learns to help OAuth framework.
+
+ * The titles of manual pages used to be chomped at an unreasonably
+   short limit, which has been removed.
+
+ * Error messages given when working on an unborn branch that is
+   checked out in another worktree have been improved.
+
+ * The documentation was misleading about the interaction between
+   GIT_DEFAULT_HASH and "git clone", which has been clarified to
+   stress that the variable is to be ignored by the command.
+
+ * "git send-email" learned "--header-cmd=<cmd>" that can inject
+   arbitrary e-mail header lines to the outgoing messages.
+
+ * "git fsck" learned to detect bit-flip breakages in the reachability
+   bitmap files.
+
+ * The "--stdin" option of "git name-rev" has been replaced with
+   the "--annotate-stdin" option more than a year ago.  We stop
+   advertising it in the "git name-rev -h" output.
+
+ * "git push --all" gained an alias "git push --branches".
+
+ * "git fetch" learned the "--porcelain" option that emits what it did
+   in a machine-parseable format.
+
+ * "git --attr-source=<tree> cmd $args" is a new way to have any
+   command to read attributes not from the working tree but from the
+   given tree object.
 
 
 Performance, Internal Implementation, Development Support etc.
@@ -109,6 +157,42 @@ Performance, Internal Implementation, Development Support etc.
 
  * "git write-tree" learns to work better with sparse-index.
 
+ * The on-disk reverse index that allows mapping from the pack offset
+   to the object name for the object stored at the offset has been
+   enabled by default.
+
+ * "git fsck" learned to validate the on-disk pack reverse index files.
+
+ * strtok() and strtok_r() are banned in this codebase.
+
+ * The detect-compilers script to help auto-tweaking the build system
+   had trouble working with compilers whose version number has extra
+   suffixes.  The script has been taught that certain suffixes (like
+   "-win32" in "gcc 10-win32") can be safely stripped as they share
+   the same features and bugs with the version without the suffix.
+
+ * ctype tests have been taught to test EOF, too.
+
+ * The implementation of credential helpers used fgets() over fixed
+   size buffers to read protocol messages, causing the remainder of
+   the folded long line to trigger unexpected behaviour, which has
+   been corrected.
+
+ * The implementation of the default "negotiator", used to find common
+   ancestor over the network for object tranfer, used to be recursive;
+   it was updated to be iterative to conserve stackspace usage.
+
+ * Our custom callout formatter is no longer used in the documentation
+   formatting toolchain, as the upstream default ones give better
+   output these days.
+
+ * The tracing mechanism learned to notice and report when
+   auto-discovered bare repositories are being used, as allowing so
+   without explicitly stating the user intends to do so (with setting
+   GIT_DIR for example) can be used with social engineering as an
+   attack vector.
+
+ * "git diff-files" learned not to expand sparse-index unless needed.
 
 
 Fixes since v2.40
@@ -240,6 +324,55 @@ Fixes since v2.40
    paths outside the current directory.
    (merge 92b1dd1b9e rs/archive-from-subdirectory-fixes later to maint).
 
+ * The code to parse capability list for v0 on-wire protocol fell into
+   an infinite loop when a capability appears multiple times, which
+   has been corrected.
+
+ * Geometric repacking ("git repack --geometric=<n>") in a repository
+   that borrows from an alternate object database had various corner
+   case bugs, which have been corrected.
+   (merge d85cd18777 ps/fix-geom-repack-with-alternates later to maint).
+
+ * The "%GT" placeholder for the "--format" option of "git log" and
+   friends caused BUG() to trigger on a commit signed with an unknown
+   key, which has been corrected.
+   (merge 7891e46585 jk/gpg-trust-level-fix later to maint).
+
+ * The completion script used to use bare "read" without the "-r"
+   option to read the contents of various state files, which risked
+   getting confused with backslashes in them.  This has been
+   corrected.
+   (merge 197152098a ek/completion-use-read-r-to-read-literally later to maint).
+
+ * A small API fix to the ort merge strategy backend.
+   (merge 000c4ceca7 en/ort-finalize-after-0-merges-fix later to maint).
+
+ * The commit object parser has been taught to be a bit more lenient
+   to parse timestamps on the author/committer line with a malformed
+   author/committer ident.
+   (merge 90ef0f14eb jk/parse-commit-with-malformed-ident later to maint).
+
+ * Retitle a test script with an overly narrow name.
+   (merge 8bb19c14fb ob/t3501-retitle later to maint).
+
+ * Doc update to clarify how text and eol attributes interact to
+   specify the end-of-line conversion.
+   (merge 6696077ace ah/doc-attributes-text later to maint).
+
+ * Gitk updates from GfW project.
+   (merge 99e70f3077 js/gitk-fixes-from-gfw later to maint).
+
+ * "git diff --dirstat" leaked memory, which has been plugged.
+   (merge 83973981eb jc/dirstat-plug-leaks later to maint).
+
+ * "git merge-tree" reads the basic configuration, which can be used
+    by git forges to disable replace-refs feature.
+   (merge b6551feadf ds/merge-tree-use-config later to maint).
+
+ * A few bugs in the sequencer machinery that results in miscounting
+   the steps have been corrected.
+   (merge 170eea9750 js/rebase-count-fixes later to maint).
+
  * Other code cleanup, docfix, build fix, etc.
    (merge f7111175df as/doc-markup-fix later to maint).
    (merge 90ff7c9898 fc/test-aggregation-clean-up later to maint).
@@ -256,3 +389,11 @@ Fixes since v2.40
    (merge 4833b08426 ow/ref-format-remove-unused-member later to maint).
    (merge d0ea2ca1cf dw/doc-submittingpatches-grammofix later to maint).
    (merge fd72637423 ar/t2024-checkout-output-fix later to maint).
+   (merge d45cbe3fe0 ob/sequencer-i18n-fix later to maint).
+   (merge b734fe49fd ob/messages-capitalize-exception later to maint).
+   (merge ad353d7e77 ma/gittutorial-fixes later to maint).
+   (merge a5855fd8d4 ar/test-cleanup-unused-file-creation-part2 later to maint).
+   (merge 0c5308af30 sd/doc-gitignore-and-rm-cached later to maint).
+   (merge cbb83daeaf kh/doc-interpret-trailers-updates later to maint).
+   (merge 3d77fbb664 ar/config-count-tests-updates later to maint).
+   (merge b7cf25c8f4 jc/t9800-fix-use-of-show-s-raw later to maint).
diff --git a/Documentation/RelNotes/2.42.0.txt b/Documentation/RelNotes/2.42.0.txt
new file mode 100644 (file)
index 0000000..8ae2d7d
--- /dev/null
@@ -0,0 +1,329 @@
+Git v2.42 Release Notes
+=======================
+
+UI, Workflows & Features
+
+ * "git pack-refs" learns "--include" and "--exclude" to tweak the ref
+   hierarchy to be packed using pattern matching.
+
+ * 'git worktree add' learned how to create a worktree based on an
+   orphaned branch with `--orphan`.
+
+ * "git pack-objects" learned to invoke a new hook program that
+   enumerates extra objects to be used as anchoring points to keep
+   otherwise unreachable objects in cruft packs.
+
+ * Add more "git var" for toolsmiths to learn various locations Git is
+   configured with either via the configuration or hardcoded defaults.
+
+ * 'git notes append' was taught '--separator' to specify string to insert
+   between paragraphs.
+
+ * The "git for-each-ref" family of commands learned placeholders
+   related to GPG signature verification.
+
+ * "git diff --no-index" learned to read from named pipes as if they
+   were regular files, to allow "git diff <(process) <(substitution)"
+   some shells support.
+
+ * Help newbies by suggesting that there are cases where force-pushing
+   is a valid and sensible thing to update a branch at a remote
+   repository, rather than reconciling with merge/rebase.
+
+ * "git blame --contents=file" has been taught to work in a bare
+   repository.
+
+ * "git branch -f X" to repoint the branch X said that X was "checked
+   out" in another worktree, even when branch X was not and instead
+   being bisected or rebased.  The message was reworded to say the
+   branch was "in use".
+
+ * Tone down the warning on SHA-256 repositories being an experimental
+   curiosity.  We do not have support for them to interoperate with
+   traditional SHA-1 repositories, but at this point, we do not plan
+   to make breaking changes to SHA-256 repositories and there is no
+   longer need for such a strongly phrased warning.
+
+
+Performance, Internal Implementation, Development Support etc.
+
+ * "git diff-tree" has been taught to take advantage of the
+   sparse-index feature.
+
+ * Clang's sanitizer implementation seems to work better than GCC's.
+   (merge d88d727143 jk/ci-use-clang-for-sanitizer-jobs later to maint).
+
+ * The object traversal using reachability bitmap done by
+   "pack-object" has been tweaked to take advantage of the fact that
+   using "boundary" commits as representative of all the uninteresting
+   ones can save quite a lot of object enumeration.
+
+ * discover_git_directory() no longer touches the_repository.
+
+ * "git worktree" learned to work better with sparse index feature.
+
+ * When the external merge driver is killed by a signal, its output
+   should not be trusted as a resolution with conflicts that is
+   proposed by the driver, but the code did.
+
+ * The set-up code for the get_revision() API now allows feeding
+   options like --all and --not in the --stdin mode.
+
+ * Move functions that are not about pure string manipulation out of
+   strbuf.[ch]
+
+ * "imap-send" codepaths got cleaned up to get rid of unused
+   parameters.
+
+ * Enumerating refs in the packed-refs file, while excluding refs that
+   match certain patterns, has been optimized.
+
+ * Mark-up unused parameters in the code so that we can eventually
+   enable -Wunused-parameter by default.
+
+ * Instead of inventing a custom counter variables for debugging,
+   use existing trace2 facility in the fsync customization codepath.
+
+ * "git branch --list --format=<format>" and friends are taught
+   a new "%(describe)" placeholder.
+
+ * Clarify how to choose the starting point for a new topic in
+   developer guidance document.
+
+ * The implementation of "get_sha1_hex()" that reads a hexadecimal
+   string that spells a full object name has been extended to cope
+   with any hash function used in the repository, but the "sha1" in
+   its name survived.  Rename it to get_hash_hex(), a name that is
+   more consistent within its friends like get_hash_hex_algop().
+
+ * Command line parser fix, and a small parse-options API update.
+
+
+Fixes since v2.41
+-----------------
+
+ * "git tag" learned to leave the "$GIT_DIR/TAG_EDITMSG" file when the
+   command failed, so that the user can salvage what they typed.
+   (merge 08c12ec1d0 kh/keep-tag-editmsg-upon-failure later to maint).
+
+ * The "-s" (silent, squelch) option of the "diff" family of commands
+   did not interact with other options that specify the output format
+   well.  This has been cleaned up so that it will clear all the
+   formatting options given before.
+   (merge 9d484b92ed jc/diff-s-with-other-options later to maint).
+
+ * Update documentation regarding Coccinelle patches.
+   (merge 3bd0097cfc gc/doc-cocci-updates later to maint).
+
+ * Some atoms that can be used in "--format=<format>" for "git ls-tree"
+   were not supported by "git ls-files", even though they were relevant
+   in the context of the latter.
+   (merge 4d28c4f75f zh/ls-files-format-atoms later to maint).
+
+ * Document more pseudo-refs and teach the command line completion
+   machinery to complete AUTO_MERGE.
+   (merge 982ff3a649 pb/complete-and-document-auto-merge-and-friends later to maint).
+
+ * "git submodule" code trusted the data coming from the config (and
+   the in-tree .gitmodules file) too much without validating, leading
+   to NULL dereference if the user mucks with a repository (e.g.
+   submodule.<name>.url is removed).  This has been corrected.
+   (merge fbc806acd1 tb/submodule-null-deref-fix later to maint).
+
+ * The value of config.worktree is per-repository, but has been kept
+   in a singleton global variable per process. This has been OK as
+   most Git operations interacted with a single repository at a time,
+   but not right for operations like recursive "grep" that want to
+   access multiple repositories from a single process without forking.
+
+   The global variable has been eliminated and made into a member in
+   the per-repository data structure.
+   (merge 3867f6d650 vd/worktree-config-is-per-repository later to maint).
+
+ * "git [-c log.follow=true] log [--follow] ':(glob)f**'" used to barf.
+   (merge 8260bc5902 jk/log-follow-with-non-literal-pathspec later to maint).
+
+ * Introduce a mechanism to disable replace refs globally and per
+   repository.
+   (merge 9c7d1b057f ds/disable-replace-refs later to maint).
+
+ * "git cat-file --batch" and friends learned "-Z" that uses NUL
+   delimiter for both input and output.
+   (merge f79e18849b ps/cat-file-null-output later to maint).
+
+ * The reimplemented "git add -i" did not honor color.ui configuration.
+   (merge 6f74648cea ds/add-i-color-configuration-fix later to maint).
+
+ * Compilation fix for platforms without D_TYPE in struct dirent.
+   (merge 03bf92b9bf as/dtype-compilation-fix later to maint).
+
+ * Suggest to refrain from using hex literals that are non-portable
+   when writing printf(1) format strings.
+   (merge f0b68f0546 jt/doc-use-octal-with-printf later to maint).
+
+ * Simplify error message when run-command fails to start a command.
+   (merge 6d224ac286 rs/run-command-exec-error-on-noent later to maint).
+
+ * Gracefully deal with a stale MIDX file that lists a packfile that
+   no longer exists.
+   (merge 06f3867865 tb/open-midx-bitmap-fallback later to maint).
+
+ * Even when diff.ignoreSubmodules tells us to ignore submodule
+   changes, "git commit" with an index that already records changes to
+   submodules should include the submodule changes in the resulting
+   commit, but it did not.
+   (merge 5768478edc js/defeat-ignore-submodules-config-with-explicit-addition later to maint).
+
+ * When "git commit --trailer=..." invokes the interpret-trailers
+   machinery, it knows what it feeds to interpret-trailers is a full
+   log message without any patch, but failed to express that by
+   passing the "--no-divider" option, which has been corrected.
+   (merge be3d654343 jk/commit-use-no-divider-with-interpret-trailers later to maint).
+
+ * Avoid breakage of "git pack-objects --cruft" due to inconsistency
+   between the way the code enumerates packfiles in the repository.
+   (merge 73320e49ad tb/collect-pack-filenames-fix later to maint).
+
+ * We create .pack and then .idx, we consider only packfiles that have
+   .idx usable (those with only .pack are not ready yet), so we should
+   remove .idx before removing .pack for consistency.
+   (merge 0dd1324a73 ds/remove-idx-before-pack later to maint).
+
+ * Partially revert a sanity check that the rest of the config code
+   was not ready, to avoid triggering it in a corner case.
+   (merge a53f43f900 gc/config-partial-submodule-kvi-fix later to maint).
+
+ * "git apply" punts when it is fed too large a patch input; the error
+   message it gives when it happens has been clarified.
+   (merge 42612e18d2 pw/apply-too-large later to maint).
+
+ * During a cherry-pick or revert session that works on multiple
+   commits, "git status" did not give correct information, which has
+   been corrected.
+   (merge a096a889f4 jk/cherry-pick-revert-status later to maint).
+
+ * A few places failed to differentiate the case where the index is
+   truly empty (nothing added) and we haven't yet read from the
+   on-disk index file, which have been corrected.
+   (merge 2ee045eea1 js/empty-index-fixes later to maint).
+
+ * "git bugreport" tests did not test what it wanted to test, which
+   has been corrected.
+   (merge 1aa92b8500 ma/t0091-fixup later to maint).
+
+ * Code snippets in a tutorial document no longer compiled after
+   recent header shuffling, which have been corrected.
+   (merge bbd7c7b7c0 vd/adjust-mfow-doc-to-updated-headers later to maint).
+
+ * "git ls-files '(attr:X)D/'" that triggers the common prefix
+   optimization codepath failed to read from "D/.gitattributes",
+   which has been corrected.
+   (merge f4a8fde057 jc/pathspec-match-with-common-prefix later to maint).
+
+ * "git fsck --no-progress" still spewed noise from the commit-graph
+   subsystem, which has been corrected.
+   (merge 9281cd07f0 tb/fsck-no-progress later to maint).
+
+ * Various offset computation in the code that accesses the packfiles
+   and other data in the object layer has been hardened against
+   arithmetic overflow, especially on 32-bit systems.
+   (merge 9a25cad7e0 tb/object-access-overflow-protection later to maint).
+
+ * Names of MinGW header files are spelled in mixed case in some
+   source files, but the build host can be using case sensitive
+   filesystem with header files with their name spelled in all
+   lowercase.
+   (merge 4a53d0d0bc mh/mingw-case-sensitive-build later to maint).
+
+ * Update message mark-up for i18n in "git bundle".
+   (merge bbb6acd998 dk/bundle-i18n-more later to maint).
+
+ * "git tag --list --points-at X" showed tags that directly refers to
+   object X, but did not list a tag that points at such a tag, which
+   has been corrected.
+
+ * "./configure --with-expat=no" did not work as a way to refuse use
+   of the expat library on a system with the library installed, which
+   has been corrected.
+   (merge fb8f7269c2 ah/autoconf-fixes later to maint).
+
+ * When the user edits "rebase -i" todo file so that it starts with a
+   "fixup", which would make it invalid, the command truncated the
+   rest of the file before giving an error and returning the control
+   back to the user.  Stop truncating to make it easier to correct
+   such a malformed todo file.
+   (merge 9645a087c2 ah/sequencer-rewrite-todo-fix later to maint).
+
+ * Rewrite the description of giving a custom command to the
+   submodule.<name>.update configuration variable.
+   (merge 7cebc5bd78 pv/doc-submodule-update-settings later to maint).
+
+ * Adjust to OpenSSL 3+, which deprecates its SHA-1 functions based on
+   its traditional API, by using its EVP API instead.
+   (merge bda9c12073 ew/hash-with-openssl-evp later to maint).
+
+ * Exclude "." from the set of characters to be removed from the
+   beginning and the end of the human-readable name.
+   (merge 1c04cb0744 bc/ident-dot-is-no-longer-crud-letter later to maint).
+
+ * "git bisect visualize" stopped running "gitk" on Git for Windows
+   when the command was reimplemented in C around Git 2.34 timeframe.
+   This has been corrected.
+   (merge fff1594fa7 ma/locate-in-path-for-windows later to maint).
+
+ * "git rebase -i" with a series of squash/fixup, when one of the
+   steps stopped in conflicts and ended up getting skipped, did not
+   handle the accumulated commit log messages, which has been
+   corrected.
+   (merge 6ce7afe163 pw/rebase-skip-commit-message-fix later to maint).
+
+ * Adjust to newer Term::ReadLine to prevent it from breaking
+   the interactive prompt code in send-email.
+   (merge c016726c2d jk/send-email-with-new-readline later to maint).
+
+ * Windows updates.
+   (merge 0050f8e401 ds/maintenance-on-windows-fix later to maint).
+
+ * Correct use of lstat() that assumed a failing call would not
+   clobber the statbuf.
+   (merge 72695d8214 st/mv-lstat-fix later to maint).
+
+ * Other code cleanup, docfix, build fix, etc.
+   (merge 51f9d2e563 sa/doc-ls-remote later to maint).
+   (merge c6d26a9dda jk/format-patch-message-id-unleak later to maint).
+   (merge f7e063f326 ps/fetch-cleanups later to maint).
+   (merge e4cf013468 tl/quote-problematic-arg-for-clarity later to maint).
+   (merge 20025fdfc7 tz/test-ssh-verifytime-fix later to maint).
+   (merge e48a21df65 tz/test-fix-pthreads-prereq later to maint).
+   (merge 68b51172e3 mh/commit-reach-get-reachable-plug-leak later to maint).
+   (merge aeee1408ce kh/use-default-notes-doc later to maint).
+   (merge 3b8724bce6 jc/test-modernization later to maint).
+   (merge 447a3b7331 jc/test-modernization-2 later to maint).
+   (merge d57fa7fc73 la/doc-interpret-trailers later to maint).
+   (merge 548afb0d9a la/docs-typofixes later to maint).
+   (merge 3744ffcbcd rs/doc-ls-tree-hex-literal later to maint).
+   (merge 6c26da8404 mh/credential-erase-improvements later to maint).
+   (merge 78e56cff69 tz/lib-gpg-prereq-fix later to maint).
+   (merge 80d32e84b5 rj/leakfixes later to maint).
+   (merge 0a868031ed pb/complete-diff-options later to maint).
+   (merge d4f28279ad jc/doc-hash-object-types later to maint).
+   (merge 1876a5ae15 ks/t4205-test-describe-with-abbrev-fix later to maint).
+   (merge 6e6a529b57 jk/fsck-indices-in-worktrees later to maint).
+   (merge 3e81b896f7 rs/packet-length-simplify later to maint).
+   (merge 4c9cb51fe7 mh/doc-credential-helpers later to maint).
+   (merge 3437f549dd jr/gitignore-doc-example-markup later to maint).
+   (merge 947ebd62a0 jc/am-parseopt-fix later to maint).
+   (merge e12cb98e1e jc/branch-parseopt-fix later to maint).
+   (merge d6f598e443 jc/gitignore-doc-pattern-markup later to maint).
+   (merge a2dad4868b jc/transport-parseopt-fix later to maint).
+   (merge 68cbb20e73 jc/parse-options-show-branch later to maint).
+   (merge 3821eb6c3d jc/parse-options-reset later to maint).
+   (merge c48af99a3e bb/trace2-comment-fix later to maint).
+   (merge c95ae3ff9c rs/describe-parseopt-fix later to maint).
+   (merge 36f76d2a25 rs/pack-objects-parseopt-fix later to maint).
+   (merge 30c8c55cbf jc/tree-walk-drop-base-offset later to maint).
+   (merge d089a06421 rs/bundle-parseopt-cleanup later to maint).
+   (merge 823839bda1 ew/sha256-gcrypt-leak-fixes later to maint).
+   (merge a5c01603b3 bc/ignore-clangd-cache later to maint).
+   (merge 12009a182b js/allow-t4000-to-be-indented-with-spaces later to maint).
+   (merge b3dcd24b8a jc/send-email-pre-process-fix later to maint).
index b218e273570158fa6a3e9863398295b1e3ab7016..973d7a81d4492d627c77ce3c6db105ae917fb957 100644 (file)
@@ -3,45 +3,101 @@ Submitting Patches
 
 == Guidelines
 
-Here are some guidelines for people who want to contribute their code to this
-software. There is also a link:MyFirstContribution.html[step-by-step tutorial]
+Here are some guidelines for contributing back to this
+project. There is also a link:MyFirstContribution.html[step-by-step tutorial]
 available which covers many of these same guidelines.
 
-[[base-branch]]
-=== Decide what to base your work on.
-
-In general, always base your work on the oldest branch that your
-change is relevant to.
-
-* A bugfix should be based on `maint` in general. If the bug is not
-  present in `maint`, base it on `master`. For a bug that's not yet
-  in `master`, find the topic that introduces the regression, and
-  base your work on the tip of the topic.
-
-* A new feature should be based on `master` in general. If the new
-  feature depends on other topics that are in `next`, but not in
-  `master`, fork a branch from the tip of `master`, merge these topics
-  to the branch, and work on that branch.  You can remind yourself of
-  how you prepared the base with `git log --first-parent master..`.
-
-* Corrections and enhancements to a topic not yet in `master` should
-  be based on the tip of that topic. If the topic has not been merged
-  to `next`, it's alright to add a note to squash minor corrections
-  into the series.
-
-* In the exceptional case that a new feature depends on several topics
-  not in `master`, start working on `next` or `seen` privately and
-  send out patches only for discussion. Once your new feature starts
-  to stabilize, you would have to rebase it (see the "depends on other
-  topics" above).
-
-* Some parts of the system have dedicated maintainers with their own
-  repositories (see the section "Subsystems" below).  Changes to
-  these parts should be based on their trees.
-
-To find the tip of a topic branch, run `git log --first-parent
-master..seen` and look for the merge commit. The second parent of this
-commit is the tip of the topic branch.
+[[choose-starting-point]]
+=== Choose a starting point.
+
+As a preliminary step, you must first choose a starting point for your
+work. Typically this means choosing a branch, although technically
+speaking it is actually a particular commit (typically the HEAD, or tip,
+of the branch).
+
+There are several important branches to be aware of. Namely, there are
+four integration branches as discussed in linkgit:gitworkflows[7]:
+
+* maint
+* master
+* next
+* seen
+
+The branches lower on the list are typically descendants of the ones
+that come before it. For example, `maint` is an "older" branch than
+`master` because `master` usually has patches (commits) on top of
+`maint`.
+
+There are also "topic" branches, which contain work from other
+contributors.  Topic branches are created by the Git maintainer (in
+their fork) to organize the current set of incoming contributions on
+the mailing list, and are itemized in the regular "What's cooking in
+git.git" announcements.  To find the tip of a topic branch, run `git log
+--first-parent master..seen` and look for the merge commit. The second
+parent of this commit is the tip of the topic branch.
+
+There is one guiding principle for choosing the right starting point: in
+general, always base your work on the oldest integration branch that
+your change is relevant to (see "Merge upwards" in
+linkgit:gitworkflows[7]).  What this principle means is that for the
+vast majority of cases, the starting point for new work should be the
+latest HEAD commit of `maint` or `master` based on the following cases:
+
+* If you are fixing bugs in the released version, use `maint` as the
+  starting point (which may mean you have to fix things without using
+  new API features on the cutting edge that recently appeared in
+  `master` but were not available in the released version).
+
+* Otherwise (such as if you are adding new features) use `master`.
+
+
+NOTE: In exceptional cases, a bug that was introduced in an old
+version may have to be fixed for users of releases that are much older
+than the recent releases.  `git describe --contains X` may describe
+`X` as `v2.30.0-rc2-gXXXXXX` for the commit `X` that introduced the
+bug, and the bug may be so high-impact that we may need to issue a new
+maintenance release for Git 2.30.x series, when "Git 2.41.0" is the
+current release.  In such a case, you may want to use the tip of the
+maintenance branch for the 2.30.x series, which may be available in the
+`maint-2.30` branch in https://github.com/gitster/git[the maintainer's
+"broken out" repo].
+
+This also means that `next` or `seen` are inappropriate starting points
+for your work, if you want your work to have a realistic chance of
+graduating to `master`.  They are simply not designed to be used as a
+base for new work; they are only there to make sure that topics in
+flight work well together. This is why both `next` and `seen` are
+frequently re-integrated with incoming patches on the mailing list and
+force-pushed to replace previous versions of themselves. A topic that is
+literally built on top of `next` cannot be merged to `master` without
+dragging in all the other topics in `next`, some of which may not be
+ready.
+
+For example, if you are making tree-wide changes, while somebody else is
+also making their own tree-wide changes, your work may have severe
+overlap with the other person's work.  This situation may tempt you to
+use `next` as your starting point (because it would have the other
+person's work included in it), but doing so would mean you'll not only
+depend on the other person's work, but all the other random things from
+other contributors that are already integrated into `next`.  And as soon
+as `next` is updated with a new version, all of your work will need to
+be rebased anyway in order for them to be cleanly applied by the
+maintainer.
+
+Under truly exceptional circumstances where you absolutely must depend
+on a select few topic branches that are already in `next` but not in
+`master`, you may want to create your own custom base-branch by forking
+`master` and merging the required topic branches to it. You could then
+work on top of this base-branch.  But keep in mind that this base-branch
+would only be known privately to you.  So when you are ready to send
+your patches to the list, be sure to communicate how you created it in
+your cover letter.  This critical piece of information would allow
+others to recreate your base-branch on their end in order for them to
+try out your work.
+
+Finally, note that some parts of the system have dedicated maintainers
+with their own separate source code repositories (see the section
+"Subsystems" below).
 
 [[separate-commits]]
 === Make separate commits for logically separate changes.
@@ -317,10 +373,13 @@ Please make sure your patch does not add commented out debugging code,
 or include any extra files which do not relate to what your patch
 is trying to achieve. Make sure to review
 your patch after generating it, to ensure accuracy.  Before
-sending out, please make sure it cleanly applies to the base you
-have chosen in the "Decide what to base your work on" section,
-and unless it targets the `master` branch (which is the default),
-mark your patches as such.
+sending out, please make sure it cleanly applies to the starting point you
+have chosen in the "Choose a starting point" section.
+
+NOTE: From the perspective of those reviewing your patch, the `master`
+branch is the default expected starting point.  So if you have chosen a
+different starting point, please communicate this choice in your cover
+letter.
 
 
 [[send-patches]]
index 95599bd6e5f48f4ead1f04bcdb0b733b74a16316..552dcc60f2a41e24260fd4f6f8d6090a3df660e1 100644 (file)
@@ -64,11 +64,9 @@ include::line-range-format.txt[]
        manual page.
 
 --contents <file>::
-       Pretend the file being annotated has a commit with the
-       contents from the named file and a parent of <rev>,
-       defaulting to HEAD when no <rev> is specified. You may
-       specify '-' to make the command read from the standard
-       input for the file contents.
+       Annotate using the contents from the named file, starting from <rev>
+       if it is specified, and HEAD otherwise. You may specify '-' to make
+       the command read from the standard input for the file contents.
 
 --date <format>::
        Specifies the format used to output dates. If --date is not
index 0e93aef86264dbe5c7af33e66a13778c160b24ba..229b63a454c035dcd6fa6797b29788ae67c053a4 100644 (file)
@@ -182,7 +182,7 @@ included, Git breaks the cycle by prohibiting these files from affecting
 the resolution of these conditions (thus, prohibiting them from
 declaring remote URLs).
 +
-As for the naming of this keyword, it is for forwards compatibiliy with
+As for the naming of this keyword, it is for forwards compatibility with
 a naming scheme that supports more variable-based include conditions,
 but currently Git only supports the exact keyword described above.
 
index c96b5b2e5d2160c3f6b1147fc6500f22acf06a55..c548a91e6761c762b19f26e2bb1f5a36f8192ba9 100644 (file)
@@ -138,4 +138,8 @@ advice.*::
                checkout.
        diverging::
                Advice shown when a fast-forward is not possible.
+       worktreeAddOrphan::
+               Advice shown when a user tries to create a worktree from an
+               invalid reference, to instruct how to create a new orphan
+               branch instead.
 --
index e52bc6b858470c60f09f52d4f9d2b9f17135483c..bf9546fca4f693f01b39252d12def7df9b51a52f 100644 (file)
@@ -15,8 +15,8 @@ feature.experimental::
 * `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
 skipping more commits at a time, reducing the number of round trips.
 +
-* `gc.cruftPacks=true` reduces disk space used by unreachable objects during
-garbage collection, preventing loose object explosions.
+* `pack.useBitmapBoundaryTraversal=true` may improve bitmap traversal times by
+walking fewer objects.
 
 feature.manyFiles::
        Enable config options that optimize for repos with many files in the
index 38fea076a26d0f1f7bf137723baba945675901fc..ca47eb200882a251ddf7ad644151bb6e896b242f 100644 (file)
@@ -43,11 +43,11 @@ gc.autoDetach::
        if the system supports it. Default is true.
 
 gc.bigPackThreshold::
-       If non-zero, all packs larger than this limit are kept when
-       `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 largest pack. Defaults to zero. Common unit suffixes of
-       'k', 'm', or 'g' are supported.
+       If non-zero, all non-cruft packs larger than this limit are kept
+       when `git gc` is run. This is very similar to
+       `--keep-largest-pack` except that all non-cruft packs that meet
+       the threshold are kept, not 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,
 this configuration variable is ignored, all packs except the base pack
@@ -84,7 +84,7 @@ gc.packRefs::
 gc.cruftPacks::
        Store unreachable objects in a cruft pack (see
        linkgit:git-repack[1]) instead of as loose objects. The default
-       is `false`.
+       is `true`.
 
 gc.pruneExpire::
        When 'git gc' is run, it will call 'prune --expire 2.weeks.ago'
@@ -130,6 +130,21 @@ or rebase occurring.  Since these changes are not part of the current
 project most users will want to expire them sooner, which is why the
 default is more aggressive than `gc.reflogExpire`.
 
+gc.recentObjectsHook::
+       When considering whether or not to remove an object (either when
+       generating a cruft pack or storing unreachable objects as
+       loose), use the shell to execute the specified command(s).
+       Interpret their output as object IDs which Git will consider as
+       "recent", regardless of their age. By treating their mtimes as
+       "now", any objects (and their descendants) mentioned in the
+       output will be kept regardless of their true age.
++
+Output must contain exactly one hex object ID per line, and nothing
+else. Objects which cannot be found in the repository are ignored.
+Multiple hooks are supported, but all must exit successfully, else the
+operation (either generating a cruft pack or unpacking unreachable
+objects) will be halted.
+
 gc.rerereResolved::
        Records of conflicted merge you resolved earlier are
        kept for this many days when 'git rerere gc' is run.
index afeeccfbfa7a7073a19088a625b03fe2abee5801..51a70781e58cf9923cb0b1b84104c6d011dbd5f8 100644 (file)
@@ -246,8 +246,9 @@ significantly since the entire buffer is allocated even for small
 pushes.
 
 http.lowSpeedLimit, http.lowSpeedTime::
-       If the HTTP transfer speed is less than 'http.lowSpeedLimit'
-       for longer than 'http.lowSpeedTime' seconds, the transfer is aborted.
+       If the HTTP transfer speed, in bytes per second, is less than
+       'http.lowSpeedLimit' for longer than 'http.lowSpeedTime' seconds,
+       the transfer is aborted.
        Can be overridden by the `GIT_HTTP_LOW_SPEED_LIMIT` and
        `GIT_HTTP_LOW_SPEED_TIME` environment variables.
 
index 53093d99969cc090e4727a570eb667a6fba445d4..3748136d141e4193682655559d91f143f31305ec 100644 (file)
@@ -123,6 +123,23 @@ pack.useBitmaps::
        true. You should not generally need to turn this off unless
        you are debugging pack bitmaps.
 
+pack.useBitmapBoundaryTraversal::
+       When true, Git will use an experimental algorithm for computing
+       reachability queries with bitmaps. Instead of building up
+       complete bitmaps for all of the negated tips and then OR-ing
+       them together, consider negated tips with existing bitmaps as
+       additive (i.e. OR-ing them into the result if they exist,
+       ignoring them otherwise), and build up a bitmap at the boundary
+       instead.
++
+When using this algorithm, Git may include too many objects as a result
+of not opening up trees belonging to certain UNINTERESTING commits. This
+inexactness matches the non-bitmap traversal algorithm.
++
+In many cases, this can provide a speed-up over the exact algorithm,
+particularly when there is poor bitmap coverage of the negated side of
+the query.
+
 pack.useSparse::
        When true, git will default to using the '--sparse' option in
        'git pack-objects' when the '--revs' option is present. This
@@ -171,9 +188,15 @@ pack.writeBitmapLookupTable::
        beneficial in repositories that have relatively large bitmap
        indexes. Defaults to false.
 
+pack.readReverseIndex::
+       When true, git will read any .rev file(s) that may be available
+       (see: linkgit:gitformat-pack[5]). When false, the reverse index
+       will be generated from scratch and stored in memory. Defaults to
+       true.
+
 pack.writeReverseIndex::
        When true, git will write a corresponding .rev file (see:
        linkgit:gitformat-pack[5])
        for each new packfile that it writes in all places except for
        linkgit:git-fast-import[1] and in the bulk checkin mechanism.
-       Defaults to false.
+       Defaults to true.
index 51da7088a844d3f148d78317e792efd485a2c0af..92a9ebe98c63e5fe75eb98237543d41d9f15c502 100644 (file)
@@ -61,6 +61,7 @@ sendemail.ccCmd::
 sendemail.chainReplyTo::
 sendemail.envelopeSender::
 sendemail.from::
+sendemail.headerCmd::
 sendemail.signedoffbycc::
 sendemail.smtpPass::
 sendemail.suppresscc::
index 08ab86189a7b62cf88898d04a57ed3e943bdc311..9f33f887711d3ac1d1f0e8933b22d8004b606dc7 100644 (file)
@@ -35,8 +35,11 @@ endif::git-diff[]
 
 -s::
 --no-patch::
-       Suppress diff output. Useful for commands like `git show` that
-       show the patch by default, or to cancel the effect of `--patch`.
+       Suppress all output from the diff machinery.  Useful for
+       commands like `git show` that show the patch by default to
+       squelch their output, or to cancel the effect of options like
+       `--patch`, `--stat` earlier on the command line in an alias.
+
 endif::git-format-patch[]
 
 ifdef::git-log[]
index 1694300e50bfcfa58cc7798614a254fec2e219a5..fb09e0ac0ebcac9f88a0fbe08c258398586ba0fe 100755 (executable)
@@ -153,7 +153,7 @@ render_tree () {
                make -j$parallel -C "$tmp/worktree" \
                        $makemanflags \
                        GIT_VERSION=omitted \
-                       SOURCE_DATE_EPOCH=0 \
+                       GIT_DATE=1970-01-01 \
                        DESTDIR="$tmp/installed/$dname+" \
                        install-man &&
                mv "$tmp/installed/$dname+" "$tmp/installed/$dname"
index 622bd84768b056e23fa0f432e745aaffd651c734..41fc7ca3c67f5d31d5a771de906394480f265d9f 100644 (file)
@@ -78,6 +78,13 @@ linkgit:git-config[1].
 --dry-run::
        Show what would be done, without making any changes.
 
+--porcelain::
+       Print the output to standard output in an easy-to-parse format for
+       scripts. See section OUTPUT in linkgit:git-fetch[1] for details.
++
+This is incompatible with `--recurse-submodules=[yes|on-demand]` and takes
+precedence over the `fetch.output` config option.
+
 ifndef::git-pull[]
 --[no-]write-fetch-head::
        Write the list of remote refs fetched in the `FETCH_HEAD`
index fbb39fbdf5d62a455c8b62d4870817998d0434ad..7872dba3aefa3de62175f0e88bfac1473bbe0723 100644 (file)
@@ -204,9 +204,14 @@ as an alternative to `visualize`):
 $ git bisect visualize
 ------------
 
-If the `DISPLAY` environment variable is not set, 'git log' is used
-instead.  You can also give command-line options such as `-p` and
-`--stat`.
+Git detects a graphical environment through various environment variables:
+`DISPLAY`, which is set in X Window System environments on Unix systems.
+`SESSIONNAME`, which is set under Cygwin in interactive desktop sessions.
+`MSYSTEM`, which is set under Msys2 and Git for Windows.
+`SECURITYSESSIONID`, which may be set on macOS in interactive desktop sessions.
+
+If none of these environment variables is set, 'git log' is used instead.
+You can also give command-line options such as `-p` and `--stat`.
 
 ------------
 $ git bisect visualize --stat
index 411de2e27ddc0db762ec9be6ceec18a7fc1bf069..0e4936d182632fb3362376787efd7d633bd623d2 100644 (file)
@@ -14,7 +14,7 @@ SYNOPSIS
 'git cat-file' (-t | -s) [--allow-unknown-type] <object>
 'git cat-file' (--batch | --batch-check | --batch-command) [--batch-all-objects]
             [--buffer] [--follow-symlinks] [--unordered]
-            [--textconv | --filters] [-z]
+            [--textconv | --filters] [-Z]
 'git cat-file' (--textconv | --filters)
             [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]
 
@@ -243,10 +243,16 @@ respectively print:
        /etc/passwd
 --
 
+-Z::
+       Only meaningful with `--batch`, `--batch-check`, or
+       `--batch-command`; input and output is NUL-delimited instead of
+       newline-delimited.
+
 -z::
        Only meaningful with `--batch`, `--batch-check`, or
        `--batch-command`; input is NUL-delimited instead of
-       newline-delimited.
+       newline-delimited. This option is deprecated in favor of
+       `-Z` as the output can otherwise be ambiguous.
 
 
 OUTPUT
@@ -384,6 +390,11 @@ notdir SP <size> LF
 is printed when, during symlink resolution, a file is used as a
 directory name.
 
+Alternatively, when `-Z` is passed, the line feeds in any of the above examples
+are replaced with NUL terminators. This ensures that output will be parsable if
+the output itself would contain a linefeed and is thus recommended for
+scripting purposes.
+
 CAVEATS
 -------
 
index 6bb32ab4602aa9b55c935a0d3bb64d56682c7bed..4af0904f4729b463d3b63bf3479f5e4b313773fd 100644 (file)
@@ -483,14 +483,11 @@ $ git checkout -b foo  # or "git switch -c foo"  <1>
 $ git branch foo                                 <2>
 $ git tag foo                                    <3>
 ------------
-
 <1> creates a new branch `foo`, which refers to commit `f`, and then
     updates `HEAD` to refer to branch `foo`. In other words, we'll no longer
     be in detached `HEAD` state after this command.
-
 <2> similarly creates a new branch `foo`, which refers to commit `f`,
     but leaves `HEAD` detached.
-
 <3> creates a new tag `foo`, which refers to commit `f`,
     leaving `HEAD` detached.
 
@@ -519,84 +516,89 @@ to checkout these paths out of the index.
 EXAMPLES
 --------
 
-. The following sequence checks out the `master` branch, reverts
-  the `Makefile` to two revisions back, deletes `hello.c` by
-  mistake, and gets it back from the index.
-+
+=== 1. Paths
+
+The following sequence checks out the `master` branch, reverts
+the `Makefile` to two revisions back, deletes `hello.c` by
+mistake, and gets it back from the index.
+
 ------------
 $ git checkout master             <1>
 $ git checkout master~2 Makefile  <2>
 $ rm -f hello.c
 $ git checkout hello.c            <3>
 ------------
-+
 <1> switch branch
 <2> take a file out of another commit
 <3> restore `hello.c` from the index
-+
+
 If you want to check out _all_ C source files out of the index,
 you can say
-+
+
 ------------
 $ git checkout -- '*.c'
 ------------
-+
+
 Note the quotes around `*.c`.  The file `hello.c` will also be
 checked out, even though it is no longer in the working tree,
 because the file globbing is used to match entries in the index
 (not in the working tree by the shell).
-+
+
 If you have an unfortunate branch that is named `hello.c`, this
 step would be confused as an instruction to switch to that branch.
 You should instead write:
-+
+
 ------------
 $ git checkout -- hello.c
 ------------
 
-. After working in the wrong branch, switching to the correct
-  branch would be done using:
-+
+=== 2. Merge
+
+After working in the wrong branch, switching to the correct
+branch would be done using:
+
 ------------
 $ git checkout mytopic
 ------------
-+
+
 However, your "wrong" branch and correct `mytopic` branch may
 differ in files that you have modified locally, in which case
 the above checkout would fail like this:
-+
+
 ------------
 $ git checkout mytopic
 error: You have local changes to 'frotz'; not switching branches.
 ------------
-+
+
 You can give the `-m` flag to the command, which would try a
 three-way merge:
-+
+
 ------------
 $ git checkout -m mytopic
 Auto-merging frotz
 ------------
-+
+
 After this three-way merge, the local modifications are _not_
 registered in your index file, so `git diff` would show you what
 changes you made since the tip of the new branch.
 
-. When a merge conflict happens during switching branches with
-  the `-m` option, you would see something like this:
-+
+=== 3. Merge conflict
+
+When a merge conflict happens during switching branches with
+the `-m` option, you would see something like this:
+
 ------------
 $ git checkout -m mytopic
 Auto-merging frotz
 ERROR: Merge conflict in frotz
 fatal: merge program failed
 ------------
-+
+
 At this point, `git diff` shows the changes cleanly merged as in
 the previous example, as well as the changes in the conflicted
 files.  Edit and resolve the conflict and mark it resolved with
 `git add` as usual:
-+
+
 ------------
 $ edit frotz
 $ git add frotz
index 3394c036113acd827b824a1f6ed7ae6fb13f143b..a220afed4f35ba2a2ea1d7bd68dd07b1353d3522 100644 (file)
@@ -39,7 +39,7 @@ for later use.
 
 If the action is `reject`, git-credential will send the description to
 any configured credential helpers, which may erase any stored
-credential matching the description.
+credentials matching the description.
 
 If the action is `approve` or `reject`, no output should be emitted.
 
@@ -156,6 +156,12 @@ Git understands the following attributes:
        When reading credentials from helpers, `git credential fill` ignores expired
        passwords. Represented as Unix time UTC, seconds since 1970.
 
+`oauth_refresh_token`::
+
+       An OAuth refresh token may accompany a password that is an OAuth access
+       token. Helpers must treat this attribute as confidential like the password
+       attribute. Git itself has no special behaviour for this attribute.
+
 `url`::
 
        When this special attribute is read by `git credential`, the
index 53f111bc0acaf08a0a208501a32973cd420d0b35..cf4a5a283ecd68f49fb3051b2f27007074eac4ef 100644 (file)
@@ -118,7 +118,7 @@ for example:
    myuser:$5$.NqmNH1vwfzGpV8B$znZIcumu1tNLATgV2l6e1/mY8RzhUDHMOaVOeL1cxV3
 ------
 You can use the 'htpasswd' facility that comes with Apache to make these
-files, but only with the -d option (or -B if your system suports it).
+files, but only with the -d option (or -B if your system supports it).
 
 Preferably use the system specific utility that manages password hash
 creation in your platform (e.g. mkpasswd in Linux, encrypt in OpenBSD or
index c6a79c2a0f29ccc1f87c331382b484ab9a1c5a62..08ff715709ccd1190cf9769c84a49322300a308e 100644 (file)
@@ -140,7 +140,7 @@ at the end.
 
 The number of additional commits is the number
 of commits which would be displayed by "git log v1.0.4..parent".
-The hash suffix is "-g" + an unambigous abbreviation for the tip commit
+The hash suffix is "-g" + an unambiguous abbreviation for the tip commit
 of parent (which was `2414721b194453f058079d897d13c4e377f92dc6`). The
 length of the abbreviation scales as the repository grows, using the
 approximate number of objects in the repository and a bit of math
@@ -203,7 +203,7 @@ BUGS
 
 Tree objects as well as tag objects not pointing at commits, cannot be described.
 When describing blobs, the lightweight tags pointing at blobs are ignored,
-but the blob is still described as <committ-ish>:<path> despite the lightweight
+but the blob is still described as <commit-ish>:<path> despite the lightweight
 tag being favorable.
 
 GIT
index 52b679256c430f582f70eac04004761fb4b5cfb8..08087ffad5fe9929cc04629ba4aeaa4240f457e4 100644 (file)
@@ -102,7 +102,11 @@ If --merge-base is given, use the merge base of the two commits for the
 Just in case you are doing something exotic, it should be
 noted that all of the <commit> in the above description, except
 in the `--merge-base` case and in the last two forms that use `..`
-notations, can be any <tree>.
+notations, can be any <tree>. A tree of interest is the one pointed to
+by the special ref `AUTO_MERGE`, which is written by the 'ort' merge
+strategy upon hitting merge conflicts (see linkgit:git-merge[1]).
+Comparing the working tree with `AUTO_MERGE` shows changes you've made
+so far to resolve textual conflicts (see the examples below).
 
 For a more complete list of ways to spell <commit>, see
 "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
@@ -152,6 +156,7 @@ Various ways to check your working tree::
 $ git diff            <1>
 $ git diff --cached   <2>
 $ git diff HEAD       <3>
+$ git diff AUTO_MERGE <4>
 ------------
 +
 <1> Changes in the working tree not yet staged for the next commit.
@@ -159,6 +164,8 @@ $ git diff HEAD       <3>
     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`
+<4> Changes in the working tree you've made to resolve textual
+    conflicts so far.
 
 Comparing with arbitrary commits::
 +
index fba66f14607a5f3f70e87e3fa1d04af90015a277..f123139c581001d2bcbd94dcc187775e58e8fd6c 100644 (file)
@@ -204,6 +204,15 @@ representing the status of a single ref. Each line is of the form:
  <flag> <summary> <from> -> <to> [<reason>]
 -------------------------------
 
+When using `--porcelain`, the output format is intended to be
+machine-parseable. In contrast to the human-readable output formats it
+thus prints to standard output instead of standard error. Each line is
+of the form:
+
+-------------------------------
+<flag> <old-object-id> <new-object-id> <local-reference>
+-------------------------------
+
 The status of up-to-date refs is shown only if the --verbose option is
 used.
 
index 1e215d4e73451f2d8dc1e70d42d53475952910dd..11b2bc3121626d047b415f805e98b380be0ef1e4 100644 (file)
@@ -14,6 +14,7 @@ SYNOPSIS
                   [--points-at=<object>]
                   [--merged[=<object>]] [--no-merged[=<object>]]
                   [--contains[=<object>]] [--no-contains[=<object>]]
+                  [--exclude=<pattern> ...]
 
 DESCRIPTION
 -----------
@@ -102,6 +103,11 @@ OPTIONS
        Do not print a newline after formatted refs where the format expands
        to the empty string.
 
+--exclude=<pattern>::
+       If one or more patterns are given, only refs which do not match
+       any excluded pattern(s) are shown. Matching is done using the
+       same rules as `<pattern>` above.
+
 FIELD NAMES
 -----------
 
@@ -221,6 +227,33 @@ symref::
        `:lstrip` and `:rstrip` options in the same way as `refname`
        above.
 
+signature::
+       The GPG signature of a commit.
+
+signature:grade::
+       Show "G" for a good (valid) signature, "B" for a bad
+       signature, "U" for a good signature with unknown validity, "X"
+       for a good signature that has expired, "Y" for a good
+       signature made by an expired key, "R" for a good signature
+       made by a revoked key, "E" if the signature cannot be
+       checked (e.g. missing key) and "N" for no signature.
+
+signature:signer::
+       The signer of the GPG signature of a commit.
+
+signature:key::
+       The key of the GPG signature of a commit.
+
+signature:fingerprint::
+       The fingerprint of the GPG signature of a commit.
+
+signature:primarykeyfingerprint::
+       The primary key fingerprint of the GPG signature of a commit.
+
+signature:trustlevel::
+       The trust level of the GPG signature of a commit. Possible
+       outputs are `ultimate`, `fully`, `marginal`, `never` and `undefined`.
+
 worktreepath::
        The absolute path to the worktree in which the ref is checked
        out, if it is checked out in any linked worktree. Empty string
@@ -231,6 +264,29 @@ ahead-behind:<committish>::
        commits ahead and behind, respectively, when comparing the output
        ref to the `<committish>` specified in the format.
 
+describe[:options]::
+       A human-readable name, like linkgit:git-describe[1];
+       empty string for undescribable commits. The `describe` string may
+       be followed by a colon and one or more comma-separated options.
++
+--
+tags=<bool-value>;;
+       Instead of only considering annotated tags, consider
+       lightweight tags as well; see the corresponding option in
+       linkgit:git-describe[1] for details.
+abbrev=<number>;;
+       Use at least <number> hexadecimal digits; see the corresponding
+       option in linkgit:git-describe[1] for details.
+match=<pattern>;;
+       Only consider tags matching the given `glob(7)` pattern,
+       excluding the "refs/tags/" prefix; see the corresponding option
+       in linkgit:git-describe[1] for details.
+exclude=<pattern>;;
+       Do not consider tags matching the given `glob(7)` pattern,
+       excluding the "refs/tags/" prefix; see the corresponding option
+       in linkgit:git-describe[1] for details.
+--
+
 In addition to the above, for commit and tag objects, the header
 field names (`tree`, `parent`, `object`, `type`, and `tag`) can
 be used to specify the value in the header field.
index b1c13fb39a03dacf6180c4963d605f09d9b76c14..373b46fc0de64f4c7426f683b95f24f95ff9cd84 100644 (file)
@@ -245,7 +245,7 @@ populated with placeholder text.
        or "--reroll-count=4rev2" are allowed), but the downside of
        using such a reroll-count is that the range-diff/interdiff
        with the previous version does not state exactly which
-       version the new interation is compared against.
+       version the new iteration is compared against.
 
 --to=<email>::
        Add a `To:` header to the email headers. This is in addition
index a65c9aa62d64112dfd03335af82a680e54d00c58..90806fd26aa4ac0d1fef93d25384af3799818896 100644 (file)
@@ -54,9 +54,10 @@ other housekeeping tasks (e.g. rerere, working trees, reflog...) will
 be performed as well.
 
 
---cruft::
+--[no-]cruft::
        When expiring unreachable objects, pack them separately into a
-       cruft pack instead of storing them as loose objects.
+       cruft pack instead of storing them as loose objects. `--cruft`
+       is on by default.
 
 --prune=<date>::
        Prune loose objects older than date (default is 2 weeks ago,
@@ -77,9 +78,10 @@ be performed as well.
        instance running on this repository.
 
 --keep-largest-pack::
-       All packs except the largest pack and those marked with a
-       `.keep` files are consolidated into a single pack. When this
-       option is used, `gc.bigPackThreshold` is ignored.
+       All packs except the largest non-cruft pack, any packs marked
+       with a `.keep` file, and any cruft pack(s) are consolidated into
+       a single pack. When this option is used, `gc.bigPackThreshold`
+       is ignored.
 
 AGGRESSIVE
 ----------
index 472b5bb995be278415daede21a5489ed2d4c01da..8577f7a7d4087d347bddf39b45c9c5365e2dafa6 100644 (file)
@@ -3,7 +3,7 @@ git-hash-object(1)
 
 NAME
 ----
-git-hash-object - Compute object ID and optionally creates a blob from a file
+git-hash-object - Compute object ID and optionally create an object from a file
 
 
 SYNOPSIS
@@ -25,7 +25,8 @@ OPTIONS
 -------
 
 -t <type>::
-       Specify the type (default: "blob").
+       Specify the type of object to be created (default: "blob"). Possible
+       values are `commit`, `tree`, `blob`, and `tag`.
 
 -w::
        Actually write the object into the object database.
index 22ff3a603e03e3c9a1f0d76918fafa225989079d..55d89614661c5c46c8dd69fb149cfec70d72fc85 100644 (file)
@@ -14,21 +14,38 @@ SYNOPSIS
 
 DESCRIPTION
 -----------
-Help parsing or adding 'trailers' lines, that look similar to RFC 822 e-mail
+Add or parse 'trailer' lines that look similar to RFC 822 e-mail
 headers, at the end of the otherwise free-form part of a commit
-message.
+message. For example, in the following commit message
 
-This command reads some patches or commit messages from either the
-<file> arguments or the standard input if no <file> is specified. If
-`--parse` is specified, the output consists of the parsed trailers.
+------------------------------------------------
+subject
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 
+Signed-off-by: Alice <alice@example.com>
+Signed-off-by: Bob <bob@example.com>
+------------------------------------------------
+
+the last two lines starting with "Signed-off-by" are trailers.
+
+This command reads commit messages from either the
+<file> arguments or the standard input if no <file> is specified.
+If `--parse` is specified, the output consists of the parsed trailers.
 Otherwise, this command applies the arguments passed using the
-`--trailer` option, if any, to the commit message part of each input
-file. The result is emitted on the standard output.
+`--trailer` option, if any, to each input file. The result is emitted on the
+standard output.
+
+This command can also operate on the output of linkgit:git-format-patch[1],
+which is more elaborate than a plain commit message. Namely, such output
+includes a commit message (as above), a "---" divider line, and a patch part.
+For these inputs, the divider and patch parts are not modified by
+this command and are emitted as is on the output, unless
+`--no-divider` is specified.
 
 Some configuration variables control the way the `--trailer` arguments
-are applied to each commit message and the way any existing trailer in
-the commit message is changed. They also make it possible to
+are applied to each input and the way any existing trailer in
+the input is changed. They also make it possible to
 automatically add some trailers.
 
 By default, a '<token>=<value>' or '<token>:<value>' argument given
@@ -36,41 +53,46 @@ using `--trailer` will be appended after the existing trailers only if
 the last trailer has a different (<token>, <value>) pair (or if there
 is no existing trailer). The <token> and <value> parts will be trimmed
 to remove starting and trailing whitespace, and the resulting trimmed
-<token> and <value> will appear in the message like this:
+<token> and <value> will appear in the output like this:
 
 ------------------------------------------------
 token: value
 ------------------------------------------------
 
 This means that the trimmed <token> and <value> will be separated by
-`': '` (one colon followed by one space).
+`': '` (one colon followed by one space). For convenience, the <token> can be a
+shortened string key (e.g., "sign") instead of the full string which should
+appear before the separator on the output (e.g., "Signed-off-by"). This can be
+configured using the 'trailer.<token>.key' configuration variable.
 
 By default the new trailer will appear at the end of all the existing
 trailers. If there is no existing trailer, the new trailer will appear
-after the commit message part of the output, and, if there is no line
-with only spaces at the end of the commit message part, one blank line
-will be added before the new trailer.
+at the end of the input. A blank line will be added before the new
+trailer if there isn't one already.
 
-Existing trailers are extracted from the input message by looking for
+Existing trailers are extracted from the input by looking for
 a group of one or more lines that (i) is all trailers, or (ii) contains at
 least one Git-generated or user-configured trailer and consists of at
 least 25% trailers.
 The group must be preceded by one or more empty (or whitespace-only) lines.
-The group must either be at the end of the message or be the last
+The group must either be at the end of the input or be the last
 non-whitespace lines before a line that starts with '---' (followed by a
-space or the end of the line). Such three minus signs start the patch
-part of the message. See also `--no-divider` below.
+space or the end of the line).
 
 When reading trailers, there can be no whitespace before or inside the
-token, but any number of regular space and tab characters are allowed
-between the token and the separator. There can be whitespaces before,
-inside or after the value. The value may be split over multiple lines
+<token>, but any number of regular space and tab characters are allowed
+between the <token> and the separator. There can be whitespaces before,
+inside or after the <value>. The <value> may be split over multiple lines
 with each subsequent line starting with at least one whitespace, like
-the "folding" in RFC 822.
+the "folding" in RFC 822. Example:
 
-Note that 'trailers' do not follow and are not intended to follow many
-rules for RFC 822 headers. For example they do not follow
-the encoding rules and probably many other rules.
+------------------------------------------------
+token: This is a very long value, with spaces and
+  newlines in it.
+------------------------------------------------
+
+Note that trailers do not follow (nor are they intended to follow) many of the
+rules for RFC 822 headers. For example they do not follow the encoding rule.
 
 OPTIONS
 -------
@@ -79,12 +101,12 @@ OPTIONS
 
 --trim-empty::
        If the <value> part of any trailer contains only whitespace,
-       the whole trailer will be removed from the resulting message.
+       the whole trailer will be removed from the output.
        This applies to existing trailers as well as new trailers.
 
 --trailer <token>[(=|:)<value>]::
        Specify a (<token>, <value>) pair that should be applied as a
-       trailer to the input messages. See the description of this
+       trailer to the inputs. See the description of this
        command.
 
 --where <placement>::
@@ -98,7 +120,7 @@ OPTIONS
 --if-exists <action>::
 --no-if-exists::
        Specify what action will be performed when there is already at
-       least one trailer with the same <token> in the message.  A setting
+       least one trailer with the same <token> in the input.  A setting
        provided with '--if-exists' overrides all configuration variables
        and applies to all '--trailer' options until the next occurrence of
        '--if-exists' or '--no-if-exists'. Possible actions are `addIfDifferent`,
@@ -107,7 +129,7 @@ OPTIONS
 --if-missing <action>::
 --no-if-missing::
        Specify what action will be performed when there is no other
-       trailer with the same <token> in the message.  A setting
+       trailer with the same <token> in the input.  A setting
        provided with '--if-missing' overrides all configuration variables
        and applies to all '--trailer' options until the next occurrence of
        '--if-missing' or '--no-if-missing'. Possible actions are `doNothing`
@@ -174,7 +196,7 @@ first trailer with the same <token>.
 trailer.ifexists::
        This option makes it possible to choose what action will be
        performed when there is already at least one trailer with the
-       same <token> in the message.
+       same <token> in the input.
 +
 The valid values for this option are: `addIfDifferentNeighbor` (this
 is the default), `addIfDifferent`, `add`, `replace` or `doNothing`.
@@ -184,10 +206,10 @@ trailer with the same (<token>, <value>) pair is above or below the line
 where the new trailer will be added.
 +
 With `addIfDifferent`, a new trailer will be added only if no trailer
-with the same (<token>, <value>) pair is already in the message.
+with the same (<token>, <value>) pair is already in the input.
 +
 With `add`, a new trailer will be added, even if some trailers with
-the same (<token>, <value>) pair are already in the message.
+the same (<token>, <value>) pair are already in the input.
 +
 With `replace`, an existing trailer with the same <token> will be
 deleted and the new trailer will be added. The deleted trailer will be
@@ -195,12 +217,12 @@ the closest one (with the same <token>) to the place where the new one
 will be added.
 +
 With `doNothing`, nothing will be done; that is no new trailer will be
-added if there is already one with the same <token> in the message.
+added if there is already one with the same <token> in the input.
 
 trailer.ifmissing::
        This option makes it possible to choose what action will be
        performed when there is not yet any trailer with the same
-       <token> in the message.
+       <token> in the input.
 +
 The valid values for this option are: `add` (this is the default) and
 `doNothing`.
@@ -235,13 +257,13 @@ trailer.<token>.ifmissing::
        that option for trailers with the specified <token>.
 
 trailer.<token>.command::
+       Deprecated in favor of 'trailer.<token>.cmd'.
        This option behaves in the same way as 'trailer.<token>.cmd', except
        that it doesn't pass anything as argument to the specified command.
        Instead the first occurrence of substring $ARG is replaced by the
-       value that would be passed as argument.
+       <value> that would be passed as argument.
 +
-The 'trailer.<token>.command' option has been deprecated in favor of
-'trailer.<token>.cmd' due to the fact that $ARG in the user's command is
+Note that $ARG in the user's command is
 only replaced once and that the original way of replacing $ARG is not safe.
 +
 When both 'trailer.<token>.cmd' and 'trailer.<token>.command' are given
@@ -249,10 +271,10 @@ for the same <token>, 'trailer.<token>.cmd' is used and
 'trailer.<token>.command' is ignored.
 
 trailer.<token>.cmd::
-       This option can be used to specify a shell command that will be called:
+       This option can be used to specify a shell command that will be called
        once to automatically add a trailer with the specified <token>, and then
-       each time a '--trailer <token>=<value>' argument to modify the <value> of
-       the trailer that this option would produce.
+       called each time a '--trailer <token>=<value>' argument is specified to
+       modify the <value> of the trailer that this option would produce.
 +
 When the specified command is first called to add a trailer
 with the specified <token>, the behavior is as if a special
@@ -272,37 +294,37 @@ EXAMPLES
 --------
 
 * Configure a 'sign' trailer with a 'Signed-off-by' key, and then
-  add two of these trailers to a message:
+  add two of these trailers to a commit message file:
 +
 ------------
 $ git config trailer.sign.key "Signed-off-by"
 $ cat msg.txt
 subject
 
-message
-$ cat msg.txt | git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>'
+body text
+$ git interpret-trailers --trailer 'sign: Alice <alice@example.com>' --trailer 'sign: Bob <bob@example.com>' <msg.txt
 subject
 
-message
+body text
 
 Signed-off-by: Alice <alice@example.com>
 Signed-off-by: Bob <bob@example.com>
 ------------
 
-* Use the `--in-place` option to edit a message file in place:
+* Use the `--in-place` option to edit a commit message file in place:
 +
 ------------
 $ cat msg.txt
 subject
 
-message
+body text
 
 Signed-off-by: Bob <bob@example.com>
 $ git interpret-trailers --trailer 'Acked-by: Alice <alice@example.com>' --in-place msg.txt
 $ cat msg.txt
 subject
 
-message
+body text
 
 Signed-off-by: Bob <bob@example.com>
 Acked-by: Alice <alice@example.com>
@@ -322,17 +344,30 @@ $ git interpret-trailers --trailer 'Cc: Alice <alice@example.com>' --trailer 'Re
   'Signed-off-by: ' already, and show how it works:
 +
 ------------
+$ cat msg1.txt
+subject
+
+body text
 $ git config trailer.sign.key "Signed-off-by: "
 $ git config trailer.sign.ifmissing add
 $ git config trailer.sign.ifexists doNothing
-$ git config trailer.sign.command 'echo "$(git config user.name) <$(git config user.email)>"'
-$ git interpret-trailers <<EOF
-> EOF
+$ git config trailer.sign.cmd 'echo "$(git config user.name) <$(git config user.email)>"'
+$ git interpret-trailers --trailer sign <msg1.txt
+subject
+
+body text
 
 Signed-off-by: Bob <bob@example.com>
-$ git interpret-trailers <<EOF
-> Signed-off-by: Alice <alice@example.com>
-> EOF
+$ cat msg2.txt
+subject
+
+body text
+
+Signed-off-by: Alice <alice@example.com>
+$ git interpret-trailers --trailer sign <msg2.txt
+subject
+
+body text
 
 Signed-off-by: Alice <alice@example.com>
 ------------
@@ -357,18 +392,17 @@ Fix #42
 $ cat ~/bin/glog-find-author
 #!/bin/sh
 test -n "$1" && git log --author="$1" --pretty="%an <%ae>" -1 || true
+$ cat msg.txt
+subject
+
+body text
 $ git config trailer.help.key "Helped-by: "
 $ git config trailer.help.ifExists "addIfDifferentNeighbor"
 $ git config trailer.help.cmd "~/bin/glog-find-author"
-$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" <<EOF
-> subject
->
-> message
->
-> EOF
+$ git interpret-trailers --trailer="help:Junio" --trailer="help:Couder" <msg.txt
 subject
 
-message
+body text
 
 Helped-by: Junio C Hamano <gitster@pobox.com>
 Helped-by: Christian Couder <christian.couder@gmail.com>
@@ -382,18 +416,17 @@ Helped-by: Christian Couder <christian.couder@gmail.com>
 $ cat ~/bin/glog-grep
 #!/bin/sh
 test -n "$1" && git log --grep "$1" --pretty=reference -1 || true
+$ cat msg.txt
+subject
+
+body text
 $ git config trailer.ref.key "Reference-to: "
 $ git config trailer.ref.ifExists "replace"
 $ git config trailer.ref.cmd "~/bin/glog-grep"
-$ git interpret-trailers --trailer="ref:Add copyright notices." <<EOF
-> subject
->
-> message
->
-> EOF
+$ git interpret-trailers --trailer="ref:Add copyright notices." <msg.txt
 subject
 
-message
+body text
 
 Reference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07)
 ------------
@@ -402,20 +435,23 @@ Reference-to: 8bc9a0c769 (Add copyright notices., 2005-04-07)
   commit that is related, and show how it works:
 +
 ------------
+$ cat msg.txt
+subject
+
+body text
+
+see: HEAD~2
+$ cat ~/bin/glog-ref
+#!/bin/sh
+git log -1 --oneline --format="%h (%s)" --abbrev-commit --abbrev=14
 $ git config trailer.see.key "See-also: "
 $ git config trailer.see.ifExists "replace"
 $ git config trailer.see.ifMissing "doNothing"
-$ git config trailer.see.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG"
-$ git interpret-trailers <<EOF
-> subject
-> 
-> message
-> 
-> see: HEAD~2
-> EOF
+$ git config trailer.see.cmd "glog-ref"
+$ git interpret-trailers --trailer=see <msg.txt
 subject
 
-message
+body text
 
 See-also: fe3187489d69c4 (subject of related commit)
 ------------
@@ -427,22 +463,21 @@ See-also: fe3187489d69c4 (subject of related commit)
   to add a 'git-version' trailer:
 +
 ------------
-$ sed -e 's/ Z$/ /' >commit_template.txt <<EOF
-***subject***
-> 
-***message***
-> 
-Fixes: Z
-Cc: Z
-Reviewed-by: Z
-Signed-off-by: Z
-> EOF
+$ cat temp.txt
+***subject***
+
+***message***
+
+Fixes: Z
+Cc: Z
+Reviewed-by: Z
+Signed-off-by: Z
+$ sed -e 's/ Z$/ /' temp.txt > commit_template.txt
 $ git config commit.template commit_template.txt
-$ cat >.git/hooks/commit-msg <<EOF
-> #!/bin/sh
-> git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new"
-> mv "\$1.new" "\$1"
-> EOF
+$ cat .git/hooks/commit-msg
+#!/bin/sh
+git interpret-trailers --trim-empty --trailer "git-version: \$(git describe)" "\$1" > "\$1.new"
+mv "\$1.new" "\$1"
 $ chmod +x .git/hooks/commit-msg
 ------------
 
index 1abdd3c21c513c3c9f547e25c83d212ba1866b2b..1bc0328bb789283461bc1b7143830a6d88e06eb0 100644 (file)
@@ -270,8 +270,14 @@ interpolated.  The following "fieldname" are understood:
 
 objectmode::
        The mode of the file which is recorded in the index.
+objecttype::
+       The object type of the file which is recorded in the index.
 objectname::
        The name of the file which is recorded in the index.
+objectsize[:padded]::
+       The object size of the file which is recorded in the index
+       ("-" if the object is a `commit` or `tree`).
+       It also supports a padded format of size with "%(objectsize:padded)".
 stage::
        The stage of the file which is recorded in the index.
 eolinfo:index::
index ff3da547ddb98a5493b5752a4b2b84bed7f799c5..1c4f696ab57e2a241bee0ebab07d0bb199e77b3e 100644 (file)
@@ -96,27 +96,51 @@ OPTIONS
        separator (so `bar` matches `refs/heads/bar` but not
        `refs/heads/foobar`).
 
+OUTPUT
+------
+
+The output is in the format:
+
+------------
+<oid> TAB <ref> LF
+------------
+
+When showing an annotated tag, unless `--refs` is given, two such
+lines are shown: one with the refname for the tag itself as `<ref>`,
+and another with `<ref>` followed by `^{}`. The `<oid>` on the latter
+line shows the name of the object the tag points at.
+
 EXAMPLES
 --------
 
+* List all references (including symbolics and pseudorefs), peeling
+  tags:
++
+----
+$ git ls-remote
+27d43aaaf50ef0ae014b88bba294f93658016a2e       HEAD
+950264636c68591989456e3ba0a5442f93152c1a       refs/heads/main
+d9ab777d41f92a8c1684c91cfb02053d7dd1046b       refs/heads/next
+d4ca2e3147b409459955613c152220f4db848ee1       refs/tags/v2.40.0
+73876f4861cd3d187a4682290ab75c9dccadbc56       refs/tags/v2.40.0^{}
 ----
-$ git ls-remote --tags .
-d6602ec5194c87b0fc87103ca4d67251c76f233a       refs/tags/v0.99
-f25a265a342aed6041ab0cc484224d9ca54b6f41       refs/tags/v0.99.1
-7ceca275d047c90c0c7d5afb13ab97efdf51bd6e       refs/tags/v0.99.3
-c5db5456ae3b0873fc659c19fafdde22313cc441       refs/tags/v0.99.2
-0918385dbd9656cab0d1d81ba7453d49bbc16250       refs/tags/junio-gpg-pub
 
+* List all references matching given patterns:
++
+----
 $ git ls-remote http://www.kernel.org/pub/scm/git/git.git master seen rc
 5fe978a5381f1fbad26a80e682ddd2a401966740       refs/heads/master
 c781a84b5204fb294c9ccc79f8b3baceeb32c061       refs/heads/seen
+----
 
-$ git remote add korg http://www.kernel.org/pub/scm/git/git.git
-$ git ls-remote --tags korg v\*
-d6602ec5194c87b0fc87103ca4d67251c76f233a       refs/tags/v0.99
-f25a265a342aed6041ab0cc484224d9ca54b6f41       refs/tags/v0.99.1
-c5db5456ae3b0873fc659c19fafdde22313cc441       refs/tags/v0.99.2
-7ceca275d047c90c0c7d5afb13ab97efdf51bd6e       refs/tags/v0.99.3
+* List only tags matching a given wildcard pattern:
++
+----
+$ git ls-remote --tags http://www.kernel.org/pub/scm/git/git.git v\*
+485a869c64a68cc5795dd99689797c5900f4716d       refs/tags/v2.39.2
+cbf04937d5b9fcf0a76c28f69e6294e9e3ecd7e6       refs/tags/v2.39.2^{}
+d4ca2e3147b409459955613c152220f4db848ee1       refs/tags/v2.40.0
+73876f4861cd3d187a4682290ab75c9dccadbc56       refs/tags/v2.40.0^{}
 ----
 
 SEE ALSO
index 0240adb8eec96600572be6f3f8b988a5aa2eab45..6572095d8d69dca5ff044282b7e299060d83b7f4 100644 (file)
@@ -86,9 +86,9 @@ OPTIONS
 --format=<format>::
        A string that interpolates `%(fieldname)` from the result
        being shown. It also interpolates `%%` to `%`, and
-       `%xx` where `xx` are hex digits interpolates to character
-       with hex code `xx`; for example `%00` interpolates to
-       `\0` (NUL), `%09` to `\t` (TAB) and `%0a` to `\n` (LF).
+       `%xNN` where `NN` are hex digits interpolates to character
+       with hex code `NN`; for example `%x00` interpolates to
+       `\0` (NUL), `%x09` to `\t` (TAB) and `%x0a` to `\n` (LF).
        When specified, `--format` cannot be combined with other
        format-altering options, including `--long`, `--name-only`
        and `--object-only`.
@@ -145,7 +145,7 @@ FIELD NAMES
 -----------
 
 Various values from structured fields can be used to interpolate
-into the resulting output. For each outputing line, the following
+into the resulting output. For each outputting line, the following
 names can be used:
 
 objectmode::
index 0aeff572a59d8fea319f334232deae4a9df4e464..8625c5cb0ec2d31ac264789d80a80b6c5a0c38b9 100644 (file)
@@ -194,9 +194,13 @@ happens:
    versions: stage 1 stores the version from the common ancestor,
    stage 2 from `HEAD`, and stage 3 from `MERGE_HEAD` (you
    can inspect the stages with `git ls-files -u`).  The working
-   tree files contain the result of the "merge" program; i.e. 3-way
+   tree files contain the result of the merge operation; i.e. 3-way
    merge results with familiar conflict markers `<<<` `===` `>>>`.
-5. No other changes are made.  In particular, the local
+5. A special ref `AUTO_MERGE` is written, pointing to a tree
+   corresponding to the current content of the working tree (including
+   conflict markers for textual conflicts).  Note that this ref is only
+   written when the 'ort' merge strategy is used (the default).
+6. No other changes are made.  In particular, the local
    modifications you had before you started merge will stay the
    same and the index entries for them stay as they were,
    i.e. matching `HEAD`.
@@ -336,7 +340,8 @@ You can work through the conflict with a number of tools:
 
  * Look at the diffs.  `git diff` will show a three-way diff,
    highlighting changes from both the `HEAD` and `MERGE_HEAD`
-   versions.
+   versions. `git diff AUTO_MERGE` will show what changes you've
+   made so far to resolve textual conflicts.
 
  * Look at the diffs from each branch. `git log --merge -p <path>`
    will show diffs first for the `HEAD` version and then the
index 466a69751910e4d7d031725f8d52d41d1e7f98a3..b2a2e80d42143a928380bf93e98ac6203442fcc8 100644 (file)
@@ -33,7 +33,7 @@ from warnings to errors (so e.g. a missing "tagger" line is an error).
 
 Extra headers in the object are also an error under mktag, but ignored
 by linkgit:git-fsck[1]. This extra check can be turned off by setting
-the appropriate `fsck.<msg-id>` varible:
+the appropriate `fsck.<msg-id>` variable:
 
     git -c fsck.extraHeaderEntry=ignore mktag <my-tag-with-headers
 
index ec8a27ce8bf8d689bb5f64554dd5426ce38262c0..5c56c870253505395ce3a68216b5b9d329fb02e0 100644 (file)
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git name-rev' [--tags] [--refs=<pattern>]
-              ( --all | --stdin | <commit-ish>... )
+              ( --all | --annotate-stdin | <commit-ish>... )
 
 DESCRIPTION
 -----------
@@ -46,7 +46,8 @@ OPTIONS
        Transform stdin by substituting all the 40-character SHA-1
        hexes (say $hex) with "$hex ($rev_name)".  When used with
        --name-only, substitute with "$rev_name", omitting $hex
-       altogether.
+       altogether. This option was called `--stdin` in older versions
+       of Git.
 +
 For example:
 +
@@ -70,10 +71,6 @@ The full name after substitution is master,
 while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
 -----------
 
---stdin::
-       This option is deprecated in favor of 'git name-rev --annotate-stdin'.
-       They are functionally equivalent.
-
 --name-only::
        Instead of printing both the SHA-1 and the name, print only
        the name.  If given with --tags the usual tag prefix of
@@ -107,7 +104,7 @@ Now you are wiser, because you know that it happened 940 revisions before v0.99.
 Another nice thing you can do is:
 
 ------------
-% git log | git name-rev --stdin
+% git log | git name-rev --annotate-stdin
 ------------
 
 GIT
index 154081f2de269975a09c1f5899dc7d5948c54ca7..284956acb3c5e8bb168626c9729a17a799c0afd7 100644 (file)
@@ -8,7 +8,7 @@ git-pack-refs - Pack heads and tags for efficient repository access
 SYNOPSIS
 --------
 [verse]
-'git pack-refs' [--all] [--no-prune]
+'git pack-refs' [--all] [--no-prune] [--include <pattern>] [--exclude <pattern>]
 
 DESCRIPTION
 -----------
@@ -51,14 +51,37 @@ The command by default packs all tags and refs that are already
 packed, and leaves other refs
 alone.  This is because branches are expected to be actively
 developed and packing their tips does not help performance.
-This option causes branch tips to be packed as well.  Useful for
-a repository with many branches of historical interests.
+This option causes all refs to be packed as well, with the exception
+of hidden refs, broken refs, and symbolic refs. Useful for a repository
+with many branches of historical interests.
 
 --no-prune::
 
 The command usually removes loose refs under `$GIT_DIR/refs`
 hierarchy after packing them.  This option tells it not to.
 
+--include <pattern>::
+
+Pack refs based on a `glob(7)` pattern. Repetitions of this option
+accumulate inclusion patterns. If a ref is both included in `--include` and
+`--exclude`, `--exclude` takes precedence. Using `--include` will preclude all
+tags from being included by default. Symbolic refs and broken refs will never
+be packed. When used with `--all`, it will be a noop. Use `--no-include` to clear
+and reset the list of patterns.
+
+--exclude <pattern>::
+
+Do not pack refs matching the given `glob(7)` pattern. Repetitions of this option
+accumulate exclusion patterns. Use `--no-exclude` to clear and reset the list of
+patterns. If a ref is already packed, including it with `--exclude` will not
+unpack it.
+
+When used with `--all`, pack only loose refs which do not match any of
+the provided `--exclude` patterns.
+
+When used with `--include`, refs provided to `--include`, minus refs that are
+provided to `--exclude` will be packed.
+
 
 BUGS
 ----
index 5bb1d5aae257fa0d6cf480efcb25cfa5cc2a4b10..297927d866789c16fdb7f50bf05e735e376166bc 100644 (file)
@@ -9,7 +9,7 @@ git-push - Update remote refs along with associated objects
 SYNOPSIS
 --------
 [verse]
-'git push' [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
+'git push' [--all | --branches | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
           [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
           [-u | --set-upstream] [-o <string> | --push-option=<string>]
           [--[no-]signed|--signed=(true|false|if-asked)]
@@ -147,6 +147,7 @@ already exists on the remote side.
 `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
 
 --all::
+--branches::
        Push all branches (i.e. refs under `refs/heads/`); cannot be
        used with other <refspec>.
 
index b0f438ec990b7e3ac2d37730273ec2fab8088553..492a82323dab8e144e96897a78e1daf22c76be6e 100644 (file)
@@ -320,6 +320,17 @@ Automating
        Output of this command must be single email address per line.
        Default is the value of `sendemail.ccCmd` configuration value.
 
+--header-cmd=<command>::
+       Specify a command that is executed once per outgoing message
+       and output RFC 2822 style header lines to be inserted into
+       them. When the `sendemail.headerCmd` configuration variable is
+       set, its value is always used. When --header-cmd is provided
+       at the command line, its value takes precedence over the
+       `sendemail.headerCmd` configuration variable.
+
+--no-header-cmd::
+       Disable any header command in use.
+
 --[no-]chain-reply-to::
        If this is set, each email will be sent as a reply to the previous
        email sent.  If disabled with "--no-chain-reply-to", all emails after
@@ -484,14 +495,10 @@ edit ~/.gitconfig to specify your account settings:
        smtpServerPort = 587
 ----
 
-If you have multi-factor authentication set up on your Gmail account, you will
-need to generate an app-specific password for use with 'git send-email'. Visit
+If you have multi-factor authentication set up on your Gmail account, you can
+generate an app-specific password for use with 'git send-email'. Visit
 https://security.google.com/settings/security/apppasswords to create it.
 
-If you do not have multi-factor authentication set up on your Gmail account,
-you will need to allow less secure app access. Visit
-https://myaccount.google.com/lesssecureapps to enable it.
-
 Once your commits are ready to be sent to the mailing list, run the
 following commands:
 
index 71f608b1ff1e1de10708212bcd815b744f9284bf..58cf6210cde2d3d1889d9fc9ac1b49bafaaa09e2 100644 (file)
@@ -74,8 +74,7 @@ OPTIONS
        that is the common ancestor of all the branches.  This
        flag tells the command to go <n> more common commits
        beyond that.  When <n> is negative, display only the
-       <reference>s given, without showing the commit ancestry
-       tree.
+       <ref>s given, without showing the commit ancestry tree.
 
 --list::
        Synonym to `--more=-1`
@@ -88,8 +87,8 @@ OPTIONS
        the case of three or more commits.
 
 --independent::
-       Among the <reference>s given, display only the ones that
-       cannot be reached from any other <reference>.
+       Among the <ref>s given, display only the ones that cannot be
+       reached from any other <ref>.
 
 --no-name::
        Do not show naming strings for each commit.
@@ -132,10 +131,11 @@ are mutually exclusive.
 
 OUTPUT
 ------
-Given N <references>, the first N lines are the one-line
-description from their commit message.  The branch head that is
-pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
-character while other heads are prefixed with a `!` character.
+
+Given N <ref>s, the first N lines are the one-line description from
+their commit message. The branch head that is pointed at by
+$GIT_DIR/HEAD is prefixed with an asterisk `*` character while other
+heads are prefixed with a `!` character.
 
 Following these N lines, one-line log for each commit is
 displayed, indented N places.  If a commit is on the I-th
index d1d56f68b4376279534d61ec44db10e9e6efd297..44c7387d78f0845f4732665d8dad88e74a6d7c9b 100644 (file)
@@ -23,7 +23,7 @@ particular ref exists.
 
 By default, shows the tags, heads, and remote refs.
 
-The --exclude-existing form is a filter that does the inverse. It reads
+The `--exclude-existing` form is a filter that does the inverse. It reads
 refs from stdin, one ref per line, and shows those that don't exist in
 the local repository.
 
@@ -47,14 +47,14 @@ OPTIONS
 -d::
 --dereference::
 
-       Dereference tags into object IDs as well. They will be shown with "{caret}{}"
+       Dereference tags into object IDs as well. They will be shown with `{caret}{}`
        appended.
 
 -s::
 --hash[=<n>]::
 
-       Only show the SHA-1 hash, not the reference name. When combined with
-       --dereference the dereferenced tag will still be shown after the SHA-1.
+       Only show the OID, not the reference name. When combined with
+       `--dereference`, the dereferenced tag will still be shown after the OID.
 
 --verify::
 
@@ -70,15 +70,15 @@ OPTIONS
 -q::
 --quiet::
 
-       Do not print any results to stdout. When combined with `--verify` this
+       Do not print any results to stdout. When combined with `--verify`, this
        can be used to silently check if a reference exists.
 
 --exclude-existing[=<pattern>]::
 
-       Make 'git show-ref' act as a filter that reads refs from stdin of the
-       form "`^(?:<anything>\s)?<refname>(?:\^{})?$`"
+       Make `git show-ref` act as a filter that reads refs from stdin of the
+       form `^(?:<anything>\s)?<refname>(?:\^{})?$`
        and performs the following actions on each:
-       (1) strip "{caret}{}" at the end of line if any;
+       (1) strip `{caret}{}` at the end of line if any;
        (2) ignore if pattern is provided and does not head-match refname;
        (3) warn if refname is not a well-formed refname and skip;
        (4) ignore if refname is a ref that exists in the local repository;
@@ -96,7 +96,13 @@ OPTIONS
 OUTPUT
 ------
 
-The output is in the format: '<SHA-1 ID>' '<space>' '<reference name>'.
+The output is in the format:
+
+------------
+<oid> SP <ref> LF
+------------
+
+For example,
 
 -----------------------------------------------------------------------------
 $ git show-ref --head --dereference
@@ -110,7 +116,13 @@ $ git show-ref --head --dereference
 ...
 -----------------------------------------------------------------------------
 
-When using --hash (and not --dereference) the output format is: '<SHA-1 ID>'
+When using `--hash` (and not `--dereference`), the output is in the format:
+
+------------
+<oid> LF
+------------
+
+For example,
 
 -----------------------------------------------------------------------------
 $ git show-ref --heads --hash
@@ -142,10 +154,10 @@ When using the `--verify` flag, the command requires an exact path:
 
 will only match the exact branch called "master".
 
-If nothing matches, 'git show-ref' will return an error code of 1,
+If nothing matches, `git show-ref` will return an error code of 1,
 and in the case of verification, it will show an error message.
 
-For scripting, you can ask it to be quiet with the "--quiet" flag, which
+For scripting, you can ask it to be quiet with the `--quiet` flag, which
 allows you to do things like
 
 -----------------------------------------------------------------------------
@@ -157,11 +169,11 @@ to check whether a particular branch exists or not (notice how we don't
 actually want to show any results, and we want to use the full refname for it
 in order to not trigger the problem with ambiguous partial matches).
 
-To show only tags, or only proper branch heads, use "--tags" and/or "--heads"
+To show only tags, or only proper branch heads, use `--tags` and/or `--heads`
 respectively (using both means that it shows tags and heads, but not other
 random references under the refs/ subdirectory).
 
-To do automatic tag object dereferencing, use the "-d" or "--dereference"
+To do automatic tag object dereferencing, use the `-d` or `--dereference`
 flag, so you can do
 
 -----------------------------------------------------------------------------
index 53dc17aa77a2904ecdf977db132bf71506c2fda5..529a8edd9c1ed88c8b0ab9c39ab95dccd97671b3 100644 (file)
@@ -286,7 +286,7 @@ patterns in non-cone mode has a number of shortcomings:
     problem above?  Also, if it suggests paths, what if the user has a
     file or directory that begins with either a '!' or '#' or has a '*',
     '\', '?', '[', or ']' in its name?  And if it suggests paths, will
-    it complete "/pro" to "/proc" (in the root filesytem) rather than to
+    it complete "/pro" to "/proc" (in the root filesystem) rather than to
     "/progress.txt" in the current directory?  (Note that users are
     likely to want to start paths with a leading '/' in non-cone mode,
     for the same reason that .gitignore files often have one.)
index f4bb6114d91f87f803003a6c7d0ac5e59978855d..06fb7f1d18c6bec047b9cbdb2487f72614fa6073 100644 (file)
@@ -366,7 +366,7 @@ only the commit ends-up being in the stash and not on the current branch.
 # ... hack hack hack ...
 $ git add --patch foo           # add unrelated changes to the index
 $ git stash push --staged       # save these changes to the stash
-# ... hack hack hack, finish curent changes ...
+# ... hack hack hack, finish current changes ...
 $ git commit -m 'Massive'       # commit fully tested changes
 $ git switch fixup-branch       # switch to another branch
 $ git stash pop                 # to finish work on the saved changes
index 4d3ab6b9f925cde1ef8835d790fa1fd66108a36d..695730609aa3ab5a18d45cbff6aba5d1499dfdce 100644 (file)
@@ -95,7 +95,7 @@ too (and can also report changes to a submodule's work tree).
 init [--] [<path>...]::
        Initialize the submodules recorded in the index (which were
        added and committed elsewhere) by setting `submodule.$name.url`
-       in .git/config. It uses the same setting from `.gitmodules` as
+       in `.git/config`, using the same setting from `.gitmodules` as
        a template. If the URL is relative, it will be resolved using
        the default remote. If there is no default remote, the current
        repository will be assumed to be upstream.
@@ -105,9 +105,12 @@ If no path is specified and submodule.active has been configured, submodules
 configured to be active will be initialized, otherwise all submodules are
 initialized.
 +
-When present, it will also copy the value of `submodule.$name.update`.
-This command does not alter existing information in .git/config.
-You can then customize the submodule clone URLs in .git/config
+It will also copy the value of `submodule.$name.update`, if present in
+the `.gitmodules` file, to `.git/config`, but (1) this command does not
+alter existing information in `.git/config`, and (2) `submodule.$name.update`
+that is set to a custom command is *not* copied for security reasons.
++
+You can then customize the submodule clone URLs in `.git/config`
 for your local setup and proceed to `git submodule update`;
 you can also just use `git submodule update --init` without
 the explicit 'init' step if you do not intend to customize
@@ -143,6 +146,8 @@ the submodules. The "updating" can be done in several ways depending
 on command line options and the value of `submodule.<name>.update`
 configuration variable. The command line option takes precedence over
 the configuration variable. If neither is given, a 'checkout' is performed.
+(note: what is in `.gitmodules` file is irrelevant at this point;
+see `git submodule init` above for how `.gitmodules` is used).
 The 'update' procedures supported both from the command line as well as
 through the `submodule.<name>.update` configuration are:
 
@@ -160,16 +165,18 @@ checked out in the submodule.
        merge;; the commit recorded in the superproject will be merged
            into the current branch in the submodule.
 
-The following 'update' procedures are only available via the
-`submodule.<name>.update` configuration variable:
+The following update procedures have additional limitations:
 
-       custom command;; arbitrary shell command that takes a single
-           argument (the sha1 of the commit recorded in the
-           superproject) is executed. When `submodule.<name>.update`
-           is set to '!command', the remainder after the exclamation mark
-           is the custom command.
+       custom command;; mechanism for running arbitrary commands with the
+           commit ID as an argument. Specifically, if the
+           `submodule.<name>.update` configuration variable is set to
+           `!custom command`, the object name of the commit recorded in the
+           superproject for the submodule is appended to the `custom command`
+           string and executed. Note that this mechanism is not supported in
+           the `.gitmodules` file or on the command line.
 
-       none;; the submodule is not updated.
+       none;; the submodule is not updated. This update procedure is not
+           allowed on the command line.
 
 If the submodule is not yet initialized, and you just want to use the
 setting as stored in `.gitmodules`, you can automatically initialize the
index 7f61c1edb3e65a3ed06ed0090b66ac855851b554..d42efb3112787f943559723b9b19915df8181d5e 100644 (file)
@@ -381,6 +381,16 @@ $ GIT_COMMITTER_DATE="2006-10-02 10:31" git tag -s v1.0.1
 
 include::date-formats.txt[]
 
+FILES
+-----
+
+`$GIT_DIR/TAG_EDITMSG`::
+       This file contains the message of an in-progress annotated
+       tag. If `git tag` exits due to an error before creating an
+       annotated tag then the tag message that has been provided by the
+       user in an editor session will be available in this file, but
+       may be overwritten by the next invocation of `git tag`.
+
 NOTES
 -----
 
index f40202b8e3ab521ea22c78986d3bf5bb44a67f09..c38fb3968bcabc6215f535ec569e3f5e258aee62 100644 (file)
@@ -71,6 +71,29 @@ endif::git-default-pager[]
 GIT_DEFAULT_BRANCH::
     The name of the first branch created in newly initialized repositories.
 
+GIT_SHELL_PATH::
+    The path of the binary providing the POSIX shell for commands which use the shell.
+
+GIT_ATTR_SYSTEM::
+    The path to the system linkgit:gitattributes[5] file, if one is enabled.
+
+GIT_ATTR_GLOBAL::
+    The path to the global (per-user) linkgit:gitattributes[5] file.
+
+GIT_CONFIG_SYSTEM::
+    The path to the system configuration file, if one is enabled.
+
+GIT_CONFIG_GLOBAL::
+    The path to the global (per-user) configuration files, if any.
+
+Most path values contain only one value. However, some can contain multiple
+values, which are separated by newlines, and are listed in order from highest to
+lowest priority.  Callers should be prepared for any such path value to contain
+multiple items.
+
+Note that paths are printed even if they do not exist, but not if they are
+disabled by other environment variables.
+
 SEE ALSO
 --------
 linkgit:git-commit-tree[1]
index 063d6eeb99dd34c4b08f3c3dde9340146ce48756..a4fbf5e8386d7d4ae58230b17b534a90461ff421 100644 (file)
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]]
-                  [-b <new-branch>] <path> [<commit-ish>]
+                  [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]
 'git worktree list' [-v | --porcelain [-z]]
 'git worktree lock' [--reason <string>] <worktree>
 'git worktree move' <worktree> <new-path>
@@ -95,6 +95,16 @@ exist, a new branch based on `HEAD` is automatically created as if
 `-b <branch>` was given.  If `<branch>` does exist, it will be checked out
 in the new worktree, if it's not checked out anywhere else, otherwise the
 command will refuse to create the worktree (unless `--force` is used).
++
+If `<commit-ish>` is omitted, neither `--detach`, or `--orphan` is
+used, and there are no valid local branches (or remote branches if
+`--guess-remote` is specified) then, as a convenience, the new worktree is
+associated with a new orphan branch named `<branch>` (after
+`$(basename <path>)` if neither `-b` or `-B` is used) as if `--orphan` was
+passed to the command. In the event the repository has a remote and
+`--guess-remote` is used, but no remote or local branches exist, then the
+command fails with a warning reminding the user to fetch from their remote
+first (or override by using `-f/--force`).
 
 list::
 
@@ -222,6 +232,10 @@ This can also be set up as the default behaviour by using the
        With `prune`, do not remove anything; just report what it would
        remove.
 
+--orphan::
+       With `add`, make the new worktree and index empty, associating
+       the worktree with a new orphan/unborn branch named `<new-branch>`.
+
 --porcelain::
        With `list`, output in an easy-to-parse format for scripts.
        This format will remain stable across Git versions and regardless of user
index 74973d3cc4044d807ee2f98b0013f6811ae4f65b..11228956cd5ec400b498d7483b8a4f71ec433ab2 100644 (file)
@@ -212,6 +212,11 @@ If you just want to run git as if it was started in `<path>` then use
        nohelpers (exclude helper commands), alias and config
        (retrieve command list from config variable completion.commands)
 
+--attr-source=<tree-ish>::
+       Read gitattributes from <tree-ish> instead of the worktree. See
+       linkgit:gitattributes[5]. This is equivalent to setting the
+       `GIT_ATTR_SOURCE` environment variable.
+
 GIT COMMANDS
 ------------
 
@@ -546,10 +551,10 @@ double-quotes and respecting backslash escapes. E.g., the value
 
 `GIT_DEFAULT_HASH`::
        If this variable is set, the default hash algorithm for new
-       repositories will be set to this value. This value is currently
-       ignored when cloning; the setting of the remote repository
-       is used instead. The default is "sha1". THIS VARIABLE IS
-       EXPERIMENTAL! See `--object-format` in linkgit:git-init[1].
+       repositories will be set to this value. This value is
+       ignored when cloning and the setting of the remote repository
+       is always used. The default is "sha1".
+       See `--object-format` in linkgit:git-init[1].
 
 Git Commits
 ~~~~~~~~~~~
@@ -686,6 +691,9 @@ for further details.
        tells Git not to verify the SSL certificate when fetching or
        pushing over HTTPS.
 
+`GIT_ATTR_SOURCE`::
+       Sets the treeish that gitattributes will be read from.
+
 `GIT_ASKPASS`::
        If this environment variable is set, then Git commands which need to
        acquire passwords or passphrases (e.g. for HTTP or IMAP authentication)
index 39bfbca1ffe565f52b9536beaf040539ab7c0bbc..6deb89a2967708dfc2c560ac72c29907a5b6334a 100644 (file)
@@ -120,20 +120,19 @@ repository upon 'git add' and 'git commit'.
 `text`
 ^^^^^^
 
-This attribute enables and controls end-of-line normalization.  When a
-text file is normalized, its line endings are converted to LF in the
-repository.  To control what line ending style is used in the working
-directory, use the `eol` attribute for a single file and the
-`core.eol` configuration variable for all text files.
-Note that setting `core.autocrlf` to `true` or `input` overrides
-`core.eol` (see the definitions of those options in
-linkgit:git-config[1]).
+This attribute marks the path as a text file, which enables end-of-line
+conversion: When a matching file is added to the index, the file's line
+endings are normalized to LF in the index.  Conversely, when the file is
+copied from the index to the working directory, its line endings may be
+converted from LF to CRLF depending on the `eol` attribute, the Git
+config, and the platform (see explanation of `eol` below).
 
 Set::
 
        Setting the `text` attribute on a path enables end-of-line
-       normalization and marks the path as a text file.  End-of-line
-       conversion takes place without guessing the content type.
+       conversion on checkin and checkout as described above.  Line endings
+       are normalized to LF in the index every time the file is checked in,
+       even if the file was previously added to Git with CRLF line endings.
 
 Unset::
 
@@ -142,10 +141,11 @@ Unset::
 
 Set to string value "auto"::
 
-       When `text` is set to "auto", the path is marked for automatic
-       end-of-line conversion.  If Git decides that the content is
-       text, its line endings are converted to LF on checkin.
-       When the file has been committed with CRLF, no conversion is done.
+       When `text` is set to "auto", Git decides by itself whether the file
+       is text or binary.  If it is text and the file was not already in
+       Git with CRLF endings, line endings are converted on checkin and
+       checkout as described above.  Otherwise, no conversion is done on
+       checkin or checkout.
 
 Unspecified::
 
@@ -159,26 +159,29 @@ unspecified.
 `eol`
 ^^^^^
 
-This attribute sets a specific line-ending style to be used in the
-working directory.  This attribute has effect only if the `text`
-attribute is set or unspecified, or if it is set to `auto`, the file is
-detected as text, and it is stored with LF endings in the index.  Note
-that setting this attribute on paths which are in the index with CRLF
-line endings may make the paths to be considered dirty unless
-`text=auto` is set. Adding the path to the index again will normalize
-the line endings in the index.
+This attribute marks a path to use a specific line-ending style in the
+working tree when it is checked out.  It has effect only if `text` or
+`text=auto` is set (see above), but specifying `eol` automatically sets
+`text` if `text` was left unspecified.
 
 Set to string value "crlf"::
 
-       This setting forces Git to normalize line endings for this
-       file on checkin and convert them to CRLF when the file is
-       checked out.
+       This setting converts the file's line endings in the working
+       directory to CRLF when the file is checked out.
 
 Set to string value "lf"::
 
-       This setting forces Git to normalize line endings to LF on
-       checkin and prevents conversion to CRLF when the file is
-       checked out.
+       This setting uses the same line endings in the working directory as
+       in the index when the file is checked out.
+
+Unspecified::
+
+       If the `eol` attribute is unspecified for a file, its line endings
+       in the working directory are determined by the `core.autocrlf` or
+       `core.eol` configuration variable (see the definitions of those
+       options in linkgit:git-config[1]).  If `text` is set but neither of
+       those variables is, the default is `eol=crlf` on Windows and
+       `eol=lf` on all other platforms.
 
 Backwards compatibility with `crlf` attribute
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1129,7 +1132,10 @@ size (see below).
 The merge driver is expected to leave the result of the merge in
 the file named with `%A` by overwriting it, and exit with zero
 status if it managed to merge them cleanly, or non-zero if there
-were conflicts.
+were conflicts.  When the driver crashes (e.g. killed by SEGV),
+it is expected to exit with non-zero status that are higher than
+128, and in such a case, the merge results in a failure (which is
+different from producing a conflict).
 
 The `merge.*.recursive` variable specifies what other merge
 driver to use when the merge driver is called for an internal
index 100f045bb1a0918e51cc3834a015913f9286dbbb..71dd19731af0dfb187ac55b15826e6b4b3e887b6 100644 (file)
@@ -104,6 +104,17 @@ $ git help credential-foo
 $ git config --global credential.helper foo
 -------------------------------------------
 
+=== Available helpers
+
+The community maintains a comprehensive list of Git credential helpers at
+https://git-scm.com/doc/credential-helpers.
+
+=== OAuth
+
+An alternative to inputting passwords or personal access tokens is to use an
+OAuth credential helper. Initial authentication opens a browser window to the
+host. Subsequent authentication happens in the background. Many popular Git
+hosts support OAuth.
 
 CREDENTIAL CONTEXTS
 -------------------
@@ -260,7 +271,7 @@ appended to its command line, which is one of:
 
 `erase`::
 
-       Remove a matching credential, if any, from the helper's storage.
+       Remove matching credentials, if any, from the helper's storage.
 
 The details of the credential will be provided on the helper's stdin
 stream. The exact format is the same as the input/output format of the
index e06af02f211e7a7a8488d1470d7f76dd58e5989c..0c1be2dbe85caf3300a314c374dd12d54b7434a7 100644 (file)
@@ -611,8 +611,8 @@ result of repeatedly resetting the objects' mtimes to the present time.
 
 If you are GC-ing repositories in a mixed version environment, consider omitting
 the `--cruft` option when using linkgit:git-repack[1] and linkgit:git-gc[1], and
-leaving the `gc.cruftPacks` configuration unset until all writers understand
-cruft packs.
+setting the `gc.cruftPacks` configuration to "false" until all writers
+understand cruft packs.
 
 === Alternatives
 
index 62908602e7bee3ff4bd6c0aaeca39f5ac3bc7741..86f804720ae71fc3d0db94623663539bd05a06f2 100644 (file)
@@ -595,10 +595,51 @@ processed by rebase.
 sendemail-validate
 ~~~~~~~~~~~~~~~~~~
 
-This hook is invoked by linkgit:git-send-email[1].  It takes a single parameter,
-the name of the file that holds the e-mail to be sent.  Exiting with a
-non-zero status causes `git send-email` to abort before sending any
-e-mails.
+This hook is invoked by linkgit:git-send-email[1].
+
+It takes these command line arguments. They are,
+1. the name of the file which holds the contents of the email to be sent.
+2. The name of the file which holds the SMTP headers of the email.
+
+The SMTP headers are passed in the exact same way as they are passed to the
+user's Mail Transport Agent (MTA). In effect, the email given to the user's
+MTA, is the contents of $2 followed by the contents of $1.
+
+An example of a few common headers is shown below. Take notice of the
+capitalization and multi-line tab structure.
+
+  From: Example <from@example.com>
+  To: to@example.com
+  Cc: cc@example.com,
+         A <author@example.com>,
+         One <one@example.com>,
+         two@example.com
+  Subject: PATCH-STRING
+
+Exiting with a non-zero status causes `git send-email` to abort
+before sending any e-mails.
+
+The following environment variables are set when executing the hook.
+
+`GIT_SENDEMAIL_FILE_COUNTER`::
+       A 1-based counter incremented by one for every file holding an e-mail
+       to be sent (excluding any FIFOs). This counter does not follow the
+       patch series counter scheme. It will always start at 1 and will end at
+       GIT_SENDEMAIL_FILE_TOTAL.
+
+`GIT_SENDEMAIL_FILE_TOTAL`::
+       The total number of files that will be sent (excluding any FIFOs). This
+       counter does not follow the patch series counter scheme. It will always
+       be equal to the number of files being sent, whether there is a cover
+       letter or not.
+
+These variables may for instance be used to validate patch series.
+
+The sample `sendemail-validate` hook that comes with Git checks that all sent
+patches (excluding the cover letter) can be applied on top of the upstream
+repository default branch without conflicts. Some placeholders are left for
+additional validation steps to be performed after all patches of a given series
+have been applied.
 
 fsmonitor-watchman
 ~~~~~~~~~~~~~~~~~~
index f2738b10db6b2be5e7babb74fbe013faecd425d1..5e0964ef4191d95acc0965b82fdfa1de295a6bc3 100644 (file)
@@ -88,7 +88,7 @@ PATTERN FORMAT
    Put a backslash ("`\`") in front of the first "`!`" for patterns
    that begin with a literal "`!`", for example, "`\!important!.txt`".
 
- - The slash '/' is used as the directory separator. Separators may
+ - The slash "`/`" is used as the directory separator. Separators may
    occur at the beginning, middle or end of the `.gitignore` search pattern.
 
  - If there is a separator at the beginning or middle (or both) of the
@@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files
 not tracked by Git remain untracked.
 
 To stop tracking a file that is currently tracked, use
-'git rm --cached'.
+'git rm --cached' to remove the file from the index. The filename
+can then be added to the `.gitignore` file to stop the file from
+being reintroduced in later commits.
 
 Git does not follow symbolic links when accessing a `.gitignore` file in
 the working tree. This keeps behavior consistent when the file is
@@ -172,10 +174,10 @@ EXAMPLES
    is not relevant  if there is already a middle slash in
    the pattern.
 
- - The pattern "foo/*", matches "foo/test.json"
-   (a regular file), "foo/bar" (a directory), but it does not match
-   "foo/bar/hello.c" (a regular file), as the asterisk in the
-   pattern does not match "bar/hello.c" which has a slash in it.
+ - The pattern `foo/*`, matches `foo/test.json`
+   (a regular file), `foo/bar` (a directory), but it does not match
+   `foo/bar/hello.c` (a regular file), as the asterisk in the
+   pattern does not match `bar/hello.c` which has a slash in it.
 
 --------------------------------------------------------------
     $ git status
index dcee09b5001dc8cfb95753c0c02a5b49ba036752..d9bec8b1875502b22934877311d3124a3e5a22df 100644 (file)
@@ -43,9 +43,9 @@ submodule.<name>.update::
        command in the superproject. This is only used by `git
        submodule init` to initialize the configuration variable of
        the same name. Allowed values here are 'checkout', 'rebase',
-       'merge' or 'none'. See description of 'update' command in
-       linkgit:git-submodule[1] for their meaning. For security
-       reasons, the '!command' form is not accepted here.
+       'merge' or 'none', but not '!command' (for security reasons).
+       See the description of the 'update' command in
+       linkgit:git-submodule[1] for more details.
 
 submodule.<name>.branch::
        A remote branch name for tracking updates in the upstream submodule.
index 0e0b863105b104b706d3cc75b4d3998a4abe580f..c7cadd8aaf1a0e6606d2b559b674526bc687849a 100644 (file)
@@ -49,7 +49,7 @@ $ git config --global user.email you@yourdomain.example.com
 Importing a new project
 -----------------------
 
-Assume you have a tarball project.tar.gz with your initial work.  You
+Assume you have a tarball `project.tar.gz` with your initial work.  You
 can place it under Git revision control as follows.
 
 ------------------------------------------------
@@ -65,10 +65,10 @@ Initialized empty Git repository in .git/
 ------------------------------------------------
 
 You've now initialized the working directory--you may notice a new
-directory created, named ".git".
+directory created, named `.git`.
 
 Next, tell Git to take a snapshot of the contents of all files under the
-current directory (note the '.'), with 'git add':
+current directory (note the `.`), with `git add`:
 
 ------------------------------------------------
 $ git add .
@@ -76,7 +76,7 @@ $ git add .
 
 This snapshot is now stored in a temporary staging area which Git calls
 the "index".  You can permanently store the contents of the index in the
-repository with 'git commit':
+repository with `git commit`:
 
 ------------------------------------------------
 $ git commit
@@ -95,21 +95,20 @@ $ git add file1 file2 file3
 ------------------------------------------------
 
 You are now ready to commit.  You can see what is about to be committed
-using 'git diff' with the --cached option:
+using `git diff` with the `--cached` option:
 
 ------------------------------------------------
 $ git diff --cached
 ------------------------------------------------
 
-(Without --cached, 'git diff' will show you any changes that
+(Without `--cached`, `git diff` will show you any changes that
 you've made but not yet added to the index.)  You can also get a brief
-summary of the situation with 'git status':
+summary of the situation with `git status`:
 
 ------------------------------------------------
 $ git status
 On branch master
 Changes to be committed:
-Your branch is up to date with 'origin/master'.
   (use "git restore --staged <file>..." to unstage)
 
        modified:   file1
@@ -128,7 +127,7 @@ $ git commit
 This will again prompt you for a message describing the change, and then
 record a new version of the project.
 
-Alternatively, instead of running 'git add' beforehand, you can use
+Alternatively, instead of running `git add` beforehand, you can use
 
 ------------------------------------------------
 $ git commit -a
@@ -151,7 +150,7 @@ Git tracks content not files
 
 Many revision control systems provide an `add` command that tells the
 system to start tracking changes to a new file.  Git's `add` command
-does something simpler and more powerful: 'git add' is used both for new
+does something simpler and more powerful: `git add` is used both for new
 and newly modified files, and in both cases it takes a snapshot of the
 given files and stages that content in the index, ready for inclusion in
 the next commit.
@@ -182,7 +181,7 @@ Managing branches
 -----------------
 
 A single Git repository can maintain multiple branches of
-development.  To create a new branch named "experimental", use
+development.  To create a new branch named `experimental`, use
 
 ------------------------------------------------
 $ git branch experimental
@@ -201,8 +200,8 @@ you'll get a list of all existing branches:
 * master
 ------------------------------------------------
 
-The "experimental" branch is the one you just created, and the
-"master" branch is a default branch that was created for you
+The `experimental` branch is the one you just created, and the
+`master` branch is a default branch that was created for you
 automatically.  The asterisk marks the branch you are currently on;
 type
 
@@ -210,8 +209,8 @@ type
 $ git switch experimental
 ------------------------------------------------
 
-to switch to the experimental branch.  Now edit a file, commit the
-change, and switch back to the master branch:
+to switch to the `experimental` branch.  Now edit a file, commit the
+change, and switch back to the `master` branch:
 
 ------------------------------------------------
 (edit file)
@@ -220,9 +219,9 @@ $ git switch master
 ------------------------------------------------
 
 Check that the change you made is no longer visible, since it was
-made on the experimental branch and you're back on the master branch.
+made on the `experimental` branch and you're back on the `master` branch.
 
-You can make a different change on the master branch:
+You can make a different change on the `master` branch:
 
 ------------------------------------------------
 (edit file)
@@ -230,7 +229,7 @@ $ git commit -a
 ------------------------------------------------
 
 at this point the two branches have diverged, with different changes
-made in each.  To merge the changes made in experimental into master, run
+made in each.  To merge the changes made in `experimental` into `master`, run
 
 ------------------------------------------------
 $ git merge experimental
@@ -258,16 +257,16 @@ $ gitk
 
 will show a nice graphical representation of the resulting history.
 
-At this point you could delete the experimental branch with
+At this point you could delete the `experimental` branch with
 
 ------------------------------------------------
 $ git branch -d experimental
 ------------------------------------------------
 
-This command ensures that the changes in the experimental branch are
+This command ensures that the changes in the `experimental` branch are
 already in the current branch.
 
-If you develop on a branch crazy-idea, then regret it, you can always
+If you develop on a branch `crazy-idea`, then regret it, you can always
 delete the branch with
 
 -------------------------------------
@@ -281,7 +280,7 @@ Using Git for collaboration
 ---------------------------
 
 Suppose that Alice has started a new project with a Git repository in
-/home/alice/project, and that Bob, who has a home directory on the
+`/home/alice/project`, and that Bob, who has a home directory on the
 same machine, wants to contribute.
 
 Bob begins with:
@@ -290,7 +289,7 @@ Bob begins with:
 bob$ git clone /home/alice/project myrepo
 ------------------------------------------------
 
-This creates a new directory "myrepo" containing a clone of Alice's
+This creates a new directory `myrepo` containing a clone of Alice's
 repository.  The clone is on an equal footing with the original
 project, possessing its own copy of the original project's history.
 
@@ -303,31 +302,31 @@ bob$ git commit -a
 ------------------------------------------------
 
 When he's ready, he tells Alice to pull changes from the repository
-at /home/bob/myrepo.  She does this with:
+at `/home/bob/myrepo`.  She does this with:
 
 ------------------------------------------------
 alice$ cd /home/alice/project
 alice$ git pull /home/bob/myrepo master
 ------------------------------------------------
 
-This merges the changes from Bob's "master" branch into Alice's
+This merges the changes from Bob's `master` branch into Alice's
 current branch.  If Alice has made her own changes in the meantime,
 then she may need to manually fix any conflicts.
 
-The "pull" command thus performs two operations: it fetches changes
+The `pull` command thus performs two operations: it fetches changes
 from a remote branch, then merges them into the current branch.
 
 Note that in general, Alice would want her local changes committed before
-initiating this "pull".  If Bob's work conflicts with what Alice did since
+initiating this `pull`.  If Bob's work conflicts with what Alice did since
 their histories forked, Alice will use her working tree and the index to
 resolve conflicts, and existing local changes will interfere with the
 conflict resolution process (Git will still perform the fetch but will
 refuse to merge -- Alice will have to get rid of her local changes in
 some way and pull again when this happens).
 
-Alice can peek at what Bob did without merging first, using the "fetch"
+Alice can peek at what Bob did without merging first, using the `fetch`
 command; this allows Alice to inspect what Bob did, using a special
-symbol "FETCH_HEAD", in order to determine if he has anything worth
+symbol `FETCH_HEAD`, in order to determine if he has anything worth
 pulling, like this:
 
 ------------------------------------------------
@@ -336,10 +335,10 @@ alice$ git log -p HEAD..FETCH_HEAD
 ------------------------------------------------
 
 This operation is safe even if Alice has uncommitted local changes.
-The range notation "HEAD..FETCH_HEAD" means "show everything that is reachable
-from the FETCH_HEAD but exclude anything that is reachable from HEAD".
-Alice already knows everything that leads to her current state (HEAD),
-and reviews what Bob has in his state (FETCH_HEAD) that she has not
+The range notation `HEAD..FETCH_HEAD` means "show everything that is reachable
+from the `FETCH_HEAD` but exclude anything that is reachable from `HEAD`".
+Alice already knows everything that leads to her current state (`HEAD`),
+and reviews what Bob has in his state (`FETCH_HEAD`) that she has not
 seen with this command.
 
 If Alice wants to visualize what Bob did since their histories forked
@@ -349,7 +348,7 @@ she can issue the following command:
 $ gitk HEAD..FETCH_HEAD
 ------------------------------------------------
 
-This uses the same two-dot range notation we saw earlier with 'git log'.
+This uses the same two-dot range notation we saw earlier with `git log`.
 
 Alice may want to view what both of them did since they forked.
 She can use three-dot form instead of the two-dot form:
@@ -361,13 +360,13 @@ $ gitk HEAD...FETCH_HEAD
 This means "show everything that is reachable from either one, but
 exclude anything that is reachable from both of them".
 
-Please note that these range notation can be used with both gitk
-and "git log".
+Please note that these range notation can be used with both `gitk`
+and `git log`.
 
 After inspecting what Bob did, if there is nothing urgent, Alice may
 decide to continue working without pulling from Bob.  If Bob's history
 does have something Alice would immediately need, Alice may choose to
-stash her work-in-progress first, do a "pull", and then finally unstash
+stash her work-in-progress first, do a `pull`, and then finally unstash
 her work-in-progress on top of the resulting history.
 
 When you are working in a small closely knit group, it is not
@@ -379,8 +378,8 @@ it easier:
 alice$ git remote add bob /home/bob/myrepo
 ------------------------------------------------
 
-With this, Alice can perform the first part of the "pull" operation
-alone using the 'git fetch' command without merging them with her own
+With this, Alice can perform the first part of the `pull` operation
+alone using the `git fetch` command without merging them with her own
 branch, using:
 
 -------------------------------------
@@ -388,7 +387,7 @@ alice$ git fetch bob
 -------------------------------------
 
 Unlike the longhand form, when Alice fetches from Bob using a
-remote repository shorthand set up with 'git remote', what was
+remote repository shorthand set up with `git remote`, what was
 fetched is stored in a remote-tracking branch, in this case
 `bob/master`.  So after this:
 
@@ -397,10 +396,10 @@ alice$ git log -p master..bob/master
 -------------------------------------
 
 shows a list of all the changes that Bob made since he branched from
-Alice's master branch.
+Alice's `master` branch.
 
 After examining those changes, Alice
-could merge the changes into her master branch:
+could merge the changes into her `master` branch:
 
 -------------------------------------
 alice$ git merge bob/master
@@ -432,12 +431,12 @@ bob$ git config --get remote.origin.url
 /home/alice/project
 -------------------------------------
 
-(The complete configuration created by 'git clone' is visible using
+(The complete configuration created by `git clone` is visible using
 `git config -l`, and the linkgit:git-config[1] man page
 explains the meaning of each option.)
 
-Git also keeps a pristine copy of Alice's master branch under the
-name "origin/master":
+Git also keeps a pristine copy of Alice's `master` branch under the
+name `origin/master`:
 
 -------------------------------------
 bob$ git branch -r
@@ -462,8 +461,8 @@ Exploring history
 -----------------
 
 Git history is represented as a series of interrelated commits.  We
-have already seen that the 'git log' command can list those commits.
-Note that first line of each git log entry also gives a name for the
+have already seen that the `git log` command can list those commits.
+Note that first line of each `git log` entry also gives a name for the
 commit:
 
 -------------------------------------
@@ -475,7 +474,7 @@ Date:   Tue May 16 17:18:22 2006 -0700
     merge-base: Clarify the comments on post processing.
 -------------------------------------
 
-We can give this name to 'git show' to see the details about this
+We can give this name to `git show` to see the details about this
 commit.
 
 -------------------------------------
@@ -514,7 +513,7 @@ You can also give commits names of your own; after running
 $ git tag v2.5 1b2e1d63ff
 -------------------------------------
 
-you can refer to 1b2e1d63ff by the name "v2.5".  If you intend to
+you can refer to `1b2e1d63ff` by the name `v2.5`.  If you intend to
 share this name with other people (for example, to identify a release
 version), you should create a "tag" object, and perhaps sign it; see
 linkgit:git-tag[1] for details.
@@ -533,22 +532,22 @@ $ git reset --hard HEAD^ # reset your current branch and working
 Be careful with that last command: in addition to losing any changes
 in the working directory, it will also remove all later commits from
 this branch.  If this branch is the only branch containing those
-commits, they will be lost.  Also, don't use 'git reset' on a
+commits, they will be lost.  Also, don't use `git reset` on a
 publicly-visible branch that other developers pull from, as it will
 force needless merges on other developers to clean up the history.
-If you need to undo changes that you have pushed, use 'git revert'
+If you need to undo changes that you have pushed, use `git revert`
 instead.
 
-The 'git grep' command can search for strings in any version of your
+The `git grep` command can search for strings in any version of your
 project, so
 
 -------------------------------------
 $ git grep "hello" v2.5
 -------------------------------------
 
-searches for all occurrences of "hello" in v2.5.
+searches for all occurrences of "hello" in `v2.5`.
 
-If you leave out the commit name, 'git grep' will search any of the
+If you leave out the commit name, `git grep` will search any of the
 files it manages in your current directory.  So
 
 -------------------------------------
@@ -558,7 +557,7 @@ $ git grep "hello"
 is a quick way to search just the files that are tracked by Git.
 
 Many Git commands also take sets of commits, which can be specified
-in a number of ways.  Here are some examples with 'git log':
+in a number of ways.  Here are some examples with `git log`:
 
 -------------------------------------
 $ git log v2.5..v2.6            # commits between v2.5 and v2.6
@@ -568,16 +567,16 @@ $ git log v2.5.. Makefile       # commits since v2.5 which modify
                                # Makefile
 -------------------------------------
 
-You can also give 'git log' a "range" of commits where the first is not
+You can also give `git log` a "range" of commits where the first is not
 necessarily an ancestor of the second; for example, if the tips of
-the branches "stable" and "master" diverged from a common
+the branches `stable` and `master` diverged from a common
 commit some time ago, then
 
 -------------------------------------
 $ git log stable..master
 -------------------------------------
 
-will list commits made in the master branch but not in the
+will list commits made in the `master` branch but not in the
 stable branch, while
 
 -------------------------------------
@@ -585,15 +584,15 @@ $ git log master..stable
 -------------------------------------
 
 will show the list of commits made on the stable branch but not
-the master branch.
+the `master` branch.
 
-The 'git log' command has a weakness: it must present commits in a
+The `git log` command has a weakness: it must present commits in a
 list.  When the history has lines of development that diverged and
-then merged back together, the order in which 'git log' presents
+then merged back together, the order in which `git log` presents
 those commits is meaningless.
 
 Most projects with multiple contributors (such as the Linux kernel,
-or Git itself) have frequent merges, and 'gitk' does a better job of
+or Git itself) have frequent merges, and `gitk` does a better job of
 visualizing their history.  For example,
 
 -------------------------------------
@@ -601,7 +600,7 @@ $ gitk --since="2 weeks ago" drivers/
 -------------------------------------
 
 allows you to browse any commits from the last 2 weeks of commits
-that modified files under the "drivers" directory.  (Note: you can
+that modified files under the `drivers` directory.  (Note: you can
 adjust gitk's fonts by holding down the control key while pressing
 "-" or "+".)
 
@@ -613,7 +612,7 @@ of the file:
 $ git diff v2.5:Makefile HEAD:Makefile.in
 -------------------------------------
 
-You can also use 'git show' to see any such file:
+You can also use `git show` to see any such file:
 
 -------------------------------------
 $ git show v2.5:Makefile
@@ -649,7 +648,7 @@ digressions that may be interesting at this point are:
 
   * linkgit:git-bisect[1]: When there is a regression in your
     project, one way to track down the bug is by searching through
-    the history to find the exact commit that's to blame.  Git bisect
+    the history to find the exact commit that's to blame.  `git bisect`
     can help you perform a binary search for that commit.  It is
     smart enough to perform a close-to-optimal search even in the
     case of complex non-linear history with lots of merged branches.
index 7cee9d36899101b1ea48cebcb875388164b002b8..af6bf3c45ec1b78c13a0886c2824eb980099c706 100644 (file)
@@ -503,7 +503,7 @@ repositories, you can configure Apache like this:
 
 The above configuration expects your public repositories to live under
 `/pub/git` and will serve them as `http://git.domain.org/dir-under-pub-git`,
-both as clonable Git URL and as browseable gitweb interface.  If you then
+both as clonable Git URL and as browsable gitweb interface.  If you then
 start your linkgit:git-daemon[1] with `--base-path=/pub/git --export-all`
 then you can even use the `git://` URL with exactly the same path.
 
index a9c7ec69f46d8c631e86449aafdf327d8e51d435..beb5ff8ec2bbc271cb61f52929d3286c027a864a 100644 (file)
@@ -8,19 +8,7 @@
 <xsl:param name="man.output.quietly" select="1"/>
 <xsl:param name="refentry.meta.get.quietly" select="1"/>
 
-<!-- convert asciidoc callouts to man page format -->
-<xsl:template match="co">
-       <xsl:value-of select="concat('\fB(',substring-after(@id,'-'),')\fR')"/>
-</xsl:template>
-<xsl:template match="calloutlist">
-       <xsl:text>.sp&#10;</xsl:text>
-       <xsl:apply-templates/>
-       <xsl:text>&#10;</xsl:text>
-</xsl:template>
-<xsl:template match="callout">
-       <xsl:value-of select="concat('\fB',substring-after(@arearefs,'-'),'. \fR')"/>
-       <xsl:apply-templates/>
-       <xsl:text>.br&#10;</xsl:text>
-</xsl:template>
+<!-- unset maximum length of title -->
+<xsl:param name="man.th.title.max.length"/>
 
 </xsl:stylesheet>
index 4cb106f0d146e754e626e5d22a512ad9ab5524a3..e561e6668c9e59daa705e563068cd8b20aabd038 100644 (file)
@@ -1,6 +1,9 @@
-THIS OPTION IS EXPERIMENTAL! SHA-256 support is experimental and still
-in an early stage.  A SHA-256 repository will in general not be able to
-share work with "regular" SHA-1 repositories.  It should be assumed
-that, e.g., Git internal file formats in relation to SHA-256
-repositories may change in backwards-incompatible ways.  Only use
-`--object-format=sha256` for testing purposes.
+Note: At present, there is no interoperability between SHA-256
+repositories and SHA-1 repositories.
+
+Historically, we warned that SHA-256 repositories may later need
+backward incompatible changes when we introduce such interoperability
+features. Today, we only expect compatible changes. Furthermore, if such
+changes prove to be necessary, it can be expected that SHA-256 repositories
+created with today's Git will be usable by future versions of Git
+without data loss.
index 3000888a90852f6bd95eee5b40dc2f184ddd3dc9..e6468bf0eb8e11a5a8b6d73320a8810ee78151f9 100644 (file)
@@ -236,10 +236,11 @@ ifndef::git-rev-list[]
 endif::git-rev-list[]
 
 --stdin::
-       In addition to the '<commit>' listed on the command
-       line, read them from the standard input. If a `--` separator is
-       seen, stop reading commits and start reading paths to limit the
-       result.
+       In addition to getting arguments from the command line, read
+       them for standard input as well. This accepts commits and
+       pseudo-options like `--all` and `--glob=`. When a `--` separator
+       is seen, the following input is treated as paths and used to
+       limit the result.
 
 ifdef::git-rev-list[]
 --quiet::
index 9aa58052bc73dc773844d77819889c66222dc591..6ea6c7cead16476a710629d1aa56c345d07b8538 100644 (file)
@@ -30,10 +30,11 @@ characters and to avoid word splitting.
   explicitly say 'heads/master' to tell Git which one you mean.
   When ambiguous, a '<refname>' is disambiguated by taking the
   first match in the following rules:
-
++
   . If '$GIT_DIR/<refname>' exists, that is what you mean (this is usually
-    useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`
-    and `CHERRY_PICK_HEAD`);
+    useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`,
+    `REBASE_HEAD`, `REVERT_HEAD`, `CHERRY_PICK_HEAD`, `BISECT_HEAD`
+    and `AUTO_MERGE`);
 
   . otherwise, 'refs/<refname>' if it exists;
 
@@ -44,19 +45,38 @@ characters and to avoid word splitting.
   . otherwise, 'refs/remotes/<refname>' if it exists;
 
   . otherwise, 'refs/remotes/<refname>/HEAD' if it exists.
+
 +
-`HEAD` names the commit on which you based the changes in the working tree.
-`FETCH_HEAD` records the branch which you fetched from a remote repository
-with your last `git fetch` invocation.
-`ORIG_HEAD` is created by commands that move your `HEAD` in a drastic
-way (`git am`, `git merge`, `git rebase`, `git reset`),
-to record the position of the `HEAD` before their operation, so that
-you can easily change the tip of the branch back to the state before you ran
-them.
-`MERGE_HEAD` records the commit(s) which you are merging into your branch
-when you run `git merge`.
-`CHERRY_PICK_HEAD` records the commit which you are cherry-picking
-when you run `git cherry-pick`.
+  `HEAD`:::
+    names the commit on which you based the changes in the working tree.
+  `FETCH_HEAD`:::
+    records the branch which you fetched from a remote repository with
+    your last `git fetch` invocation.
+  `ORIG_HEAD`:::
+    is created by commands that move your `HEAD` in a drastic way (`git
+    am`, `git merge`, `git rebase`, `git reset`), to record the position
+    of the `HEAD` before their operation, so that you can easily change
+    the tip of the branch back to the state before you ran them.
+  `MERGE_HEAD`:::
+    records the commit(s) which you are merging into your branch when you
+    run `git merge`.
+  `REBASE_HEAD`:::
+    during a rebase, records the commit at which the operation is
+    currently stopped, either because of conflicts or an `edit` command in
+    an interactive rebase.
+  `REVERT_HEAD`:::
+    records the commit which you are reverting when you run `git revert`.
+  `CHERRY_PICK_HEAD`:::
+    records the commit which you are cherry-picking when you run `git
+    cherry-pick`.
+  `BISECT_HEAD`:::
+    records the current commit to be tested when you run `git bisect
+    --no-checkout`.
+  `AUTO_MERGE`:::
+    records a tree object corresponding to the state the
+    'ort' merge strategy wrote to the working tree when a merge operation
+    resulted in conflicts.
+
 +
 Note that any of the 'refs/*' cases above may come either from
 the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.
index 487d4d83fff2a873e762a9fc57a6f392a68caad4..c2ba01828c6b01b258d4d77d46714db3fafb6e0a 100644 (file)
@@ -28,9 +28,9 @@ and `diff.c` for examples.
 
 * `struct ll_merge_options`
 
-Check ll-merge.h for details.
+Check merge-ll.h for details.
 
 Low-level (single file) merge
 -----------------------------
 
-Check ll-merge.h for details.
+Check merge-ll.h for details.
index 1e34d913901e5922089da9451042ad2dc496b8f0..73f41761e2090a467dc0cade4888825d4606a7a7 100644 (file)
@@ -664,7 +664,7 @@ skip-irrelevant-renames optimization means we sometimes don't detect
 renames for any files within a directory that was renamed, in which
 case we will not have been able to detect any rename for the directory
 itself.  In such a case, we do not know whether the directory was
-renamed; we want to be careful to avoid cacheing some kind of "this
+renamed; we want to be careful to avoid caching some kind of "this
 directory was not renamed" statement.  If we did, then a subsequent
 commit being rebased could add a file to the old directory, and the
 user would expect it to end up in the correct directory -- something
index e410912fe52b9defd6de1601174cd214998ab336..ae8c2db427bb6a5671b6cf598574e8392c715d97 100644 (file)
@@ -35,7 +35,7 @@ config file would appear like this:
 The `<pushurl>` is used for pushes only. It is optional and defaults
 to `<URL>`. Pushing to a remote affects all defined pushurls or to all
 defined urls if no pushurls are defined. Fetch, however, will only
-fetch from the first defined url if muliple urls are defined.
+fetch from the first defined url if multiple urls are defined.
 
 Named file in `$GIT_DIR/remotes`
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index dc9c6a663a97e644d865e7d01957bfa2ac77bb5d..4281396093d7c92d22ccf2a8f7dd7c98400445e2 100644 (file)
@@ -1343,6 +1343,33 @@ $ git diff -3 file.txt           # diff against stage 3
 $ git diff --theirs file.txt   # same as the above.
 -------------------------------------------------
 
+When using the 'ort' merge strategy (the default), before updating the working
+tree with the result of the merge, Git writes a special ref named AUTO_MERGE
+reflecting the state of the tree it is about to write. Conflicted paths with
+textual conflicts that could not be automatically merged are written to this
+tree with conflict markers, just as in the working tree. AUTO_MERGE can thus be
+used with linkgit:git-diff[1] to show the changes you've made so far to resolve
+conflicts. Using the same example as above, after resolving the conflict we
+get:
+
+-------------------------------------------------
+$ git diff AUTO_MERGE
+diff --git a/file.txt b/file.txt
+index cd10406..8bf5ae7 100644
+--- a/file.txt
++++ b/file.txt
+@@ -1,5 +1 @@
+-<<<<<<< HEAD:file.txt
+-Hello world
+-=======
+-Goodbye
+->>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
++Goodbye world
+-------------------------------------------------
+
+Notice that the diff shows we deleted the conflict markers and both versions of
+the content line, and wrote "Goodbye world" instead.
+
 The linkgit:git-log[1] and linkgit:gitk[1] commands also provide special help
 for merges:
 
@@ -4102,13 +4129,11 @@ Note that terminology has changed since that revision.  For example, the
 README in that revision uses the word "changeset" to describe what we
 now call a <<def_commit_object,commit>>.
 
-Also, we do not call it "cache" any more, but rather "index"; however, the
-file is still called `cache.h`.  Remark: Not much reason to change it now,
-especially since there is no good single name for it anyway, because it is
-basically _the_ header file which is included by _all_ of Git's C sources.
+Also, we do not call it "cache" any more, but rather "index"; however,
+the file is still called `read-cache.h`.
 
 If you grasp the ideas in that initial commit, you should check out a
-more recent version and skim `cache.h`, `object.h` and `commit.h`.
+more recent version and skim `read-cache-ll.h`, `object.h` and `commit.h`.
 
 In the early days, Git (in the tradition of UNIX) was a bunch of programs
 which were extremely simple, and which you used in scripts, piping the
@@ -4119,11 +4144,11 @@ many of these parts have become builtins, and some of the core has been
 and to avoid code duplication.
 
 By now, you know what the index is (and find the corresponding data
-structures in `cache.h`), and that there are just a couple of object types
-(blobs, trees, commits and tags) which inherit their common structure from
-`struct object`, which is their first member (and thus, you can cast e.g.
-`(struct object *)commit` to achieve the _same_ as `&commit->object`, i.e.
-get at the object name and flags).
+structures in `read-cache-ll.h`), and that there are just a couple of
+object types (blobs, trees, commits and tags) which inherit their
+common structure from `struct object`, which is their first member
+(and thus, you can cast e.g.  `(struct object *)commit` to achieve the
+_same_ as `&commit->object`, i.e.  get at the object name and flags).
 
 Now is a good point to take a break to let this information sink in.
 
index 9a1111af9b14f373be57a832931062d57e0723f1..bbfb1418e363da48debfbfc87a1b0bb2c206916c 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.40.GIT
+DEF_VER=v2.42.0-rc2
 
 LF='
 '
index 60ab1a8b4f4f2f72b6d6232d1d0130a57eb4a082..5776309365357a5848c5f03214690e75d7deb57c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1032,6 +1032,7 @@ LIB_OBJS += fsmonitor.o
 LIB_OBJS += fsmonitor-ipc.o
 LIB_OBJS += fsmonitor-settings.o
 LIB_OBJS += gettext.o
+LIB_OBJS += git-zlib.o
 LIB_OBJS += gpg-interface.o
 LIB_OBJS += graph.o
 LIB_OBJS += grep.o
@@ -1050,7 +1051,6 @@ LIB_OBJS += linear-assignment.o
 LIB_OBJS += list-objects-filter-options.o
 LIB_OBJS += list-objects-filter.o
 LIB_OBJS += list-objects.o
-LIB_OBJS += ll-merge.o
 LIB_OBJS += lockfile.o
 LIB_OBJS += log-tree.o
 LIB_OBJS += ls-refs.o
@@ -1059,6 +1059,7 @@ LIB_OBJS += mailmap.o
 LIB_OBJS += match-trees.o
 LIB_OBJS += mem-pool.o
 LIB_OBJS += merge-blobs.o
+LIB_OBJS += merge-ll.o
 LIB_OBJS += merge-ort.o
 LIB_OBJS += merge-ort-wrappers.o
 LIB_OBJS += merge-recursive.o
@@ -1141,6 +1142,7 @@ LIB_OBJS += sigchain.o
 LIB_OBJS += sparse-index.o
 LIB_OBJS += split-index.o
 LIB_OBJS += stable-qsort.o
+LIB_OBJS += statinfo.o
 LIB_OBJS += strbuf.o
 LIB_OBJS += streaming.o
 LIB_OBJS += string-list.o
@@ -1192,7 +1194,6 @@ LIB_OBJS += write-or-die.o
 LIB_OBJS += ws.o
 LIB_OBJS += wt-status.o
 LIB_OBJS += xdiff-interface.o
-LIB_OBJS += zlib.o
 
 BUILTIN_OBJS += builtin/add.o
 BUILTIN_OBJS += builtin/am.o
@@ -1951,7 +1952,7 @@ endif
        BASIC_CFLAGS += \
                -DSHA1DC_NO_STANDARD_INCLUDES \
                -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
-               -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
+               -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" \
                -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
 endif
 endif
@@ -2742,8 +2743,8 @@ exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \
        '-DBINDIR="$(bindir_relative_SQ)"' \
        '-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"'
 
-builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX
-builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
+setup.sp setup.s setup.o: GIT-PREFIX
+setup.sp setup.s setup.o: EXTRA_CPPFLAGS = \
        -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
 
 config.sp config.s config.o: GIT-PREFIX
@@ -2778,6 +2779,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
 compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
 endif
 
+headless-git.o: compat/win32/headless.c GIT-CFLAGS
+       $(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
+               -fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
+
+headless-git$X: headless-git.o git.res GIT-LDFLAGS
+       $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
+
 git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
 
@@ -3215,6 +3223,12 @@ $(SP_OBJ): %.sp: %.c %.o
 sparse: $(SP_OBJ)
 
 EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%
+ifndef OPENSSL_SHA1
+       EXCEPT_HDRS += sha1/openssl.h
+endif
+ifndef OPENSSL_SHA256
+       EXCEPT_HDRS += sha256/openssl.h
+endif
 ifndef NETTLE_SHA256
        EXCEPT_HDRS += sha256/nettle.h
 endif
@@ -3651,6 +3665,7 @@ clean: profile-clean coverage-clean cocciclean
        $(RM) po/git.pot po/git-core.pot
        $(RM) git.res
        $(RM) $(OBJECTS)
+       $(RM) headless-git.o
        $(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
        $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
        $(RM) $(TEST_PROGRAMS)
@@ -3679,6 +3694,7 @@ endif
        $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
 ifdef MSVC
        $(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
+       $(RM) headless-git.o.pdb
        $(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
        $(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
        $(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
index 4da73c9a6d376789944260138a56c6d8d79fd5fb..0527f30c2d8ff1c8bda66ddbddff0ff436ad0813 120000 (symlink)
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/2.41.0.txt
\ No newline at end of file
+Documentation/RelNotes/2.42.0.txt
\ No newline at end of file
index d032f5dce517cbeb11ce703c5d9709bc35c8435b..1202cde23dbc9b27e3bee5d3198a9cec3236a288 100644 (file)
--- a/abspath.c
+++ b/abspath.c
@@ -289,3 +289,39 @@ char *prefix_filename_except_for_dash(const char *pfx, const char *arg)
                return xstrdup(arg);
        return prefix_filename(pfx, arg);
 }
+
+void strbuf_add_absolute_path(struct strbuf *sb, const char *path)
+{
+       if (!*path)
+               die("The empty string is not a valid path");
+       if (!is_absolute_path(path)) {
+               struct stat cwd_stat, pwd_stat;
+               size_t orig_len = sb->len;
+               char *cwd = xgetcwd();
+               char *pwd = getenv("PWD");
+               if (pwd && strcmp(pwd, cwd) &&
+                   !stat(cwd, &cwd_stat) &&
+                   (cwd_stat.st_dev || cwd_stat.st_ino) &&
+                   !stat(pwd, &pwd_stat) &&
+                   pwd_stat.st_dev == cwd_stat.st_dev &&
+                   pwd_stat.st_ino == cwd_stat.st_ino)
+                       strbuf_addstr(sb, pwd);
+               else
+                       strbuf_addstr(sb, cwd);
+               if (sb->len > orig_len && !is_dir_sep(sb->buf[sb->len - 1]))
+                       strbuf_addch(sb, '/');
+               free(cwd);
+       }
+       strbuf_addstr(sb, path);
+}
+
+void strbuf_add_real_path(struct strbuf *sb, const char *path)
+{
+       if (sb->len) {
+               struct strbuf resolved = STRBUF_INIT;
+               strbuf_realpath(&resolved, path, 1);
+               strbuf_addbuf(sb, &resolved);
+               strbuf_release(&resolved);
+       } else
+               strbuf_realpath(sb, path, 1);
+}
index 7cd3de5e9de5391381dfa6a28a43bb709e4b04c4..4653080d5e4b7aee7c5bc2a239c709012d6f6474 100644 (file)
--- a/abspath.h
+++ b/abspath.h
@@ -30,4 +30,25 @@ static inline int is_absolute_path(const char *path)
        return is_dir_sep(path[0]) || has_dos_drive_prefix(path);
 }
 
+/**
+ * Add a path to a buffer, converting a relative path to an
+ * absolute one in the process.  Symbolic links are not
+ * resolved.
+ */
+void strbuf_add_absolute_path(struct strbuf *sb, const char *path);
+
+/**
+ * Canonize `path` (make it absolute, resolve symlinks, remove extra
+ * slashes) and append it to `sb`.  Die with an informative error
+ * message if there is a problem.
+ *
+ * The directory part of `path` (i.e., everything up to the last
+ * dir_sep) must denote a valid, existing directory, but the last
+ * component need not exist.
+ *
+ * Callers that don't mind links should use the more lightweight
+ * strbuf_add_absolute_path() instead.
+ */
+void strbuf_add_real_path(struct strbuf *sb, const char *path);
+
 #endif /* ABSPATH_H */
index 757a9929d41242fd878dae25d12839cd2a6cb52d..add9a1ad4364f92833256d5f53dbb3bc85b43ede 100644 (file)
@@ -1,10 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "add-interactive.h"
 #include "color.h"
 #include "config.h"
 #include "diffcore.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
+#include "preload-index.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "revision.h"
 #include "refs.h"
 #include "string-list.h"
@@ -12,6 +16,7 @@
 #include "dir.h"
 #include "run-command.h"
 #include "prompt.h"
+#include "tree.h"
 
 static void init_color(struct repository *r, struct add_i_state *s,
                       const char *section_and_slot, char *dst,
index 1e1ee2df59674ebf5340ae77b8e00a3de30f1947..bfe19876cd50c5aca2e465d9334c49e65a1972fc 100644 (file)
@@ -1,8 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "add-interactive.h"
-#include "alloc.h"
+#include "advice.h"
+#include "editor.h"
 #include "environment.h"
 #include "gettext.h"
+#include "object-name.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "strbuf.h"
 #include "run-command.h"
 #include "strvec.h"
@@ -1102,10 +1106,11 @@ static int edit_hunk_manually(struct add_p_state *s, struct hunk *hunk)
        size_t i;
 
        strbuf_reset(&s->buf);
-       strbuf_commented_addf(&s->buf, _("Manual hunk edit mode -- see bottom for "
-                                     "a quick guide.\n"));
+       strbuf_commented_addf(&s->buf, comment_line_char,
+                             _("Manual hunk edit mode -- see bottom for "
+                               "a quick guide.\n"));
        render_hunk(s, hunk, 0, 0, &s->buf);
-       strbuf_commented_addf(&s->buf,
+       strbuf_commented_addf(&s->buf, comment_line_char,
                              _("---\n"
                                "To remove '%c' lines, make them ' ' lines "
                                "(context).\n"
@@ -1114,12 +1119,13 @@ static int edit_hunk_manually(struct add_p_state *s, struct hunk *hunk)
                              s->mode->is_reverse ? '+' : '-',
                              s->mode->is_reverse ? '-' : '+',
                              comment_line_char);
-       strbuf_commented_addf(&s->buf, "%s", _(s->mode->edit_hunk_hint));
+       strbuf_commented_addf(&s->buf, comment_line_char, "%s",
+                             _(s->mode->edit_hunk_hint));
        /*
         * TRANSLATORS: 'it' refers to the patch mentioned in the previous
         * messages.
         */
-       strbuf_commented_addf(&s->buf,
+       strbuf_commented_addf(&s->buf, comment_line_char,
                              _("If it does not apply cleanly, you will be "
                                "given an opportunity to\n"
                                "edit again.  If all lines of the hunk are "
index d6232439c3863b4c6136adfd12465b0aa714e81f..50c79443ba749fc56437806c21a20755c1988714 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -78,6 +78,7 @@ static struct {
        [ADVICE_SUBMODULES_NOT_UPDATED]                 = { "submodulesNotUpdated", 1 },
        [ADVICE_UPDATE_SPARSE_PATH]                     = { "updateSparsePath", 1 },
        [ADVICE_WAITING_FOR_EDITOR]                     = { "waitingForEditor", 1 },
+       [ADVICE_WORKTREE_ADD_ORPHAN]                    = { "worktreeAddOrphan", 1 },
 };
 
 static const char turn_off_instructions[] =
@@ -190,9 +191,10 @@ int error_resolve_conflict(const char *me)
                error(_("Pulling is not possible because you have unmerged files."));
        else if (!strcmp(me, "revert"))
                error(_("Reverting is not possible because you have unmerged files."));
+       else if (!strcmp(me, "rebase"))
+               error(_("Rebasing is not possible because you have unmerged files."));
        else
-               error(_("It is not possible to %s because you have unmerged files."),
-                       me);
+               BUG("Unhandled conflict reason '%s'", me);
 
        if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
                /*
index 0f584163f5808ce536ff5d1a5294eed2437ba23b..2affbe142616de0d329c9aaaaee9ca355fb73adf 100644 (file)
--- a/advice.h
+++ b/advice.h
@@ -49,6 +49,7 @@ struct string_list;
        ADVICE_UPDATE_SPARSE_PATH,
        ADVICE_WAITING_FOR_EDITOR,
        ADVICE_SKIPPED_CHERRY_PICKS,
+       ADVICE_WORKTREE_ADD_ORPHAN,
 };
 
 int git_default_advice_config(const char *var, const char *value);
diff --git a/alias.c b/alias.c
index 54a1a23d2cf1a5983e47f4369fe08ef935616508..5a238f2e3012d2fb12443b27ed02831e9edee476 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "alias.h"
-#include "alloc.h"
 #include "config.h"
 #include "gettext.h"
 #include "strbuf.h"
@@ -12,7 +11,8 @@ struct config_alias_data {
        struct string_list *list;
 };
 
-static int config_alias_cb(const char *key, const char *value, void *d)
+static int config_alias_cb(const char *key, const char *value,
+                          const struct config_context *ctx UNUSED, void *d)
 {
        struct config_alias_data *data = d;
        const char *p;
diff --git a/alloc.c b/alloc.c
index 2886aa93543478f4bf221ca3e4a830a40f9baf42..377e80f5dda2f80e6222f4eb2fa8c607d708cc9d 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -13,6 +13,7 @@
 #include "blob.h"
 #include "tree.h"
 #include "commit.h"
+#include "repository.h"
 #include "tag.h"
 #include "alloc.h"
 
diff --git a/alloc.h b/alloc.h
index 4312db4bd087bde3632c547bb72d0b5cc77be713..3f4a0ad310a94bd026f48f48491985e3e2053ee2 100644 (file)
--- a/alloc.h
+++ b/alloc.h
@@ -17,79 +17,4 @@ void *alloc_object_node(struct repository *r);
 struct alloc_state *allocate_alloc_state(void);
 void clear_alloc_state(struct alloc_state *s);
 
-#define alloc_nr(x) (((x)+16)*3/2)
-
-/**
- * Dynamically growing an array using realloc() is error prone and boring.
- *
- * Define your array with:
- *
- * - a pointer (`item`) that points at the array, initialized to `NULL`
- *   (although please name the variable based on its contents, not on its
- *   type);
- *
- * - an integer variable (`alloc`) that keeps track of how big the current
- *   allocation is, initialized to `0`;
- *
- * - another integer variable (`nr`) to keep track of how many elements the
- *   array currently has, initialized to `0`.
- *
- * Then before adding `n`th element to the item, call `ALLOC_GROW(item, n,
- * alloc)`.  This ensures that the array can hold at least `n` elements by
- * calling `realloc(3)` and adjusting `alloc` variable.
- *
- * ------------
- * sometype *item;
- * size_t nr;
- * size_t alloc
- *
- * for (i = 0; i < nr; i++)
- *     if (we like item[i] already)
- *             return;
- *
- * // we did not like any existing one, so add one
- * ALLOC_GROW(item, nr + 1, alloc);
- * item[nr++] = value you like;
- * ------------
- *
- * You are responsible for updating the `nr` variable.
- *
- * If you need to specify the number of elements to allocate explicitly
- * then use the macro `REALLOC_ARRAY(item, alloc)` instead of `ALLOC_GROW`.
- *
- * Consider using ALLOC_GROW_BY instead of ALLOC_GROW as it has some
- * added niceties.
- *
- * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'.
- */
-#define ALLOC_GROW(x, nr, alloc) \
-       do { \
-               if ((nr) > alloc) { \
-                       if (alloc_nr(alloc) < (nr)) \
-                               alloc = (nr); \
-                       else \
-                               alloc = alloc_nr(alloc); \
-                       REALLOC_ARRAY(x, alloc); \
-               } \
-       } while (0)
-
-/*
- * Similar to ALLOC_GROW but handles updating of the nr value and
- * zeroing the bytes of the newly-grown array elements.
- *
- * DO NOT USE any expression with side-effect for any of the
- * arguments.
- */
-#define ALLOC_GROW_BY(x, nr, increase, alloc) \
-       do { \
-               if (increase) { \
-                       size_t new_nr = nr + (increase); \
-                       if (new_nr < nr) \
-                               BUG("negative growth in ALLOC_GROW_BY"); \
-                       ALLOC_GROW(x, new_nr, alloc); \
-                       memset((x) + nr, 0, sizeof(*(x)) * (increase)); \
-                       nr = new_nr; \
-               } \
-       } while (0)
-
 #endif
diff --git a/apply.c b/apply.c
index 9b7288bc9270754447b1750142c58946ba9b04c6..3d69fec836d41fbae10988606ac20ce96dad562d 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -7,11 +7,11 @@
  *
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
+#include "base85.h"
 #include "config.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "delta.h"
 #include "diff.h"
 #include "gettext.h"
 #include "hex.h"
 #include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "lockfile.h"
+#include "name-hash.h"
+#include "object-name.h"
+#include "object-file.h"
 #include "parse-options.h"
+#include "path.h"
 #include "quote.h"
+#include "read-cache.h"
 #include "rerere.h"
 #include "apply.h"
 #include "entry.h"
 #include "setup.h"
-#include "wrapper.h"
+#include "symlinks.h"
+#include "wildmatch.h"
+#include "ws.h"
 
 struct gitdiff_data {
        struct strbuf *root;
@@ -405,9 +412,10 @@ static void say_patch_name(FILE *output, const char *fmt, struct patch *patch)
 
 static int read_patch_file(struct strbuf *sb, int fd)
 {
-       if (strbuf_read(sb, fd, 0) < 0 || sb->len >= MAX_APPLY_SIZE)
-               return error_errno("git apply: failed to read");
-
+       if (strbuf_read(sb, fd, 0) < 0)
+               return error_errno(_("failed to read patch"));
+       else if (sb->len >= MAX_APPLY_SIZE)
+               return error(_("patch too large"));
        /*
         * Make sure that we have some slop in the buffer
         * so that we can do speculative "memcmp" etc, and
@@ -4586,7 +4594,7 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
        FILE *rej;
        char namebuf[PATH_MAX];
        struct fragment *frag;
-       int cnt = 0;
+       int fd, cnt = 0;
        struct strbuf sb = STRBUF_INIT;
 
        for (cnt = 0, frag = patch->fragments; frag; frag = frag->next) {
@@ -4626,7 +4634,17 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
        memcpy(namebuf, patch->new_name, cnt);
        memcpy(namebuf + cnt, ".rej", 5);
 
-       rej = fopen(namebuf, "w");
+       fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
+       if (fd < 0) {
+               if (errno != EEXIST)
+                       return error_errno(_("cannot open %s"), namebuf);
+               if (unlink(namebuf))
+                       return error_errno(_("cannot unlink '%s'"), namebuf);
+               fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
+               if (fd < 0)
+                       return error_errno(_("cannot open %s"), namebuf);
+       }
+       rej = fdopen(fd, "w");
        if (!rej)
                return error_errno(_("cannot open %s"), namebuf);
 
diff --git a/apply.h b/apply.h
index b9f18ce87d1e0374a04aaaf785592c752dba6058..7cd38b1443c67e448bdc9f004f94a841a12eb747 100644 (file)
--- a/apply.h
+++ b/apply.h
@@ -1,7 +1,7 @@
 #ifndef APPLY_H
 #define APPLY_H
 
-#include "hash.h"
+#include "hash-ll.h"
 #include "lockfile.h"
 #include "string-list.h"
 #include "strmap.h"
index 497dad0b3af4adac513ee70d5eb72f9cc1517179..07269968399a5e1b1731fb458d48f4188ed25577 100644 (file)
@@ -2,13 +2,13 @@
  * Copyright (c) 2005, 2006 Rene Scharfe
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "tar.h"
 #include "archive.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "streaming.h"
 #include "run-command.h"
 #include "write-or-die.h"
@@ -410,14 +410,15 @@ static int tar_filter_config(const char *var, const char *value,
        return 0;
 }
 
-static int git_tar_config(const char *var, const char *value, void *cb)
+static int git_tar_config(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "tar.umask")) {
                if (value && !strcmp(value, "user")) {
                        tar_umask = umask(0);
                        umask(tar_umask);
                } else {
-                       tar_umask = git_config_int(var, value);
+                       tar_umask = git_config_int(var, value, ctx->kvi);
                }
                return 0;
        }
index e6f5c10a14f20a105de81224aae0144610f5a312..7229e3e454feb080509d1587a974925ff1318f31 100644 (file)
@@ -1,14 +1,15 @@
 /*
  * Copyright (c) 2006 Rene Scharfe
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "archive.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
 #include "streaming.h"
 #include "utf8.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "userdiff.h"
 #include "write-or-die.h"
 #include "xdiff-interface.h"
@@ -616,6 +617,7 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
 }
 
 static int archive_zip_config(const char *var, const char *value,
+                             const struct config_context *ctx UNUSED,
                              void *data UNUSED)
 {
        return userdiff_config(var, value);
index d2d1b4eb42e713ed36715478af9b582c98510296..ca11db185b15a73dd31b239d91a609071faa9a2a 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -1,14 +1,17 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
+#include "convert.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "path.h"
+#include "pretty.h"
 #include "setup.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
+#include "tree.h"
 #include "tree-walk.h"
 #include "attr.h"
 #include "archive.h"
@@ -127,7 +130,7 @@ static const struct attr_check *get_archive_attrs(struct index_state *istate,
        static struct attr_check *check;
        if (!check)
                check = attr_check_initl("export-ignore", "export-subst", NULL);
-       git_check_attr(istate, NULL, path, check);
+       git_check_attr(istate, path, check);
        return check;
 }
 
index 7178e2a9a2d06c5c3eaaa8884464e6f4cc26fbde..3a4bdfbd078109680dd54143d03ee2567a0cba31 100644 (file)
--- a/archive.h
+++ b/archive.h
@@ -1,8 +1,9 @@
 #ifndef ARCHIVE_H
 #define ARCHIVE_H
 
-#include "cache.h"
+#include "object-name.h"
 #include "pathspec.h"
+#include "string-list.h"
 
 struct repository;
 struct pretty_print_context;
diff --git a/attr.c b/attr.c
index 2d8aeb8b58cbc0f19f050bce768b06f0c6f4b705..ff0a3e7b61ad0468de7d42305ffc723fbfb9c9e1 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -6,20 +6,23 @@
  * an insanely large number of attributes.
  */
 
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
 #include "exec-cmd.h"
 #include "attr.h"
 #include "dir.h"
 #include "gettext.h"
+#include "path.h"
 #include "utf8.h"
 #include "quote.h"
+#include "read-cache-ll.h"
 #include "revision.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "setup.h"
 #include "thread-utils.h"
+#include "tree-walk.h"
+#include "object-name.h"
 
 const char git_attr__true[] = "(builtin)true";
 const char git_attr__false[] = "\0(builtin)false";
@@ -868,7 +871,7 @@ static struct attr_stack *read_attr(struct index_state *istate,
        return res;
 }
 
-static const char *git_etc_gitattributes(void)
+const char *git_attr_system_file(void)
 {
        static const char *system_wide;
        if (!system_wide)
@@ -876,7 +879,7 @@ static const char *git_etc_gitattributes(void)
        return system_wide;
 }
 
-static const char *get_home_gitattributes(void)
+const char *git_attr_global_file(void)
 {
        if (!git_attributes_file)
                git_attributes_file = xdg_config_home("attributes");
@@ -884,7 +887,7 @@ static const char *get_home_gitattributes(void)
        return git_attributes_file;
 }
 
-static int git_attr_system(void)
+int git_attr_system_is_enabled(void)
 {
        return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
 }
@@ -918,14 +921,14 @@ static void bootstrap_attr_stack(struct index_state *istate,
        push_stack(stack, e, NULL, 0);
 
        /* system-wide frame */
-       if (git_attr_system()) {
-               e = read_attr_from_file(git_etc_gitattributes(), flags);
+       if (git_attr_system_is_enabled()) {
+               e = read_attr_from_file(git_attr_system_file(), flags);
                push_stack(stack, e, NULL, 0);
        }
 
        /* home directory */
-       if (get_home_gitattributes()) {
-               e = read_attr_from_file(get_home_gitattributes(), flags);
+       if (git_attr_global_file()) {
+               e = read_attr_from_file(git_attr_global_file(), flags);
                push_stack(stack, e, NULL, 0);
        }
 
@@ -1169,11 +1172,42 @@ static void collect_some_attrs(struct index_state *istate,
        fill(path, pathlen, basename_offset, check->stack, check->all_attrs, rem);
 }
 
+static const char *default_attr_source_tree_object_name;
+
+void set_git_attr_source(const char *tree_object_name)
+{
+       default_attr_source_tree_object_name = xstrdup(tree_object_name);
+}
+
+static void compute_default_attr_source(struct object_id *attr_source)
+{
+       if (!default_attr_source_tree_object_name)
+               default_attr_source_tree_object_name = getenv(GIT_ATTR_SOURCE_ENVIRONMENT);
+
+       if (!default_attr_source_tree_object_name || !is_null_oid(attr_source))
+               return;
+
+       if (repo_get_oid_treeish(the_repository, default_attr_source_tree_object_name, attr_source))
+               die(_("bad --attr-source or GIT_ATTR_SOURCE"));
+}
+
+static struct object_id *default_attr_source(void)
+{
+       static struct object_id attr_source;
+
+       if (is_null_oid(&attr_source))
+               compute_default_attr_source(&attr_source);
+       if (is_null_oid(&attr_source))
+               return NULL;
+       return &attr_source;
+}
+
 void git_check_attr(struct index_state *istate,
-                   const struct object_id *tree_oid, const char *path,
+                   const char *path,
                    struct attr_check *check)
 {
        int i;
+       const struct object_id *tree_oid = default_attr_source();
 
        collect_some_attrs(istate, tree_oid, path, check);
 
@@ -1186,10 +1220,11 @@ void git_check_attr(struct index_state *istate,
        }
 }
 
-void git_all_attrs(struct index_state *istate, const struct object_id *tree_oid,
+void git_all_attrs(struct index_state *istate,
                   const char *path, struct attr_check *check)
 {
        int i;
+       const struct object_id *tree_oid = default_attr_source();
 
        attr_check_reset(check);
        collect_some_attrs(istate, tree_oid, path, check);
diff --git a/attr.h b/attr.h
index 9884ea2bc60fb4816ed11222b4c820a855f22a24..2b745df4054d7a5fe5e537ac4d894ccbd199b9c4 100644 (file)
--- a/attr.h
+++ b/attr.h
@@ -45,7 +45,7 @@
  * const char *path;
  *
  * setup_check();
- * git_check_attr(&the_index, tree_oid, path, check);
+ * git_check_attr(&the_index, path, check);
  * ------------
  *
  * - Act on `.value` member of the result, left in `check->items[]`:
 #define ATTR_MAX_FILE_SIZE (100 * 1024 * 1024)
 
 struct index_state;
-struct object_id;
 
 /**
  * An attribute is an opaque object that is identified by its name. Pass the
@@ -135,6 +134,12 @@ struct git_attr;
 struct all_attrs_item;
 struct attr_stack;
 
+/*
+ * The textual object name for the tree-ish used by git_check_attr()
+ * to read attributes from (instead of from the working tree).
+ */
+void set_git_attr_source(const char *);
+
 /*
  * Given a string, return the gitattribute object that
  * corresponds to it.
@@ -203,14 +208,14 @@ void attr_check_free(struct attr_check *check);
 const char *git_attr_name(const struct git_attr *);
 
 void git_check_attr(struct index_state *istate,
-                   const struct object_id *tree_oid, const char *path,
+                   const char *path,
                    struct attr_check *check);
 
 /*
  * Retrieve all attributes that apply to the specified path.
  * check holds the attributes and their values.
  */
-void git_all_attrs(struct index_state *istate, const struct object_id *tree_oid,
+void git_all_attrs(struct index_state *istate,
                   const char *path, struct attr_check *check);
 
 enum git_attr_direction {
@@ -222,4 +227,13 @@ void git_attr_set_direction(enum git_attr_direction new_direction);
 
 void attr_start(void);
 
+/* Return the system gitattributes file. */
+const char *git_attr_system_file(void);
+
+/* Return the global gitattributes file, if any. */
+const char *git_attr_global_file(void);
+
+/* Return whether the system gitattributes file is enabled and should be used. */
+int git_attr_system_is_enabled(void);
+
 #endif /* ATTR_H */
index 6ccf46bc197e8cce014421f803e07e1f8f9d4963..44e76bd90af76938f04f7e7b0df8818d4bb81e61 100644 (file)
--- a/banned.h
+++ b/banned.h
 #define strncpy(x,y,n) BANNED(strncpy)
 #undef strncat
 #define strncat(x,y,n) BANNED(strncat)
+#undef strtok
+#define strtok(x,y) BANNED(strtok)
+#undef strtok_r
+#define strtok_r(x,y,z) BANNED(strtok_r)
 
 #undef sprintf
 #undef vsprintf
index 5ca601ee14fd2ab3b78577aa22a5db778bc7fbe0..bbacdca31b3bc3c1020d49e8e0c4c539a1232cbc 100644 (file)
--- a/base85.c
+++ b/base85.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "base85.h"
 
 #undef DEBUG_85
 
diff --git a/base85.h b/base85.h
new file mode 100644 (file)
index 0000000..c835086
--- /dev/null
+++ b/base85.h
@@ -0,0 +1,7 @@
+#ifndef BASE85_H
+#define BASE85_H
+
+int decode_85(char *dst, const char *line, int linelen);
+void encode_85(char *buf, const unsigned char *data, int bytes);
+
+#endif /* BASE85_H */
index 0a5f2ed35467e47f80a7c1968b5c7de3035ed64a..1be8e0a2711df9d29c1ba903fd4e8901379ea406 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "commit.h"
 #include "diff.h"
@@ -17,7 +17,9 @@
 #include "strvec.h"
 #include "commit-slab.h"
 #include "commit-reach.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "dir.h"
 
 static struct oid_array good_revs;
diff --git a/blame.c b/blame.c
index 2c427bcdbfdddecc7835b2628caca279a7925b99..141756975bf5a58a1744eda78c1750d9d949272f 100644 (file)
--- a/blame.c
+++ b/blame.c
@@ -1,14 +1,18 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "cache-tree.h"
 #include "mergesort.h"
+#include "convert.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "gettext.h"
 #include "hex.h"
+#include "path.h"
+#include "read-cache.h"
 #include "setup.h"
 #include "tag.h"
+#include "trace2.h"
 #include "blame.h"
 #include "alloc.h"
 #include "commit-slab.h"
@@ -206,8 +210,12 @@ static struct commit *fake_working_tree_commit(struct repository *r,
 
        origin = make_origin(commit, path);
 
-       ident = fmt_ident("Not Committed Yet", "not.committed.yet",
-                       WANT_BLANK_IDENT, NULL, 0);
+       if (contents_from)
+               ident = fmt_ident("External file (--contents)", "external.file",
+                                 WANT_BLANK_IDENT, NULL, 0);
+       else
+               ident = fmt_ident("Not Committed Yet", "not.committed.yet",
+                                 WANT_BLANK_IDENT, NULL, 0);
        strbuf_addstr(&msg, "tree 0000000000000000000000000000000000000000\n");
        for (parent = commit->parents; parent; parent = parent->next)
                strbuf_addf(&msg, "parent %s\n",
@@ -2798,7 +2806,9 @@ void setup_scoreboard(struct blame_scoreboard *sb,
                        parent_oid = &head_oid;
                }
 
-               setup_work_tree();
+               if (!sb->contents_from)
+                       setup_work_tree();
+
                sb->final = fake_working_tree_commit(sb->repo,
                                                     &sb->revs->diffopt,
                                                     sb->path, sb->contents_from,
diff --git a/blame.h b/blame.h
index b60d1d81e3032acc5df2191321202b13eecc81fe..31ddc85f19e359908710162ad4aa144784dec16b 100644 (file)
--- a/blame.h
+++ b/blame.h
@@ -2,6 +2,7 @@
 #define BLAME_H
 
 #include "commit.h"
+#include "oidset.h"
 #include "xdiff-interface.h"
 #include "revision.h"
 #include "prio-queue.h"
diff --git a/bloom.c b/bloom.c
index d0730525da51f783e0f72f502a62db4407bd7ad9..aef6b5fea2d18f521b4812bd017fe685f635be47 100644 (file)
--- a/bloom.c
+++ b/bloom.c
@@ -6,6 +6,7 @@
 #include "hashmap.h"
 #include "commit-graph.h"
 #include "commit.h"
+#include "commit-slab.h"
 
 define_commit_slab(bloom_filter_slab, struct bloom_filter);
 
index 99a0e7889e42226ce8230e8d0472268bcfec7fe5..3e4684f79f693059a6272465dd983e149aee5eb9 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -1,13 +1,16 @@
 #include "git-compat-util.h"
-#include "cache.h"
+#include "advice.h"
 #include "config.h"
 #include "branch.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-name.h"
+#include "path.h"
 #include "refs.h"
 #include "refspec.h"
 #include "remote.h"
+#include "repository.h"
 #include "sequencer.h"
 #include "commit.h"
 #include "worktree.h"
@@ -35,7 +38,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)
        if (!remote_find_tracking(remote, &tracking->spec)) {
                switch (++tracking->matches) {
                case 1:
-                       string_list_append(tracking->srcs, tracking->spec.src);
+                       string_list_append_nodup(tracking->srcs, tracking->spec.src);
                        tracking->remote = remote->name;
                        break;
                case 2:
@@ -231,7 +234,7 @@ static int inherit_tracking(struct tracking *tracking, const char *orig_ref)
                return -1;
        }
 
-       tracking->remote = xstrdup(branch->remote_name);
+       tracking->remote = branch->remote_name;
        for (i = 0; i < branch->merge_nr; i++)
                string_list_append(tracking->srcs, branch->merge_name[i]);
        return 0;
@@ -331,7 +334,7 @@ static void setup_tracking(const char *new_ref, const char *orig_ref,
                if (!skip_prefix(tracking.srcs->items[0].string,
                                 "refs/heads/", &tracked_branch) ||
                    strcmp(tracked_branch, new_ref))
-                       return;
+                       goto cleanup;
        }
 
        if (tracking.srcs->nr < 1)
@@ -468,7 +471,7 @@ int validate_new_branchname(const char *name, struct strbuf *ref, int force)
 
        if ((path = branch_checked_out(ref->buf)))
                die(_("cannot force update the branch '%s' "
-                     "checked out at '%s'"),
+                     "used by worktree at '%s'"),
                    ref->buf + strlen("refs/heads/"), path);
 
        return 1;
@@ -478,9 +481,12 @@ static int check_tracking_branch(struct remote *remote, void *cb_data)
 {
        char *tracking_branch = cb_data;
        struct refspec_item query;
+       int res;
        memset(&query, 0, sizeof(struct refspec_item));
        query.dst = tracking_branch;
-       return !remote_find_tracking(remote, &query);
+       res = !remote_find_tracking(remote, &query);
+       free(query.src);
+       return res;
 }
 
 static int validate_remote_tracking_branch(char *ref)
@@ -636,9 +642,10 @@ void dwim_and_setup_tracking(struct repository *r, const char *new_ref,
                             const char *orig_ref, enum branch_track track,
                             int quiet)
 {
-       char *real_orig_ref;
+       char *real_orig_ref = NULL;
        dwim_branch_start(r, orig_ref, track, &real_orig_ref, NULL);
        setup_tracking(new_ref, real_orig_ref, track, quiet);
+       free(real_orig_ref);
 }
 
 /**
@@ -838,30 +845,3 @@ void die_if_checked_out(const char *branch, int ignore_current_worktree)
 
        free_worktrees(worktrees);
 }
-
-int replace_each_worktree_head_symref(const char *oldref, const char *newref,
-                                     const char *logmsg)
-{
-       int ret = 0;
-       struct worktree **worktrees = get_worktrees();
-       int i;
-
-       for (i = 0; worktrees[i]; i++) {
-               struct ref_store *refs;
-
-               if (worktrees[i]->is_detached)
-                       continue;
-               if (!worktrees[i]->head_ref)
-                       continue;
-               if (strcmp(oldref, worktrees[i]->head_ref))
-                       continue;
-
-               refs = get_worktree_ref_store(worktrees[i]);
-               if (refs_create_symref(refs, "HEAD", newref, logmsg))
-                       ret = error(_("HEAD of working tree %s is not updated"),
-                                   worktrees[i]->path);
-       }
-
-       free_worktrees(worktrees);
-       return ret;
-}
index ef56103c050fa09d6087e2bade7f24240d79ae04..30c01aed73d7b7751b87cfb4c5cd55387c8b8bb9 100644 (file)
--- a/branch.h
+++ b/branch.h
@@ -155,12 +155,4 @@ int read_branch_desc(struct strbuf *, const char *branch_name);
  */
 void die_if_checked_out(const char *branch, int ignore_current_worktree);
 
-/*
- * Update all per-worktree HEADs pointing at the old ref to point the new ref.
- * This will be used when renaming a branch. Returns 0 if successful, non-zero
- * otherwise.
- */
-int replace_each_worktree_head_symref(const char *oldref, const char *newref,
-                                     const char *logmsg);
-
 #endif
index cb0db676814d8a43dd3e5cb3a7a729676f5a429d..d560baa6618ac9e021dc7f957b942466ac6e35b3 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -2,9 +2,6 @@
 #define BUILTIN_H
 
 #include "git-compat-util.h"
-#include "strbuf.h"
-#include "cache.h"
-#include "commit.h"
 
 /*
  * builtin API
index f12054d9be113b5fa63bd0df1445ae59343d4cd5..4b0dd798df5909905f7be69479d4b3b2ce1b19ae 100644 (file)
@@ -4,10 +4,11 @@
  * Copyright (C) 2006 Linus Torvalds
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "advice.h"
+#include "config.h"
 #include "lockfile.h"
+#include "editor.h"
 #include "dir.h"
 #include "gettext.h"
 #include "pathspec.h"
 #include "cache-tree.h"
 #include "run-command.h"
 #include "parse-options.h"
+#include "path.h"
+#include "preload-index.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "read-cache.h"
+#include "repository.h"
 #include "revision.h"
 #include "bulk-checkin.h"
 #include "strvec.h"
@@ -34,11 +39,6 @@ static int pathspec_file_nul;
 static int include_sparse;
 static const char *pathspec_from_file;
 
-struct update_callback_data {
-       int flags;
-       int add_errors;
-};
-
 static int chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
 {
        int i, ret = 0;
@@ -67,95 +67,6 @@ static int chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
        return ret;
 }
 
-static int fix_unmerged_status(struct diff_filepair *p,
-                              struct update_callback_data *data)
-{
-       if (p->status != DIFF_STATUS_UNMERGED)
-               return p->status;
-       if (!(data->flags & ADD_CACHE_IGNORE_REMOVAL) && !p->two->mode)
-               /*
-                * This is not an explicit add request, and the
-                * path is missing from the working tree (deleted)
-                */
-               return DIFF_STATUS_DELETED;
-       else
-               /*
-                * Either an explicit add request, or path exists
-                * in the working tree.  An attempt to explicitly
-                * add a path that does not exist in the working tree
-                * will be caught as an error by the caller immediately.
-                */
-               return DIFF_STATUS_MODIFIED;
-}
-
-static void update_callback(struct diff_queue_struct *q,
-                           struct diff_options *opt UNUSED, void *cbdata)
-{
-       int i;
-       struct update_callback_data *data = cbdata;
-
-       for (i = 0; i < q->nr; i++) {
-               struct diff_filepair *p = q->queue[i];
-               const char *path = p->one->path;
-
-               if (!include_sparse && !path_in_sparse_checkout(path, &the_index))
-                       continue;
-
-               switch (fix_unmerged_status(p, data)) {
-               default:
-                       die(_("unexpected diff status %c"), p->status);
-               case DIFF_STATUS_MODIFIED:
-               case DIFF_STATUS_TYPE_CHANGED:
-                       if (add_file_to_index(&the_index, path, data->flags)) {
-                               if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
-                                       die(_("updating files failed"));
-                               data->add_errors++;
-                       }
-                       break;
-               case DIFF_STATUS_DELETED:
-                       if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
-                               break;
-                       if (!(data->flags & ADD_CACHE_PRETEND))
-                               remove_file_from_index(&the_index, path);
-                       if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
-                               printf(_("remove '%s'\n"), path);
-                       break;
-               }
-       }
-}
-
-int add_files_to_cache(const char *prefix,
-                      const struct pathspec *pathspec, int flags)
-{
-       struct update_callback_data data;
-       struct rev_info rev;
-
-       memset(&data, 0, sizeof(data));
-       data.flags = flags;
-
-       repo_init_revisions(the_repository, &rev, prefix);
-       setup_revisions(0, NULL, &rev, NULL);
-       if (pathspec)
-               copy_pathspec(&rev.prune_data, pathspec);
-       rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
-       rev.diffopt.format_callback = update_callback;
-       rev.diffopt.format_callback_data = &data;
-       rev.diffopt.flags.override_submodule_config = 1;
-       rev.max_count = 0; /* do not compare unmerged paths with stage #2 */
-
-       /*
-        * Use an ODB transaction to optimize adding multiple objects.
-        * This function is invoked from commands other than 'add', which
-        * may not have their own transaction active.
-        */
-       begin_odb_transaction();
-       run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
-       end_odb_transaction();
-
-       release_revisions(&rev);
-       return !!data.add_errors;
-}
-
 static int renormalize_tracked_files(const struct pathspec *pathspec, int flags)
 {
        int i, retval = 0;
@@ -355,7 +266,8 @@ static struct option builtin_add_options[] = {
        OPT_END(),
 };
 
-static int add_config(const char *var, const char *value, void *cb)
+static int add_config(const char *var, const char *value,
+                     const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "add.ignoreerrors") ||
            !strcmp(var, "add.ignore-errors")) {
@@ -363,7 +275,10 @@ static int add_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       if (git_color_config(var, value, cb) < 0)
+               return -1;
+
+       return git_default_config(var, value, ctx, cb);
 }
 
 static const char embedded_advice[] = N_(
@@ -638,7 +553,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
        if (add_renormalize)
                exit_status |= renormalize_tracked_files(&pathspec, flags);
        else
-               exit_status |= add_files_to_cache(prefix, &pathspec, flags);
+               exit_status |= add_files_to_cache(the_repository, prefix,
+                                                 &pathspec, include_sparse,
+                                                 flags);
 
        if (add_new_files)
                exit_status |= add_files(&dir, flags);
index cd1e20f24e542360fbc7bcb7b6ada156d13bf89d..8bde034fae68bcdd8fc0f0b9b61837d29608d62b 100644 (file)
@@ -4,10 +4,11 @@
  * Based on git-am.sh by Junio C Hamano.
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
+#include "advice.h"
 #include "config.h"
-#include "builtin.h"
+#include "editor.h"
 #include "environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
@@ -26,6 +27,8 @@
 #include "diffcore.h"
 #include "unpack-trees.h"
 #include "branch.h"
+#include "object-name.h"
+#include "preload-index.h"
 #include "sequencer.h"
 #include "revision.h"
 #include "merge-recursive.h"
 #include "apply.h"
 #include "string-list.h"
 #include "packfile.h"
+#include "pager.h"
+#include "path.h"
 #include "repository.h"
 #include "pretty.h"
-#include "wrapper.h"
 
 /**
  * Returns the length of the first line of msg.
@@ -782,7 +786,7 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *state,
  * A split_mail_conv() callback that converts an StGit patch to an RFC2822
  * message suitable for parsing with git-mailinfo.
  */
-static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr)
+static int stgit_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
 {
        struct strbuf sb = STRBUF_INIT;
        int subject_printed = 0;
@@ -865,7 +869,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
  * A split_patches_conv() callback that converts a mercurial patch to a RFC2822
  * message suitable for parsing with git-mailinfo.
  */
-static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr)
+static int hg_patch_to_mail(FILE *out, FILE *in, int keep_cr UNUSED)
 {
        struct strbuf sb = STRBUF_INIT;
        int rc = 0;
@@ -1279,7 +1283,7 @@ static int parse_mail(struct am_state *state, const char *mail)
 
        strbuf_addstr(&msg, "\n\n");
        strbuf_addbuf(&msg, &mi.log_message);
-       strbuf_stripspace(&msg, 0);
+       strbuf_stripspace(&msg, '\0');
 
        assert(!state->author_name);
        state->author_name = strbuf_detach(&author_name, NULL);
@@ -2343,12 +2347,9 @@ int cmd_am(int argc, const char **argv, const char *prefix)
                        N_("pass -b flag to git-mailinfo"), KEEP_NON_PATCH),
                OPT_BOOL('m', "message-id", &state.message_id,
                        N_("pass -m flag to git-mailinfo")),
-               OPT_SET_INT_F(0, "keep-cr", &keep_cr,
-                       N_("pass --keep-cr flag to git-mailsplit for mbox format"),
-                       1, PARSE_OPT_NONEG),
-               OPT_SET_INT_F(0, "no-keep-cr", &keep_cr,
-                       N_("do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"),
-                       0, PARSE_OPT_NONEG),
+               OPT_SET_INT(0, "keep-cr", &keep_cr,
+                           N_("pass --keep-cr flag to git-mailsplit for mbox format"),
+                           1),
                OPT_BOOL('c', "scissors", &state.scissors,
                        N_("strip everything before a scissors line")),
                OPT_CALLBACK_F(0, "quoted-cr", &state.quoted_cr, N_("action"),
index fe72c0ec3eb08794c0d68eebd1c0b935bc0f527d..c18b7ea5d3da4aa66d82c9fa0e911274308ad598 100644 (file)
@@ -1,7 +1,7 @@
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "repository.h"
 #include "apply.h"
 
 static const char * const apply_usage[] = {
index d13934f1a8028fbc42c24be863d6c665bc91d75c..90761fdfee0f58f0d2d8cca9c7b0bcd6e0ee7fe9 100644 (file)
@@ -2,13 +2,13 @@
  * Copyright (c) 2006 Franck Bui-Huu
  * Copyright (c) 2006 Rene Scharfe
  */
-#include "cache.h"
 #include "builtin.h"
 #include "archive.h"
 #include "gettext.h"
 #include "transport.h"
 #include "parse-options.h"
 #include "pkt-line.h"
+#include "repository.h"
 #include "sideband.h"
 
 static void create_output_file(const char *output_file)
index 26f07357a03ead1e0bba6946c4f3afb68ed60eeb..65478ef40f54e35cbed33234209fc3fac8b4e99b 100644 (file)
@@ -1,18 +1,20 @@
 #include "builtin.h"
-#include "cache.h"
+#include "copy.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "bisect.h"
 #include "refs.h"
 #include "dir.h"
 #include "strvec.h"
 #include "run-command.h"
+#include "oid-array.h"
+#include "path.h"
 #include "prompt.h"
 #include "quote.h"
 #include "revision.h"
-#include "wrapper.h"
 
 static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
 static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
index a8d2114adc90f84de3610019d3599192f0be4f4d..9c987d656756e8f436e3b1cb818306097e402e4c 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "color.h"
 #include "builtin.h"
@@ -28,7 +27,9 @@
 #include "line-log.h"
 #include "dir.h"
 #include "progress.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "pager.h"
 #include "blame.h"
 #include "refs.h"
 #include "setup.h"
@@ -692,7 +693,8 @@ static const char *add_prefix(const char *prefix, const char *path)
        return prefix_path(prefix, prefix ? strlen(prefix) : 0, path);
 }
 
-static int git_blame_config(const char *var, const char *value, void *cb)
+static int git_blame_config(const char *var, const char *value,
+                           const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "blame.showroot")) {
                show_root = git_config_bool(var, value);
@@ -765,7 +767,7 @@ static int git_blame_config(const char *var, const char *value, void *cb)
        if (userdiff_config(var, value) < 0)
                return -1;
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static int blame_copy_callback(const struct option *option, const char *arg, int unset)
index bb7e1ac206373311c217b66002c93ba0c1ae4db2..08da650516037e2e18b2e99831562db533111254 100644 (file)
@@ -5,18 +5,20 @@
  * Based on git-branch.sh by Junio C Hamano.
  */
 
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "color.h"
+#include "editor.h"
 #include "environment.h"
 #include "refs.h"
 #include "commit.h"
-#include "builtin.h"
 #include "gettext.h"
+#include "object-name.h"
 #include "remote.h"
 #include "parse-options.h"
 #include "branch.h"
 #include "diff.h"
+#include "path.h"
 #include "revision.h"
 #include "string-list.h"
 #include "column.h"
@@ -26,7 +28,6 @@
 #include "worktree.h"
 #include "help.h"
 #include "commit-reach.h"
-#include "wrapper.h"
 
 static const char * const builtin_branch_usage[] = {
        N_("git branch [<options>] [-r | -a] [--merged] [--no-merged]"),
@@ -81,7 +82,8 @@ static unsigned int colopts;
 
 define_list_config_array(color_branch_slots);
 
-static int git_branch_config(const char *var, const char *value, void *cb)
+static int git_branch_config(const char *var, const char *value,
+                            const struct config_context *ctx, void *cb)
 {
        const char *slot_name;
 
@@ -115,7 +117,10 @@ static int git_branch_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_color_default_config(var, value, cb);
+       if (git_color_config(var, value, cb) < 0)
+               return -1;
+
+       return git_default_config(var, value, ctx, cb);
 }
 
 static const char *branch_get_color(enum color_branch ix)
@@ -364,17 +369,8 @@ static const char *quote_literal_for_format(const char *s)
        static struct strbuf buf = STRBUF_INIT;
 
        strbuf_reset(&buf);
-       while (*s) {
-               const char *ep = strchrnul(s, '%');
-               if (s < ep)
-                       strbuf_add(&buf, s, ep - s);
-               if (*ep == '%') {
-                       strbuf_addstr(&buf, "%%");
-                       s = ep + 1;
-               } else {
-                       s = ep;
-               }
-       }
+       while (strbuf_expand_step(&buf, &s))
+               strbuf_addstr(&buf, "%%");
        return buf.buf;
 }
 
@@ -510,9 +506,9 @@ static void print_current_branch_name(void)
                die(_("HEAD (%s) points outside of refs/heads/"), refname);
 }
 
-static void reject_rebase_or_bisect_branch(const char *target)
+static void reject_rebase_or_bisect_branch(struct worktree **worktrees,
+                                          const char *target)
 {
-       struct worktree **worktrees = get_worktrees();
        int i;
 
        for (i = 0; worktrees[i]; i++) {
@@ -529,17 +525,50 @@ static void reject_rebase_or_bisect_branch(const char *target)
                        die(_("Branch %s is being bisected at %s"),
                            target, wt->path);
        }
+}
 
-       free_worktrees(worktrees);
+/*
+ * Update all per-worktree HEADs pointing at the old ref to point the new ref.
+ * This will be used when renaming a branch. Returns 0 if successful, non-zero
+ * otherwise.
+ */
+static int replace_each_worktree_head_symref(struct worktree **worktrees,
+                                            const char *oldref, const char *newref,
+                                            const char *logmsg)
+{
+       int ret = 0;
+       int i;
+
+       for (i = 0; worktrees[i]; i++) {
+               struct ref_store *refs;
+
+               if (worktrees[i]->is_detached)
+                       continue;
+               if (!worktrees[i]->head_ref)
+                       continue;
+               if (strcmp(oldref, worktrees[i]->head_ref))
+                       continue;
+
+               refs = get_worktree_ref_store(worktrees[i]);
+               if (refs_create_symref(refs, "HEAD", newref, logmsg))
+                       ret = error(_("HEAD of working tree %s is not updated"),
+                                   worktrees[i]->path);
+       }
+
+       return ret;
 }
 
+#define IS_HEAD 1
+#define IS_ORPHAN 2
+
 static void copy_or_rename_branch(const char *oldname, const char *newname, int copy, int force)
 {
        struct strbuf oldref = STRBUF_INIT, newref = STRBUF_INIT, logmsg = STRBUF_INIT;
        struct strbuf oldsection = STRBUF_INIT, newsection = STRBUF_INIT;
        const char *interpreted_oldname = NULL;
        const char *interpreted_newname = NULL;
-       int recovery = 0;
+       int recovery = 0, oldref_usage = 0;
+       struct worktree **worktrees = get_worktrees();
 
        if (strbuf_check_branch_ref(&oldref, oldname)) {
                /*
@@ -552,8 +581,19 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
                        die(_("Invalid branch name: '%s'"), oldname);
        }
 
-       if ((copy || strcmp(head, oldname)) && !ref_exists(oldref.buf)) {
-               if (copy && !strcmp(head, oldname))
+       for (int i = 0; worktrees[i]; i++) {
+               struct worktree *wt = worktrees[i];
+
+               if (wt->head_ref && !strcmp(oldref.buf, wt->head_ref)) {
+                       oldref_usage |= IS_HEAD;
+                       if (is_null_oid(&wt->head_oid))
+                               oldref_usage |= IS_ORPHAN;
+                       break;
+               }
+       }
+
+       if ((copy || !(oldref_usage & IS_HEAD)) && !ref_exists(oldref.buf)) {
+               if (oldref_usage & IS_HEAD)
                        die(_("No commit on branch '%s' yet."), oldname);
                else
                        die(_("No branch named '%s'."), oldname);
@@ -568,7 +608,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
        else
                validate_new_branchname(newname, &newref, force);
 
-       reject_rebase_or_bisect_branch(oldref.buf);
+       reject_rebase_or_bisect_branch(worktrees, oldref.buf);
 
        if (!skip_prefix(oldref.buf, "refs/heads/", &interpreted_oldname) ||
            !skip_prefix(newref.buf, "refs/heads/", &interpreted_newname)) {
@@ -582,8 +622,7 @@ 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 &&
-           (!head || strcmp(oldname, head) || !is_null_oid(&head_oid)) &&
+       if (!copy && !(oldref_usage & IS_ORPHAN) &&
            rename_ref(oldref.buf, newref.buf, logmsg.buf))
                die(_("Branch rename failed"));
        if (copy && copy_existing_ref(oldref.buf, newref.buf, logmsg.buf))
@@ -598,8 +637,9 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
                                interpreted_oldname);
        }
 
-       if (!copy &&
-           replace_each_worktree_head_symref(oldref.buf, newref.buf, logmsg.buf))
+       if (!copy && (oldref_usage & IS_HEAD) &&
+           replace_each_worktree_head_symref(worktrees, oldref.buf, newref.buf,
+                                             logmsg.buf))
                die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
 
        strbuf_release(&logmsg);
@@ -614,6 +654,7 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
        strbuf_release(&newref);
        strbuf_release(&oldsection);
        strbuf_release(&newsection);
+       free_worktrees(worktrees);
 }
 
 static GIT_PATH_FUNC(edit_description, "EDIT_DESCRIPTION")
@@ -627,7 +668,7 @@ static int edit_branch_description(const char *branch_name)
        exists = !read_branch_desc(&buf, branch_name);
        if (!buf.len || buf.buf[buf.len-1] != '\n')
                strbuf_addch(&buf, '\n');
-       strbuf_commented_addf(&buf,
+       strbuf_commented_addf(&buf, comment_line_char,
                    _("Please edit the description for the branch\n"
                      "  %s\n"
                      "Lines starting with '%c' will be stripped.\n"),
@@ -638,7 +679,7 @@ static int edit_branch_description(const char *branch_name)
                strbuf_release(&buf);
                return -1;
        }
-       strbuf_stripspace(&buf, 1);
+       strbuf_stripspace(&buf, comment_line_char);
 
        strbuf_addf(&name, "branch.%s.description", branch_name);
        if (buf.len || exists)
@@ -660,7 +701,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
        int reflog = 0, quiet = 0, icase = 0, force = 0,
            recurse_submodules_explicit = 0;
        enum branch_track track;
-       struct ref_filter filter;
+       struct ref_filter filter = REF_FILTER_INIT;
        static struct ref_sorting *sorting;
        struct string_list sorting_options = STRING_LIST_INIT_DUP;
        struct ref_format format = REF_FORMAT_INIT;
@@ -679,8 +720,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                OPT_STRING('u', "set-upstream-to", &new_upstream, N_("upstream"), N_("change the upstream info")),
                OPT_BOOL(0, "unset-upstream", &unset_upstream, N_("unset the upstream info")),
                OPT__COLOR(&branch_use_color, N_("use colored output")),
-               OPT_SET_INT('r', "remotes",     &filter.kind, N_("act on remote-tracking branches"),
-                       FILTER_REFS_REMOTES),
+               OPT_SET_INT_F('r', "remotes",     &filter.kind, N_("act on remote-tracking branches"),
+                             FILTER_REFS_REMOTES,
+                             PARSE_OPT_NONEG),
                OPT_CONTAINS(&filter.with_commit, N_("print only branches that contain the commit")),
                OPT_NO_CONTAINS(&filter.no_commit, N_("print only branches that don't contain the commit")),
                OPT_WITH(&filter.with_commit, N_("print only branches that contain the commit")),
@@ -688,8 +730,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                OPT__ABBREV(&filter.abbrev),
 
                OPT_GROUP(N_("Specific git-branch actions:")),
-               OPT_SET_INT('a', "all", &filter.kind, N_("list both remote-tracking and local branches"),
-                       FILTER_REFS_REMOTES | FILTER_REFS_BRANCHES),
+               OPT_SET_INT_F('a', "all", &filter.kind, N_("list both remote-tracking and local branches"),
+                             FILTER_REFS_REMOTES | FILTER_REFS_BRANCHES,
+                             PARSE_OPT_NONEG),
                OPT_BIT('d', "delete", &delete, N_("delete fully merged branch"), 1),
                OPT_BIT('D', NULL, &delete, N_("delete branch (even if not merged)"), 2),
                OPT_BIT('m', "move", &rename, N_("move/rename a branch and its reflog"), 1),
@@ -718,7 +761,6 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 
        setup_ref_filter_porcelain_msg();
 
-       memset(&filter, 0, sizeof(filter));
        filter.kind = FILTER_REFS_BRANCHES;
        filter.abbrev = -1;
 
@@ -785,6 +827,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
        if (list)
                setup_auto_pager("branch", 1);
 
+       UNLEAK(sorting_options);
+
        if (delete) {
                if (!argc)
                        die(_("branch name required"));
@@ -812,6 +856,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                print_columns(&output, colopts, NULL);
                string_list_clear(&output, 0);
                ref_sorting_release(sorting);
+               ref_filter_clear(&filter);
                return 0;
        } else if (edit_description) {
                const char *branch_name;
@@ -832,7 +877,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 
                strbuf_addf(&branch_ref, "refs/heads/%s", branch_name);
                if (!ref_exists(branch_ref.buf))
-                       error((!argc || !strcmp(head, branch_name))
+                       error((!argc || branch_checked_out(branch_ref.buf))
                              ? _("No commit on branch '%s' yet.")
                              : _("No branch named '%s'."),
                              branch_name);
@@ -877,7 +922,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                }
 
                if (!ref_exists(branch->refname)) {
-                       if (!argc || !strcmp(head, branch->name))
+                       if (!argc || branch_checked_out(branch->refname))
                                die(_("No commit on branch '%s' yet."), branch->name);
                        die(_("branch '%s' does not exist"), branch->name);
                }
index 52955e1d389bbd92628a0329a17998a0b8513cfd..d2ae5c305db82cda78851196411f6437f4abbda9 100644 (file)
@@ -1,5 +1,6 @@
 #include "builtin.h"
 #include "abspath.h"
+#include "editor.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "strbuf.h"
@@ -8,8 +9,8 @@
 #include "hook.h"
 #include "hook-list.h"
 #include "diagnose.h"
+#include "object-file.h"
 #include "setup.h"
-#include "wrapper.h"
 
 static void get_system_info(struct strbuf *sys_info)
 {
index e68fc83d94323582d3eb46a1cc96918c04f323db..3ad11dc5d0548727da0f27e04563a8d947207f74 100644 (file)
@@ -4,7 +4,8 @@
 #include "setup.h"
 #include "strvec.h"
 #include "parse-options.h"
-#include "cache.h"
+#include "pkt-line.h"
+#include "repository.h"
 #include "bundle.h"
 
 /*
@@ -67,42 +68,36 @@ static int parse_options_cmd_bundle(int argc,
 }
 
 static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
-       int all_progress_implied = 1;
-       int progress = isatty(STDERR_FILENO);
-       struct strvec pack_opts;
+       struct strvec pack_opts = STRVEC_INIT;
        int version = -1;
        int ret;
        struct option options[] = {
-               OPT_SET_INT('q', "quiet", &progress,
-                           N_("do not show progress meter"), 0),
-               OPT_SET_INT(0, "progress", &progress,
-                           N_("show progress meter"), 1),
-               OPT_SET_INT_F(0, "all-progress", &progress,
-                             N_("historical; same as --progress"), 2,
-                             PARSE_OPT_HIDDEN),
-               OPT_HIDDEN_BOOL(0, "all-progress-implied",
-                               &all_progress_implied,
-                               N_("historical; does nothing")),
+               OPT_PASSTHRU_ARGV('q', "quiet", &pack_opts, NULL,
+                                 N_("do not show progress meter"),
+                                 PARSE_OPT_NOARG),
+               OPT_PASSTHRU_ARGV(0, "progress", &pack_opts, NULL,
+                                 N_("show progress meter"),
+                                 PARSE_OPT_NOARG),
+               OPT_PASSTHRU_ARGV(0, "all-progress", &pack_opts, NULL,
+                                 N_("historical; same as --progress"),
+                                 PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
+               OPT_PASSTHRU_ARGV(0, "all-progress-implied", &pack_opts, NULL,
+                                 N_("historical; does nothing"),
+                                 PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
                OPT_INTEGER(0, "version", &version,
                            N_("specify bundle format version")),
                OPT_END()
        };
        char *bundle_file;
 
+       if (isatty(STDERR_FILENO))
+               strvec_push(&pack_opts, "--progress");
+       strvec_push(&pack_opts, "--all-progress-implied");
+
        argc = parse_options_cmd_bundle(argc, argv, prefix,
                        builtin_bundle_create_usage, options, &bundle_file);
        /* bundle internals use argv[1] as further parameters */
 
-       strvec_init(&pack_opts);
-       if (progress == 0)
-               strvec_push(&pack_opts, "--quiet");
-       else if (progress == 1)
-               strvec_push(&pack_opts, "--progress");
-       else if (progress == 2)
-               strvec_push(&pack_opts, "--all-progress");
-       if (progress && all_progress_implied)
-               strvec_push(&pack_opts, "--all-progress-implied");
-
        if (!startup_info->have_repository)
                die(_("Need a repository to create a bundle."));
        ret = !!create_bundle(the_repository, bundle_file, argc, argv, &pack_opts, version);
index 04d4bb6c77772fa185c40573fa5b231501709112..694c8538df2ff8200e214351e5e857530d2a1191 100644 (file)
@@ -4,10 +4,9 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
-#include "alloc.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
+#include "convert.h"
 #include "diff.h"
 #include "environment.h"
 #include "gettext.h"
@@ -19,7 +18,9 @@
 #include "tree-walk.h"
 #include "oid-array.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
 #include "mailmap.h"
@@ -39,7 +40,8 @@ struct batch_options {
        int all_objects;
        int unordered;
        int transform_mode; /* may be 'w' or 'c' for --filters or --textconv */
-       int nul_terminated;
+       char input_delim;
+       char output_delim;
        const char *format;
 };
 
@@ -306,10 +308,8 @@ static int is_atom(const char *atom, const char *s, int slen)
 }
 
 static void expand_atom(struct strbuf *sb, const char *atom, int len,
-                       void *vdata)
+                       struct expand_data *data)
 {
-       struct expand_data *data = vdata;
-
        if (is_atom("objectname", atom, len)) {
                if (!data->mark_query)
                        strbuf_addstr(sb, oid_to_hex(&data->oid));
@@ -343,19 +343,21 @@ static void expand_atom(struct strbuf *sb, const char *atom, int len,
                die("unknown format element: %.*s", len, atom);
 }
 
-static size_t expand_format(struct strbuf *sb, const char *start, void *data)
+static void expand_format(struct strbuf *sb, const char *start,
+                         struct expand_data *data)
 {
-       const char *end;
-
-       if (*start != '(')
-               return 0;
-       end = strchr(start + 1, ')');
-       if (!end)
-               die("format element '%s' does not end in ')'", start);
-
-       expand_atom(sb, start + 1, end - start - 1, data);
-
-       return end - start + 1;
+       while (strbuf_expand_step(sb, &start)) {
+               const char *end;
+
+               if (skip_prefix(start, "%", &start) || *start != '(')
+                       strbuf_addch(sb, '%');
+               else if (!(end = strchr(start + 1, ')')))
+                       die("format element '%s' does not end in ')'", start);
+               else {
+                       expand_atom(sb, start + 1, end - start - 1, data);
+                       start = end + 1;
+               }
+       }
 }
 
 static void batch_write(struct batch_options *opt, const void *data, int len)
@@ -434,11 +436,12 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
        }
 }
 
-static void print_default_format(struct strbuf *scratch, struct expand_data *data)
+static void print_default_format(struct strbuf *scratch, struct expand_data *data,
+                                struct batch_options *opt)
 {
-       strbuf_addf(scratch, "%s %s %"PRIuMAX"\n", oid_to_hex(&data->oid),
+       strbuf_addf(scratch, "%s %s %"PRIuMAX"%c", oid_to_hex(&data->oid),
                    type_name(data->type),
-                   (uintmax_t)data->size);
+                   (uintmax_t)data->size, opt->output_delim);
 }
 
 /*
@@ -467,8 +470,8 @@ static void batch_object_write(const char *obj_name,
                                                       &data->oid, &data->info,
                                                       OBJECT_INFO_LOOKUP_REPLACE);
                if (ret < 0) {
-                       printf("%s missing\n",
-                              obj_name ? obj_name : oid_to_hex(&data->oid));
+                       printf("%s missing%c",
+                              obj_name ? obj_name : oid_to_hex(&data->oid), opt->output_delim);
                        fflush(stdout);
                        return;
                }
@@ -489,17 +492,17 @@ static void batch_object_write(const char *obj_name,
        strbuf_reset(scratch);
 
        if (!opt->format) {
-               print_default_format(scratch, data);
+               print_default_format(scratch, data, opt);
        } else {
-               strbuf_expand(scratch, opt->format, expand_format, data);
-               strbuf_addch(scratch, '\n');
+               expand_format(scratch, opt->format, data);
+               strbuf_addch(scratch, opt->output_delim);
        }
 
        batch_write(opt, scratch->buf, scratch->len);
 
        if (opt->batch_mode == BATCH_MODE_CONTENTS) {
                print_object_or_die(opt, data);
-               batch_write(opt, "\n", 1);
+               batch_write(opt, &opt->output_delim, 1);
        }
 }
 
@@ -517,22 +520,25 @@ static void batch_one_object(const char *obj_name,
        if (result != FOUND) {
                switch (result) {
                case MISSING_OBJECT:
-                       printf("%s missing\n", obj_name);
+                       printf("%s missing%c", obj_name, opt->output_delim);
                        break;
                case SHORT_NAME_AMBIGUOUS:
-                       printf("%s ambiguous\n", obj_name);
+                       printf("%s ambiguous%c", obj_name, opt->output_delim);
                        break;
                case DANGLING_SYMLINK:
-                       printf("dangling %"PRIuMAX"\n%s\n",
-                              (uintmax_t)strlen(obj_name), obj_name);
+                       printf("dangling %"PRIuMAX"%c%s%c",
+                              (uintmax_t)strlen(obj_name),
+                              opt->output_delim, obj_name, opt->output_delim);
                        break;
                case SYMLINK_LOOP:
-                       printf("loop %"PRIuMAX"\n%s\n",
-                              (uintmax_t)strlen(obj_name), obj_name);
+                       printf("loop %"PRIuMAX"%c%s%c",
+                              (uintmax_t)strlen(obj_name),
+                              opt->output_delim, obj_name, opt->output_delim);
                        break;
                case NOT_DIR:
-                       printf("notdir %"PRIuMAX"\n%s\n",
-                              (uintmax_t)strlen(obj_name), obj_name);
+                       printf("notdir %"PRIuMAX"%c%s%c",
+                              (uintmax_t)strlen(obj_name),
+                              opt->output_delim, obj_name, opt->output_delim);
                        break;
                default:
                        BUG("unknown get_sha1_with_context result %d\n",
@@ -544,9 +550,9 @@ static void batch_one_object(const char *obj_name,
        }
 
        if (ctx.mode == 0) {
-               printf("symlink %"PRIuMAX"\n%s\n",
+               printf("symlink %"PRIuMAX"%c%s%c",
                       (uintmax_t)ctx.symlink_path.len,
-                      ctx.symlink_path.buf);
+                      opt->output_delim, ctx.symlink_path.buf, opt->output_delim);
                fflush(stdout);
                return;
        }
@@ -691,20 +697,12 @@ static void batch_objects_command(struct batch_options *opt,
        struct queued_cmd *queued_cmd = NULL;
        size_t alloc = 0, nr = 0;
 
-       while (1) {
-               int i, ret;
+       while (strbuf_getdelim_strip_crlf(&input, stdin, opt->input_delim) != EOF) {
+               int i;
                const struct parse_cmd *cmd = NULL;
                const char *p = NULL, *cmd_end;
                struct queued_cmd call = {0};
 
-               if (opt->nul_terminated)
-                       ret = strbuf_getline_nul(&input, stdin);
-               else
-                       ret = strbuf_getline(&input, stdin);
-
-               if (ret)
-                       break;
-
                if (!input.len)
                        die(_("empty command in input"));
                if (isspace(*input.buf))
@@ -774,9 +772,8 @@ static int batch_objects(struct batch_options *opt)
         */
        memset(&data, 0, sizeof(data));
        data.mark_query = 1;
-       strbuf_expand(&output,
+       expand_format(&output,
                      opt->format ? opt->format : DEFAULT_FORMAT,
-                     expand_format,
                      &data);
        data.mark_query = 0;
        strbuf_release(&output);
@@ -802,7 +799,7 @@ static int batch_objects(struct batch_options *opt)
                if (repo_has_promisor_remote(the_repository))
                        warning("This repository uses promisor remotes. Some objects may not be loaded.");
 
-               read_replace_refs = 0;
+               disable_replace_refs();
 
                cb.opt = opt;
                cb.expand = &data;
@@ -848,16 +845,7 @@ static int batch_objects(struct batch_options *opt)
                goto cleanup;
        }
 
-       while (1) {
-               int ret;
-               if (opt->nul_terminated)
-                       ret = strbuf_getline_nul(&input, stdin);
-               else
-                       ret = strbuf_getline(&input, stdin);
-
-               if (ret == EOF)
-                       break;
-
+       while (strbuf_getdelim_strip_crlf(&input, stdin, opt->input_delim) != EOF) {
                if (data.split_on_whitespace) {
                        /*
                         * Split at first whitespace, tying off the beginning
@@ -882,12 +870,13 @@ static int batch_objects(struct batch_options *opt)
        return retval;
 }
 
-static int git_cat_file_config(const char *var, const char *value, void *cb)
+static int git_cat_file_config(const char *var, const char *value,
+                              const struct config_context *ctx, void *cb)
 {
        if (userdiff_config(var, value) < 0)
                return -1;
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static int batch_option_callback(const struct option *opt,
@@ -926,6 +915,8 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
        const char *exp_type = NULL, *obj_name = NULL;
        struct batch_options batch = {0};
        int unknown_type = 0;
+       int input_nul_terminated = 0;
+       int nul_terminated = 0;
 
        const char * const usage[] = {
                N_("git cat-file <type> <object>"),
@@ -933,7 +924,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
                N_("git cat-file (-t | -s) [--allow-unknown-type] <object>"),
                N_("git cat-file (--batch | --batch-check | --batch-command) [--batch-all-objects]\n"
                   "             [--buffer] [--follow-symlinks] [--unordered]\n"
-                  "             [--textconv | --filters] [-z]"),
+                  "             [--textconv | --filters] [-Z]"),
                N_("git cat-file (--textconv | --filters)\n"
                   "             [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"),
                NULL
@@ -962,7 +953,9 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
                        N_("like --batch, but don't emit <contents>"),
                        PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
                        batch_option_callback),
-               OPT_BOOL('z', NULL, &batch.nul_terminated, N_("stdin is NUL-terminated")),
+               OPT_BOOL_F('z', NULL, &input_nul_terminated, N_("stdin is NUL-terminated"),
+                       PARSE_OPT_HIDDEN),
+               OPT_BOOL('Z', NULL, &nul_terminated, N_("stdin and stdout is NUL-terminated")),
                OPT_CALLBACK_F(0, "batch-command", &batch, N_("format"),
                        N_("read commands from stdin"),
                        PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
@@ -1021,9 +1014,18 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
        else if (batch.all_objects)
                usage_msg_optf(_("'%s' requires a batch mode"), usage, options,
                               "--batch-all-objects");
-       else if (batch.nul_terminated)
+       else if (input_nul_terminated)
                usage_msg_optf(_("'%s' requires a batch mode"), usage, options,
                               "-z");
+       else if (nul_terminated)
+               usage_msg_optf(_("'%s' requires a batch mode"), usage, options,
+                              "-Z");
+
+       batch.input_delim = batch.output_delim = '\n';
+       if (input_nul_terminated)
+               batch.input_delim = '\0';
+       if (nul_terminated)
+               batch.input_delim = batch.output_delim = '\0';
 
        /* Batch defaults */
        if (batch.buffer_output < 0)
index 1dbe9d6ca887811134b77df04c8bc6ff453d3625..b22ff748c3e20819887084f1175015a9a6078815 100644 (file)
@@ -1,11 +1,12 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "attr.h"
 #include "environment.h"
 #include "gettext.h"
+#include "object-name.h"
 #include "quote.h"
+#include "repository.h"
 #include "setup.h"
 #include "parse-options.h"
 #include "write-or-die.h"
@@ -62,7 +63,7 @@ static void output_attr(struct attr_check *check, const char *file)
 }
 
 static void check_attr(const char *prefix, struct attr_check *check,
-                      const struct object_id *tree_oid, int collect_all,
+                      int collect_all,
                       const char *file)
 
 {
@@ -70,9 +71,9 @@ static void check_attr(const char *prefix, struct attr_check *check,
                prefix_path(prefix, prefix ? strlen(prefix) : 0, file);
 
        if (collect_all) {
-               git_all_attrs(&the_index, tree_oid, full_path, check);
+               git_all_attrs(&the_index, full_path, check);
        } else {
-               git_check_attr(&the_index, tree_oid, full_path, check);
+               git_check_attr(&the_index, full_path, check);
        }
        output_attr(check, file);
 
@@ -80,7 +81,7 @@ static void check_attr(const char *prefix, struct attr_check *check,
 }
 
 static void check_attr_stdin_paths(const char *prefix, struct attr_check *check,
-                                  const struct object_id *tree_oid, int collect_all)
+                                  int collect_all)
 {
        struct strbuf buf = STRBUF_INIT;
        struct strbuf unquoted = STRBUF_INIT;
@@ -94,7 +95,7 @@ static void check_attr_stdin_paths(const char *prefix, struct attr_check *check,
                                die("line is badly quoted");
                        strbuf_swap(&buf, &unquoted);
                }
-               check_attr(prefix, check, tree_oid, collect_all, buf.buf);
+               check_attr(prefix, check, collect_all, buf.buf);
                maybe_flush_or_die(stdout, "attribute to stdout");
        }
        strbuf_release(&buf);
@@ -110,7 +111,6 @@ static NORETURN void error_with_usage(const char *msg)
 int cmd_check_attr(int argc, const char **argv, const char *prefix)
 {
        struct attr_check *check;
-       struct object_id *tree_oid = NULL;
        struct object_id initialized_oid;
        int cnt, i, doubledash, filei;
 
@@ -186,14 +186,14 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
        if (source) {
                if (repo_get_oid_tree(the_repository, source, &initialized_oid))
                        die("%s: not a valid tree-ish source", source);
-               tree_oid = &initialized_oid;
+               set_git_attr_source(source);
        }
 
        if (stdin_paths)
-               check_attr_stdin_paths(prefix, check, tree_oid, all_attrs);
+               check_attr_stdin_paths(prefix, check, all_attrs);
        else {
                for (i = filei; i < argc; i++)
-                       check_attr(prefix, check, tree_oid, all_attrs, argv[i]);
+                       check_attr(prefix, check, all_attrs, argv[i]);
                maybe_flush_or_die(stdout, "attribute to stdout");
        }
 
index 9401dad0070c025af4592eb1fd2b34f601c2fba1..906cd967536c6f3a90c0a57cb4f3649e7b0da804 100644 (file)
@@ -1,12 +1,12 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "gettext.h"
 #include "quote.h"
 #include "pathspec.h"
 #include "parse-options.h"
+#include "repository.h"
 #include "submodule.h"
 #include "write-or-die.h"
 
index 002d2941e931034f9426c8e3dbda28310fc2776a..b8a05b8e07b523953dfe9e8d6e572346a27d7791 100644 (file)
@@ -4,6 +4,7 @@
 #include "ident.h"
 #include "mailmap.h"
 #include "parse-options.h"
+#include "strbuf.h"
 #include "string-list.h"
 #include "write-or-die.h"
 
index 57f0505070f6293460803ad670e491d98240c1ca..5eb6bdc3f691e8a71e07fc2be80ee94e3599f522 100644 (file)
@@ -2,9 +2,8 @@
  * GIT - The information manager from hell
  */
 
-#include "cache.h"
-#include "refs.h"
 #include "builtin.h"
+#include "refs.h"
 #include "setup.h"
 #include "strbuf.h"
 
index 2120dd1d300788b1833e0c1619652586f7366508..6b62b5375bd2bf0d998f74ba2c63c071a5e76e73 100644 (file)
@@ -1,11 +1,11 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "config.h"
 #include "entry.h"
 #include "gettext.h"
 #include "parallel-checkout.h"
 #include "parse-options.h"
 #include "pkt-line.h"
+#include "read-cache-ll.h"
 
 static void packet_to_pc_item(const char *buffer, int len,
                              struct parallel_checkout_item *pc_item)
index 7df673e3e70c26dd10407060623e1276f343f432..f62f13f2b5324e15f982071f73b24281d2d9637a 100644 (file)
 #include "gettext.h"
 #include "lockfile.h"
 #include "quote.h"
+#include "repository.h"
 #include "cache-tree.h"
 #include "parse-options.h"
 #include "entry.h"
 #include "parallel-checkout.h"
+#include "read-cache-ll.h"
 #include "setup.h"
+#include "sparse-index.h"
 
 #define CHECKOUT_ALL 4
 static int nul_term_line;
index 38a8cd6a965210b3959043c3e228a3d84ba93ab1..f53612f46870529e87cec15a2f7233c74e4b173d 100644 (file)
 #include "gettext.h"
 #include "hex.h"
 #include "hook.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "lockfile.h"
+#include "mem-pool.h"
 #include "merge-recursive.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "parse-options.h"
+#include "path.h"
+#include "preload-index.h"
+#include "read-cache.h"
 #include "refs.h"
 #include "remote.h"
 #include "resolve-undo.h"
@@ -26,6 +31,8 @@
 #include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "symlinks.h"
+#include "trace2.h"
 #include "tree.h"
 #include "tree-walk.h"
 #include "unpack-trees.h"
@@ -857,7 +864,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
                         * entries in the index.
                         */
 
-                       add_files_to_cache(NULL, NULL, 0);
+                       add_files_to_cache(the_repository, NULL, NULL, 0, 0);
                        init_merge_options(&o, the_repository);
                        o.verbosity = 0;
                        work = write_in_core_index_as_tree(the_repository);
@@ -909,7 +916,7 @@ static void report_tracking(struct branch_info *new_branch_info)
        struct strbuf sb = STRBUF_INIT;
        struct branch *branch = branch_get(new_branch_info->name);
 
-       if (!format_tracking_info(branch, &sb, AHEAD_BEHIND_FULL))
+       if (!format_tracking_info(branch, &sb, AHEAD_BEHIND_FULL, 1))
                return;
        fputs(sb.buf, stdout);
        strbuf_release(&sb);
@@ -1182,7 +1189,8 @@ static int switch_branches(const struct checkout_opts *opts,
        return ret || writeout_error;
 }
 
-static int git_checkout_config(const char *var, const char *value, void *cb)
+static int git_checkout_config(const char *var, const char *value,
+                              const struct config_context *ctx, void *cb)
 {
        struct checkout_opts *opts = cb;
 
@@ -1198,7 +1206,7 @@ static int git_checkout_config(const char *var, const char *value, void *cb)
        if (starts_with(var, "submodule."))
                return git_default_submodule_config(var, value, NULL);
 
-       return git_xmerge_config(var, value, NULL);
+       return git_xmerge_config(var, value, ctx, NULL);
 }
 
 static void setup_new_branch_info_and_source_tree(
@@ -1685,8 +1693,13 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
        }
 
        if (opts->conflict_style) {
+               struct key_value_info kvi = KVI_INIT;
+               struct config_context ctx = {
+                       .kvi = &kvi,
+               };
                opts->merge = 1; /* implied */
-               git_xmerge_config("merge.conflictstyle", opts->conflict_style, NULL);
+               git_xmerge_config("merge.conflictstyle", opts->conflict_style,
+                                 &ctx, NULL);
        }
        if (opts->force) {
                opts->discard_changes = 1;
index 14c0d555eac8af68ec2ac5d3cad3afe5b5240aa5..49c224e626d61819a633252572d3e7f3b32ffd62 100644 (file)
@@ -9,11 +9,13 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "path.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 #include "string-list.h"
 #include "quote.h"
@@ -102,7 +104,8 @@ struct menu_stuff {
 
 define_list_config_array(color_interactive_slots);
 
-static int git_clean_config(const char *var, const char *value, void *cb)
+static int git_clean_config(const char *var, const char *value,
+                           const struct config_context *ctx, void *cb)
 {
        const char *slot_name;
 
@@ -129,8 +132,10 @@ static int git_clean_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       /* inspect the color.ui config variable and others */
-       return git_color_default_config(var, value, cb);
+       if (git_color_config(var, value, cb) < 0)
+               return -1;
+
+       return git_default_config(var, value, ctx, cb);
 }
 
 static const char *clean_get_color(enum color_clean ix)
index eeec8067ec30315dbe85f5a5f44298358bfc7e86..c6357af949895a688639c83984598931906b2690 100644 (file)
@@ -11,7 +11,9 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
+#include "advice.h"
 #include "config.h"
+#include "copy.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
@@ -20,7 +22,8 @@
 #include "fetch-pack.h"
 #include "refs.h"
 #include "refspec.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "tree.h"
 #include "tree-walk.h"
 #include "unpack-trees.h"
@@ -36,6 +39,8 @@
 #include "setup.h"
 #include "connected.h"
 #include "packfile.h"
+#include "path.h"
+#include "pkt-line.h"
 #include "list-objects-filter-options.h"
 #include "hook.h"
 #include "bundle.h"
@@ -156,10 +161,7 @@ static struct option builtin_clone_options[] = {
                        N_("set config inside the new repository")),
        OPT_STRING_LIST(0, "server-option", &server_options,
                        N_("server-specific"), N_("option to transmit")),
-       OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
-                       TRANSPORT_FAMILY_IPV4),
-       OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
-                       TRANSPORT_FAMILY_IPV6),
+       OPT_IPVERSION(&family),
        OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
        OPT_BOOL(0, "also-filter-submodules", &option_filter_submodules,
                    N_("apply partial clone filters to submodules")),
@@ -785,7 +787,8 @@ static int checkout(int submodule_progress, int filter_submodules)
        return err;
 }
 
-static int git_clone_config(const char *k, const char *v, void *cb)
+static int git_clone_config(const char *k, const char *v,
+                           const struct config_context *ctx, void *cb)
 {
        if (!strcmp(k, "clone.defaultremotename")) {
                free(remote_name);
@@ -796,17 +799,19 @@ static int git_clone_config(const char *k, const char *v, void *cb)
        if (!strcmp(k, "clone.filtersubmodules"))
                config_filter_submodules = git_config_bool(k, v);
 
-       return git_default_config(k, v, cb);
+       return git_default_config(k, v, ctx, cb);
 }
 
-static int write_one_config(const char *key, const char *value, void *data)
+static int write_one_config(const char *key, const char *value,
+                           const struct config_context *ctx,
+                           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);
+       int apply_failed = git_clone_config(key, value, ctx, data);
        if (apply_failed)
                return apply_failed;
 
@@ -925,6 +930,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        int submodule_progress;
        int filter_submodules = 0;
        int hash_algo;
+       const int do_not_override_repo_unix_permissions = -1;
 
        struct transport_ls_refs_options transport_ls_refs_options =
                TRANSPORT_LS_REFS_OPTIONS_INIT;
@@ -1092,7 +1098,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        }
 
        init_db(git_dir, real_git_dir, option_template, GIT_HASH_UNKNOWN, NULL,
-               INIT_DB_QUIET);
+               do_not_override_repo_unix_permissions, INIT_DB_QUIET);
 
        if (real_git_dir) {
                free((char *)git_dir);
index de623a16c2d2f5bd4e206f9c84721be1b454281b..a83be8bc991a8c9dfca5b64f886d33f952890236 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "strbuf.h"
@@ -13,7 +12,8 @@ static const char * const builtin_column_usage[] = {
 };
 static unsigned int colopts;
 
-static int column_config(const char *var, const char *value, void *cb)
+static int column_config(const char *var, const char *value,
+                        const struct config_context *ctx UNUSED, void *cb)
 {
        return git_column_config(var, value, cb, &colopts);
 }
index 901142697612feb7354e87049d44048411fbcd13..c88389df24ed5cb552ca22a4be0e29c625a9ac23 100644 (file)
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "commit.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
@@ -8,10 +9,11 @@
 #include "parse-options.h"
 #include "repository.h"
 #include "commit-graph.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "progress.h"
 #include "replace-object.h"
 #include "tag.h"
+#include "trace2.h"
 
 #define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
        N_("git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]")
@@ -185,10 +187,11 @@ static int write_option_max_new_filters(const struct option *opt,
 }
 
 static int git_commit_graph_write_config(const char *var, const char *value,
+                                        const struct config_context *ctx,
                                         void *cb UNUSED)
 {
        if (!strcmp(var, "commitgraph.maxnewfilters"))
-               write_opts.max_new_filters = git_config_int(var, value);
+               write_opts.max_new_filters = git_config_int(var, value, ctx->kvi);
        /*
         * No need to fall-back to 'git_default_config', since this was already
         * called in 'cmd_commit_graph()'.
@@ -323,7 +326,7 @@ int cmd_commit_graph(int argc, const char **argv, const char *prefix)
 
        git_config(git_default_config, NULL);
 
-       read_replace_refs = 0;
+       disable_replace_refs();
        save_commit_buffer = 0;
 
        argc = parse_options(argc, argv, prefix, options,
index 15be167f87a47915530996248cb95fcedaf30b95..02625e71761dbf8d25f063b5ff4835e5eb4bf477 100644 (file)
@@ -3,15 +3,15 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "commit.h"
 #include "tree.h"
-#include "builtin.h"
 #include "utf8.h"
 #include "gpg-interface.h"
 #include "parse-options.h"
index 9d8e1ea91a327248799cf137ef3c0aaf0fc65ed1..7da5f924484d586c765796f8e411a042f2a3817a 100644 (file)
@@ -6,14 +6,15 @@
  */
 
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
+#include "advice.h"
 #include "config.h"
 #include "lockfile.h"
 #include "cache-tree.h"
 #include "color.h"
 #include "dir.h"
+#include "editor.h"
 #include "environment.h"
-#include "builtin.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "commit.h"
 #include "log-tree.h"
 #include "strbuf.h"
 #include "utf8.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
+#include "preload-index.h"
+#include "read-cache.h"
 #include "string-list.h"
 #include "rerere.h"
 #include "unpack-trees.h"
@@ -35,6 +40,7 @@
 #include "gpg-interface.h"
 #include "column.h"
 #include "sequencer.h"
+#include "sparse-index.h"
 #include "mailmap.h"
 #include "help.h"
 #include "commit-reach.h"
@@ -444,7 +450,8 @@ static const char *prepare_index(const char **argv, const char *prefix,
        if (all || (also && pathspec.nr)) {
                repo_hold_locked_index(the_repository, &index_lock,
                                       LOCK_DIE_ON_ERROR);
-               add_files_to_cache(also ? prefix : NULL, &pathspec, 0);
+               add_files_to_cache(the_repository, also ? prefix : NULL,
+                                  &pathspec, 0, 0);
                refresh_cache_or_die(refresh_flags);
                cache_tree_update(&the_index, WRITE_TREE_SILENT);
                if (write_locked_index(&the_index, &index_lock, 0))
@@ -760,7 +767,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
                        struct commit *c;
                        c = lookup_commit_reference_by_name(squash_message);
                        if (!c)
-                               die(_("could not lookup commit %s"), squash_message);
+                               die(_("could not lookup commit '%s'"), squash_message);
                        ctx.output_encoding = get_commit_output_encoding();
                        repo_format_commit_message(the_repository, c,
                                                   "squash! %s\n\n", &sb,
@@ -795,7 +802,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
                char *fmt;
                commit = lookup_commit_reference_by_name(fixup_commit);
                if (!commit)
-                       die(_("could not lookup commit %s"), fixup_commit);
+                       die(_("could not lookup commit '%s'"), fixup_commit);
                ctx.output_encoding = get_commit_output_encoding();
                fmt = xstrfmt("%s! %%s\n\n", fixup_prefix);
                repo_format_commit_message(the_repository, commit, fmt, &sb,
@@ -890,7 +897,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
        s->hints = 0;
 
        if (clean_message_contents)
-               strbuf_stripspace(&sb, 0);
+               strbuf_stripspace(&sb, '\0');
 
        if (signoff)
                append_signoff(&sb, ignore_non_trailer(sb.buf, sb.len), 0);
@@ -995,11 +1002,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
                struct object_id oid;
                const char *parent = "HEAD";
 
-               if (!the_index.cache_nr) {
-                       discard_index(&the_index);
-                       if (repo_read_index(the_repository) < 0)
-                               die(_("Cannot read index"));
-               }
+               if (!the_index.initialized && repo_read_index(the_repository) < 0)
+                       die(_("Cannot read index"));
 
                if (amend)
                        parent = "HEAD^1";
@@ -1040,7 +1044,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
                struct child_process run_trailer = CHILD_PROCESS_INIT;
 
                strvec_pushl(&run_trailer.args, "interpret-trailers",
-                            "--in-place", git_path_commit_editmsg(), NULL);
+                            "--in-place", "--no-divider",
+                            git_path_commit_editmsg(), NULL);
                strvec_pushv(&run_trailer.args, trailer_args.v);
                run_trailer.git_cmd = 1;
                if (run_command(&run_trailer))
@@ -1186,7 +1191,7 @@ static const char *read_commit_message(const char *name)
 
        commit = lookup_commit_reference_by_name(name);
        if (!commit)
-               die(_("could not lookup commit %s"), name);
+               die(_("could not lookup commit '%s'"), name);
        out_enc = get_commit_output_encoding();
        return repo_logmsg_reencode(the_repository, commit, NULL, out_enc);
 }
@@ -1402,7 +1407,8 @@ static int parse_status_slot(const char *slot)
        return LOOKUP_CONFIG(color_status_slots, slot);
 }
 
-static int git_status_config(const char *k, const char *v, void *cb)
+static int git_status_config(const char *k, const char *v,
+                            const struct config_context *ctx, void *cb)
 {
        struct wt_status *s = cb;
        const char *slot_name;
@@ -1411,7 +1417,8 @@ static int git_status_config(const char *k, const char *v, void *cb)
                return git_column_config(k, v, "status", &s->colopts);
        if (!strcmp(k, "status.submodulesummary")) {
                int is_bool;
-               s->submodule_summary = git_config_bool_or_int(k, v, &is_bool);
+               s->submodule_summary = git_config_bool_or_int(k, v, ctx->kvi,
+                                                             &is_bool);
                if (is_bool && s->submodule_summary)
                        s->submodule_summary = -1;
                return 0;
@@ -1471,11 +1478,11 @@ static int git_status_config(const char *k, const char *v, void *cb)
        }
        if (!strcmp(k, "diff.renamelimit")) {
                if (s->rename_limit == -1)
-                       s->rename_limit = git_config_int(k, v);
+                       s->rename_limit = git_config_int(k, v, ctx->kvi);
                return 0;
        }
        if (!strcmp(k, "status.renamelimit")) {
-               s->rename_limit = git_config_int(k, v);
+               s->rename_limit = git_config_int(k, v, ctx->kvi);
                return 0;
        }
        if (!strcmp(k, "diff.renames")) {
@@ -1487,7 +1494,7 @@ static int git_status_config(const char *k, const char *v, void *cb)
                s->detect_rename = git_config_rename(k, v);
                return 0;
        }
-       return git_diff_ui_config(k, v, NULL);
+       return git_diff_ui_config(k, v, ctx, NULL);
 }
 
 int cmd_status(int argc, const char **argv, const char *prefix)
@@ -1602,7 +1609,8 @@ int cmd_status(int argc, const char **argv, const char *prefix)
        return 0;
 }
 
-static int git_commit_config(const char *k, const char *v, void *cb)
+static int git_commit_config(const char *k, const char *v,
+                            const struct config_context *ctx, void *cb)
 {
        struct wt_status *s = cb;
 
@@ -1620,11 +1628,12 @@ static int git_commit_config(const char *k, const char *v, void *cb)
        }
        if (!strcmp(k, "commit.verbose")) {
                int is_bool;
-               config_commit_verbose = git_config_bool_or_int(k, v, &is_bool);
+               config_commit_verbose = git_config_bool_or_int(k, v, ctx->kvi,
+                                                              &is_bool);
                return 0;
        }
 
-       return git_status_config(k, v, s);
+       return git_status_config(k, v, ctx, s);
 }
 
 int cmd_commit(int argc, const char **argv, const char *prefix)
index fe79fb60c4377bce46fa56f44e7534cf7b96e0d8..11a4d4ef1411222f3750c760b68efd10180148c0 100644 (file)
@@ -1,17 +1,19 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "color.h"
+#include "editor.h"
 #include "environment.h"
+#include "repository.h"
 #include "gettext.h"
 #include "ident.h"
 #include "parse-options.h"
 #include "urlmatch.h"
+#include "path.h"
 #include "quote.h"
 #include "setup.h"
+#include "strbuf.h"
 #include "worktree.h"
-#include "wrapper.h"
 
 static const char *const builtin_config_usage[] = {
        N_("git config [<options>]"),
@@ -191,37 +193,42 @@ static void check_argc(int argc, int min, int max)
        usage_builtin_config();
 }
 
-static void show_config_origin(struct strbuf *buf)
+static void show_config_origin(const struct key_value_info *kvi,
+                              struct strbuf *buf)
 {
        const char term = end_nul ? '\0' : '\t';
 
-       strbuf_addstr(buf, current_config_origin_type());
+       strbuf_addstr(buf, config_origin_type_name(kvi->origin_type));
        strbuf_addch(buf, ':');
        if (end_nul)
-               strbuf_addstr(buf, current_config_name());
+               strbuf_addstr(buf, kvi->filename ? kvi->filename : "");
        else
-               quote_c_style(current_config_name(), buf, NULL, 0);
+               quote_c_style(kvi->filename ? kvi->filename : "", buf, NULL, 0);
        strbuf_addch(buf, term);
 }
 
-static void show_config_scope(struct strbuf *buf)
+static void show_config_scope(const struct key_value_info *kvi,
+                             struct strbuf *buf)
 {
        const char term = end_nul ? '\0' : '\t';
-       const char *scope = config_scope_name(current_config_scope());
+       const char *scope = config_scope_name(kvi->scope);
 
        strbuf_addstr(buf, N_(scope));
        strbuf_addch(buf, term);
 }
 
 static int show_all_config(const char *key_, const char *value_,
+                          const struct config_context *ctx,
                           void *cb UNUSED)
 {
+       const struct key_value_info *kvi = ctx->kvi;
+
        if (show_origin || show_scope) {
                struct strbuf buf = STRBUF_INIT;
                if (show_scope)
-                       show_config_scope(&buf);
+                       show_config_scope(kvi, &buf);
                if (show_origin)
-                       show_config_origin(&buf);
+                       show_config_origin(kvi, &buf);
                /* Use fwrite as "buf" can contain \0's if "end_null" is set. */
                fwrite(buf.buf, 1, buf.len, stdout);
                strbuf_release(&buf);
@@ -239,12 +246,13 @@ struct strbuf_list {
        int alloc;
 };
 
-static int format_config(struct strbuf *buf, const char *key_, const char *value_)
+static int format_config(struct strbuf *buf, const char *key_,
+                        const char *value_, const struct key_value_info *kvi)
 {
        if (show_scope)
-               show_config_scope(buf);
+               show_config_scope(kvi, buf);
        if (show_origin)
-               show_config_origin(buf);
+               show_config_origin(kvi, buf);
        if (show_keys)
                strbuf_addstr(buf, key_);
        if (!omit_values) {
@@ -253,13 +261,14 @@ static int format_config(struct strbuf *buf, const char *key_, const char *value
 
                if (type == TYPE_INT)
                        strbuf_addf(buf, "%"PRId64,
-                                   git_config_int64(key_, value_ ? value_ : ""));
+                                   git_config_int64(key_, value_ ? value_ : "", kvi));
                else if (type == TYPE_BOOL)
                        strbuf_addstr(buf, git_config_bool(key_, value_) ?
                                      "true" : "false");
                else if (type == TYPE_BOOL_OR_INT) {
                        int is_bool, v;
-                       v = git_config_bool_or_int(key_, value_, &is_bool);
+                       v = git_config_bool_or_int(key_, value_, kvi,
+                                                  &is_bool);
                        if (is_bool)
                                strbuf_addstr(buf, v ? "true" : "false");
                        else
@@ -298,9 +307,11 @@ static int format_config(struct strbuf *buf, const char *key_, const char *value
        return 0;
 }
 
-static int collect_config(const char *key_, const char *value_, void *cb)
+static int collect_config(const char *key_, const char *value_,
+                         const struct config_context *ctx, void *cb)
 {
        struct strbuf_list *values = cb;
+       const struct key_value_info *kvi = ctx->kvi;
 
        if (!use_key_regexp && strcmp(key_, key))
                return 0;
@@ -315,7 +326,7 @@ static int collect_config(const char *key_, const char *value_, void *cb)
        ALLOC_GROW(values->items, values->nr + 1, values->alloc);
        strbuf_init(&values->items[values->nr], 0);
 
-       return format_config(&values->items[values->nr++], key_, value_);
+       return format_config(&values->items[values->nr++], key_, value_, kvi);
 }
 
 static int get_value(const char *key_, const char *regex_, unsigned flags)
@@ -373,14 +384,18 @@ static int get_value(const char *key_, const char *regex_, unsigned flags)
        }
 
        config_with_options(collect_config, &values,
-                           &given_config_source, &config_options);
+                           &given_config_source, the_repository,
+                           &config_options);
 
        if (!values.nr && default_value) {
+               struct key_value_info kvi = KVI_INIT;
                struct strbuf *item;
+
+               kvi_from_param(&kvi);
                ALLOC_GROW(values.items, values.nr + 1, values.alloc);
                item = &values.items[values.nr++];
                strbuf_init(item, 0);
-               if (format_config(item, key_, default_value) < 0)
+               if (format_config(item, key_, default_value, &kvi) < 0)
                        die(_("failed to format default config value: %s"),
                                default_value);
        }
@@ -409,7 +424,8 @@ free_strings:
        return ret;
 }
 
-static char *normalize_value(const char *key, const char *value)
+static char *normalize_value(const char *key, const char *value,
+                            struct key_value_info *kvi)
 {
        if (!value)
                return NULL;
@@ -424,12 +440,12 @@ static char *normalize_value(const char *key, const char *value)
                 */
                return xstrdup(value);
        if (type == TYPE_INT)
-               return xstrfmt("%"PRId64, git_config_int64(key, value));
+               return xstrfmt("%"PRId64, git_config_int64(key, value, kvi));
        if (type == TYPE_BOOL)
                return xstrdup(git_config_bool(key, value) ?  "true" : "false");
        if (type == TYPE_BOOL_OR_INT) {
                int is_bool, v;
-               v = git_config_bool_or_int(key, value, &is_bool);
+               v = git_config_bool_or_int(key, value, kvi, &is_bool);
                if (!is_bool)
                        return xstrfmt("%d", v);
                else
@@ -466,6 +482,7 @@ static const char *get_colorbool_slot;
 static char parsed_color[COLOR_MAXLEN];
 
 static int git_get_color_config(const char *var, const char *value,
+                               const struct config_context *ctx UNUSED,
                                void *cb UNUSED)
 {
        if (!strcmp(var, get_color_slot)) {
@@ -484,7 +501,8 @@ static void get_color(const char *var, const char *def_color)
        get_color_found = 0;
        parsed_color[0] = '\0';
        config_with_options(git_get_color_config, NULL,
-                           &given_config_source, &config_options);
+                           &given_config_source, the_repository,
+                           &config_options);
 
        if (!get_color_found && def_color) {
                if (color_parse(def_color, parsed_color) < 0)
@@ -498,6 +516,7 @@ static int get_colorbool_found;
 static int get_diff_color_found;
 static int get_color_ui_found;
 static int git_get_colorbool_config(const char *var, const char *value,
+                                   const struct config_context *ctx UNUSED,
                                    void *data UNUSED)
 {
        if (!strcmp(var, get_colorbool_slot))
@@ -516,7 +535,8 @@ static int get_colorbool(const char *var, int print)
        get_diff_color_found = -1;
        get_color_ui_found = -1;
        config_with_options(git_get_colorbool_config, NULL,
-                           &given_config_source, &config_options);
+                           &given_config_source, the_repository,
+                           &config_options);
 
        if (get_colorbool_found < 0) {
                if (!strcmp(get_colorbool_slot, "color.diff"))
@@ -553,13 +573,17 @@ static void check_write(void)
 struct urlmatch_current_candidate_value {
        char value_is_null;
        struct strbuf value;
+       struct key_value_info kvi;
 };
 
-static int urlmatch_collect_fn(const char *var, const char *value, void *cb)
+static int urlmatch_collect_fn(const char *var, const char *value,
+                              const struct config_context *ctx,
+                              void *cb)
 {
        struct string_list *values = cb;
        struct string_list_item *item = string_list_insert(values, var);
        struct urlmatch_current_candidate_value *matched = item->util;
+       const struct key_value_info *kvi = ctx->kvi;
 
        if (!matched) {
                matched = xmalloc(sizeof(*matched));
@@ -568,6 +592,7 @@ static int urlmatch_collect_fn(const char *var, const char *value, void *cb)
        } else {
                strbuf_reset(&matched->value);
        }
+       matched->kvi = *kvi;
 
        if (value) {
                strbuf_addstr(&matched->value, value);
@@ -605,7 +630,8 @@ static int get_urlmatch(const char *var, const char *url)
        }
 
        config_with_options(urlmatch_config_entry, &config,
-                           &given_config_source, &config_options);
+                           &given_config_source, the_repository,
+                           &config_options);
 
        ret = !values.nr;
 
@@ -614,7 +640,8 @@ static int get_urlmatch(const char *var, const char *url)
                struct strbuf buf = STRBUF_INIT;
 
                format_config(&buf, item->string,
-                             matched->value_is_null ? NULL : matched->value.buf);
+                             matched->value_is_null ? NULL : matched->value.buf,
+                             &matched->kvi);
                fwrite(buf.buf, 1, buf.len, stdout);
                strbuf_release(&buf);
 
@@ -648,6 +675,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        char *value = NULL;
        int flags = 0;
        int ret = 0;
+       struct key_value_info default_kvi = KVI_INIT;
 
        given_config_source.file = xstrdup_or_null(getenv(CONFIG_ENVIRONMENT));
 
@@ -711,7 +739,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                given_config_source.scope = CONFIG_SCOPE_LOCAL;
        } else if (use_worktree_config) {
                struct worktree **worktrees = get_worktrees();
-               if (repository_format_worktree_config)
+               if (the_repository->repository_format_worktree_config)
                        given_config_source.file = git_pathdup("config.worktree");
                else if (worktrees[0] && worktrees[1])
                        die(_("--worktree cannot be used with multiple "
@@ -825,7 +853,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        if (actions == ACTION_LIST) {
                check_argc(argc, 0, 0);
                if (config_with_options(show_all_config, NULL,
-                                       &given_config_source,
+                                       &given_config_source, the_repository,
                                        &config_options) < 0) {
                        if (given_config_source.file)
                                die_errno(_("unable to read config file '%s'"),
@@ -865,7 +893,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        else if (actions == ACTION_SET) {
                check_write();
                check_argc(argc, 2, 2);
-               value = normalize_value(argv[0], argv[1]);
+               value = normalize_value(argv[0], argv[1], &default_kvi);
                ret = git_config_set_in_file_gently(given_config_source.file, argv[0], value);
                if (ret == CONFIG_NOTHING_SET)
                        error(_("cannot overwrite multiple values with a single value\n"
@@ -874,7 +902,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        else if (actions == ACTION_SET_ALL) {
                check_write();
                check_argc(argc, 2, 3);
-               value = normalize_value(argv[0], argv[1]);
+               value = normalize_value(argv[0], argv[1], &default_kvi);
                ret = git_config_set_multivar_in_file_gently(given_config_source.file,
                                                             argv[0], value, argv[2],
                                                             flags);
@@ -882,7 +910,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        else if (actions == ACTION_ADD) {
                check_write();
                check_argc(argc, 2, 2);
-               value = normalize_value(argv[0], argv[1]);
+               value = normalize_value(argv[0], argv[1], &default_kvi);
                ret = git_config_set_multivar_in_file_gently(given_config_source.file,
                                                             argv[0], value,
                                                             CONFIG_REGEX_NONE,
@@ -891,7 +919,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
        else if (actions == ACTION_REPLACE_ALL) {
                check_write();
                check_argc(argc, 2, 3);
-               value = normalize_value(argv[0], argv[1]);
+               value = normalize_value(argv[0], argv[1], &default_kvi);
                ret = git_config_set_multivar_in_file_gently(given_config_source.file,
                                                             argv[0], value, argv[2],
                                                             flags | CONFIG_FLAGS_MULTI_REPLACE);
index f3d8f1bcbb00902356d0bb5f0637b04672af7fe9..2d4bb5e8d0a8dfce1290760f7cd99dac7ba39a3e 100644 (file)
@@ -4,17 +4,17 @@
  * Copyright (c) 2006 Junio C Hamano
  */
 
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
+#include "path.h"
 #include "repository.h"
-#include "builtin.h"
 #include "parse-options.h"
 #include "quote.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static unsigned long garbage;
 static off_t size_garbage;
@@ -82,7 +82,7 @@ static int count_cruft(const char *basename UNUSED, const char *path,
        return 0;
 }
 
-static int print_alternate(struct object_directory *odb, void *data)
+static int print_alternate(struct object_directory *odb, void *data UNUSED)
 {
        printf("alternate: ");
        quote_c_style(odb->path, NULL, stdout, 0);
index 62c09a271d6eb4578ef0360910575c5611f61ffd..3a6a750a8eb320bb3622184843ede3d2b9884385 100644 (file)
@@ -1,7 +1,7 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "gettext.h"
+#include "object-file.h"
 #include "parse-options.h"
 
 #ifndef NO_UNIX_SOCKETS
@@ -37,19 +37,22 @@ static struct credential_cache_entry *lookup_credential(const struct credential
        int i;
        for (i = 0; i < entries_nr; i++) {
                struct credential *e = &entries[i].item;
-               if (credential_match(c, e))
+               if (credential_match(c, e, 0))
                        return &entries[i];
        }
        return NULL;
 }
 
-static void remove_credential(const struct credential *c)
+static void remove_credential(const struct credential *c, int match_password)
 {
        struct credential_cache_entry *e;
 
-       e = lookup_credential(c);
-       if (e)
-               e->expiration = 0;
+       int i;
+       for (i = 0; i < entries_nr; i++) {
+               e = &entries[i];
+               if (credential_match(c, &e->item, match_password))
+                       e->expiration = 0;
+       }
 }
 
 static timestamp_t check_expirations(void)
@@ -133,6 +136,9 @@ static void serve_one_client(FILE *in, FILE *out)
                        if (e->item.password_expiry_utc != TIME_MAX)
                                fprintf(out, "password_expiry_utc=%"PRItime"\n",
                                        e->item.password_expiry_utc);
+                       if (e->item.oauth_refresh_token)
+                               fprintf(out, "oauth_refresh_token=%s\n",
+                                       e->item.oauth_refresh_token);
                }
        }
        else if (!strcmp(action.buf, "exit")) {
@@ -147,14 +153,14 @@ static void serve_one_client(FILE *in, FILE *out)
                exit(0);
        }
        else if (!strcmp(action.buf, "erase"))
-               remove_credential(&c);
+               remove_credential(&c, 1);
        else if (!strcmp(action.buf, "store")) {
                if (timeout < 0)
                        warning("cache client didn't specify a timeout");
                else if (!c.username || !c.password)
                        warning("cache client gave us a partial credential");
                else {
-                       remove_credential(&c);
+                       remove_credential(&c, 0);
                        cache_credential(&c, timeout);
                }
        }
index 508da4c6e4d4b42d0b6e159ed01211d9d02f168c..43b9d0e5b16ba5da555a3b16ce53b88dff5dbb4c 100644 (file)
@@ -1,7 +1,8 @@
 #include "builtin.h"
 #include "gettext.h"
 #include "parse-options.h"
-#include "wrapper.h"
+#include "path.h"
+#include "strbuf.h"
 #include "write-or-die.h"
 
 #ifndef NO_UNIX_SOCKETS
index 8977604eb9dc0b206474282e6e34afe36aeeb35f..4a492411bbf3d2a7f0a34ada0bd127ae97cf5552 100644 (file)
@@ -3,6 +3,7 @@
 #include "gettext.h"
 #include "lockfile.h"
 #include "credential.h"
+#include "path.h"
 #include "string-list.h"
 #include "parse-options.h"
 #include "write-or-die.h"
@@ -12,7 +13,8 @@ static struct lock_file credential_lock;
 static int parse_credential_file(const char *fn,
                                  struct credential *c,
                                  void (*match_cb)(struct credential *),
-                                 void (*other_cb)(struct strbuf *))
+                                 void (*other_cb)(struct strbuf *),
+                                 int match_password)
 {
        FILE *fh;
        struct strbuf line = STRBUF_INIT;
@@ -29,7 +31,7 @@ static int parse_credential_file(const char *fn,
        while (strbuf_getline_lf(&line, fh) != EOF) {
                if (!credential_from_url_gently(&entry, line.buf, 1) &&
                    entry.username && entry.password &&
-                   credential_match(c, &entry)) {
+                   credential_match(c, &entry, match_password)) {
                        found_credential = 1;
                        if (match_cb) {
                                match_cb(&entry);
@@ -59,7 +61,7 @@ static void print_line(struct strbuf *buf)
 }
 
 static void rewrite_credential_file(const char *fn, struct credential *c,
-                                   struct strbuf *extra)
+                                   struct strbuf *extra, int match_password)
 {
        int timeout_ms = 1000;
 
@@ -68,11 +70,30 @@ static void rewrite_credential_file(const char *fn, struct credential *c,
                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);
+       parse_credential_file(fn, c, NULL, print_line, match_password);
        if (commit_lock_file(&credential_lock) < 0)
                die_errno("unable to write credential store");
 }
 
+static int is_rfc3986_unreserved(char ch)
+{
+       return isalnum(ch) ||
+               ch == '-' || ch == '_' || ch == '.' || ch == '~';
+}
+
+static int is_rfc3986_reserved_or_unreserved(char ch)
+{
+       if (is_rfc3986_unreserved(ch))
+               return 1;
+       switch (ch) {
+               case '!': case '*': case '\'': case '(': case ')': case ';':
+               case ':': case '@': case '&': case '=': case '+': case '$':
+               case ',': case '/': case '?': case '#': case '[': case ']':
+                       return 1;
+       }
+       return 0;
+}
+
 static void store_credential_file(const char *fn, struct credential *c)
 {
        struct strbuf buf = STRBUF_INIT;
@@ -90,7 +111,7 @@ static void store_credential_file(const char *fn, struct credential *c)
                                        is_rfc3986_reserved_or_unreserved);
        }
 
-       rewrite_credential_file(fn, c, &buf);
+       rewrite_credential_file(fn, c, &buf, 0);
        strbuf_release(&buf);
 }
 
@@ -137,7 +158,7 @@ static void remove_credential(const struct string_list *fns, struct credential *
                return;
        for_each_string_list_item(fn, fns)
                if (!access(fn->string, F_OK))
-                       rewrite_credential_file(fn->string, c, NULL);
+                       rewrite_credential_file(fn->string, c, NULL, 1);
 }
 
 static void lookup_credential(const struct string_list *fns, struct credential *c)
@@ -145,7 +166,7 @@ static void lookup_credential(const struct string_list *fns, struct credential *
        struct string_list_item *fn;
 
        for_each_string_list_item(fn, fns)
-               if (parse_credential_file(fn->string, c, print_entry, NULL))
+               if (parse_credential_file(fn->string, c, print_entry, NULL, 0))
                        return; /* Found credential */
 }
 
index c6b388e6494df94831c2b7c6cd99afae36ee63bc..b28a4a1f82d5290f4800b238224946923cf7811b 100644 (file)
@@ -1,5 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -9,20 +9,23 @@
 #include "tag.h"
 #include "blob.h"
 #include "refs.h"
-#include "builtin.h"
 #include "exec-cmd.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "diff.h"
 #include "hashmap.h"
 #include "setup.h"
 #include "strvec.h"
 #include "run-command.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "list-objects.h"
 #include "commit-slab.h"
+#include "wildmatch.h"
 
 #define MAX_TAGS       (FLAG_BITS - 1)
+#define DEFAULT_CANDIDATES 10
 
 define_commit_slab(commit_names, struct commit_name *);
 
@@ -39,7 +42,7 @@ static int tags;      /* Allow lightweight tags */
 static int longformat;
 static int first_parent;
 static int abbrev = -1; /* unspecified */
-static int max_candidates = 10;
+static int max_candidates = DEFAULT_CANDIDATES;
 static struct hashmap names;
 static int have_util;
 static struct string_list patterns = STRING_LIST_INIT_NODUP;
@@ -555,6 +558,15 @@ static void describe(const char *arg, int last_one)
        strbuf_release(&sb);
 }
 
+static int option_parse_exact_match(const struct option *opt, const char *arg,
+                                   int unset)
+{
+       BUG_ON_OPT_ARG(arg);
+
+       max_candidates = unset ? DEFAULT_CANDIDATES : 0;
+       return 0;
+}
+
 int cmd_describe(int argc, const char **argv, const char *prefix)
 {
        int contains = 0;
@@ -566,8 +578,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
                OPT_BOOL(0, "long",       &longformat, N_("always use long format")),
                OPT_BOOL(0, "first-parent", &first_parent, N_("only follow first parent")),
                OPT__ABBREV(&abbrev),
-               OPT_SET_INT(0, "exact-match", &max_candidates,
-                           N_("only output exact matches"), 0),
+               OPT_CALLBACK_F(0, "exact-match", NULL, NULL,
+                              N_("only output exact matches"),
+                              PARSE_OPT_NOARG, option_parse_exact_match),
                OPT_INTEGER(0, "candidates", &max_candidates,
                            N_("consider <n> most recent tags (default: 10)")),
                OPT_STRING_LIST(0, "match", &patterns, N_("pattern"),
index 0f8b64994c427a241e3d66726775d86a37c51f10..4f22eb2b55d06968896d12ae9257d470d5d3a8fb 100644 (file)
@@ -1,6 +1,7 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "gettext.h"
+#include "object-file.h"
 #include "parse-options.h"
 #include "diagnose.h"
 
index dc991f753bb8f10b2414a9c3486f8374d388f82a..50330b8dd2fd289a188b6143d528da2658327057 100644 (file)
@@ -3,13 +3,14 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "diff.h"
 #include "diff-merges.h"
 #include "commit.h"
+#include "preload-index.h"
+#include "repository.h"
 #include "revision.h"
-#include "builtin.h"
 #include "submodule.h"
 
 static const char diff_files_usage[] =
@@ -27,6 +28,10 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
                usage(diff_files_usage);
 
        git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+
+       prepare_repo_settings(the_repository);
+       the_repository->settings.command_requires_full_index = 0;
+
        repo_init_revisions(the_repository, &rev, prefix);
        rev.abbrev = 0;
 
index b9a19bb7d38074a907369c74b9cd72c98ac208c7..9db7139b839e46d10cf553fbb3d4a3a8e567735b 100644 (file)
@@ -1,11 +1,13 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "diff.h"
 #include "diff-merges.h"
 #include "commit.h"
+#include "preload-index.h"
+#include "repository.h"
 #include "revision.h"
-#include "builtin.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "submodule.h"
 
 static const char diff_cache_usage[] =
index 385c2d0230c5864f74ee26efd58a56993490222a..c9ba35f143814f2b016fccfb57ab99f86bee4c85 100644 (file)
@@ -1,14 +1,16 @@
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "diff.h"
 #include "commit.h"
 #include "gettext.h"
 #include "hex.h"
 #include "log-tree.h"
-#include "builtin.h"
 #include "submodule.h"
+#include "read-cache-ll.h"
 #include "repository.h"
+#include "revision.h"
+#include "tree.h"
 
 static struct rev_info log_tree_opt;
 
@@ -97,7 +99,7 @@ static const char diff_tree_usage[] =
 "  --root        include the initial commit as diff against /dev/null\n"
 COMMON_DIFF_OPTIONS_HELP;
 
-static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt *opt)
+static void diff_tree_tweak_rev(struct rev_info *rev)
 {
        if (!rev->diffopt.output_format) {
                if (rev->dense_combined_merges)
@@ -121,6 +123,10 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
                usage(diff_tree_usage);
 
        git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+
+       prepare_repo_settings(the_repository);
+       the_repository->settings.command_requires_full_index = 0;
+
        repo_init_revisions(the_repository, opt, prefix);
        if (repo_read_index(the_repository) < 0)
                die(_("index file corrupt"));
index 5a6a5d7f4b4a8a7b53f8138fd398664972180aab..b19530c996c7cd43be9baa3649c93247de888ebd 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2006 Junio C Hamano
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "ewah/ewok.h"
 #include "lockfile.h"
 #include "diff.h"
 #include "diff-merges.h"
 #include "diffcore.h"
+#include "preload-index.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "log-tree.h"
-#include "builtin.h"
 #include "setup.h"
 #include "submodule.h"
 #include "oid-array.h"
+#include "tree.h"
 
 #define DIFF_NO_INDEX_EXPLICIT 1
 #define DIFF_NO_INDEX_IMPLICIT 2
index 5ba524fa639cdd30dd6f6fa846519370fecc2510..0f5eae9cd41b3219b06964011089bb8d389975b4 100644 (file)
  * Copyright (C) 2016 Johannes Schindelin
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "config.h"
-#include "builtin.h"
+#include "copy.h"
 #include "run-command.h"
 #include "environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
+#include "sparse-index.h"
 #include "strvec.h"
 #include "strbuf.h"
 #include "lockfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "dir.h"
 #include "entry.h"
 #include "setup.h"
-#include "wrapper.h"
 
 static int trust_exit_code;
 
@@ -38,14 +40,15 @@ static const char *const builtin_difftool_usage[] = {
        NULL
 };
 
-static int difftool_config(const char *var, const char *value, void *cb)
+static int difftool_config(const char *var, const char *value,
+                          const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "difftool.trustexitcode")) {
                trust_exit_code = git_config_bool(var, value);
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static int print_tool_help(void)
index 8224bf4bc1d58b581d361cafcac5a584c1bbf850..56dc69fac180126a43f8a9ca3ed116ca67283737 100644 (file)
@@ -4,13 +4,13 @@
  * Copyright (C) 2007 Johannes E. Schindelin
  */
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
 #include "refspec.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "object.h"
 #include "tag.h"
index 1fb95275d70669006f1f43271880b23e776c6a98..4dbb10aff3dacf58b0ecb5daf648cefb16d41f4b 100644 (file)
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "commit.h"
 #include "delta.h"
 #include "pack.h"
+#include "path.h"
 #include "refs.h"
 #include "csum-file.h"
 #include "quote.h"
 #include "dir.h"
 #include "run-command.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "mem-pool.h"
 #include "commit-reach.h"
 #include "khash.h"
 #include "date.h"
-#include "wrapper.h"
 
 #define PACK_ID_BITS 16
 #define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
index 5f341b794dc0184c936a4dd9aad4d93dca2cd9dc..44c05ee86cc7048e72e455f4c2a28a1d42a1f7fa 100644 (file)
@@ -1,7 +1,7 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-file.h"
 #include "pkt-line.h"
 #include "fetch-pack.h"
 #include "remote.h"
index 85bd2801036a8401a096043e26db1aeadc44d325..eed4a7cdb6c1d672ab7324ea129d83ea312b688e 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * "git fetch"
  */
-#include "cache.h"
+#include "builtin.h"
+#include "advice.h"
 #include "config.h"
 #include "gettext.h"
 #include "environment.h"
 #include "repository.h"
 #include "refs.h"
 #include "refspec.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "oidset.h"
+#include "oid-array.h"
 #include "commit.h"
-#include "builtin.h"
 #include "string-list.h"
 #include "remote.h"
 #include "transport.h"
 #include "strvec.h"
 #include "utf8.h"
 #include "packfile.h"
+#include "pager.h"
+#include "path.h"
+#include "pkt-line.h"
 #include "list-objects-filter-options.h"
 #include "commit-reach.h"
 #include "branch.h"
 #include "promisor-remote.h"
 #include "commit-graph.h"
 #include "shallow.h"
+#include "trace.h"
+#include "trace2.h"
 #include "worktree.h"
 #include "bundle-uri.h"
 
@@ -50,35 +57,35 @@ enum {
        TAGS_SET = 2
 };
 
+enum display_format {
+       DISPLAY_FORMAT_FULL,
+       DISPLAY_FORMAT_COMPACT,
+       DISPLAY_FORMAT_PORCELAIN,
+};
+
 struct display_state {
        struct strbuf buf;
 
        int refcol_width;
-       int compact_format;
+       enum display_format format;
 
        char *url;
        int url_len, shown_url;
 };
 
-static int fetch_prune_config = -1; /* unspecified */
-static int fetch_show_forced_updates = 1;
 static uint64_t forced_updates_ms = 0;
 static int prefetch = 0;
 static int prune = -1; /* unspecified */
 #define PRUNE_BY_DEFAULT 0 /* do we prune by default? */
 
-static int fetch_prune_tags_config = -1; /* unspecified */
 static int prune_tags = -1; /* unspecified */
 #define PRUNE_TAGS_BY_DEFAULT 0 /* do we prune tags by default? */
 
-static int all, append, dry_run, force, keep, multiple, update_head_ok;
+static int append, dry_run, force, keep, update_head_ok;
 static int write_fetch_head = 1;
 static int verbosity, deepen_relative, set_upstream, refetch;
 static int progress = -1;
-static int enable_auto_gc = 1;
-static int tags = TAGS_DEFAULT, unshallow, update_shallow, deepen;
-static int max_jobs = -1, submodule_fetch_jobs_config = -1;
-static int fetch_parallel_config = 1;
+static int tags = TAGS_DEFAULT, update_shallow, deepen;
 static int atomic_fetch;
 static enum transport_family family;
 static const char *depth;
@@ -88,59 +95,77 @@ static struct string_list deepen_not = STRING_LIST_INIT_NODUP;
 static struct strbuf default_rla = STRBUF_INIT;
 static struct transport *gtransport;
 static struct transport *gsecondary;
-static const char *submodule_prefix = "";
-static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
-static int recurse_submodules_cli = RECURSE_SUBMODULES_DEFAULT;
-static int recurse_submodules_default = RECURSE_SUBMODULES_ON_DEMAND;
 static struct refspec refmap = REFSPEC_INIT_FETCH;
 static struct list_objects_filter_options filter_options = LIST_OBJECTS_FILTER_INIT;
 static struct string_list server_options = STRING_LIST_INIT_DUP;
 static struct string_list negotiation_tip = STRING_LIST_INIT_NODUP;
-static int fetch_write_commit_graph = -1;
-static int stdin_refspecs = 0;
-static int negotiate_only;
 
-static int git_fetch_config(const char *k, const char *v, void *cb)
+struct fetch_config {
+       enum display_format display_format;
+       int prune;
+       int prune_tags;
+       int show_forced_updates;
+       int recurse_submodules;
+       int parallel;
+       int submodule_fetch_jobs;
+};
+
+static int git_fetch_config(const char *k, const char *v,
+                           const struct config_context *ctx, void *cb)
 {
+       struct fetch_config *fetch_config = cb;
+
        if (!strcmp(k, "fetch.prune")) {
-               fetch_prune_config = git_config_bool(k, v);
+               fetch_config->prune = git_config_bool(k, v);
                return 0;
        }
 
        if (!strcmp(k, "fetch.prunetags")) {
-               fetch_prune_tags_config = git_config_bool(k, v);
+               fetch_config->prune_tags = git_config_bool(k, v);
                return 0;
        }
 
        if (!strcmp(k, "fetch.showforcedupdates")) {
-               fetch_show_forced_updates = git_config_bool(k, v);
+               fetch_config->show_forced_updates = git_config_bool(k, v);
                return 0;
        }
 
        if (!strcmp(k, "submodule.recurse")) {
                int r = git_config_bool(k, v) ?
                        RECURSE_SUBMODULES_ON : RECURSE_SUBMODULES_OFF;
-               recurse_submodules = r;
+               fetch_config->recurse_submodules = r;
        }
 
        if (!strcmp(k, "submodule.fetchjobs")) {
-               submodule_fetch_jobs_config = parse_submodule_fetchjobs(k, v);
+               fetch_config->submodule_fetch_jobs = parse_submodule_fetchjobs(k, v, ctx->kvi);
                return 0;
        } else if (!strcmp(k, "fetch.recursesubmodules")) {
-               recurse_submodules = parse_fetch_recurse_submodules_arg(k, v);
+               fetch_config->recurse_submodules = parse_fetch_recurse_submodules_arg(k, v);
                return 0;
        }
 
        if (!strcmp(k, "fetch.parallel")) {
-               fetch_parallel_config = git_config_int(k, v);
-               if (fetch_parallel_config < 0)
+               fetch_config->parallel = git_config_int(k, v, ctx->kvi);
+               if (fetch_config->parallel < 0)
                        die(_("fetch.parallel cannot be negative"));
-               if (!fetch_parallel_config)
-                       fetch_parallel_config = online_cpus();
+               if (!fetch_config->parallel)
+                       fetch_config->parallel = online_cpus();
                return 0;
        }
 
-       return git_default_config(k, v, cb);
+       if (!strcmp(k, "fetch.output")) {
+               if (!v)
+                       return config_error_nonbool(k);
+               else if (!strcasecmp(v, "full"))
+                       fetch_config->display_format = DISPLAY_FORMAT_FULL;
+               else if (!strcasecmp(v, "compact"))
+                       fetch_config->display_format = DISPLAY_FORMAT_COMPACT;
+               else
+                       die(_("invalid value for '%s': '%s'"),
+                           "fetch.output", v);
+       }
+
+       return git_default_config(k, v, ctx, cb);
 }
 
 static int parse_refmap_arg(const struct option *opt, const char *arg, int unset)
@@ -156,92 +181,6 @@ static int parse_refmap_arg(const struct option *opt, const char *arg, int unset
        return 0;
 }
 
-static struct option builtin_fetch_options[] = {
-       OPT__VERBOSITY(&verbosity),
-       OPT_BOOL(0, "all", &all,
-                N_("fetch from all remotes")),
-       OPT_BOOL(0, "set-upstream", &set_upstream,
-                N_("set upstream for git pull/fetch")),
-       OPT_BOOL('a', "append", &append,
-                N_("append to .git/FETCH_HEAD instead of overwriting")),
-       OPT_BOOL(0, "atomic", &atomic_fetch,
-                N_("use atomic transaction to update references")),
-       OPT_STRING(0, "upload-pack", &upload_pack, N_("path"),
-                  N_("path to upload pack on remote end")),
-       OPT__FORCE(&force, N_("force overwrite of local reference"), 0),
-       OPT_BOOL('m', "multiple", &multiple,
-                N_("fetch from multiple remotes")),
-       OPT_SET_INT('t', "tags", &tags,
-                   N_("fetch all tags and associated objects"), TAGS_SET),
-       OPT_SET_INT('n', NULL, &tags,
-                   N_("do not fetch all tags (--no-tags)"), TAGS_UNSET),
-       OPT_INTEGER('j', "jobs", &max_jobs,
-                   N_("number of submodules fetched in parallel")),
-       OPT_BOOL(0, "prefetch", &prefetch,
-                N_("modify the refspec to place all refs within refs/prefetch/")),
-       OPT_BOOL('p', "prune", &prune,
-                N_("prune remote-tracking branches no longer on remote")),
-       OPT_BOOL('P', "prune-tags", &prune_tags,
-                N_("prune local tags no longer on remote and clobber changed tags")),
-       OPT_CALLBACK_F(0, "recurse-submodules", &recurse_submodules_cli, N_("on-demand"),
-                   N_("control recursive fetching of submodules"),
-                   PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules),
-       OPT_BOOL(0, "dry-run", &dry_run,
-                N_("dry run")),
-       OPT_BOOL(0, "write-fetch-head", &write_fetch_head,
-                N_("write fetched references to the FETCH_HEAD file")),
-       OPT_BOOL('k', "keep", &keep, N_("keep downloaded pack")),
-       OPT_BOOL('u', "update-head-ok", &update_head_ok,
-                   N_("allow updating of HEAD ref")),
-       OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
-       OPT_STRING(0, "depth", &depth, N_("depth"),
-                  N_("deepen history of shallow clone")),
-       OPT_STRING(0, "shallow-since", &deepen_since, N_("time"),
-                  N_("deepen history of shallow repository based on time")),
-       OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("revision"),
-                       N_("deepen history of shallow clone, excluding rev")),
-       OPT_INTEGER(0, "deepen", &deepen_relative,
-                   N_("deepen history of shallow clone")),
-       OPT_SET_INT_F(0, "unshallow", &unshallow,
-                     N_("convert to a complete repository"),
-                     1, PARSE_OPT_NONEG),
-       OPT_SET_INT_F(0, "refetch", &refetch,
-                     N_("re-fetch without negotiating common commits"),
-                     1, PARSE_OPT_NONEG),
-       { OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
-                  N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN },
-       OPT_CALLBACK_F(0, "recurse-submodules-default",
-                  &recurse_submodules_default, N_("on-demand"),
-                  N_("default for recursive fetching of submodules "
-                     "(lower priority than config files)"),
-                  PARSE_OPT_HIDDEN, option_fetch_parse_recurse_submodules),
-       OPT_BOOL(0, "update-shallow", &update_shallow,
-                N_("accept refs that update .git/shallow")),
-       OPT_CALLBACK_F(0, "refmap", NULL, N_("refmap"),
-                      N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg),
-       OPT_STRING_LIST('o', "server-option", &server_options, N_("server-specific"), N_("option to transmit")),
-       OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
-                       TRANSPORT_FAMILY_IPV4),
-       OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
-                       TRANSPORT_FAMILY_IPV6),
-       OPT_STRING_LIST(0, "negotiation-tip", &negotiation_tip, N_("revision"),
-                       N_("report that we have only objects reachable from this object")),
-       OPT_BOOL(0, "negotiate-only", &negotiate_only,
-                N_("do not fetch a packfile; instead, print ancestors of negotiation tips")),
-       OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
-       OPT_BOOL(0, "auto-maintenance", &enable_auto_gc,
-                N_("run 'maintenance --auto' after fetching")),
-       OPT_BOOL(0, "auto-gc", &enable_auto_gc,
-                N_("run 'maintenance --auto' after fetching")),
-       OPT_BOOL(0, "show-forced-updates", &fetch_show_forced_updates,
-                N_("check for forced-updates on all updated branches")),
-       OPT_BOOL(0, "write-commit-graph", &fetch_write_commit_graph,
-                N_("write the commit-graph after fetching")),
-       OPT_BOOL(0, "stdin", &stdin_refspecs,
-                N_("accept refspecs from stdin")),
-       OPT_END()
-};
-
 static void unlock_pack(unsigned int flags)
 {
        if (gtransport)
@@ -753,46 +692,56 @@ out:
        return ret;
 }
 
-static int refcol_width(const struct ref *ref, int compact_format)
+static int refcol_width(const struct ref *ref_map, int compact_format)
 {
-       int max, rlen, llen, len;
+       const struct ref *ref;
+       int max, width = 10;
 
-       /* uptodate lines are only shown on high verbosity level */
-       if (verbosity <= 0 && oideq(&ref->peer_ref->old_oid, &ref->old_oid))
-               return 0;
+       max = term_columns();
+       if (compact_format)
+               max = max * 2 / 3;
 
-       max    = term_columns();
-       rlen   = utf8_strwidth(prettify_refname(ref->name));
+       for (ref = ref_map; ref; ref = ref->next) {
+               int rlen, llen = 0, len;
 
-       llen   = utf8_strwidth(prettify_refname(ref->peer_ref->name));
+               if (ref->status == REF_STATUS_REJECT_SHALLOW ||
+                   !ref->peer_ref ||
+                   !strcmp(ref->name, "HEAD"))
+                       continue;
 
-       /*
-        * rough estimation to see if the output line is too long and
-        * should not be counted (we can't do precise calculation
-        * anyway because we don't know if the error explanation part
-        * will be printed in update_local_ref)
-        */
-       if (compact_format) {
-               llen = 0;
-               max = max * 2 / 3;
+               /* uptodate lines are only shown on high verbosity level */
+               if (verbosity <= 0 && oideq(&ref->peer_ref->old_oid, &ref->old_oid))
+                       continue;
+
+               rlen = utf8_strwidth(prettify_refname(ref->name));
+               if (!compact_format)
+                       llen = utf8_strwidth(prettify_refname(ref->peer_ref->name));
+
+               /*
+                * rough estimation to see if the output line is too long and
+                * should not be counted (we can't do precise calculation
+                * anyway because we don't know if the error explanation part
+                * will be printed in update_local_ref)
+                */
+               len = 21 /* flag and summary */ + rlen + 4 /* -> */ + llen;
+               if (len >= max)
+                       continue;
+
+               if (width < rlen)
+                       width = rlen;
        }
-       len = 21 /* flag and summary */ + rlen + 4 /* -> */ + llen;
-       if (len >= max)
-               return 0;
 
-       return rlen;
+       return width;
 }
 
 static void display_state_init(struct display_state *display_state, struct ref *ref_map,
-                              const char *raw_url)
+                              const char *raw_url, enum display_format format)
 {
-       struct ref *rm;
-       const char *format = "full";
        int i;
 
        memset(display_state, 0, sizeof(*display_state));
-
        strbuf_init(&display_state->buf, 0);
+       display_state->format = format;
 
        if (raw_url)
                display_state->url = transport_anonymize_url(raw_url);
@@ -809,33 +758,17 @@ static void display_state_init(struct display_state *display_state, struct ref *
        if (verbosity < 0)
                return;
 
-       git_config_get_string_tmp("fetch.output", &format);
-       if (!strcasecmp(format, "full"))
-               display_state->compact_format = 0;
-       else if (!strcasecmp(format, "compact"))
-               display_state->compact_format = 1;
-       else
-               die(_("invalid value for '%s': '%s'"),
-                   "fetch.output", format);
-
-       display_state->refcol_width = 10;
-       for (rm = ref_map; rm; rm = rm->next) {
-               int width;
-
-               if (rm->status == REF_STATUS_REJECT_SHALLOW ||
-                   !rm->peer_ref ||
-                   !strcmp(rm->name, "HEAD"))
-                       continue;
-
-               width = refcol_width(rm, display_state->compact_format);
-
-               /*
-                * Not precise calculation for compact mode because '*' can
-                * appear on the left hand side of '->' and shrink the column
-                * back.
-                */
-               if (display_state->refcol_width < width)
-                       display_state->refcol_width = width;
+       switch (display_state->format) {
+       case DISPLAY_FORMAT_FULL:
+       case DISPLAY_FORMAT_COMPACT:
+               display_state->refcol_width = refcol_width(ref_map,
+                                                          display_state->format == DISPLAY_FORMAT_COMPACT);
+               break;
+       case DISPLAY_FORMAT_PORCELAIN:
+               /* We don't need to precompute anything here. */
+               break;
+       default:
+               BUG("unexpected display format %d", display_state->format);
        }
 }
 
@@ -904,40 +837,63 @@ static void print_compact(struct display_state *display_state,
 static void display_ref_update(struct display_state *display_state, char code,
                               const char *summary, const char *error,
                               const char *remote, const char *local,
+                              const struct object_id *old_oid,
+                              const struct object_id *new_oid,
                               int summary_width)
 {
-       int width;
+       FILE *f = stderr;
 
        if (verbosity < 0)
                return;
 
        strbuf_reset(&display_state->buf);
 
-       if (!display_state->shown_url) {
-               strbuf_addf(&display_state->buf, _("From %.*s\n"),
-                           display_state->url_len, display_state->url);
-               display_state->shown_url = 1;
-       }
+       switch (display_state->format) {
+       case DISPLAY_FORMAT_FULL:
+       case DISPLAY_FORMAT_COMPACT: {
+               int width;
 
-       width = (summary_width + strlen(summary) - gettext_width(summary));
+               if (!display_state->shown_url) {
+                       strbuf_addf(&display_state->buf, _("From %.*s\n"),
+                                   display_state->url_len, display_state->url);
+                       display_state->shown_url = 1;
+               }
 
-       strbuf_addf(&display_state->buf, " %c %-*s ", code, width, summary);
-       if (!display_state->compact_format)
-               print_remote_to_local(display_state, remote, prettify_refname(local));
-       else
-               print_compact(display_state, remote, prettify_refname(local));
-       if (error)
-               strbuf_addf(&display_state->buf, "  (%s)", error);
+               width = (summary_width + strlen(summary) - gettext_width(summary));
+               remote = prettify_refname(remote);
+               local = prettify_refname(local);
+
+               strbuf_addf(&display_state->buf, " %c %-*s ", code, width, summary);
+
+               if (display_state->format != DISPLAY_FORMAT_COMPACT)
+                       print_remote_to_local(display_state, remote, local);
+               else
+                       print_compact(display_state, remote, local);
+
+               if (error)
+                       strbuf_addf(&display_state->buf, "  (%s)", error);
+
+               break;
+       }
+       case DISPLAY_FORMAT_PORCELAIN:
+               strbuf_addf(&display_state->buf, "%c %s %s %s", code,
+                           oid_to_hex(old_oid), oid_to_hex(new_oid), local);
+               f = stdout;
+               break;
+       default:
+               BUG("unexpected display format %d", display_state->format);
+       };
        strbuf_addch(&display_state->buf, '\n');
 
-       fputs(display_state->buf.buf, stderr);
+       fputs(display_state->buf.buf, f);
 }
 
 static int update_local_ref(struct ref *ref,
                            struct ref_transaction *transaction,
                            struct display_state *display_state,
-                           const char *remote, const struct ref *remote_ref,
-                           int summary_width)
+                           const struct ref *remote_ref,
+                           int summary_width,
+                           const struct fetch_config *config)
 {
        struct commit *current = NULL, *updated;
        int fast_forward = 0;
@@ -948,7 +904,8 @@ static int update_local_ref(struct ref *ref,
        if (oideq(&ref->old_oid, &ref->new_oid)) {
                if (verbosity > 0)
                        display_ref_update(display_state, '=', _("[up to date]"), NULL,
-                                          remote, ref->name, summary_width);
+                                          remote_ref->name, ref->name,
+                                          &ref->old_oid, &ref->new_oid, summary_width);
                return 0;
        }
 
@@ -961,7 +918,8 @@ static int update_local_ref(struct ref *ref,
                 */
                display_ref_update(display_state, '!', _("[rejected]"),
                                   _("can't fetch into checked-out branch"),
-                                  remote, ref->name, summary_width);
+                                  remote_ref->name, ref->name,
+                                  &ref->old_oid, &ref->new_oid, summary_width);
                return 1;
        }
 
@@ -972,12 +930,14 @@ static int update_local_ref(struct ref *ref,
                        r = s_update_ref("updating tag", ref, transaction, 0);
                        display_ref_update(display_state, r ? '!' : 't', _("[tag update]"),
                                           r ? _("unable to update local ref") : NULL,
-                                          remote, ref->name, summary_width);
+                                          remote_ref->name, ref->name,
+                                          &ref->old_oid, &ref->new_oid, summary_width);
                        return r;
                } else {
                        display_ref_update(display_state, '!', _("[rejected]"),
                                           _("would clobber existing tag"),
-                                          remote, ref->name, summary_width);
+                                          remote_ref->name, ref->name,
+                                          &ref->old_oid, &ref->new_oid, summary_width);
                        return 1;
                }
        }
@@ -995,11 +955,10 @@ static int update_local_ref(struct ref *ref,
                 * Base this on the remote's ref name, as it's
                 * more likely to follow a standard layout.
                 */
-               const char *name = remote_ref ? remote_ref->name : "";
-               if (starts_with(name, "refs/tags/")) {
+               if (starts_with(remote_ref->name, "refs/tags/")) {
                        msg = "storing tag";
                        what = _("[new tag]");
-               } else if (starts_with(name, "refs/heads/")) {
+               } else if (starts_with(remote_ref->name, "refs/heads/")) {
                        msg = "storing head";
                        what = _("[new branch]");
                } else {
@@ -1010,11 +969,12 @@ static int update_local_ref(struct ref *ref,
                r = s_update_ref(msg, ref, transaction, 0);
                display_ref_update(display_state, r ? '!' : '*', what,
                                   r ? _("unable to update local ref") : NULL,
-                                  remote, ref->name, summary_width);
+                                  remote_ref->name, ref->name,
+                                  &ref->old_oid, &ref->new_oid, summary_width);
                return r;
        }
 
-       if (fetch_show_forced_updates) {
+       if (config->show_forced_updates) {
                uint64_t t_before = getnanotime();
                fast_forward = repo_in_merge_bases(the_repository, current,
                                                   updated);
@@ -1033,7 +993,8 @@ static int update_local_ref(struct ref *ref,
                r = s_update_ref("fast-forward", ref, transaction, 1);
                display_ref_update(display_state, r ? '!' : ' ', quickref.buf,
                                   r ? _("unable to update local ref") : NULL,
-                                  remote, ref->name, summary_width);
+                                  remote_ref->name, ref->name,
+                                  &ref->old_oid, &ref->new_oid, summary_width);
                strbuf_release(&quickref);
                return r;
        } else if (force || ref->force) {
@@ -1045,12 +1006,14 @@ static int update_local_ref(struct ref *ref,
                r = s_update_ref("forced-update", ref, transaction, 1);
                display_ref_update(display_state, r ? '!' : '+', quickref.buf,
                                   r ? _("unable to update local ref") : _("forced update"),
-                                  remote, ref->name, summary_width);
+                                  remote_ref->name, ref->name,
+                                  &ref->old_oid, &ref->new_oid, summary_width);
                strbuf_release(&quickref);
                return r;
        } else {
                display_ref_update(display_state, '!', _("[rejected]"), _("non-fast-forward"),
-                                  remote, ref->name, summary_width);
+                                  remote_ref->name, ref->name,
+                                  &ref->old_oid, &ref->new_oid, summary_width);
                return 1;
        }
 }
@@ -1164,7 +1127,8 @@ static int store_updated_refs(struct display_state *display_state,
                              const char *remote_name,
                              int connectivity_checked,
                              struct ref_transaction *transaction, struct ref *ref_map,
-                             struct fetch_head *fetch_head)
+                             struct fetch_head *fetch_head,
+                             const struct fetch_config *config)
 {
        int rc = 0;
        struct strbuf note = STRBUF_INIT;
@@ -1247,7 +1211,7 @@ static int store_updated_refs(struct display_state *display_state,
                                ref->force = rm->peer_ref->force;
                        }
 
-                       if (recurse_submodules != RECURSE_SUBMODULES_OFF &&
+                       if (config->recurse_submodules != RECURSE_SUBMODULES_OFF &&
                            (!rm->peer_ref || !oideq(&ref->old_oid, &ref->new_oid))) {
                                check_for_new_submodule_commits(&rm->old_oid);
                        }
@@ -1255,14 +1219,13 @@ static int store_updated_refs(struct display_state *display_state,
                        if (!strcmp(rm->name, "HEAD")) {
                                kind = "";
                                what = "";
-                       }
-                       else if (skip_prefix(rm->name, "refs/heads/", &what))
+                       } else if (skip_prefix(rm->name, "refs/heads/", &what)) {
                                kind = "branch";
-                       else if (skip_prefix(rm->name, "refs/tags/", &what))
+                       } else if (skip_prefix(rm->name, "refs/tags/", &what)) {
                                kind = "tag";
-                       else if (skip_prefix(rm->name, "refs/remotes/", &what))
+                       } else if (skip_prefix(rm->name, "refs/remotes/", &what)) {
                                kind = "remote-tracking branch";
-                       else {
+                       else {
                                kind = "";
                                what = rm->name;
                        }
@@ -1280,8 +1243,8 @@ static int store_updated_refs(struct display_state *display_state,
                                          display_state->url_len);
 
                        if (ref) {
-                               rc |= update_local_ref(ref, transaction, display_state, what,
-                                                      rm, summary_width);
+                               rc |= update_local_ref(ref, transaction, display_state,
+                                                      rm, summary_width, config);
                                free(ref);
                        } else if (write_fetch_head || dry_run) {
                                /*
@@ -1291,8 +1254,10 @@ static int store_updated_refs(struct display_state *display_state,
                                 */
                                display_ref_update(display_state, '*',
                                                   *kind ? kind : "branch", NULL,
-                                                  *what ? what : "HEAD",
-                                                  "FETCH_HEAD", summary_width);
+                                                  rm->name,
+                                                  "FETCH_HEAD",
+                                                  &rm->new_oid, &rm->old_oid,
+                                                  summary_width);
                        }
                }
        }
@@ -1303,7 +1268,7 @@ static int store_updated_refs(struct display_state *display_state,
                      "branches"), remote_name);
 
        if (advice_enabled(ADVICE_FETCH_SHOW_FORCED_UPDATES)) {
-               if (!fetch_show_forced_updates) {
+               if (!config->show_forced_updates) {
                        warning(_(warn_show_forced_updates));
                } else if (forced_updates_ms > FORCED_UPDATES_DELAY_WARNING_IN_MS) {
                        warning(_(warn_time_show_forced_updates),
@@ -1364,7 +1329,8 @@ static int fetch_and_consume_refs(struct display_state *display_state,
                                  struct transport *transport,
                                  struct ref_transaction *transaction,
                                  struct ref *ref_map,
-                                 struct fetch_head *fetch_head)
+                                 struct fetch_head *fetch_head,
+                                 const struct fetch_config *config)
 {
        int connectivity_checked = 1;
        int ret;
@@ -1387,7 +1353,7 @@ static int fetch_and_consume_refs(struct display_state *display_state,
        trace2_region_enter("fetch", "consume_refs", the_repository);
        ret = store_updated_refs(display_state, transport->remote->name,
                                 connectivity_checked, transaction, ref_map,
-                                fetch_head);
+                                fetch_head, config);
        trace2_region_leave("fetch", "consume_refs", the_repository);
 
 out:
@@ -1432,6 +1398,7 @@ static int prune_refs(struct display_state *display_state,
                for (ref = stale_refs; ref; ref = ref->next) {
                        display_ref_update(display_state, '-', _("[deleted]"), NULL,
                                           _("(none)"), ref->name,
+                                          &ref->new_oid, &ref->old_oid,
                                           summary_width);
                        warn_dangling_symref(stderr, dangling_msg, ref->name);
                }
@@ -1557,7 +1524,8 @@ static int backfill_tags(struct display_state *display_state,
                         struct transport *transport,
                         struct ref_transaction *transaction,
                         struct ref *ref_map,
-                        struct fetch_head *fetch_head)
+                        struct fetch_head *fetch_head,
+                        const struct fetch_config *config)
 {
        int retcode, cannot_reuse;
 
@@ -1578,7 +1546,8 @@ static int backfill_tags(struct display_state *display_state,
        transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, NULL);
        transport_set_option(transport, TRANS_OPT_DEPTH, "0");
        transport_set_option(transport, TRANS_OPT_DEEPEN_RELATIVE, NULL);
-       retcode = fetch_and_consume_refs(display_state, transport, transaction, ref_map, fetch_head);
+       retcode = fetch_and_consume_refs(display_state, transport, transaction, ref_map,
+                                        fetch_head, config);
 
        if (gsecondary) {
                transport_disconnect(gsecondary);
@@ -1589,7 +1558,8 @@ static int backfill_tags(struct display_state *display_state,
 }
 
 static int do_fetch(struct transport *transport,
-                   struct refspec *rs)
+                   struct refspec *rs,
+                   const struct fetch_config *config)
 {
        struct ref_transaction *transaction = NULL;
        struct ref *ref_map = NULL;
@@ -1675,7 +1645,8 @@ static int do_fetch(struct transport *transport,
        if (retcode)
                goto cleanup;
 
-       display_state_init(&display_state, ref_map, transport->url);
+       display_state_init(&display_state, ref_map, transport->url,
+                          config->display_format);
 
        if (atomic_fetch) {
                transaction = ref_transaction_begin(&err);
@@ -1703,7 +1674,8 @@ static int do_fetch(struct transport *transport,
                        retcode = 1;
        }
 
-       if (fetch_and_consume_refs(&display_state, transport, transaction, ref_map, &fetch_head)) {
+       if (fetch_and_consume_refs(&display_state, transport, transaction, ref_map,
+                                  &fetch_head, config)) {
                retcode = 1;
                goto cleanup;
        }
@@ -1726,7 +1698,7 @@ static int do_fetch(struct transport *transport,
                         * the transaction and don't commit anything.
                         */
                        if (backfill_tags(&display_state, transport, transaction, tags_ref_map,
-                                         &fetch_head))
+                                         &fetch_head, config))
                                retcode = 1;
                }
 
@@ -1828,7 +1800,9 @@ struct remote_group_data {
        struct string_list *list;
 };
 
-static int get_remote_group(const char *key, const char *value, void *priv)
+static int get_remote_group(const char *key, const char *value,
+                           const struct config_context *ctx UNUSED,
+                           void *priv)
 {
        struct remote_group_data *g = priv;
 
@@ -1863,7 +1837,8 @@ static int add_remote_or_group(const char *name, struct string_list *list)
        return 1;
 }
 
-static void add_options_to_argv(struct strvec *argv)
+static void add_options_to_argv(struct strvec *argv,
+                               const struct fetch_config *config)
 {
        if (dry_run)
                strvec_push(argv, "--dry-run");
@@ -1877,9 +1852,11 @@ static void add_options_to_argv(struct strvec *argv)
                strvec_push(argv, "--force");
        if (keep)
                strvec_push(argv, "--keep");
-       if (recurse_submodules == RECURSE_SUBMODULES_ON)
+       if (config->recurse_submodules == RECURSE_SUBMODULES_ON)
                strvec_push(argv, "--recurse-submodules");
-       else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
+       else if (config->recurse_submodules == RECURSE_SUBMODULES_OFF)
+               strvec_push(argv, "--no-recurse-submodules");
+       else if (config->recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)
                strvec_push(argv, "--recurse-submodules=on-demand");
        if (tags == TAGS_SET)
                strvec_push(argv, "--tags");
@@ -1897,6 +1874,8 @@ static void add_options_to_argv(struct strvec *argv)
                strvec_push(argv, "--ipv6");
        if (!write_fetch_head)
                strvec_push(argv, "--no-write-fetch-head");
+       if (config->display_format == DISPLAY_FORMAT_PORCELAIN)
+               strvec_pushf(argv, "--porcelain");
 }
 
 /* Fetch multiple remotes in parallel */
@@ -1905,6 +1884,7 @@ struct parallel_fetch_state {
        const char **argv;
        struct string_list *remotes;
        int next, result;
+       const struct fetch_config *config;
 };
 
 static int fetch_next_remote(struct child_process *cp,
@@ -1924,7 +1904,7 @@ static int fetch_next_remote(struct child_process *cp,
        strvec_push(&cp->args, remote);
        cp->git_cmd = 1;
 
-       if (verbosity >= 0)
+       if (verbosity >= 0 && state->config->display_format != DISPLAY_FORMAT_PORCELAIN)
                printf(_("Fetching %s\n"), remote);
 
        return 1;
@@ -1956,7 +1936,8 @@ static int fetch_finished(int result, struct strbuf *out,
        return 0;
 }
 
-static int fetch_multiple(struct string_list *list, int max_children)
+static int fetch_multiple(struct string_list *list, int max_children,
+                         const struct fetch_config *config)
 {
        int i, result = 0;
        struct strvec argv = STRVEC_INIT;
@@ -1974,10 +1955,10 @@ static int fetch_multiple(struct string_list *list, int max_children)
        strvec_pushl(&argv, "-c", "fetch.bundleURI=",
                     "fetch", "--append", "--no-auto-gc",
                     "--no-write-commit-graph", NULL);
-       add_options_to_argv(&argv);
+       add_options_to_argv(&argv, config);
 
        if (max_children != 1 && list->nr != 1) {
-               struct parallel_fetch_state state = { argv.v, list, 0, 0 };
+               struct parallel_fetch_state state = { argv.v, list, 0, 0, config };
                const struct run_process_parallel_opts opts = {
                        .tr2_category = "fetch",
                        .tr2_label = "parallel/fetch",
@@ -2001,7 +1982,7 @@ static int fetch_multiple(struct string_list *list, int max_children)
 
                        strvec_pushv(&cmd.args, argv.v);
                        strvec_push(&cmd.args, name);
-                       if (verbosity >= 0)
+                       if (verbosity >= 0 && config->display_format != DISPLAY_FORMAT_PORCELAIN)
                                printf(_("Fetching %s\n"), name);
                        cmd.git_cmd = 1;
                        if (run_command(&cmd)) {
@@ -2056,7 +2037,8 @@ static inline void fetch_one_setup_partial(struct remote *remote)
 }
 
 static int fetch_one(struct remote *remote, int argc, const char **argv,
-                    int prune_tags_ok, int use_stdin_refspecs)
+                    int prune_tags_ok, int use_stdin_refspecs,
+                    const struct fetch_config *config)
 {
        struct refspec rs = REFSPEC_INIT_FETCH;
        int i;
@@ -2074,8 +2056,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
                /* no command line request */
                if (0 <= remote->prune)
                        prune = remote->prune;
-               else if (0 <= fetch_prune_config)
-                       prune = fetch_prune_config;
+               else if (0 <= config->prune)
+                       prune = config->prune;
                else
                        prune = PRUNE_BY_DEFAULT;
        }
@@ -2084,8 +2066,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
                /* no command line request */
                if (0 <= remote->prune_tags)
                        prune_tags = remote->prune_tags;
-               else if (0 <= fetch_prune_tags_config)
-                       prune_tags = fetch_prune_tags_config;
+               else if (0 <= config->prune_tags)
+                       prune_tags = config->prune_tags;
                else
                        prune_tags = PRUNE_TAGS_BY_DEFAULT;
        }
@@ -2123,7 +2105,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
        sigchain_push_common(unlock_pack_on_signal);
        atexit(unlock_pack_atexit);
        sigchain_push(SIGPIPE, SIG_IGN);
-       exit_code = do_fetch(gtransport, &rs);
+       exit_code = do_fetch(gtransport, &rs, config);
        sigchain_pop(SIGPIPE);
        refspec_clear(&rs);
        transport_disconnect(gtransport);
@@ -2133,12 +2115,116 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
 
 int cmd_fetch(int argc, const char **argv, const char *prefix)
 {
-       int i;
+       struct fetch_config config = {
+               .display_format = DISPLAY_FORMAT_FULL,
+               .prune = -1,
+               .prune_tags = -1,
+               .show_forced_updates = 1,
+               .recurse_submodules = RECURSE_SUBMODULES_DEFAULT,
+               .parallel = 1,
+               .submodule_fetch_jobs = -1,
+       };
+       const char *submodule_prefix = "";
        const char *bundle_uri;
        struct string_list list = STRING_LIST_INIT_DUP;
        struct remote *remote = NULL;
+       int all = 0, multiple = 0;
        int result = 0;
        int prune_tags_ok = 1;
+       int enable_auto_gc = 1;
+       int unshallow = 0;
+       int max_jobs = -1;
+       int recurse_submodules_cli = RECURSE_SUBMODULES_DEFAULT;
+       int recurse_submodules_default = RECURSE_SUBMODULES_ON_DEMAND;
+       int fetch_write_commit_graph = -1;
+       int stdin_refspecs = 0;
+       int negotiate_only = 0;
+       int porcelain = 0;
+       int i;
+
+       struct option builtin_fetch_options[] = {
+               OPT__VERBOSITY(&verbosity),
+               OPT_BOOL(0, "all", &all,
+                        N_("fetch from all remotes")),
+               OPT_BOOL(0, "set-upstream", &set_upstream,
+                        N_("set upstream for git pull/fetch")),
+               OPT_BOOL('a', "append", &append,
+                        N_("append to .git/FETCH_HEAD instead of overwriting")),
+               OPT_BOOL(0, "atomic", &atomic_fetch,
+                        N_("use atomic transaction to update references")),
+               OPT_STRING(0, "upload-pack", &upload_pack, N_("path"),
+                          N_("path to upload pack on remote end")),
+               OPT__FORCE(&force, N_("force overwrite of local reference"), 0),
+               OPT_BOOL('m', "multiple", &multiple,
+                        N_("fetch from multiple remotes")),
+               OPT_SET_INT('t', "tags", &tags,
+                           N_("fetch all tags and associated objects"), TAGS_SET),
+               OPT_SET_INT('n', NULL, &tags,
+                           N_("do not fetch all tags (--no-tags)"), TAGS_UNSET),
+               OPT_INTEGER('j', "jobs", &max_jobs,
+                           N_("number of submodules fetched in parallel")),
+               OPT_BOOL(0, "prefetch", &prefetch,
+                        N_("modify the refspec to place all refs within refs/prefetch/")),
+               OPT_BOOL('p', "prune", &prune,
+                        N_("prune remote-tracking branches no longer on remote")),
+               OPT_BOOL('P', "prune-tags", &prune_tags,
+                        N_("prune local tags no longer on remote and clobber changed tags")),
+               OPT_CALLBACK_F(0, "recurse-submodules", &recurse_submodules_cli, N_("on-demand"),
+                           N_("control recursive fetching of submodules"),
+                           PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules),
+               OPT_BOOL(0, "dry-run", &dry_run,
+                        N_("dry run")),
+               OPT_BOOL(0, "porcelain", &porcelain, N_("machine-readable output")),
+               OPT_BOOL(0, "write-fetch-head", &write_fetch_head,
+                        N_("write fetched references to the FETCH_HEAD file")),
+               OPT_BOOL('k', "keep", &keep, N_("keep downloaded pack")),
+               OPT_BOOL('u', "update-head-ok", &update_head_ok,
+                           N_("allow updating of HEAD ref")),
+               OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
+               OPT_STRING(0, "depth", &depth, N_("depth"),
+                          N_("deepen history of shallow clone")),
+               OPT_STRING(0, "shallow-since", &deepen_since, N_("time"),
+                          N_("deepen history of shallow repository based on time")),
+               OPT_STRING_LIST(0, "shallow-exclude", &deepen_not, N_("revision"),
+                               N_("deepen history of shallow clone, excluding rev")),
+               OPT_INTEGER(0, "deepen", &deepen_relative,
+                           N_("deepen history of shallow clone")),
+               OPT_SET_INT_F(0, "unshallow", &unshallow,
+                             N_("convert to a complete repository"),
+                             1, PARSE_OPT_NONEG),
+               OPT_SET_INT_F(0, "refetch", &refetch,
+                             N_("re-fetch without negotiating common commits"),
+                             1, PARSE_OPT_NONEG),
+               { OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
+                          N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN },
+               OPT_CALLBACK_F(0, "recurse-submodules-default",
+                          &recurse_submodules_default, N_("on-demand"),
+                          N_("default for recursive fetching of submodules "
+                             "(lower priority than config files)"),
+                          PARSE_OPT_HIDDEN, option_fetch_parse_recurse_submodules),
+               OPT_BOOL(0, "update-shallow", &update_shallow,
+                        N_("accept refs that update .git/shallow")),
+               OPT_CALLBACK_F(0, "refmap", NULL, N_("refmap"),
+                              N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg),
+               OPT_STRING_LIST('o', "server-option", &server_options, N_("server-specific"), N_("option to transmit")),
+               OPT_IPVERSION(&family),
+               OPT_STRING_LIST(0, "negotiation-tip", &negotiation_tip, N_("revision"),
+                               N_("report that we have only objects reachable from this object")),
+               OPT_BOOL(0, "negotiate-only", &negotiate_only,
+                        N_("do not fetch a packfile; instead, print ancestors of negotiation tips")),
+               OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
+               OPT_BOOL(0, "auto-maintenance", &enable_auto_gc,
+                        N_("run 'maintenance --auto' after fetching")),
+               OPT_BOOL(0, "auto-gc", &enable_auto_gc,
+                        N_("run 'maintenance --auto' after fetching")),
+               OPT_BOOL(0, "show-forced-updates", &config.show_forced_updates,
+                        N_("check for forced-updates on all updated branches")),
+               OPT_BOOL(0, "write-commit-graph", &fetch_write_commit_graph,
+                        N_("write the commit-graph after fetching")),
+               OPT_BOOL(0, "stdin", &stdin_refspecs,
+                        N_("accept refspecs from stdin")),
+               OPT_END()
+       };
 
        packet_trace_identity("fetch");
 
@@ -2152,7 +2238,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
                free(anon);
        }
 
-       git_config(git_fetch_config, NULL);
+       git_config(git_fetch_config, &config);
        if (the_repository->gitdir) {
                prepare_repo_settings(the_repository);
                the_repository->settings.command_requires_full_index = 0;
@@ -2162,7 +2248,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
                             builtin_fetch_options, builtin_fetch_usage, 0);
 
        if (recurse_submodules_cli != RECURSE_SUBMODULES_DEFAULT)
-               recurse_submodules = recurse_submodules_cli;
+               config.recurse_submodules = recurse_submodules_cli;
 
        if (negotiate_only) {
                switch (recurse_submodules_cli) {
@@ -2173,7 +2259,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
                         * submodules. Skip it by setting recurse_submodules to
                         * RECURSE_SUBMODULES_OFF.
                         */
-                       recurse_submodules = RECURSE_SUBMODULES_OFF;
+                       config.recurse_submodules = RECURSE_SUBMODULES_OFF;
                        break;
 
                default:
@@ -2182,15 +2268,35 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
                }
        }
 
-       if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
-               int *sfjc = submodule_fetch_jobs_config == -1
-                           ? &submodule_fetch_jobs_config : NULL;
-               int *rs = recurse_submodules == RECURSE_SUBMODULES_DEFAULT
-                         ? &recurse_submodules : NULL;
+       if (config.recurse_submodules != RECURSE_SUBMODULES_OFF) {
+               int *sfjc = config.submodule_fetch_jobs == -1
+                           ? &config.submodule_fetch_jobs : NULL;
+               int *rs = config.recurse_submodules == RECURSE_SUBMODULES_DEFAULT
+                         ? &config.recurse_submodules : NULL;
 
                fetch_config_from_gitmodules(sfjc, rs);
        }
 
+
+       if (porcelain) {
+               switch (recurse_submodules_cli) {
+               case RECURSE_SUBMODULES_OFF:
+               case RECURSE_SUBMODULES_DEFAULT:
+                       /*
+                        * Reference updates in submodules would be ambiguous
+                        * in porcelain mode, so we reject this combination.
+                        */
+                       config.recurse_submodules = RECURSE_SUBMODULES_OFF;
+                       break;
+
+               default:
+                       die(_("options '%s' and '%s' cannot be used together"),
+                           "--porcelain", "--recurse-submodules");
+               }
+
+               config.display_format = DISPLAY_FORMAT_PORCELAIN;
+       }
+
        if (negotiate_only && !negotiation_tip.nr)
                die(_("--negotiate-only needs one or more --negotiation-tip=*"));
 
@@ -2289,7 +2395,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
        } else if (remote) {
                if (filter_options.choice || repo_has_promisor_remote(the_repository))
                        fetch_one_setup_partial(remote);
-               result = fetch_one(remote, argc, argv, prune_tags_ok, stdin_refspecs);
+               result = fetch_one(remote, argc, argv, prune_tags_ok, stdin_refspecs,
+                                  &config);
        } else {
                int max_children = max_jobs;
 
@@ -2306,13 +2413,12 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
                              "from one remote"));
 
                if (max_children < 0)
-                       max_children = fetch_parallel_config;
+                       max_children = config.parallel;
 
                /* TODO should this also die if we have a previous partial-clone? */
-               result = fetch_multiple(&list, max_children);
+               result = fetch_multiple(&list, max_children, &config);
        }
 
-
        /*
         * This is only needed after fetch_one(), which does not fetch
         * submodules by itself.
@@ -2322,20 +2428,20 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
         * the fetched history from each remote, so there is no need
         * to fetch submodules from here.
         */
-       if (!result && remote && (recurse_submodules != RECURSE_SUBMODULES_OFF)) {
+       if (!result && remote && (config.recurse_submodules != RECURSE_SUBMODULES_OFF)) {
                struct strvec options = STRVEC_INIT;
                int max_children = max_jobs;
 
                if (max_children < 0)
-                       max_children = submodule_fetch_jobs_config;
+                       max_children = config.submodule_fetch_jobs;
                if (max_children < 0)
-                       max_children = fetch_parallel_config;
+                       max_children = config.parallel;
 
-               add_options_to_argv(&options);
+               add_options_to_argv(&options, &config);
                result = fetch_submodules(the_repository,
                                          &options,
                                          submodule_prefix,
-                                         recurse_submodules,
+                                         config.recurse_submodules,
                                          recurse_submodules_default,
                                          verbosity < 0,
                                          max_children);
index cc812416420d7c3ac876b95affbb3ebab7caf040..0f9855b680eb7bf4e534af40847e32af835cfa13 100644 (file)
@@ -3,7 +3,6 @@
 #include "fmt-merge-msg.h"
 #include "gettext.h"
 #include "parse-options.h"
-#include "wrapper.h"
 
 static const char * const fmt_merge_msg_usage[] = {
        N_("git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"),
index 695fc8f4a5e5622b15de4167f892559aaa8aafd4..350bfa6e811b8c53d94ba33083a03bf9d93437dc 100644 (file)
@@ -1,11 +1,11 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "refs.h"
 #include "object.h"
 #include "parse-options.h"
 #include "ref-filter.h"
+#include "strbuf.h"
 #include "strvec.h"
 #include "commit-reach.h"
 
@@ -24,7 +24,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
        struct string_list sorting_options = STRING_LIST_INIT_DUP;
        int maxcount = 0, icase = 0, omit_empty = 0;
        struct ref_array array;
-       struct ref_filter filter;
+       struct ref_filter filter = REF_FILTER_INIT;
        struct ref_format format = REF_FORMAT_INIT;
        struct strbuf output = STRBUF_INIT;
        struct strbuf err = STRBUF_INIT;
@@ -47,6 +47,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
                OPT_INTEGER( 0 , "count", &maxcount, N_("show only <n> matched refs")),
                OPT_STRING(  0 , "format", &format.format, N_("format"), N_("format to use for the output")),
                OPT__COLOR(&format.use_color, N_("respect format colors")),
+               OPT_REF_FILTER_EXCLUDE(&filter),
                OPT_REF_SORT(&sorting_options),
                OPT_CALLBACK(0, "points-at", &filter.points_at,
                             N_("object"), N_("print only refs which points at the given object"),
@@ -61,7 +62,6 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
        };
 
        memset(&array, 0, sizeof(array));
-       memset(&filter, 0, sizeof(filter));
 
        format.format = "%(objectname) %(objecttype)\t%(refname)";
 
@@ -121,8 +121,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
        strbuf_release(&err);
        strbuf_release(&output);
        ref_array_clear(&array);
-       free_commit_list(filter.with_commit);
-       free_commit_list(filter.no_commit);
+       ref_filter_clear(&filter);
        ref_sorting_release(sorting);
        strvec_clear(&vec);
        return 0;
index 598ca16c46e5455d0c810a8a043c4a49a818404a..28186b30f54818cdbb42a4876358b7ceb20d20e2 100644 (file)
@@ -1,8 +1,9 @@
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "path.h"
+#include "repository.h"
 #include "run-command.h"
 #include "string-list.h"
 
index 095b39d39803492fd8142269d0b26cefb580b37e..c1d02900268b03f385131bb41242c567505e2018 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "gettext.h"
 #include "hex.h"
 #include "repository.h"
 #include "streaming.h"
 #include "decorate.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
+#include "read-cache-ll.h"
 #include "replace-object.h"
 #include "resolve-undo.h"
 #include "run-command.h"
+#include "sparse-index.h"
 #include "worktree.h"
+#include "pack-revindex.h"
+#include "pack-bitmap.h"
 
 #define REACHABLE 0x0001
 #define SEEN      0x0002
@@ -53,6 +59,8 @@ static int name_objects;
 #define ERROR_REFS 010
 #define ERROR_COMMIT_GRAPH 020
 #define ERROR_MULTI_PACK_INDEX 040
+#define ERROR_PACK_REV_INDEX 0100
+#define ERROR_BITMAP 0200
 
 static const char *describe_object(const struct object_id *oid)
 {
@@ -84,11 +92,11 @@ static int objerror(struct object *obj, const char *err)
        return -1;
 }
 
-static int fsck_error_func(struct fsck_options *o,
+static int fsck_error_func(struct fsck_options *o UNUSED,
                           const struct object_id *oid,
                           enum object_type object_type,
                           enum fsck_msg_type msg_type,
-                          enum fsck_msg_id msg_id,
+                          enum fsck_msg_id msg_id UNUSED,
                           const char *message)
 {
        switch (msg_type) {
@@ -113,7 +121,7 @@ static int fsck_error_func(struct fsck_options *o,
 static struct object_array pending;
 
 static int mark_object(struct object *obj, enum object_type type,
-                      void *data, struct fsck_options *options)
+                      void *data, struct fsck_options *options UNUSED)
 {
        struct object *parent = data;
 
@@ -198,8 +206,8 @@ static int traverse_reachable(void)
        return !!result;
 }
 
-static int mark_used(struct object *obj, enum object_type object_type,
-                    void *data, struct fsck_options *options)
+static int mark_used(struct object *obj, int type UNUSED,
+                    void *data UNUSED, struct fsck_options *options UNUSED)
 {
        if (!obj)
                return 1;
@@ -802,7 +810,7 @@ static int fsck_resolve_undo(struct index_state *istate,
 }
 
 static void fsck_index(struct index_state *istate, const char *index_path,
-                      int is_main_index)
+                      int is_current_worktree)
 {
        unsigned int i;
 
@@ -824,7 +832,7 @@ static void fsck_index(struct index_state *istate, const char *index_path,
                obj->flags |= USED;
                fsck_put_object_name(&fsck_walk_options, &obj->oid,
                                     "%s:%s",
-                                    is_main_index ? "" : index_path,
+                                    is_current_worktree ? "" : index_path,
                                     istate->cache[i]->name);
                mark_object_reachable(obj);
        }
@@ -856,6 +864,38 @@ static int mark_packed_for_connectivity(const struct object_id *oid,
        return 0;
 }
 
+static int check_pack_rev_indexes(struct repository *r, int show_progress)
+{
+       struct progress *progress = NULL;
+       uint32_t pack_count = 0;
+       int res = 0;
+
+       if (show_progress) {
+               for (struct packed_git *p = get_all_packs(r); p; p = p->next)
+                       pack_count++;
+               progress = start_delayed_progress("Verifying reverse pack-indexes", pack_count);
+               pack_count = 0;
+       }
+
+       for (struct packed_git *p = get_all_packs(r); p; p = p->next) {
+               int load_error = load_pack_revindex_from_disk(p);
+
+               if (load_error < 0) {
+                       error(_("unable to load rev-index for pack '%s'"), p->pack_name);
+                       res = ERROR_PACK_REV_INDEX;
+               } else if (!load_error &&
+                          !load_pack_revindex(r, p) &&
+                          verify_pack_revindex(p)) {
+                       error(_("invalid rev-index for pack '%s'"), p->pack_name);
+                       res = ERROR_PACK_REV_INDEX;
+               }
+               display_progress(progress, ++pack_count);
+       }
+       stop_progress(&progress);
+
+       return res;
+}
+
 static char const * const fsck_usage[] = {
        N_("git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
           "         [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
@@ -891,7 +931,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
        fetch_if_missing = 0;
 
        errors_found = 0;
-       read_replace_refs = 0;
+       disable_replace_refs();
        save_commit_buffer = 0;
 
        argc = parse_options(argc, argv, prefix, fsck_opts, fsck_usage, 0);
@@ -1019,6 +1059,10 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
                free_worktrees(worktrees);
        }
 
+       errors_found |= check_pack_rev_indexes(the_repository, show_progress);
+       if (verify_bitmap_files(the_repository))
+               errors_found |= ERROR_BITMAP;
+
        check_connectivity();
 
        if (the_repository->settings.core_commit_graph) {
@@ -1030,6 +1074,10 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
                        commit_graph_verify.git_cmd = 1;
                        strvec_pushl(&commit_graph_verify.args, "commit-graph",
                                     "verify", "--object-dir", odb->path, NULL);
+                       if (show_progress)
+                               strvec_push(&commit_graph_verify.args, "--progress");
+                       else
+                               strvec_push(&commit_graph_verify.args, "--no-progress");
                        if (run_command(&commit_graph_verify))
                                errors_found |= ERROR_COMMIT_GRAPH;
                }
@@ -1044,6 +1092,10 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
                        midx_verify.git_cmd = 1;
                        strvec_pushl(&midx_verify.args, "multi-pack-index",
                                     "verify", "--object-dir", odb->path, NULL);
+                       if (show_progress)
+                               strvec_push(&midx_verify.args, "--progress");
+                       else
+                               strvec_push(&midx_verify.args, "--no-progress");
                        if (run_command(&midx_verify))
                                errors_found |= ERROR_MULTI_PACK_INDEX;
                }
index 42af6a2cc7e7df7f96906227da62f580c261d0b7..7e99c4d61ba95942014d8ab2681568f53658fd0d 100644 (file)
@@ -1,19 +1,21 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
 #include "parse-options.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-ipc.h"
 #include "fsmonitor-path-utils.h"
+#include "fsmonitor-settings.h"
 #include "compat/fsmonitor/fsm-health.h"
 #include "compat/fsmonitor/fsm-listen.h"
 #include "fsmonitor--daemon.h"
 #include "simple-ipc.h"
 #include "khash.h"
 #include "pkt-line.h"
+#include "trace.h"
+#include "trace2.h"
 
 static const char * const builtin_fsmonitor__daemon_usage[] = {
        N_("git fsmonitor--daemon start [<options>]"),
@@ -36,10 +38,11 @@ static int fsmonitor__start_timeout_sec = 60;
 #define FSMONITOR__ANNOUNCE_STARTUP "fsmonitor.announcestartup"
 static int fsmonitor__announce_startup = 0;
 
-static int fsmonitor_config(const char *var, const char *value, void *cb)
+static int fsmonitor_config(const char *var, const char *value,
+                           const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, FSMONITOR__IPC_THREADS)) {
-               int i = git_config_int(var, value);
+               int i = git_config_int(var, value, ctx->kvi);
                if (i < 1)
                        return error(_("value of '%s' out of range: %d"),
                                     FSMONITOR__IPC_THREADS, i);
@@ -48,7 +51,7 @@ static int fsmonitor_config(const char *var, const char *value, void *cb)
        }
 
        if (!strcmp(var, FSMONITOR__START_TIMEOUT)) {
-               int i = git_config_int(var, value);
+               int i = git_config_int(var, value, ctx->kvi);
                if (i < 0)
                        return error(_("value of '%s' out of range: %d"),
                                     FSMONITOR__START_TIMEOUT, i);
@@ -58,7 +61,7 @@ static int fsmonitor_config(const char *var, const char *value, void *cb)
 
        if (!strcmp(var, FSMONITOR__ANNOUNCE_STARTUP)) {
                int is_bool;
-               int i = git_config_bool_or_int(var, value, &is_bool);
+               int i = git_config_bool_or_int(var, value, ctx->kvi, &is_bool);
                if (i < 0)
                        return error(_("value of '%s' not bool or int: %d"),
                                     var, i);
@@ -66,7 +69,7 @@ static int fsmonitor_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 /*
index edd98d35a5a460a06bd812e455be201a0309d334..5c4315f0d816c8e197bf22105f1d2ae56707ea2b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "builtin.h"
 #include "abspath.h"
+#include "date.h"
 #include "environment.h"
 #include "hex.h"
 #include "repository.h"
 #include "commit.h"
 #include "commit-graph.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "pack.h"
 #include "pack-objects.h"
+#include "path.h"
 #include "blob.h"
 #include "tree.h"
 #include "promisor-remote.h"
@@ -37,7 +40,7 @@
 #include "gettext.h"
 #include "hook.h"
 #include "setup.h"
-#include "wrapper.h"
+#include "trace2.h"
 
 #define FAILED_RUN "failed to run %s"
 
@@ -48,7 +51,7 @@ static const char * const builtin_gc_usage[] = {
 
 static int pack_refs = 1;
 static int prune_reflogs = 1;
-static int cruft_packs = -1;
+static int cruft_packs = 1;
 static int aggressive_depth = 50;
 static int aggressive_window = 250;
 static int gc_auto_threshold = 6700;
@@ -219,7 +222,7 @@ static struct packed_git *find_base_packs(struct string_list *packs,
        struct packed_git *p, *base = NULL;
 
        for (p = get_all_packs(the_repository); p; p = p->next) {
-               if (!p->pack_local)
+               if (!p->pack_local || p->is_cruft)
                        continue;
                if (limit) {
                        if (p->pack_size >= limit)
@@ -608,10 +611,6 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        if (prune_expire && parse_expiry_date(prune_expire, &dummy))
                die(_("failed to parse prune expiry value %s"), prune_expire);
 
-       prepare_repo_settings(the_repository);
-       if (cruft_packs < 0)
-               cruft_packs = the_repository->settings.gc_cruft_packs;
-
        if (aggressive) {
                strvec_push(&repack, "-f");
                if (aggressive_depth > 0)
@@ -1687,11 +1686,11 @@ static int get_schedule_cmd(const char **cmd, int *is_available)
        if (is_available)
                *is_available = 0;
 
-       string_list_split_in_place(&list, testing, ',', -1);
+       string_list_split_in_place(&list, testing, ",", -1);
        for_each_string_list_item(item, &list) {
                struct string_list pair = STRING_LIST_INIT_NODUP;
 
-               if (string_list_split_in_place(&pair, item->string, ':', 2) != 2)
+               if (string_list_split_in_place(&pair, item->string, ":", 2) != 2)
                        continue;
 
                if (!strcmp(*cmd, pair.items[0].string)) {
@@ -2069,7 +2068,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
              "</Settings>\n"
              "<Actions Context=\"Author\">\n"
              "<Exec>\n"
-             "<Command>\"%s\\git.exe\"</Command>\n"
+             "<Command>\"%s\\headless-git.exe\"</Command>\n"
              "<Arguments>--exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%s</Arguments>\n"
              "</Exec>\n"
              "</Actions>\n"
index 564cfcac4fb0ac4c9de1748b816f395d45665cbb..20d0dfe9cf1dfefe6ffacb23bd500701cca71a09 100644 (file)
@@ -1,12 +1,10 @@
 /*
  * Copyright (c) 2005, 2006 Rene Scharfe
  */
-#include "cache.h"
+#include "builtin.h"
 #include "commit.h"
 #include "tar.h"
-#include "builtin.h"
 #include "quote.h"
-#include "wrapper.h"
 
 static const char builtin_get_tar_commit_id_usage[] =
 "git get-tar-commit-id";
index a1b68d90bdb630327f08273b4f3658db86e2eb6a..50e712a18479750d42186214c9be43c7f71eebeb 100644 (file)
@@ -3,8 +3,7 @@
  *
  * Copyright (c) 2006 Junio C Hamano
  */
-#include "cache.h"
-#include "alloc.h"
+#include "builtin.h"
 #include "gettext.h"
 #include "hex.h"
 #include "repository.h"
@@ -14,7 +13,6 @@
 #include "commit.h"
 #include "tag.h"
 #include "tree-walk.h"
-#include "builtin.h"
 #include "parse-options.h"
 #include "string-list.h"
 #include "run-command.h"
 #include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "packfile.h"
+#include "pager.h"
+#include "path.h"
+#include "read-cache-ll.h"
 #include "write-or-die.h"
 
 static const char *grep_prefix;
@@ -287,14 +290,18 @@ static int wait_all(void)
        return hit;
 }
 
-static int grep_cmd_config(const char *var, const char *value, void *cb)
+static int grep_cmd_config(const char *var, const char *value,
+                          const struct config_context *ctx, void *cb)
 {
-       int st = grep_config(var, value, cb);
-       if (git_color_default_config(var, value, NULL) < 0)
+       int st = grep_config(var, value, ctx, cb);
+
+       if (git_color_config(var, value, cb) < 0)
+               st = -1;
+       else if (git_default_config(var, value, ctx, cb) < 0)
                st = -1;
 
        if (!strcmp(var, "grep.threads")) {
-               num_threads = git_config_int(var, value);
+               num_threads = git_config_int(var, value, ctx->kvi);
                if (num_threads < 0)
                        die(_("invalid number of threads specified (%d) for %s"),
                            num_threads, var);
@@ -636,7 +643,7 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
                        strbuf_addstr(&name, base->buf + tn_len);
                        match = tree_entry_interesting(repo->index,
                                                       &entry, &name,
-                                                      0, pathspec);
+                                                      pathspec);
                        strbuf_setlen(&name, name_base_len);
 
                        if (match == all_entries_not_interesting)
index a15fe4fd3f4f96b9f82535c224956eb957e93b49..5ffec99dceaf5c95d9b57c1f0c6c90358b80507d 100644 (file)
@@ -9,12 +9,14 @@
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "quote.h"
 #include "parse-options.h"
 #include "exec-cmd.h"
 #include "setup.h"
+#include "strbuf.h"
 #include "write-or-die.h"
 
 /*
index 87333a02ec40adb4e2b2b613b840c36f066f4e52..dc1fbe2b9862df507dc1e077258d3c44048eebef 100644 (file)
@@ -1,12 +1,13 @@
 /*
  * Builtin help command
  */
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "exec-cmd.h"
 #include "gettext.h"
+#include "pager.h"
 #include "parse-options.h"
+#include "path.h"
 #include "run-command.h"
 #include "config-list.h"
 #include "help.h"
@@ -396,7 +397,8 @@ static int add_man_viewer_info(const char *var, const char *value)
        return 0;
 }
 
-static int git_help_config(const char *var, const char *value, void *cb)
+static int git_help_config(const char *var, const char *value,
+                          const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "help.format")) {
                if (!value)
@@ -419,7 +421,7 @@ static int git_help_config(const char *var, const char *value, void *cb)
        if (starts_with(var, "man."))
                return add_man_viewer_info(var, value);
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static struct cmdnames main_cmds, other_cmds;
index 88051795c7f5bf016fc5856167c5d350827dff2e..09b51a6487c3928bc099567109193c32fe82fe30 100644 (file)
@@ -1,4 +1,3 @@
-#include "cache.h"
 #include "builtin.h"
 #include "config.h"
 #include "gettext.h"
index b17e79cd40f797d53ee3dbe12440af0ed4787228..006ffdc9c550d75a034960635f13d87b33dc57cc 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "config.h"
 #include "delta.h"
 #include "environment.h"
 #include "progress.h"
 #include "fsck.h"
 #include "exec-cmd.h"
+#include "strbuf.h"
 #include "streaming.h"
 #include "thread-utils.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "pack-revindex.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
 #include "setup.h"
-#include "wrapper.h"
 
 static const char index_pack_usage[] =
 "git index-pack [-v] [-o <index-file>] [--keep | --keep=<msg>] [--[no-]rev-index] [--verify] [--strict] (<pack-file> | --stdin [--fix-thin] [<pack-file>])";
@@ -219,7 +221,8 @@ static void cleanup_thread(void)
 }
 
 static int mark_link(struct object *obj, enum object_type type,
-                    void *data, struct fsck_options *options)
+                    void *data UNUSED,
+                    struct fsck_options *options UNUSED)
 {
        if (!obj)
                return -1;
@@ -1578,18 +1581,19 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
        strbuf_release(&pack_name);
 }
 
-static int git_index_pack_config(const char *k, const char *v, void *cb)
+static int git_index_pack_config(const char *k, const char *v,
+                                const struct config_context *ctx, void *cb)
 {
        struct pack_idx_option *opts = cb;
 
        if (!strcmp(k, "pack.indexversion")) {
-               opts->version = git_config_int(k, v);
+               opts->version = git_config_int(k, v, ctx->kvi);
                if (opts->version > 2)
                        die(_("bad pack.indexVersion=%"PRIu32), opts->version);
                return 0;
        }
        if (!strcmp(k, "pack.threads")) {
-               nr_threads = git_config_int(k, v);
+               nr_threads = git_config_int(k, v, ctx->kvi);
                if (nr_threads < 0)
                        die(_("invalid number of threads specified (%d)"),
                            nr_threads);
@@ -1605,7 +1609,7 @@ static int git_index_pack_config(const char *k, const char *v, void *cb)
                else
                        opts->flags &= ~WRITE_REV;
        }
-       return git_default_config(k, v, cb);
+       return git_default_config(k, v, ctx, cb);
 }
 
 static int cmp_uint32(const void *a_, const void *b_)
@@ -1749,16 +1753,17 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage(index_pack_usage);
 
-       read_replace_refs = 0;
+       disable_replace_refs();
        fsck_options.walk = mark_link;
 
        reset_pack_idx_option(&opts);
+       opts.flags |= WRITE_REV;
        git_config(git_index_pack_config, &opts);
        if (prefix && chdir(prefix))
                die(_("Cannot come back to cwd"));
 
-       if (git_env_bool(GIT_TEST_WRITE_REV_INDEX, 0))
-               rev_index = 1;
+       if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
+               rev_index = 0;
        else
                rev_index = !!(opts.flags & (WRITE_REV_VERIFY | WRITE_REV));
 
index ba6e0b20fa524e2f4fdb5d43dd977ed2046a36f1..cb727c826f5653ab2827ccfbd575e6d305fad75a 100644 (file)
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
-#include "refs.h"
-#include "builtin.h"
-#include "exec-cmd.h"
+#include "object-file.h"
 #include "parse-options.h"
+#include "path.h"
 #include "setup.h"
-#include "worktree.h"
-#include "wrapper.h"
-
-#ifndef DEFAULT_GIT_TEMPLATE_DIR
-#define DEFAULT_GIT_TEMPLATE_DIR "/usr/share/git-core/templates"
-#endif
-
-#ifdef NO_TRUSTABLE_FILEMODE
-#define TEST_FILEMODE 0
-#else
-#define TEST_FILEMODE 1
-#endif
-
-#define GIT_DEFAULT_HASH_ENVIRONMENT "GIT_DEFAULT_HASH"
-
-static int init_is_bare_repository = 0;
-static int init_shared_repository = -1;
-
-static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
-                            DIR *dir)
-{
-       size_t path_baselen = path->len;
-       size_t template_baselen = template_path->len;
-       struct dirent *de;
-
-       /* Note: if ".git/hooks" file exists in the repository being
-        * re-initialized, /etc/core-git/templates/hooks/update would
-        * cause "git init" to fail here.  I think this is sane but
-        * it means that the set of templates we ship by default, along
-        * with the way the namespace under .git/ is organized, should
-        * be really carefully chosen.
-        */
-       safe_create_dir(path->buf, 1);
-       while ((de = readdir(dir)) != NULL) {
-               struct stat st_git, st_template;
-               int exists = 0;
-
-               strbuf_setlen(path, path_baselen);
-               strbuf_setlen(template_path, template_baselen);
-
-               if (de->d_name[0] == '.')
-                       continue;
-               strbuf_addstr(path, de->d_name);
-               strbuf_addstr(template_path, de->d_name);
-               if (lstat(path->buf, &st_git)) {
-                       if (errno != ENOENT)
-                               die_errno(_("cannot stat '%s'"), path->buf);
-               }
-               else
-                       exists = 1;
-
-               if (lstat(template_path->buf, &st_template))
-                       die_errno(_("cannot stat template '%s'"), template_path->buf);
-
-               if (S_ISDIR(st_template.st_mode)) {
-                       DIR *subdir = opendir(template_path->buf);
-                       if (!subdir)
-                               die_errno(_("cannot opendir '%s'"), template_path->buf);
-                       strbuf_addch(path, '/');
-                       strbuf_addch(template_path, '/');
-                       copy_templates_1(path, template_path, subdir);
-                       closedir(subdir);
-               }
-               else if (exists)
-                       continue;
-               else if (S_ISLNK(st_template.st_mode)) {
-                       struct strbuf lnk = STRBUF_INIT;
-                       if (strbuf_readlink(&lnk, template_path->buf,
-                                           st_template.st_size) < 0)
-                               die_errno(_("cannot readlink '%s'"), template_path->buf);
-                       if (symlink(lnk.buf, path->buf))
-                               die_errno(_("cannot symlink '%s' '%s'"),
-                                         lnk.buf, path->buf);
-                       strbuf_release(&lnk);
-               }
-               else if (S_ISREG(st_template.st_mode)) {
-                       if (copy_file(path->buf, template_path->buf, st_template.st_mode))
-                               die_errno(_("cannot copy '%s' to '%s'"),
-                                         template_path->buf, path->buf);
-               }
-               else
-                       error(_("ignoring template %s"), template_path->buf);
-       }
-}
-
-static void copy_templates(const char *template_dir, const char *init_template_dir)
-{
-       struct strbuf path = STRBUF_INIT;
-       struct strbuf template_path = STRBUF_INIT;
-       size_t template_len;
-       struct repository_format template_format = REPOSITORY_FORMAT_INIT;
-       struct strbuf err = STRBUF_INIT;
-       DIR *dir;
-       char *to_free = NULL;
-
-       if (!template_dir)
-               template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT);
-       if (!template_dir)
-               template_dir = init_template_dir;
-       if (!template_dir)
-               template_dir = to_free = system_path(DEFAULT_GIT_TEMPLATE_DIR);
-       if (!template_dir[0]) {
-               free(to_free);
-               return;
-       }
-
-       strbuf_addstr(&template_path, template_dir);
-       strbuf_complete(&template_path, '/');
-       template_len = template_path.len;
-
-       dir = opendir(template_path.buf);
-       if (!dir) {
-               warning(_("templates not found in %s"), template_dir);
-               goto free_return;
-       }
-
-       /* Make sure that template is from the correct vintage */
-       strbuf_addstr(&template_path, "config");
-       read_repository_format(&template_format, template_path.buf);
-       strbuf_setlen(&template_path, template_len);
-
-       /*
-        * No mention of version at all is OK, but anything else should be
-        * verified.
-        */
-       if (template_format.version >= 0 &&
-           verify_repository_format(&template_format, &err) < 0) {
-               warning(_("not copying templates from '%s': %s"),
-                         template_dir, err.buf);
-               strbuf_release(&err);
-               goto close_free_return;
-       }
-
-       strbuf_addstr(&path, get_git_common_dir());
-       strbuf_complete(&path, '/');
-       copy_templates_1(&path, &template_path, dir);
-close_free_return:
-       closedir(dir);
-free_return:
-       free(to_free);
-       strbuf_release(&path);
-       strbuf_release(&template_path);
-       clear_repository_format(&template_format);
-}
-
-/*
- * If the git_dir is not directly inside the working tree, then git will not
- * find it by default, and we need to set the worktree explicitly.
- */
-static int needs_work_tree_config(const char *git_dir, const char *work_tree)
-{
-       if (!strcmp(work_tree, "/") && !strcmp(git_dir, "/.git"))
-               return 0;
-       if (skip_prefix(git_dir, work_tree, &git_dir) &&
-           !strcmp(git_dir, "/.git"))
-               return 0;
-       return 1;
-}
-
-void initialize_repository_version(int hash_algo, int reinit)
-{
-       char repo_version_string[10];
-       int repo_version = GIT_REPO_VERSION;
-
-       if (hash_algo != GIT_HASH_SHA1)
-               repo_version = GIT_REPO_VERSION_READ;
-
-       /* This forces creation of new config file */
-       xsnprintf(repo_version_string, sizeof(repo_version_string),
-                 "%d", repo_version);
-       git_config_set("core.repositoryformatversion", repo_version_string);
-
-       if (hash_algo != GIT_HASH_SHA1)
-               git_config_set("extensions.objectformat",
-                              hash_algos[hash_algo].name);
-       else if (reinit)
-               git_config_set_gently("extensions.objectformat", NULL);
-}
-
-static int create_default_files(const char *template_path,
-                               const char *original_git_dir,
-                               const char *initial_branch,
-                               const struct repository_format *fmt,
-                               int quiet)
-{
-       struct stat st1;
-       struct strbuf buf = STRBUF_INIT;
-       char *path;
-       char junk[2];
-       int reinit;
-       int filemode;
-       struct strbuf err = STRBUF_INIT;
-       const char *init_template_dir = NULL;
-       const char *work_tree = get_git_work_tree();
-
-       /*
-        * First copy the templates -- we might have the default
-        * config file there, in which case we would want to read
-        * from it after installing.
-        *
-        * Before reading that config, we also need to clear out any cached
-        * values (since we've just potentially changed what's available on
-        * disk).
-        */
-       git_config_get_pathname("init.templatedir", &init_template_dir);
-       copy_templates(template_path, init_template_dir);
-       free((char *)init_template_dir);
-       git_config_clear();
-       reset_shared_repository();
-       git_config(git_default_config, NULL);
-
-       /*
-        * We must make sure command-line options continue to override any
-        * values we might have just re-read from the config.
-        */
-       is_bare_repository_cfg = init_is_bare_repository || !work_tree;
-       if (init_shared_repository != -1)
-               set_shared_repository(init_shared_repository);
-
-       /*
-        * We would have created the above under user's umask -- under
-        * shared-repository settings, we would need to fix them up.
-        */
-       if (get_shared_repository()) {
-               adjust_shared_perm(get_git_dir());
-       }
-
-       /*
-        * We need to create a "refs" dir in any case so that older
-        * versions of git can tell that this is a repository.
-        */
-       safe_create_dir(git_path("refs"), 1);
-       adjust_shared_perm(git_path("refs"));
-
-       if (refs_init_db(&err))
-               die("failed to set up refs db: %s", err.buf);
-
-       /*
-        * Point the HEAD symref to the initial branch with if HEAD does
-        * not yet exist.
-        */
-       path = git_path_buf(&buf, "HEAD");
-       reinit = (!access(path, R_OK)
-                 || readlink(path, junk, sizeof(junk)-1) != -1);
-       if (!reinit) {
-               char *ref;
-
-               if (!initial_branch)
-                       initial_branch = git_default_branch_name(quiet);
-
-               ref = xstrfmt("refs/heads/%s", initial_branch);
-               if (check_refname_format(ref, 0) < 0)
-                       die(_("invalid initial branch name: '%s'"),
-                           initial_branch);
-
-               if (create_symref("HEAD", ref, NULL) < 0)
-                       exit(1);
-               free(ref);
-       }
-
-       initialize_repository_version(fmt->hash_algo, 0);
-
-       /* Check filemode trustability */
-       path = git_path_buf(&buf, "config");
-       filemode = TEST_FILEMODE;
-       if (TEST_FILEMODE && !lstat(path, &st1)) {
-               struct stat st2;
-               filemode = (!chmod(path, st1.st_mode ^ S_IXUSR) &&
-                               !lstat(path, &st2) &&
-                               st1.st_mode != st2.st_mode &&
-                               !chmod(path, st1.st_mode));
-               if (filemode && !reinit && (st1.st_mode & S_IXUSR))
-                       filemode = 0;
-       }
-       git_config_set("core.filemode", filemode ? "true" : "false");
-
-       if (is_bare_repository())
-               git_config_set("core.bare", "true");
-       else {
-               git_config_set("core.bare", "false");
-               /* allow template config file to override the default */
-               if (log_all_ref_updates == LOG_REFS_UNSET)
-                       git_config_set("core.logallrefupdates", "true");
-               if (needs_work_tree_config(original_git_dir, work_tree))
-                       git_config_set("core.worktree", work_tree);
-       }
-
-       if (!reinit) {
-               /* Check if symlink is supported in the work tree */
-               path = git_path_buf(&buf, "tXXXXXX");
-               if (!close(xmkstemp(path)) &&
-                   !unlink(path) &&
-                   !symlink("testing", path) &&
-                   !lstat(path, &st1) &&
-                   S_ISLNK(st1.st_mode))
-                       unlink(path); /* good */
-               else
-                       git_config_set("core.symlinks", "false");
-
-               /* Check if the filesystem is case-insensitive */
-               path = git_path_buf(&buf, "CoNfIg");
-               if (!access(path, F_OK))
-                       git_config_set("core.ignorecase", "true");
-               probe_utf8_pathname_composition();
-       }
-
-       strbuf_release(&buf);
-       return reinit;
-}
-
-static void create_object_directory(void)
-{
-       struct strbuf path = STRBUF_INIT;
-       size_t baselen;
-
-       strbuf_addstr(&path, get_object_directory());
-       baselen = path.len;
-
-       safe_create_dir(path.buf, 1);
-
-       strbuf_setlen(&path, baselen);
-       strbuf_addstr(&path, "/pack");
-       safe_create_dir(path.buf, 1);
-
-       strbuf_setlen(&path, baselen);
-       strbuf_addstr(&path, "/info");
-       safe_create_dir(path.buf, 1);
-
-       strbuf_release(&path);
-}
-
-static void separate_git_dir(const char *git_dir, const char *git_link)
-{
-       struct stat st;
-
-       if (!stat(git_link, &st)) {
-               const char *src;
-
-               if (S_ISREG(st.st_mode))
-                       src = read_gitfile(git_link);
-               else if (S_ISDIR(st.st_mode))
-                       src = git_link;
-               else
-                       die(_("unable to handle file type %d"), (int)st.st_mode);
-
-               if (rename(src, git_dir))
-                       die_errno(_("unable to move %s to %s"), src, git_dir);
-               repair_worktrees(NULL, NULL);
-       }
-
-       write_file(git_link, "gitdir: %s", git_dir);
-}
-
-static void validate_hash_algorithm(struct repository_format *repo_fmt, int hash)
-{
-       const char *env = getenv(GIT_DEFAULT_HASH_ENVIRONMENT);
-       /*
-        * If we already have an initialized repo, don't allow the user to
-        * specify a different algorithm, as that could cause corruption.
-        * Otherwise, if the user has specified one on the command line, use it.
-        */
-       if (repo_fmt->version >= 0 && hash != GIT_HASH_UNKNOWN && hash != repo_fmt->hash_algo)
-               die(_("attempt to reinitialize repository with different hash"));
-       else if (hash != GIT_HASH_UNKNOWN)
-               repo_fmt->hash_algo = hash;
-       else if (env) {
-               int env_algo = hash_algo_by_name(env);
-               if (env_algo == GIT_HASH_UNKNOWN)
-                       die(_("unknown hash algorithm '%s'"), env);
-               repo_fmt->hash_algo = env_algo;
-       }
-}
-
-int init_db(const char *git_dir, const char *real_git_dir,
-           const char *template_dir, int hash, const char *initial_branch,
-           unsigned int flags)
-{
-       int reinit;
-       int exist_ok = flags & INIT_DB_EXIST_OK;
-       char *original_git_dir = real_pathdup(git_dir, 1);
-       struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
-
-       if (real_git_dir) {
-               struct stat st;
-
-               if (!exist_ok && !stat(git_dir, &st))
-                       die(_("%s already exists"), git_dir);
-
-               if (!exist_ok && !stat(real_git_dir, &st))
-                       die(_("%s already exists"), real_git_dir);
-
-               set_git_dir(real_git_dir, 1);
-               git_dir = get_git_dir();
-               separate_git_dir(git_dir, original_git_dir);
-       }
-       else {
-               set_git_dir(git_dir, 1);
-               git_dir = get_git_dir();
-       }
-       startup_info->have_repository = 1;
-
-       /* Ensure `core.hidedotfiles` is processed */
-       git_config(platform_core_config, NULL);
-
-       safe_create_dir(git_dir, 0);
-
-       init_is_bare_repository = is_bare_repository();
-
-       /* Check to see if the repository version is right.
-        * Note that a newly created repository does not have
-        * config file, so this will not fail.  What we are catching
-        * is an attempt to reinitialize new repository with an old tool.
-        */
-       check_repository_format(&repo_fmt);
-
-       validate_hash_algorithm(&repo_fmt, hash);
-
-       reinit = create_default_files(template_dir, original_git_dir,
-                                     initial_branch, &repo_fmt,
-                                     flags & INIT_DB_QUIET);
-       if (reinit && initial_branch)
-               warning(_("re-init: ignored --initial-branch=%s"),
-                       initial_branch);
-
-       create_object_directory();
-
-       if (get_shared_repository()) {
-               char buf[10];
-               /* We do not spell "group" and such, so that
-                * the configuration can be read by older version
-                * of git. Note, we use octal numbers for new share modes,
-                * and compatibility values for PERM_GROUP and
-                * PERM_EVERYBODY.
-                */
-               if (get_shared_repository() < 0)
-                       /* force to the mode value */
-                       xsnprintf(buf, sizeof(buf), "0%o", -get_shared_repository());
-               else if (get_shared_repository() == PERM_GROUP)
-                       xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_GROUP);
-               else if (get_shared_repository() == PERM_EVERYBODY)
-                       xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_EVERYBODY);
-               else
-                       BUG("invalid value for shared_repository");
-               git_config_set("core.sharedrepository", buf);
-               git_config_set("receive.denyNonFastforwards", "true");
-       }
-
-       if (!(flags & INIT_DB_QUIET)) {
-               int len = strlen(git_dir);
-
-               if (reinit)
-                       printf(get_shared_repository()
-                              ? _("Reinitialized existing shared Git repository in %s%s\n")
-                              : _("Reinitialized existing Git repository in %s%s\n"),
-                              git_dir, len && git_dir[len-1] != '/' ? "/" : "");
-               else
-                       printf(get_shared_repository()
-                              ? _("Initialized empty shared Git repository in %s%s\n")
-                              : _("Initialized empty Git repository in %s%s\n"),
-                              git_dir, len && git_dir[len-1] != '/' ? "/" : "");
-       }
-
-       free(original_git_dir);
-       return 0;
-}
+#include "strbuf.h"
 
 static int guess_repository_type(const char *git_dir)
 {
@@ -543,6 +78,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
        const char *object_format = NULL;
        const char *initial_branch = NULL;
        int hash_algo = GIT_HASH_UNKNOWN;
+       int init_shared_repository = -1;
        const struct option init_db_options[] = {
                OPT_STRING(0, "template", &template_dir, N_("template-directory"),
                                N_("directory from which templates will be used")),
@@ -700,5 +236,5 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 
        flags |= INIT_DB_EXIST_OK;
        return init_db(git_dir, real_git_dir, template_dir, hash_algo,
-                      initial_branch, flags);
+                      initial_branch, init_shared_repository, flags);
 }
index 107ac28f0e8cb0cb6d6f0ac31102a165a4850b20..c5e83452654de9242f01a4045fb90f3f058ea8f7 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
 #include "parse-options.h"
index 7d195789633978c03c18e2c331d75f1b56f924e8..db3a88bfe96058679dff1059a6f4769599ee1801 100644 (file)
@@ -6,13 +6,15 @@
  */
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "pager.h"
 #include "color.h"
 #include "commit.h"
 #include "diff.h"
@@ -20,6 +22,7 @@
 #include "revision.h"
 #include "log-tree.h"
 #include "builtin.h"
+#include "oid-array.h"
 #include "tag.h"
 #include "reflog-walk.h"
 #include "patch-ids.h"
@@ -40,6 +43,7 @@
 #include "commit-reach.h"
 #include "range-diff.h"
 #include "tmp-objdir.h"
+#include "tree.h"
 #include "write-or-die.h"
 
 #define MAIL_DEFAULT_WRAP 72
@@ -559,7 +563,8 @@ static int cmd_log_walk(struct rev_info *rev)
        return retval;
 }
 
-static int git_log_config(const char *var, const char *value, void *cb)
+static int git_log_config(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb)
 {
        const char *slot_name;
 
@@ -568,7 +573,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
        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);
+               fmt_patch_name_max = git_config_int(var, value, ctx->kvi);
                return 0;
        }
        if (!strcmp(var, "format.encodeemailheaders")) {
@@ -608,7 +613,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_diff_ui_config(var, value, cb);
+       return git_diff_ui_config(var, value, ctx, cb);
 }
 
 int cmd_whatchanged(int argc, const char **argv, const char *prefix)
@@ -713,8 +718,7 @@ static int show_tree_object(const struct object_id *oid UNUSED,
        return 0;
 }
 
-static void show_setup_revisions_tweak(struct rev_info *rev,
-                                      struct setup_revision_opt *opt)
+static void show_setup_revisions_tweak(struct rev_info *rev)
 {
        if (rev->first_parent_only)
                diff_merges_default_to_first_parent(rev);
@@ -857,11 +861,10 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
        return cmd_log_deinit(cmd_log_walk(&rev), &rev);
 }
 
-static void log_setup_revisions_tweak(struct rev_info *rev,
-                                     struct setup_revision_opt *opt)
+static void log_setup_revisions_tweak(struct rev_info *rev)
 {
        if (rev->diffopt.flags.default_follow_renames &&
-           rev->prune_data.nr == 1)
+           diff_check_follow_pathspec(&rev->prune_data, 0))
                rev->diffopt.flags.follow_renames = 1;
 
        if (rev->first_parent_only)
@@ -974,7 +977,8 @@ static enum cover_from_description parse_cover_from_description(const char *arg)
                die(_("%s: invalid cover from description mode"), arg);
 }
 
-static int git_format_config(const char *var, const char *value, void *cb)
+static int git_format_config(const char *var, const char *value,
+                            const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "format.headers")) {
                if (!value)
@@ -1103,7 +1107,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
        if (!strcmp(var, "diff.noprefix"))
                return 0;
 
-       return git_log_config(var, value, cb);
+       return git_log_config(var, value, ctx, cb);
 }
 
 static const char *output_directory = NULL;
@@ -1401,7 +1405,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
        }
 }
 
-static const char *clean_message_id(const char *msg_id)
+static char *clean_message_id(const char *msg_id)
 {
        char ch;
        const char *a, *z, *m;
@@ -1419,7 +1423,7 @@ static const char *clean_message_id(const char *msg_id)
        if (!z)
                die(_("insane in-reply-to: %s"), msg_id);
        if (++z == m)
-               return a;
+               return xstrdup(a);
        return xmemdupz(a, z - a);
 }
 
@@ -2305,11 +2309,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
        if (in_reply_to || thread || cover_letter) {
                rev.ref_message_ids = xmalloc(sizeof(*rev.ref_message_ids));
-               string_list_init_nodup(rev.ref_message_ids);
+               string_list_init_dup(rev.ref_message_ids);
        }
        if (in_reply_to) {
-               const char *msgid = clean_message_id(in_reply_to);
-               string_list_append(rev.ref_message_ids, msgid);
+               char *msgid = clean_message_id(in_reply_to);
+               string_list_append_nodup(rev.ref_message_ids, msgid);
        }
        rev.numbered_files = just_numbers;
        rev.patch_suffix = fmt_patch_suffix;
@@ -2365,8 +2369,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                                    && (!cover_letter || rev.nr > 1))
                                        free(rev.message_id);
                                else
-                                       string_list_append(rev.ref_message_ids,
-                                                          rev.message_id);
+                                       string_list_append_nodup(rev.ref_message_ids,
+                                                                rev.message_id);
                        }
                        gen_message_id(&rev, oid_to_hex(&commit->object.oid));
                }
@@ -2415,6 +2419,7 @@ done:
        strbuf_release(&rdiff_title);
        strbuf_release(&sprefix);
        free(to_free);
+       free(rev.message_id);
        if (rev.ref_message_ids)
                string_list_clear(rev.ref_message_ids, 0);
        free(rev.ref_message_ids);
index ed35fa8d8e84b57bbc7bc2b3e62a2b4d437c992f..a0229c3277874accc9edf0a4a5ac4e8186217903 100644 (file)
@@ -5,24 +5,31 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "repository.h"
 #include "config.h"
+#include "convert.h"
 #include "quote.h"
 #include "dir.h"
-#include "builtin.h"
 #include "gettext.h"
+#include "object-name.h"
 #include "strbuf.h"
 #include "tree.h"
 #include "cache-tree.h"
 #include "parse-options.h"
 #include "resolve-undo.h"
 #include "string-list.h"
+#include "path.h"
 #include "pathspec.h"
+#include "read-cache.h"
 #include "run-command.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "object-store.h"
+#include "hex.h"
+
 
 static int abbrev;
 static int show_deleted;
@@ -239,68 +246,75 @@ static void show_submodule(struct repository *superproject,
        repo_clear(&subrepo);
 }
 
-struct show_index_data {
-       const char *pathname;
-       struct index_state *istate;
-       const struct cache_entry *ce;
-};
-
-static size_t expand_show_index(struct strbuf *sb, const char *start,
-                               void *context)
+static void expand_objectsize(struct strbuf *line, const struct object_id *oid,
+                             const enum object_type type, unsigned int padded)
 {
-       struct show_index_data *data = context;
-       const char *end;
-       const char *p;
-       size_t len = strbuf_expand_literal_cb(sb, start, NULL);
-       struct stat st;
-
-       if (len)
-               return len;
-       if (*start != '(')
-               die(_("bad ls-files format: element '%s' "
-                     "does not start with '('"), start);
-
-       end = strchr(start + 1, ')');
-       if (!end)
-               die(_("bad ls-files format: element '%s' "
-                     "does not end in ')'"), start);
-
-       len = end - start + 1;
-       if (skip_prefix(start, "(objectmode)", &p))
-               strbuf_addf(sb, "%06o", data->ce->ce_mode);
-       else if (skip_prefix(start, "(objectname)", &p))
-               strbuf_add_unique_abbrev(sb, &data->ce->oid, abbrev);
-       else if (skip_prefix(start, "(stage)", &p))
-               strbuf_addf(sb, "%d", ce_stage(data->ce));
-       else if (skip_prefix(start, "(eolinfo:index)", &p))
-               strbuf_addstr(sb, S_ISREG(data->ce->ce_mode) ?
-                             get_cached_convert_stats_ascii(data->istate,
-                             data->ce->name) : "");
-       else if (skip_prefix(start, "(eolinfo:worktree)", &p))
-               strbuf_addstr(sb, !lstat(data->pathname, &st) &&
-                             S_ISREG(st.st_mode) ?
-                             get_wt_convert_stats_ascii(data->pathname) : "");
-       else if (skip_prefix(start, "(eolattr)", &p))
-               strbuf_addstr(sb, get_convert_attr_ascii(data->istate,
-                             data->pathname));
-       else if (skip_prefix(start, "(path)", &p))
-               write_name_to_buf(sb, data->pathname);
-       else
-               die(_("bad ls-files format: %%%.*s"), (int)len, start);
-
-       return len;
+       if (type == OBJ_BLOB) {
+               unsigned long size;
+               if (oid_object_info(the_repository, oid, &size) < 0)
+                       die(_("could not get object info about '%s'"),
+                           oid_to_hex(oid));
+               if (padded)
+                       strbuf_addf(line, "%7"PRIuMAX, (uintmax_t)size);
+               else
+                       strbuf_addf(line, "%"PRIuMAX, (uintmax_t)size);
+       } else if (padded) {
+               strbuf_addf(line, "%7s", "-");
+       } else {
+               strbuf_addstr(line, "-");
+       }
 }
 
 static void show_ce_fmt(struct repository *repo, const struct cache_entry *ce,
                        const char *format, const char *fullname) {
-       struct show_index_data data = {
-               .pathname = fullname,
-               .istate = repo->index,
-               .ce = ce,
-       };
        struct strbuf sb = STRBUF_INIT;
 
-       strbuf_expand(&sb, format, expand_show_index, &data);
+       while (strbuf_expand_step(&sb, &format)) {
+               const char *end;
+               size_t len;
+               struct stat st;
+
+               if (skip_prefix(format, "%", &format))
+                       strbuf_addch(&sb, '%');
+               else if ((len = strbuf_expand_literal(&sb, format)))
+                       format += len;
+               else if (*format != '(')
+                       die(_("bad ls-files format: element '%s' "
+                             "does not start with '('"), format);
+               else if (!(end = strchr(format + 1, ')')))
+                       die(_("bad ls-files format: element '%s' "
+                             "does not end in ')'"), format);
+               else if (skip_prefix(format, "(objectmode)", &format))
+                       strbuf_addf(&sb, "%06o", ce->ce_mode);
+               else if (skip_prefix(format, "(objectname)", &format))
+                       strbuf_add_unique_abbrev(&sb, &ce->oid, abbrev);
+               else if (skip_prefix(format, "(objecttype)", &format))
+                       strbuf_addstr(&sb, type_name(object_type(ce->ce_mode)));
+               else if (skip_prefix(format, "(objectsize:padded)", &format))
+                       expand_objectsize(&sb, &ce->oid,
+                                         object_type(ce->ce_mode), 1);
+               else if (skip_prefix(format, "(objectsize)", &format))
+                       expand_objectsize(&sb, &ce->oid,
+                                         object_type(ce->ce_mode), 0);
+               else if (skip_prefix(format, "(stage)", &format))
+                       strbuf_addf(&sb, "%d", ce_stage(ce));
+               else if (skip_prefix(format, "(eolinfo:index)", &format))
+                       strbuf_addstr(&sb, S_ISREG(ce->ce_mode) ?
+                                     get_cached_convert_stats_ascii(repo->index,
+                                     ce->name) : "");
+               else if (skip_prefix(format, "(eolinfo:worktree)", &format))
+                       strbuf_addstr(&sb, !lstat(fullname, &st) &&
+                                     S_ISREG(st.st_mode) ?
+                                     get_wt_convert_stats_ascii(fullname) : "");
+               else if (skip_prefix(format, "(eolattr)", &format))
+                       strbuf_addstr(&sb, get_convert_attr_ascii(repo->index,
+                                                                fullname));
+               else if (skip_prefix(format, "(path)", &format))
+                       write_name_to_buf(&sb, fullname);
+               else
+                       die(_("bad ls-files format: %%%.*s"),
+                           (int)(end - format + 1), format);
+       }
        strbuf_addch(&sb, line_terminator);
        fwrite(sb.buf, sb.len, 1, stdout);
        strbuf_release(&sb);
@@ -514,143 +528,6 @@ static int get_common_prefix_len(const char *common_prefix)
        return common_prefix_len;
 }
 
-static int read_one_entry_opt(struct index_state *istate,
-                             const struct object_id *oid,
-                             struct strbuf *base,
-                             const char *pathname,
-                             unsigned mode, int opt)
-{
-       int len;
-       struct cache_entry *ce;
-
-       if (S_ISDIR(mode))
-               return READ_TREE_RECURSIVE;
-
-       len = strlen(pathname);
-       ce = make_empty_cache_entry(istate, base->len + len);
-
-       ce->ce_mode = create_ce_mode(mode);
-       ce->ce_flags = create_ce_flags(1);
-       ce->ce_namelen = base->len + len;
-       memcpy(ce->name, base->buf, base->len);
-       memcpy(ce->name + base->len, pathname, len+1);
-       oidcpy(&ce->oid, oid);
-       return add_index_entry(istate, ce, opt);
-}
-
-static int read_one_entry(const struct object_id *oid, struct strbuf *base,
-                         const char *pathname, unsigned mode,
-                         void *context)
-{
-       struct index_state *istate = context;
-       return read_one_entry_opt(istate, oid, base, pathname,
-                                 mode,
-                                 ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
-}
-
-/*
- * This is used when the caller knows there is no existing entries at
- * the stage that will conflict with the entry being added.
- */
-static int read_one_entry_quick(const struct object_id *oid, struct strbuf *base,
-                               const char *pathname, unsigned mode,
-                               void *context)
-{
-       struct index_state *istate = context;
-       return read_one_entry_opt(istate, oid, base, pathname,
-                                 mode, ADD_CACHE_JUST_APPEND);
-}
-
-/*
- * Read the tree specified with --with-tree option
- * (typically, HEAD) into stage #1 and then
- * squash them down to stage #0.  This is used for
- * --error-unmatch to list and check the path patterns
- * that were given from the command line.  We are not
- * going to write this index out.
- */
-void overlay_tree_on_index(struct index_state *istate,
-                          const char *tree_name, const char *prefix)
-{
-       struct tree *tree;
-       struct object_id oid;
-       struct pathspec pathspec;
-       struct cache_entry *last_stage0 = NULL;
-       int i;
-       read_tree_fn_t fn = NULL;
-       int err;
-
-       if (repo_get_oid(the_repository, tree_name, &oid))
-               die("tree-ish %s not found.", tree_name);
-       tree = parse_tree_indirect(&oid);
-       if (!tree)
-               die("bad tree-ish %s", tree_name);
-
-       /* Hoist the unmerged entries up to stage #3 to make room */
-       /* TODO: audit for interaction with sparse-index. */
-       ensure_full_index(istate);
-       for (i = 0; i < istate->cache_nr; i++) {
-               struct cache_entry *ce = istate->cache[i];
-               if (!ce_stage(ce))
-                       continue;
-               ce->ce_flags |= CE_STAGEMASK;
-       }
-
-       if (prefix) {
-               static const char *(matchbuf[1]);
-               matchbuf[0] = NULL;
-               parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC,
-                              PATHSPEC_PREFER_CWD, prefix, matchbuf);
-       } else
-               memset(&pathspec, 0, sizeof(pathspec));
-
-       /*
-        * See if we have cache entry at the stage.  If so,
-        * do it the original slow way, otherwise, append and then
-        * sort at the end.
-        */
-       for (i = 0; !fn && i < istate->cache_nr; i++) {
-               const struct cache_entry *ce = istate->cache[i];
-               if (ce_stage(ce) == 1)
-                       fn = read_one_entry;
-       }
-
-       if (!fn)
-               fn = read_one_entry_quick;
-       err = read_tree(the_repository, tree, &pathspec, fn, istate);
-       clear_pathspec(&pathspec);
-       if (err)
-               die("unable to read tree entries %s", tree_name);
-
-       /*
-        * Sort the cache entry -- we need to nuke the cache tree, though.
-        */
-       if (fn == read_one_entry_quick) {
-               cache_tree_free(&istate->cache_tree);
-               QSORT(istate->cache, istate->cache_nr, cmp_cache_name_compare);
-       }
-
-       for (i = 0; i < istate->cache_nr; i++) {
-               struct cache_entry *ce = istate->cache[i];
-               switch (ce_stage(ce)) {
-               case 0:
-                       last_stage0 = ce;
-                       /* fallthru */
-               default:
-                       continue;
-               case 1:
-                       /*
-                        * If there is stage #0 entry for this, we do not
-                        * need to show it.  We use CE_UPDATE bit to mark
-                        * such an entry.
-                        */
-                       if (last_stage0 &&
-                           !strcmp(last_stage0->name, ce->name))
-                               ce->ce_flags |= CE_UPDATE;
-               }
-       }
-}
-
 static const char * const ls_files_usage[] = {
        N_("git ls-files [<options>] [<file>...]"),
        NULL
index 3c74c4a104b3f8eddd9fb5ae8e63eb7c5232f95c..fc765754305ed7a3f8a2efdcd604dd29c8b3b502 100644 (file)
@@ -1,12 +1,13 @@
 #include "builtin.h"
-#include "cache.h"
 #include "gettext.h"
 #include "hex.h"
 #include "transport.h"
+#include "pkt-line.h"
 #include "ref-filter.h"
 #include "remote.h"
 #include "refs.h"
 #include "parse-options.h"
+#include "wildmatch.h"
 
 static const char * const ls_remote_usage[] = {
        N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
index f32e6be21983cff504ac46cc727bc076cae4026c..f558db5f3b80b3d72f5f66f008e3fa2072c2e8ed 100644 (file)
@@ -3,16 +3,17 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "tree.h"
 #include "commit.h"
+#include "path.h"
 #include "quote.h"
-#include "builtin.h"
 #include "parse-options.h"
 #include "pathspec.h"
 
@@ -49,68 +50,10 @@ struct ls_tree_options {
                LS_SHOW_TREES = 1 << 2,
        } ls_options;
        struct pathspec pathspec;
-       int chomp_prefix;
-       const char *ls_tree_prefix;
+       const char *prefix;
        const char *format;
 };
 
-struct show_tree_data {
-       struct ls_tree_options *options;
-       unsigned mode;
-       enum object_type type;
-       const struct object_id *oid;
-       const char *pathname;
-       struct strbuf *base;
-};
-
-static size_t expand_show_tree(struct strbuf *sb, const char *start,
-                              void *context)
-{
-       struct show_tree_data *data = context;
-       struct ls_tree_options *options = data->options;
-       const char *end;
-       const char *p;
-       unsigned int errlen;
-       size_t len = strbuf_expand_literal_cb(sb, start, NULL);
-
-       if (len)
-               return len;
-       if (*start != '(')
-               die(_("bad ls-tree format: element '%s' does not start with '('"), start);
-
-       end = strchr(start + 1, ')');
-       if (!end)
-               die(_("bad ls-tree format: element '%s' does not end in ')'"), start);
-
-       len = end - start + 1;
-       if (skip_prefix(start, "(objectmode)", &p)) {
-               strbuf_addf(sb, "%06o", data->mode);
-       } else if (skip_prefix(start, "(objecttype)", &p)) {
-               strbuf_addstr(sb, type_name(data->type));
-       } else if (skip_prefix(start, "(objectsize:padded)", &p)) {
-               expand_objectsize(sb, data->oid, data->type, 1);
-       } else if (skip_prefix(start, "(objectsize)", &p)) {
-               expand_objectsize(sb, data->oid, data->type, 0);
-       } else if (skip_prefix(start, "(objectname)", &p)) {
-               strbuf_add_unique_abbrev(sb, data->oid, options->abbrev);
-       } else if (skip_prefix(start, "(path)", &p)) {
-               const char *name = data->base->buf;
-               const char *prefix = options->chomp_prefix ? options->ls_tree_prefix : NULL;
-               struct strbuf sbuf = STRBUF_INIT;
-               size_t baselen = data->base->len;
-
-               strbuf_addstr(data->base, data->pathname);
-               name = relative_path(data->base->buf, prefix, &sbuf);
-               quote_c_style(name, sb, NULL, 0);
-               strbuf_setlen(data->base, baselen);
-               strbuf_release(&sbuf);
-       } else {
-               errlen = (unsigned long)len;
-               die(_("bad ls-tree format: %%%.*s"), errlen, start);
-       }
-       return len;
-}
-
 static int show_recursive(struct ls_tree_options *options, const char *base,
                          size_t baselen, const char *pathname)
 {
@@ -149,14 +92,7 @@ static int show_tree_fmt(const struct object_id *oid, struct strbuf *base,
        int recurse = 0;
        struct strbuf sb = STRBUF_INIT;
        enum object_type type = object_type(mode);
-       struct show_tree_data cb_data = {
-               .options = options,
-               .mode = mode,
-               .type = type,
-               .oid = oid,
-               .pathname = pathname,
-               .base = base,
-       };
+       const char *format = options->format;
 
        if (type == OBJ_TREE && show_recursive(options, base->buf, base->len, pathname))
                recurse = READ_TREE_RECURSIVE;
@@ -165,7 +101,45 @@ static int show_tree_fmt(const struct object_id *oid, struct strbuf *base,
        if (type == OBJ_BLOB && (options->ls_options & LS_TREE_ONLY))
                return 0;
 
-       strbuf_expand(&sb, options->format, expand_show_tree, &cb_data);
+       while (strbuf_expand_step(&sb, &format)) {
+               const char *end;
+               size_t len;
+
+               if (skip_prefix(format, "%", &format))
+                       strbuf_addch(&sb, '%');
+               else if ((len = strbuf_expand_literal(&sb, format)))
+                       format += len;
+               else if (*format != '(')
+                       die(_("bad ls-tree format: element '%s' "
+                             "does not start with '('"), format);
+               else if (!(end = strchr(format + 1, ')')))
+                       die(_("bad ls-tree format: element '%s' "
+                             "does not end in ')'"), format);
+               else if (skip_prefix(format, "(objectmode)", &format))
+                       strbuf_addf(&sb, "%06o", mode);
+               else if (skip_prefix(format, "(objecttype)", &format))
+                       strbuf_addstr(&sb, type_name(type));
+               else if (skip_prefix(format, "(objectsize:padded)", &format))
+                       expand_objectsize(&sb, oid, type, 1);
+               else if (skip_prefix(format, "(objectsize)", &format))
+                       expand_objectsize(&sb, oid, type, 0);
+               else if (skip_prefix(format, "(objectname)", &format))
+                       strbuf_add_unique_abbrev(&sb, oid, options->abbrev);
+               else if (skip_prefix(format, "(path)", &format)) {
+                       const char *name;
+                       const char *prefix = options->prefix;
+                       struct strbuf sbuf = STRBUF_INIT;
+                       size_t baselen = base->len;
+
+                       strbuf_addstr(base, pathname);
+                       name = relative_path(base->buf, prefix, &sbuf);
+                       quote_c_style(name, &sb, NULL, 0);
+                       strbuf_setlen(base, baselen);
+                       strbuf_release(&sbuf);
+               } else
+                       die(_("bad ls-tree format: %%%.*s"),
+                           (int)(end - format + 1), format);
+       }
        strbuf_addch(&sb, options->null_termination ? '\0' : '\n');
        fwrite(sb.buf, sb.len, 1, stdout);
        strbuf_release(&sb);
@@ -197,7 +171,7 @@ static void show_tree_common_default_long(struct ls_tree_options *options,
                                          const char *pathname,
                                          const size_t baselen)
 {
-       const char *prefix = options->chomp_prefix ? options->ls_tree_prefix : NULL;
+       const char *prefix = options->prefix;
 
        strbuf_addstr(base, pathname);
 
@@ -282,7 +256,7 @@ static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
        if (early >= 0)
                return early;
 
-       prefix = options->chomp_prefix ? options->ls_tree_prefix : NULL;
+       prefix = options->prefix;
        strbuf_addstr(base, pathname);
        if (options->null_termination) {
                struct strbuf sb = STRBUF_INIT;
@@ -369,6 +343,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
        struct object_id oid;
        struct tree *tree;
        int i, full_tree = 0;
+       int full_name = !prefix || !*prefix;
        read_tree_fn_t fn = NULL;
        enum ls_tree_cmdmode cmdmode = MODE_DEFAULT;
        int null_termination = 0;
@@ -390,8 +365,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
                            MODE_NAME_STATUS),
                OPT_CMDMODE(0, "object-only", &cmdmode, N_("list only objects"),
                            MODE_OBJECT_ONLY),
-               OPT_SET_INT(0, "full-name", &options.chomp_prefix,
-                           N_("use full path names"), 0),
+               OPT_BOOL(0, "full-name", &full_name, N_("use full path names")),
                OPT_BOOL(0, "full-tree", &full_tree,
                         N_("list entire tree; not just current directory "
                            "(implies --full-name)")),
@@ -405,18 +379,15 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
        int ret;
 
        git_config(git_default_config, NULL);
-       options.ls_tree_prefix = prefix;
-       if (prefix)
-               options.chomp_prefix = strlen(prefix);
 
        argc = parse_options(argc, argv, prefix, ls_tree_options,
                             ls_tree_usage, 0);
        options.null_termination = null_termination;
 
-       if (full_tree) {
-               options.ls_tree_prefix = prefix = NULL;
-               options.chomp_prefix = 0;
-       }
+       if (full_tree)
+               prefix = NULL;
+       options.prefix = full_name ? NULL : prefix;
+
        /*
         * We wanted to detect conflicts between --name-only and
         * --name-status, but once we're done with that subsequent
index a032a1c3881cf4d35f72e8b714204647a3e06400..53b55dd71c0537b149860c4b9c0d505ea305fe57 100644 (file)
@@ -2,9 +2,8 @@
  * Another stupid program, this one parsing the headers of an
  * email to figure out authorship and subject
  */
-#include "cache.h"
-#include "abspath.h"
 #include "builtin.h"
+#include "abspath.h"
 #include "environment.h"
 #include "gettext.h"
 #include "utf8.h"
index 0b6193a0915a1fef572bb8a1148ae02f53ecf51c..3af9ddb8ae5c7e902937ada927590d908c193e0f 100644 (file)
@@ -4,7 +4,6 @@
  * It just splits a mbox into a list of files: "0001" "0002" ..
  * so you can process them further from there.
  */
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
 #include "string-list.h"
index 3f22273b40076df9432f5b435b92461badda064d..e68b7fe45d77a9b032dd6031864b876eeeca5e5c 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "commit.h"
 #include "gettext.h"
@@ -7,6 +6,7 @@
 #include "refs.h"
 #include "diff.h"
 #include "revision.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "repository.h"
 #include "commit-reach.h"
index 781818d08f560714303889ff9eb002408307e244..d7eb4c654018e2bf8270ba90f1a3d945a261d025 100644 (file)
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "setup.h"
index b747b4ed983f22b724dac40a6b50ecbcae5e39ba..270d5f644ac22e1a8a1b43b282b9ebf0f5cb12b0 100644 (file)
@@ -1,7 +1,10 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "hex.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "run-command.h"
+#include "sparse-index.h"
 
 static const char *pgm;
 static int one_shot, quiet;
index c2e519301e91cef4ac3204a37aa9e792c518c0f3..932924e5d0e573959e2d8c70168f77224de45bc8 100644 (file)
@@ -10,6 +10,7 @@
 #include "git-compat-util.h"
 #include "builtin.h"
 #include "diff.h"
+#include "repository.h"
 
 static const char builtin_merge_ours_usage[] =
        "git merge-ours <base>... -- HEAD <remote>...";
index 91ed55f3ab79b0aff7c0870b0e9d3eeaaa3f63cb..3366699657c9c390f850dfcba11be08327834f50 100644 (file)
@@ -1,9 +1,12 @@
-#include "cache.h"
 #include "builtin.h"
+#include "advice.h"
 #include "commit.h"
 #include "gettext.h"
+#include "hash.h"
 #include "tag.h"
 #include "merge-recursive.h"
+#include "object-name.h"
+#include "repository.h"
 #include "xdiff-interface.h"
 
 static const char builtin_merge_recursive_usage[] =
index 803e380856edf087ca06bb42bef1813d2c6b11ba..0de42aecf4babf5d1cae19aa81e7d46676c636d1 100644 (file)
@@ -8,13 +8,16 @@
 #include "commit.h"
 #include "commit-reach.h"
 #include "merge-ort.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "parse-options.h"
 #include "repository.h"
 #include "blob.h"
 #include "exec-cmd.h"
 #include "merge-blobs.h"
 #include "quote.h"
+#include "tree.h"
+#include "config.h"
 
 static int line_termination = '\n';
 
@@ -321,7 +324,9 @@ static void unresolved(const struct traverse_info *info, struct name_entry n[3])
  * The successful merge rules are the same as for the three-way merge
  * in git-read-tree.
  */
-static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *info)
+static int threeway_callback(int n UNUSED, unsigned long mask,
+                            unsigned long dirmask UNUSED,
+                            struct name_entry *entry, struct traverse_info *info)
 {
        /* Same in both? */
        if (same_entry(entry+1, entry+2) || both_empty(entry+1, entry+2)) {
@@ -445,7 +450,7 @@ static int real_merge(struct merge_tree_options *o,
 
                base_commit = lookup_commit_reference_by_name(merge_base);
                if (!base_commit)
-                       die(_("could not lookup commit %s"), merge_base);
+                       die(_("could not lookup commit '%s'"), merge_base);
 
                opt.ancestor = merge_base;
                base_tree = repo_get_commit_tree(the_repository, base_commit);
@@ -626,6 +631,8 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
        if (argc != expected_remaining_argc)
                usage_with_options(merge_tree_usage, mt_options);
 
+       git_config(git_default_config, NULL);
+
        /* Do the relevant type of merge */
        if (o.mode == MODE_REAL)
                return real_merge(&o, merge_base, argv[0], argv[1], prefix);
index a99be9610e9bc1950deb0afd9c47395ccc6a3ab1..de68910177fbff00d19a0f8ef824776de0458636 100644 (file)
@@ -7,15 +7,16 @@
  */
 
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
+#include "advice.h"
 #include "config.h"
+#include "editor.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-name.h"
 #include "parse-options.h"
-#include "builtin.h"
 #include "lockfile.h"
 #include "run-command.h"
 #include "hook.h"
@@ -25,6 +26,7 @@
 #include "refspec.h"
 #include "commit.h"
 #include "diffcore.h"
+#include "path.h"
 #include "revision.h"
 #include "unpack-trees.h"
 #include "cache-tree.h"
@@ -34,6 +36,7 @@
 #include "color.h"
 #include "rerere.h"
 #include "help.h"
+#include "merge.h"
 #include "merge-recursive.h"
 #include "merge-ort-wrappers.h"
 #include "resolve-undo.h"
@@ -49,7 +52,6 @@
 #include "commit-reach.h"
 #include "wt-status.h"
 #include "commit-graph.h"
-#include "wrapper.h"
 
 #define DEFAULT_TWOHEAD (1<<0)
 #define DEFAULT_OCTOPUS (1<<1)
@@ -620,7 +622,8 @@ static void parse_branch_merge_options(char *bmo)
        free(argv);
 }
 
-static int git_merge_config(const char *k, const char *v, void *cb)
+static int git_merge_config(const char *k, const char *v,
+                           const struct config_context *ctx, void *cb)
 {
        int status;
        const char *str;
@@ -665,10 +668,10 @@ static int git_merge_config(const char *k, const char *v, void *cb)
                return 0;
        }
 
-       status = fmt_merge_msg_config(k, v, cb);
+       status = fmt_merge_msg_config(k, v, ctx, cb);
        if (status)
                return status;
-       return git_diff_ui_config(k, v, cb);
+       return git_diff_ui_config(k, v, ctx, cb);
 }
 
 static int read_tree_trivial(struct object_id *common, struct object_id *head,
@@ -876,13 +879,15 @@ static void prepare_to_commit(struct commit_list *remoteheads)
                strbuf_addch(&msg, '\n');
                if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS) {
                        wt_status_append_cut_line(&msg);
-                       strbuf_commented_addf(&msg, "\n");
+                       strbuf_commented_addf(&msg, comment_line_char, "\n");
                }
-               strbuf_commented_addf(&msg, _(merge_editor_comment));
+               strbuf_commented_addf(&msg, comment_line_char,
+                                     _(merge_editor_comment));
                if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS)
-                       strbuf_commented_addf(&msg, _(scissors_editor_comment));
+                       strbuf_commented_addf(&msg, comment_line_char,
+                                             _(scissors_editor_comment));
                else
-                       strbuf_commented_addf(&msg,
+                       strbuf_commented_addf(&msg, comment_line_char,
                                _(no_scissors_editor_comment), comment_line_char);
        }
        if (signoff)
index b3f6d7ea389788610c6ae9351f31ed040b2eb264..d8e0b5afc079d2f71383eed6881b733fea251312 100644 (file)
@@ -2,9 +2,11 @@
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "strbuf.h"
 #include "tag.h"
 #include "replace-object.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "fsck.h"
 #include "config.h"
 
@@ -16,11 +18,11 @@ static int option_strict = 1;
 
 static struct fsck_options fsck_options = FSCK_OPTIONS_STRICT;
 
-static int mktag_fsck_error_func(struct fsck_options *o,
-                                const struct object_id *oid,
-                                enum object_type object_type,
+static int mktag_fsck_error_func(struct fsck_options *o UNUSED,
+                                const struct object_id *oid UNUSED,
+                                enum object_type object_type UNUSED,
                                 enum fsck_msg_type msg_type,
-                                enum fsck_msg_id msg_id,
+                                enum fsck_msg_id msg_id UNUSED,
                                 const char *message)
 {
        switch (msg_type) {
index 09a7bd5c5c250fb22ca204932c6e00c50de62690..9a22d4e27735d55265fbf1a16cec8aeb66c27883 100644 (file)
@@ -4,13 +4,13 @@
  * Copyright (c) Junio C Hamano, 2006, 2009
  */
 #include "builtin.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
 #include "quote.h"
+#include "strbuf.h"
 #include "tree.h"
 #include "parse-options.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static struct treeent {
        unsigned mode;
index 1b5083f8b26cd8f15bf8e0ee0cadd38cc35fc5c6..a72aebecaa2f3aa96f802b635b4d55c5f122d56c 100644 (file)
@@ -1,13 +1,13 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "midx.h"
+#include "strbuf.h"
 #include "trace2.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 #define BUILTIN_MIDX_WRITE_USAGE \
        N_("git multi-pack-index [<options>] write [--preferred-pack=<pack>]" \
@@ -82,6 +82,7 @@ static struct option *add_common_options(struct option *prev)
 }
 
 static int git_multi_pack_index_write_config(const char *var, const char *value,
+                                            const struct config_context *ctx UNUSED,
                                             void *cb UNUSED)
 {
        if (!strcmp(var, "pack.writebitmaphashcache")) {
index b7c5ffbd8c796f5848523ac8fbe450ce425be13d..05e7156034e04d637990cabf105f7fa967b0f2aa 100644 (file)
@@ -6,16 +6,20 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
+#include "advice.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "name-hash.h"
+#include "object-file.h"
 #include "pathspec.h"
 #include "lockfile.h"
 #include "dir.h"
 #include "cache-tree.h"
 #include "string-list.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 #include "submodule.h"
 #include "entry.h"
@@ -180,7 +184,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
        int src_dir_nr = 0, src_dir_alloc = 0;
        struct strbuf a_src_dir = STRBUF_INIT;
        enum update_mode *modes, dst_mode = 0;
-       struct stat st;
+       struct stat st, dest_st;
        struct string_list src_for_dst = STRING_LIST_INIT_NODUP;
        struct lock_file lock_file = LOCK_INIT;
        struct cache_entry *ce;
@@ -300,7 +304,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
                        goto act_on_entry;
                }
                if (S_ISDIR(st.st_mode)
-                   && lstat(dst, &st) == 0) {
+                   && lstat(dst, &dest_st) == 0) {
                        bad = _("cannot move directory over file");
                        goto act_on_entry;
                }
index 831d360a78a6a706cd1e6b4cc5b9d3eced21bea6..c706fa37201aeabc5bdc3eb752a5be859490a42d 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
@@ -8,11 +7,14 @@
 #include "commit.h"
 #include "tag.h"
 #include "refs.h"
+#include "object-name.h"
+#include "pager.h"
 #include "parse-options.h"
 #include "prio-queue.h"
 #include "hash-lookup.h"
 #include "commit-slab.h"
 #include "commit-graph.h"
+#include "wildmatch.h"
 
 /*
  * One day.  See the 'name a rev shortly after epoch' test in t6120 when
@@ -571,7 +573,11 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
                                   N_("ignore refs matching <pattern>")),
                OPT_GROUP(""),
                OPT_BOOL(0, "all", &all, N_("list all commits reachable from all refs")),
-               OPT_BOOL(0, "stdin", &transform_stdin, N_("deprecated: use --annotate-stdin instead")),
+               OPT_BOOL_F(0,
+                          "stdin",
+                          &transform_stdin,
+                          N_("deprecated: use --annotate-stdin instead"),
+                          PARSE_OPT_HIDDEN),
                OPT_BOOL(0, "annotate-stdin", &annotate_stdin, N_("annotate text from stdin")),
                OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
                OPT_BOOL(0, "always",     &always,
index 00268e949cf9664ea9cb8d1d02e313306bf03e13..9f38863dd507ff680cf8a006b81a413d75550b1b 100644 (file)
@@ -7,14 +7,17 @@
  * and builtin/tag.c by Kristian Høgsberg and Carlos Rica.
  */
 
-#include "cache.h"
-#include "alloc.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
+#include "alloc.h"
+#include "editor.h"
+#include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "notes.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "repository.h"
 #include "blob.h"
 #include "pretty.h"
@@ -178,7 +181,7 @@ static void write_commented_object(int fd, const struct object_id *object)
 
        if (strbuf_read(&buf, show.out, 0) < 0)
                die_errno(_("could not read 'show' output"));
-       strbuf_add_commented_lines(&cbuf, buf.buf, buf.len);
+       strbuf_add_commented_lines(&cbuf, buf.buf, buf.len, comment_line_char);
        write_or_die(fd, cbuf.buf, cbuf.len);
 
        strbuf_release(&cbuf);
@@ -206,9 +209,10 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
                        copy_obj_to_fd(fd, old_note);
 
                strbuf_addch(&buf, '\n');
-               strbuf_add_commented_lines(&buf, "\n", strlen("\n"));
-               strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)));
-               strbuf_add_commented_lines(&buf, "\n", strlen("\n"));
+               strbuf_add_commented_lines(&buf, "\n", strlen("\n"), comment_line_char);
+               strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)),
+                                          comment_line_char);
+               strbuf_add_commented_lines(&buf, "\n", strlen("\n"), comment_line_char);
                write_or_die(fd, buf.buf, buf.len);
 
                write_commented_object(fd, object);
@@ -221,7 +225,7 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
                        die(_("please supply the note contents using either -m or -F option"));
                }
                if (d->stripspace)
-                       strbuf_stripspace(&d->buf, 1);
+                       strbuf_stripspace(&d->buf, comment_line_char);
        }
 }
 
index 77d88f85b04c6d8febb6ed3c79d817e68a991ac2..d2a162d52804cf7fdf1fd1a11303f2380c24c9e3 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
@@ -33,7 +32,8 @@
 #include "strvec.h"
 #include "list.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "dir.h"
 #include "midx.h"
@@ -42,7 +42,6 @@
 #include "promisor-remote.h"
 #include "pack-mtimes.h"
 #include "parse-options.h"
-#include "wrapper.h"
 
 /*
  * Objects we are going to pack are collected in the `to_pack` structure.
@@ -1330,7 +1329,7 @@ static int no_try_delta(const char *path)
 
        if (!check)
                check = attr_check_initl("delta", NULL);
-       git_check_attr(the_repository->index, NULL, path, check);
+       git_check_attr(the_repository->index, path, check);
        if (ATTR_FALSE(check->items[0].value))
                return 1;
        return 0;
@@ -3134,26 +3133,27 @@ static void prepare_pack(int window, int depth)
        free(delta_list);
 }
 
-static int git_pack_config(const char *k, const char *v, void *cb)
+static int git_pack_config(const char *k, const char *v,
+                          const struct config_context *ctx, void *cb)
 {
        if (!strcmp(k, "pack.window")) {
-               window = git_config_int(k, v);
+               window = git_config_int(k, v, ctx->kvi);
                return 0;
        }
        if (!strcmp(k, "pack.windowmemory")) {
-               window_memory_limit = git_config_ulong(k, v);
+               window_memory_limit = git_config_ulong(k, v, ctx->kvi);
                return 0;
        }
        if (!strcmp(k, "pack.depth")) {
-               depth = git_config_int(k, v);
+               depth = git_config_int(k, v, ctx->kvi);
                return 0;
        }
        if (!strcmp(k, "pack.deltacachesize")) {
-               max_delta_cache_size = git_config_int(k, v);
+               max_delta_cache_size = git_config_int(k, v, ctx->kvi);
                return 0;
        }
        if (!strcmp(k, "pack.deltacachelimit")) {
-               cache_max_small_delta_size = git_config_int(k, v);
+               cache_max_small_delta_size = git_config_int(k, v, ctx->kvi);
                return 0;
        }
        if (!strcmp(k, "pack.writebitmaphashcache")) {
@@ -3179,7 +3179,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
                return 0;
        }
        if (!strcmp(k, "pack.threads")) {
-               delta_search_threads = git_config_int(k, v);
+               delta_search_threads = git_config_int(k, v, ctx->kvi);
                if (delta_search_threads < 0)
                        die(_("invalid number of threads specified (%d)"),
                            delta_search_threads);
@@ -3190,7 +3190,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
                return 0;
        }
        if (!strcmp(k, "pack.indexversion")) {
-               pack_idx_opts.version = git_config_int(k, v);
+               pack_idx_opts.version = git_config_int(k, v, ctx->kvi);
                if (pack_idx_opts.version > 2)
                        die(_("bad pack.indexVersion=%"PRIu32),
                            pack_idx_opts.version);
@@ -3226,7 +3226,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
                ex->uri = xstrdup(pack_end + 1);
                oidmap_put(&configured_exclusions, ex);
        }
-       return git_default_config(k, v, cb);
+       return git_default_config(k, v, ctx, cb);
 }
 
 /* Counters for trace2 output when in --stdin-packs mode. */
@@ -3359,16 +3359,16 @@ static void read_packs_list_from_stdin(void)
        }
 
        string_list_sort(&include_packs);
+       string_list_remove_duplicates(&include_packs, 0);
        string_list_sort(&exclude_packs);
+       string_list_remove_duplicates(&exclude_packs, 0);
 
        for (p = get_all_packs(the_repository); p; p = p->next) {
                const char *pack_name = pack_basename(p);
 
-               item = string_list_lookup(&include_packs, pack_name);
-               if (!item)
-                       item = string_list_lookup(&exclude_packs, pack_name);
-
-               if (item)
+               if ((item = string_list_lookup(&include_packs, pack_name)))
+                       item->util = p;
+               if ((item = string_list_lookup(&exclude_packs, pack_name)))
                        item->util = p;
        }
 
@@ -4117,6 +4117,18 @@ static void add_extra_kept_packs(const struct string_list *names)
        }
 }
 
+static int option_parse_quiet(const struct option *opt, const char *arg,
+                             int unset)
+{
+       BUG_ON_OPT_ARG(arg);
+
+       if (!unset)
+               progress = 0;
+       else if (!progress)
+               progress = 1;
+       return 0;
+}
+
 static int option_parse_index_version(const struct option *opt,
                                      const char *arg, int unset)
 {
@@ -4178,8 +4190,9 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
                LIST_OBJECTS_FILTER_INIT;
 
        struct option pack_objects_options[] = {
-               OPT_SET_INT('q', "quiet", &progress,
-                           N_("do not show progress meter"), 0),
+               OPT_CALLBACK_F('q', "quiet", NULL, NULL,
+                              N_("do not show progress meter"),
+                              PARSE_OPT_NOARG, option_parse_quiet),
                OPT_SET_INT(0, "progress", &progress,
                            N_("show progress meter"), 1),
                OPT_SET_INT(0, "all-progress", &progress,
@@ -4255,8 +4268,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
                                N_("ignore this pack")),
                OPT_INTEGER(0, "compression", &pack_compression_level,
                            N_("pack compression level")),
-               OPT_SET_INT(0, "keep-true-parents", &grafts_replace_parents,
-                           N_("do not hide commits by grafts"), 0),
+               OPT_BOOL(0, "keep-true-parents", &grafts_keep_true_parents,
+                        N_("do not hide commits by grafts")),
                OPT_BOOL(0, "use-bitmap-index", &use_bitmap_index,
                         N_("use a bitmap index if available to speed up counting objects")),
                OPT_SET_INT(0, "write-bitmap-index", &write_bitmap_index,
@@ -4283,7 +4296,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
        if (DFS_NUM_STATES > (1 << OE_DFS_STATE_BITS))
                BUG("too many dfs states, increase OE_DFS_STATE_BITS");
 
-       read_replace_refs = 0;
+       disable_replace_refs();
 
        sparse = git_env_bool("GIT_TEST_PACK_SPARSE", -1);
        if (the_repository->gitdir) {
@@ -4293,9 +4306,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
        }
 
        reset_pack_idx_option(&pack_idx_opts);
+       pack_idx_opts.flags |= WRITE_REV;
        git_config(git_pack_config, NULL);
-       if (git_env_bool(GIT_TEST_WRITE_REV_INDEX, 0))
-               pack_idx_opts.flags |= WRITE_REV;
+       if (git_env_bool(GIT_TEST_NO_WRITE_REV_INDEX, 0))
+               pack_idx_opts.flags &= ~WRITE_REV;
 
        progress = isatty(2);
        argc = parse_options(argc, argv, prefix, pack_objects_options,
index 43e9d12dfdc2075efd9f3aab5e0f4d38a5ad73a4..4c735ba069caf6626791d85741f78c3869a5c89d 100644 (file)
@@ -11,7 +11,7 @@
 #include "hex.h"
 #include "repository.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 #define BLKSIZE 512
 
index 9833815fb30a3aae55c9512dc53094d1862e4be6..bcf383cac9dd875354d3c91152f7b8d635f82ff4 100644 (file)
@@ -4,22 +4,45 @@
 #include "parse-options.h"
 #include "refs.h"
 #include "repository.h"
+#include "revision.h"
 
 static char const * const pack_refs_usage[] = {
-       N_("git pack-refs [--all] [--no-prune]"),
+       N_("git pack-refs [--all] [--no-prune] [--include <pattern>] [--exclude <pattern>]"),
        NULL
 };
 
 int cmd_pack_refs(int argc, const char **argv, const char *prefix)
 {
        unsigned int flags = PACK_REFS_PRUNE;
+       static struct ref_exclusions excludes = REF_EXCLUSIONS_INIT;
+       static struct string_list included_refs = STRING_LIST_INIT_NODUP;
+       struct pack_refs_opts pack_refs_opts = { .exclusions = &excludes,
+                                                .includes = &included_refs,
+                                                .flags = flags };
+       static struct string_list option_excluded_refs = STRING_LIST_INIT_NODUP;
+       struct string_list_item *item;
+
        struct option opts[] = {
-               OPT_BIT(0, "all",   &flags, N_("pack everything"), PACK_REFS_ALL),
-               OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
+               OPT_BIT(0, "all",   &pack_refs_opts.flags, N_("pack everything"), PACK_REFS_ALL),
+               OPT_BIT(0, "prune", &pack_refs_opts.flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
+               OPT_STRING_LIST(0, "include", pack_refs_opts.includes, N_("pattern"),
+                       N_("references to include")),
+               OPT_STRING_LIST(0, "exclude", &option_excluded_refs, N_("pattern"),
+                       N_("references to exclude")),
                OPT_END(),
        };
        git_config(git_default_config, NULL);
        if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
                usage_with_options(pack_refs_usage, opts);
-       return refs_pack_refs(get_main_ref_store(the_repository), flags);
+
+       for_each_string_list_item(item, &option_excluded_refs)
+               add_ref_exclusion(pack_refs_opts.exclusions, item->string);
+
+       if (pack_refs_opts.flags & PACK_REFS_ALL)
+               string_list_append(pack_refs_opts.includes, "*");
+
+       if (!pack_refs_opts.includes->nr)
+               string_list_append(pack_refs_opts.includes, "refs/tags/*");
+
+       return refs_pack_refs(get_main_ref_store(the_repository), &pack_refs_opts);
 }
index 9d5585d3a72459725c14598738faa73529175b81..3894d2b970612cab4a47250dd53da5b0908c820e 100644 (file)
@@ -1,8 +1,8 @@
-#include "cache.h"
 #include "builtin.h"
 #include "config.h"
 #include "diff.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "parse-options.h"
 
@@ -196,7 +196,8 @@ struct patch_id_opts {
        int verbatim;
 };
 
-static int git_patch_id_config(const char *var, const char *value, void *cb)
+static int git_patch_id_config(const char *var, const char *value,
+                              const struct config_context *ctx, void *cb)
 {
        struct patch_id_opts *opts = cb;
 
@@ -209,7 +210,7 @@ static int git_patch_id_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 int cmd_patch_id(int argc, const char **argv, const char *prefix)
index 5c0952f5c647c255c2b29e41c4f349a4ecbfc9ff..57fe31467fe5ac9768f1b04f7c7e6dd3e9409468 100644 (file)
@@ -1,17 +1,20 @@
-#include "cache.h"
+#include "builtin.h"
 #include "commit.h"
 #include "diff.h"
+#include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "revision.h"
-#include "builtin.h"
 #include "reachable.h"
 #include "parse-options.h"
+#include "path.h"
 #include "progress.h"
 #include "prune-packed.h"
 #include "replace-object.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "shallow.h"
 
 static const char * const prune_usage[] = {
@@ -162,7 +165,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
 
        expire = TIME_MAX;
        save_commit_buffer = 0;
-       read_replace_refs = 0;
+       disable_replace_refs();
        repo_init_revisions(the_repository, &revs, prefix);
 
        argc = parse_options(argc, argv, prefix, options, prune_usage, 0);
index 5405d09f22fbf5b2c5b036650d175ba3e7d1eaae..be2b2c9ebc97b2a1620b93e1766e0ccfa6c7843a 100644 (file)
@@ -6,17 +6,21 @@
  * Fetch one or more remote refs and merge it/them into the current HEAD.
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "advice.h"
+#include "config.h"
 #include "gettext.h"
 #include "hex.h"
+#include "merge.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "exec-cmd.h"
 #include "run-command.h"
 #include "oid-array.h"
 #include "remote.h"
 #include "dir.h"
+#include "path.h"
+#include "read-cache-ll.h"
 #include "rebase.h"
 #include "refs.h"
 #include "refspec.h"
@@ -359,7 +363,8 @@ static enum rebase_type config_get_rebase(int *rebase_unspecified)
 /**
  * Read config variables.
  */
-static int git_pull_config(const char *var, const char *value, void *cb)
+static int git_pull_config(const char *var, const char *value,
+                          const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "rebase.autostash")) {
                config_autostash = git_config_bool(var, value);
@@ -372,7 +377,7 @@ static int git_pull_config(const char *var, const char *value, void *cb)
                check_trust_level = 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 /**
@@ -1045,7 +1050,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
                if (!opt_autostash)
                        require_clean_work_tree(the_repository,
                                N_("pull with rebase"),
-                               _("please commit or stash them."), 1, 0);
+                               _("Please commit or stash them."), 1, 0);
 
                if (get_rebase_fork_point(&rebase_fork_point, repo, *refspecs))
                        oidclr(&rebase_fork_point);
index fa550b8f80ad4e3d8da1f15fbf98ba8ac6858d03..2e708383c24ba86e07fc14b0139afb28d489c014 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * "git push"
  */
-#include "cache.h"
+#include "builtin.h"
+#include "advice.h"
 #include "branch.h"
 #include "config.h"
 #include "environment.h"
 #include "refs.h"
 #include "refspec.h"
 #include "run-command.h"
-#include "builtin.h"
 #include "remote.h"
 #include "transport.h"
 #include "parse-options.h"
+#include "pkt-line.h"
+#include "repository.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "send-pack.h"
+#include "trace2.h"
 #include "color.h"
 
 static const char * const push_usage[] = {
@@ -298,21 +301,21 @@ static void setup_default_push_refspecs(int *flags, struct remote *remote)
 
 static const char message_advice_pull_before_push[] =
        N_("Updates were rejected because the tip of your current branch is behind\n"
-          "its remote counterpart. Integrate the remote changes (e.g.\n"
-          "'git pull ...') before pushing again.\n"
+          "its remote counterpart. If you want to integrate the remote changes,\n"
+          "use 'git pull' before pushing again.\n"
           "See the 'Note about fast-forwards' in 'git push --help' for details.");
 
 static const char message_advice_checkout_pull_push[] =
        N_("Updates were rejected because a pushed branch tip is behind its remote\n"
-          "counterpart. Check out this branch and integrate the remote changes\n"
-          "(e.g. 'git pull ...') before pushing again.\n"
+          "counterpart. If you want to integrate the remote changes, use 'git pull'\n"
+          "before pushing again.\n"
           "See the 'Note about fast-forwards' in 'git push --help' for details.");
 
 static const char message_advice_ref_fetch_first[] =
-       N_("Updates were rejected because the remote contains work that you do\n"
-          "not have locally. This is usually caused by another repository pushing\n"
-          "to the same ref. You may want to first integrate the remote changes\n"
-          "(e.g., 'git pull ...') before pushing again.\n"
+       N_("Updates were rejected because the remote contains work that you do not\n"
+          "have locally. This is usually caused by another repository pushing to\n"
+          "the same ref. If you want to integrate the remote changes, use\n"
+          "'git pull' before pushing again.\n"
           "See the 'Note about fast-forwards' in 'git push --help' for details.");
 
 static const char message_advice_ref_already_exists[] =
@@ -324,10 +327,10 @@ static const char message_advice_ref_needs_force[] =
           "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");
+       N_("Updates were rejected because the tip of the remote-tracking branch has\n"
+          "been updated since the last checkout. If you want to integrate the\n"
+          "remote changes, use 'git pull' before pushing again.\n"
+          "See the 'Note about fast-forwards' in 'git push --help' for details.");
 
 static void advise_pull_before_push(void)
 {
@@ -506,7 +509,8 @@ static void set_push_cert_flags(int *flags, int v)
 }
 
 
-static int git_push_config(const char *k, const char *v, void *cb)
+static int git_push_config(const char *k, const char *v,
+                          const struct config_context *ctx, void *cb)
 {
        const char *slot_name;
        int *flags = cb;
@@ -573,7 +577,7 @@ static int git_push_config(const char *k, const char *v, void *cb)
                return 0;
        }
 
-       return git_default_config(k, v, NULL);
+       return git_default_config(k, v, ctx, NULL);
 }
 
 int cmd_push(int argc, const char **argv, const char *prefix)
@@ -591,11 +595,12 @@ int cmd_push(int argc, const char **argv, const char *prefix)
        struct option options[] = {
                OPT__VERBOSITY(&verbosity),
                OPT_STRING( 0 , "repo", &repo, N_("repository"), N_("repository")),
-               OPT_BIT( 0 , "all", &flags, N_("push all refs"), TRANSPORT_PUSH_ALL),
+               OPT_BIT( 0 , "all", &flags, N_("push all branches"), TRANSPORT_PUSH_ALL),
+               OPT_ALIAS( 0 , "branches", "all"),
                OPT_BIT( 0 , "mirror", &flags, N_("mirror all refs"),
                            (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
                OPT_BOOL('d', "delete", &deleterefs, N_("delete refs")),
-               OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")),
+               OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --branches or --mirror)")),
                OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN),
                OPT_BIT( 0,  "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN),
                OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE),
@@ -622,10 +627,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
                                PARSE_OPT_OPTARG, option_parse_push_signed),
                OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC),
                OPT_STRING_LIST('o', "push-option", &push_options_cmdline, N_("server-specific"), N_("option to transmit")),
-               OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
-                               TRANSPORT_FAMILY_IPV4),
-               OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
-                               TRANSPORT_FAMILY_IPV6),
+               OPT_IPVERSION(&family),
                OPT_END()
        };
 
@@ -638,7 +640,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
        set_push_cert_flags(&flags, push_cert);
 
        if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
-               die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--mirror/--tags");
+               die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--branches/--mirror/--tags");
        if (deleterefs && argc < 2)
                die(_("--delete doesn't make sense without any refs"));
 
index b72af527f08bc1275d4e1ccf4c56870c3c0dc822..e455a4795cc8101576a806ee68df71a56c7661ce 100644 (file)
@@ -1,9 +1,10 @@
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "range-diff.h"
 #include "config.h"
+#include "repository.h"
 #include "revision.h"
 
 static const char * const builtin_range_diff_usage[] = {
index 600d4f748fcff432f05bbeb318d7007f5b551c7f..1fec702a04fa9b9785d767c4e8b44e50d0e3a89c 100644 (file)
@@ -5,21 +5,23 @@
  */
 
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "object.h"
+#include "object-name.h"
 #include "tree.h"
 #include "tree-walk.h"
 #include "cache-tree.h"
 #include "unpack-trees.h"
 #include "dir.h"
-#include "builtin.h"
 #include "parse-options.h"
+#include "repository.h"
 #include "resolve-undo.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
 
@@ -100,12 +102,13 @@ static int debug_merge(const struct cache_entry * const *stages,
        return 0;
 }
 
-static int git_read_tree_config(const char *var, const char *value, void *cb)
+static int git_read_tree_config(const char *var, const char *value,
+                               const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "submodule.recurse"))
                return git_default_submodule_config(var, value, cb);
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
index 1ceac603c724aabd482b15680b2df195d3039622..50cb85751f798e81d30d631754a3aaad443c3c49 100644 (file)
 #include "cache-tree.h"
 #include "unpack-trees.h"
 #include "lockfile.h"
+#include "object-file.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "commit.h"
 #include "diff.h"
 #include "wt-status.h"
@@ -32,8 +35,8 @@
 #include "sequencer.h"
 #include "rebase-interactive.h"
 #include "reset.h"
+#include "trace2.h"
 #include "hook.h"
-#include "wrapper.h"
 
 static char const * const builtin_rebase_usage[] = {
        N_("git rebase [-i] [options] [--exec <cmd>] "
@@ -206,7 +209,7 @@ static int edit_todo_file(unsigned flags)
        if (strbuf_read_file(&todo_list.buf, todo_file, 0) < 0)
                return error_errno(_("could not read '%s'."), todo_file);
 
-       strbuf_stripspace(&todo_list.buf, 1);
+       strbuf_stripspace(&todo_list.buf, comment_line_char);
        res = edit_todo_list(the_repository, &todo_list, &new_todo, NULL, NULL, flags);
        if (!res && todo_list_write_to_file(the_repository, &new_todo, todo_file,
                                            NULL, NULL, -1, flags & ~(TODO_LIST_SHORTEN_IDS)))
@@ -769,7 +772,8 @@ static void parse_rebase_merges_value(struct rebase_options *options, const char
                die(_("Unknown rebase-merges mode: %s"), value);
 }
 
-static int rebase_config(const char *var, const char *value, void *data)
+static int rebase_config(const char *var, const char *value,
+                        const struct config_context *ctx, void *data)
 {
        struct rebase_options *opts = data;
 
@@ -828,7 +832,7 @@ static int rebase_config(const char *var, const char *value, void *data)
                return git_config_string(&opts->default_backend, var, value);
        }
 
-       return git_default_config(var, value, data);
+       return git_default_config(var, value, ctx, data);
 }
 
 static int checkout_up_to_date(struct rebase_options *options)
index 9109552533d838755a0db62b8de9bd8a671cad12..fb8e1549d1be1e0b5e90cc2b7426eda7b7ce2f51 100644 (file)
 #include "tmp-objdir.h"
 #include "oidset.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "protocol.h"
 #include "commit-reach.h"
+#include "server-info.h"
+#include "trace.h"
+#include "trace2.h"
 #include "worktree.h"
 #include "shallow.h"
 #include "parse-options.h"
-#include "wrapper.h"
 
 static const char * const receive_pack_usage[] = {
        N_("git receive-pack <git-dir>"),
@@ -86,7 +90,7 @@ static struct object_id push_cert_oid;
 static struct signature_check sigcheck;
 static const char *push_cert_nonce;
 static const char *cert_nonce_seed;
-static struct string_list hidden_refs = STRING_LIST_INIT_DUP;
+static struct strvec hidden_refs = STRVEC_INIT;
 
 static const char *NONCE_UNSOLICITED = "UNSOLICITED";
 static const char *NONCE_BAD = "BAD";
@@ -135,7 +139,8 @@ static enum deny_action parse_deny_action(const char *var, const char *value)
        return DENY_IGNORE;
 }
 
-static int receive_pack_config(const char *var, const char *value, void *cb)
+static int receive_pack_config(const char *var, const char *value,
+                              const struct config_context *ctx, void *cb)
 {
        int status = parse_hide_refs_config(var, value, "receive", &hidden_refs);
 
@@ -153,12 +158,12 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
        }
 
        if (strcmp(var, "receive.unpacklimit") == 0) {
-               receive_unpack_limit = git_config_int(var, value);
+               receive_unpack_limit = git_config_int(var, value, ctx->kvi);
                return 0;
        }
 
        if (strcmp(var, "transfer.unpacklimit") == 0) {
-               transfer_unpack_limit = git_config_int(var, value);
+               transfer_unpack_limit = git_config_int(var, value, ctx->kvi);
                return 0;
        }
 
@@ -226,7 +231,7 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
                return git_config_string(&cert_nonce_seed, var, value);
 
        if (strcmp(var, "receive.certnonceslop") == 0) {
-               nonce_stamp_slop_limit = git_config_ulong(var, value);
+               nonce_stamp_slop_limit = git_config_ulong(var, value, ctx->kvi);
                return 0;
        }
 
@@ -241,12 +246,12 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
        }
 
        if (strcmp(var, "receive.keepalive") == 0) {
-               keepalive_in_sec = git_config_int(var, value);
+               keepalive_in_sec = git_config_int(var, value, ctx->kvi);
                return 0;
        }
 
        if (strcmp(var, "receive.maxinputsize") == 0) {
-               max_input_size = git_config_int64(var, value);
+               max_input_size = git_config_int64(var, value, ctx->kvi);
                return 0;
        }
 
@@ -262,7 +267,7 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static void show_ref(const char *path, const struct object_id *oid)
@@ -333,7 +338,9 @@ static void write_head_info(void)
 {
        static struct oidset seen = OIDSET_INIT;
 
-       for_each_ref(show_ref_cb, &seen);
+       refs_for_each_fullref_in(get_main_ref_store(the_repository), "",
+                                hidden_refs_to_excludes(&hidden_refs),
+                                show_ref_cb, &seen);
        for_each_alternate_ref(show_one_alternate_ref, &seen);
        oidset_clear(&seen);
        if (!sent_capabilities)
@@ -2093,7 +2100,7 @@ static struct command *read_head_info(struct packet_reader *reader,
                        const char *feature_list = reader->line + linelen + 1;
                        const char *hash = NULL;
                        const char *client_sid;
-                       int len = 0;
+                       size_t len = 0;
                        if (parse_feature_request(feature_list, "report-status"))
                                report_status = 1;
                        if (parse_feature_request(feature_list, "report-status-v2"))
@@ -2615,7 +2622,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
                packet_flush(1);
        oid_array_clear(&shallow);
        oid_array_clear(&ref);
-       string_list_clear(&hidden_refs, 0);
+       strvec_clear(&hidden_refs);
        free((void *)push_cert_nonce);
        return 0;
 }
index a1fa0c855f4ae74188e5e258c8a7b0f9ba57ed19..df63a5892e71057e342792147fe5d30e13603952 100644 (file)
@@ -1,8 +1,10 @@
 #include "builtin.h"
 #include "config.h"
 #include "gettext.h"
+#include "repository.h"
 #include "revision.h"
 #include "reachable.h"
+#include "wildmatch.h"
 #include "worktree.h"
 #include "reflog.h"
 #include "parse-options.h"
@@ -108,7 +110,8 @@ static struct reflog_expire_cfg *find_cfg_ent(const char *pattern, size_t len)
 #define EXPIRE_TOTAL   01
 #define EXPIRE_UNREACH 02
 
-static int reflog_expire_config(const char *var, const char *value, void *cb)
+static int reflog_expire_config(const char *var, const char *value,
+                               const struct config_context *ctx, void *cb)
 {
        const char *pattern, *key;
        size_t pattern_len;
@@ -117,7 +120,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
        struct reflog_expire_cfg *ent;
 
        if (parse_config_key(var, "gc", &pattern, &pattern_len, &key) < 0)
-               return git_default_config(var, value, cb);
+               return git_default_config(var, value, ctx, cb);
 
        if (!strcmp(key, "reflogexpire")) {
                slot = EXPIRE_TOTAL;
@@ -128,7 +131,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
                if (git_config_expiry_date(&expire, var, value))
                        return -1;
        } else
-               return git_default_config(var, value, cb);
+               return git_default_config(var, value, ctx, cb);
 
        if (!pattern) {
                switch (slot) {
index 1e0b137d977bb74da381cf173f82e25c5c548537..d91bbe728d739e074e5f4fa54f70c186f371c1b7 100644 (file)
@@ -2,6 +2,7 @@
 #include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "path.h"
 #include "transport.h"
 #include "remote.h"
 #include "string-list.h"
@@ -10,7 +11,7 @@
 #include "rebase.h"
 #include "refs.h"
 #include "refspec.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "strvec.h"
 #include "commit-reach.h"
 #include "progress.h"
@@ -167,10 +168,9 @@ static int add(int argc, const char **argv, const char *prefix)
        struct option options[] = {
                OPT_BOOL('f', "fetch", &fetch, N_("fetch the remote branches")),
                OPT_SET_INT(0, "tags", &fetch_tags,
-                           N_("import all tags and associated objects when fetching"),
+                           N_("import all tags and associated objects when fetching\n"
+                              "or do not fetch any tag at all (--no-tags)"),
                            TAGS_SET),
-               OPT_SET_INT(0, NULL, &fetch_tags,
-                           N_("or do not fetch any tag at all (--no-tags)"), TAGS_UNSET),
                OPT_STRING_LIST('t', "track", &track, N_("branch"),
                                N_("branch(es) to track")),
                OPT_STRING('m', "master", &master, N_("branch"), N_("master branch")),
@@ -268,6 +268,7 @@ static const char *abbrev_ref(const char *name, const char *prefix)
 #define abbrev_branch(name) abbrev_ref((name), "refs/heads/")
 
 static int config_read_branches(const char *key, const char *value,
+                               const struct config_context *ctx UNUSED,
                                void *data UNUSED)
 {
        const char *orig_key = key;
@@ -645,17 +646,19 @@ struct push_default_info
 };
 
 static int config_read_push_default(const char *key, const char *value,
-       void *cb)
+       const struct config_context *ctx, void *cb)
 {
+       const struct key_value_info *kvi = ctx->kvi;
+
        struct push_default_info* info = cb;
        if (strcmp(key, "remote.pushdefault") ||
            !value || strcmp(value, info->old_name))
                return 0;
 
-       info->scope = current_config_scope();
+       info->scope = kvi->scope;
        strbuf_reset(&info->origin);
-       strbuf_addstr(&info->origin, current_config_name());
-       info->linenr = current_config_line();
+       strbuf_addstr(&info->origin, config_origin_type_name(kvi->origin_type));
+       info->linenr = kvi->linenr;
 
        return 0;
 }
@@ -1494,7 +1497,9 @@ static int prune(int argc, const char **argv, const char *prefix)
        return result;
 }
 
-static int get_remote_default(const char *key, const char *value UNUSED, void *priv)
+static int get_remote_default(const char *key, const char *value UNUSED,
+                             const struct config_context *ctx UNUSED,
+                             void *priv)
 {
        if (strcmp(key, "remotes.default") == 0) {
                int *found = priv;
index df4d8e0f0bafc912f4b5cb410aaf74abf6819ec4..97051479e49bf12418dfd70ac42b9bc132b9d571 100644 (file)
@@ -1,12 +1,13 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "path.h"
 #include "run-command.h"
+#include "server-info.h"
 #include "sigchain.h"
 #include "strbuf.h"
 #include "string-list.h"
@@ -14,7 +15,7 @@
 #include "midx.h"
 #include "packfile.h"
 #include "prune-packed.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "promisor-remote.h"
 #include "shallow.h"
 #include "pack.h"
@@ -58,7 +59,8 @@ struct pack_objects_args {
        int local;
 };
 
-static int repack_config(const char *var, const char *value, void *cb)
+static int repack_config(const char *var, const char *value,
+                        const struct config_context *ctx, void *cb)
 {
        struct pack_objects_args *cruft_po_args = cb;
        if (!strcmp(var, "repack.usedeltabaseoffset")) {
@@ -90,12 +92,12 @@ static int repack_config(const char *var, const char *value, void *cb)
                return git_config_string(&cruft_po_args->depth, var, value);
        if (!strcmp(var, "repack.cruftthreads"))
                return git_config_string(&cruft_po_args->threads, var, value);
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 /*
- * Adds all packs hex strings to either fname_nonkept_list or
- * fname_kept_list based on whether each pack has a corresponding
+ * Adds all packs hex strings (pack-$HASH) to either fname_nonkept_list
+ * or fname_kept_list based on whether each pack has a corresponding
  * .keep file or not.  Packs without a .keep file are not to be kept
  * if we are going to pack everything into one file.
  */
@@ -103,40 +105,38 @@ static void collect_pack_filenames(struct string_list *fname_nonkept_list,
                                   struct string_list *fname_kept_list,
                                   const struct string_list *extra_keep)
 {
-       DIR *dir;
-       struct dirent *e;
-       char *fname;
-
-       if (!(dir = opendir(packdir)))
-               return;
+       struct packed_git *p;
+       struct strbuf buf = STRBUF_INIT;
 
-       while ((e = readdir(dir)) != NULL) {
-               size_t len;
+       for (p = get_all_packs(the_repository); p; p = p->next) {
                int i;
+               const char *base;
 
-               if (!strip_suffix(e->d_name, ".pack", &len))
+               if (!p->pack_local)
                        continue;
 
+               base = pack_basename(p);
+
                for (i = 0; i < extra_keep->nr; i++)
-                       if (!fspathcmp(e->d_name, extra_keep->items[i].string))
+                       if (!fspathcmp(base, extra_keep->items[i].string))
                                break;
 
-               fname = xmemdupz(e->d_name, len);
+               strbuf_reset(&buf);
+               strbuf_addstr(&buf, base);
+               strbuf_strip_suffix(&buf, ".pack");
 
-               if ((extra_keep->nr > 0 && i < extra_keep->nr) ||
-                   (file_exists(mkpath("%s/%s.keep", packdir, fname)))) {
-                       string_list_append_nodup(fname_kept_list, fname);
-               } else {
+               if ((extra_keep->nr > 0 && i < extra_keep->nr) || p->pack_keep)
+                       string_list_append(fname_kept_list, buf.buf);
+               else {
                        struct string_list_item *item;
-                       item = string_list_append_nodup(fname_nonkept_list,
-                                                       fname);
-                       if (file_exists(mkpath("%s/%s.mtimes", packdir, fname)))
+                       item = string_list_append(fname_nonkept_list, buf.buf);
+                       if (p->is_cruft)
                                item->util = (void*)(uintptr_t)CRUFT_PACK;
                }
        }
-       closedir(dir);
 
        string_list_sort(fname_kept_list);
+       strbuf_release(&buf);
 }
 
 static void remove_redundant_pack(const char *dir_name, const char *base_name)
@@ -325,7 +325,8 @@ static int geometry_cmp(const void *va, const void *vb)
 }
 
 static void init_pack_geometry(struct pack_geometry **geometry_p,
-                              struct string_list *existing_kept_packs)
+                              struct string_list *existing_kept_packs,
+                              const struct pack_objects_args *args)
 {
        struct packed_git *p;
        struct pack_geometry *geometry;
@@ -335,6 +336,14 @@ static void init_pack_geometry(struct pack_geometry **geometry_p,
        geometry = *geometry_p;
 
        for (p = get_all_packs(the_repository); p; p = p->next) {
+               if (args->local && !p->pack_local)
+                       /*
+                        * When asked to only repack local packfiles we skip
+                        * over any packfiles that are borrowed from alternate
+                        * object directories.
+                        */
+                       continue;
+
                if (!pack_kept_objects) {
                        /*
                         * Any pack that has its pack_keep bit set will appear
@@ -448,8 +457,10 @@ static void split_pack_geometry(struct pack_geometry *geometry, int factor)
        geometry->split = split;
 }
 
-static struct packed_git *get_largest_active_pack(struct pack_geometry *geometry)
+static struct packed_git *get_preferred_pack(struct pack_geometry *geometry)
 {
+       uint32_t i;
+
        if (!geometry) {
                /*
                 * No geometry means either an all-into-one repack (in which
@@ -464,18 +475,30 @@ static struct packed_git *get_largest_active_pack(struct pack_geometry *geometry
        }
        if (geometry->split == geometry->pack_nr)
                return NULL;
-       return geometry->pack[geometry->pack_nr - 1];
+
+       /*
+        * The preferred pack is the largest pack above the split line. In
+        * other words, it is the largest pack that does not get rolled up in
+        * the geometric repack.
+        */
+       for (i = geometry->pack_nr; i > geometry->split; i--)
+               /*
+                * A pack that is not local would never be included in a
+                * multi-pack index. We thus skip over any non-local packs.
+                */
+               if (geometry->pack[i - 1]->pack_local)
+                       return geometry->pack[i - 1];
+
+       return NULL;
 }
 
-static void clear_pack_geometry(struct pack_geometry *geometry)
+static void free_pack_geometry(struct pack_geometry *geometry)
 {
        if (!geometry)
                return;
 
        free(geometry->pack);
-       geometry->pack_nr = 0;
-       geometry->pack_alloc = 0;
-       geometry->split = 0;
+       free(geometry);
 }
 
 struct midx_snapshot_ref_data {
@@ -558,6 +581,17 @@ static void midx_included_packs(struct string_list *include,
                for (i = geometry->split; i < geometry->pack_nr; i++) {
                        struct packed_git *p = geometry->pack[i];
 
+                       /*
+                        * The multi-pack index never refers to packfiles part
+                        * of an alternate object database, so we skip these.
+                        * While git-multi-pack-index(1) would silently ignore
+                        * them anyway, this allows us to skip executing the
+                        * command completely when we have only non-local
+                        * packfiles.
+                        */
+                       if (!p->pack_local)
+                               continue;
+
                        strbuf_addstr(&buf, pack_basename(p));
                        strbuf_strip_suffix(&buf, ".pack");
                        strbuf_addstr(&buf, ".idx");
@@ -591,7 +625,7 @@ static int write_midx_included_packs(struct string_list *include,
 {
        struct child_process cmd = CHILD_PROCESS_INIT;
        struct string_list_item *item;
-       struct packed_git *largest = get_largest_active_pack(geometry);
+       struct packed_git *preferred = get_preferred_pack(geometry);
        FILE *in;
        int ret;
 
@@ -612,9 +646,9 @@ static int write_midx_included_packs(struct string_list *include,
        if (write_bitmaps)
                strvec_push(&cmd.args, "--bitmap");
 
-       if (largest)
+       if (preferred)
                strvec_pushf(&cmd.args, "--preferred-pack=%s",
-                            pack_basename(largest));
+                            pack_basename(preferred));
 
        if (refs_snapshot)
                strvec_pushf(&cmd.args, "--refs-snapshot=%s", refs_snapshot);
@@ -774,7 +808,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
                                N_("same as -a, pack unreachable cruft objects separately"),
                                   PACK_CRUFT),
                OPT_STRING(0, "cruft-expiration", &cruft_expiration, N_("approxidate"),
-                               N_("with -C, expire objects older than this")),
+                               N_("with --cruft, expire objects older than this")),
                OPT_BOOL('d', NULL, &delete_redundant,
                                N_("remove redundant packs, and run git-prune-packed")),
                OPT_BOOL('f', NULL, &po_args.no_reuse_delta,
@@ -853,6 +887,18 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        if (write_bitmaps && !(pack_everything & ALL_INTO_ONE) && !write_midx)
                die(_(incremental_bitmap_conflict_error));
 
+       if (write_bitmaps && po_args.local && has_alt_odb(the_repository)) {
+               /*
+                * When asked to do a local repack, but we have
+                * packfiles that are inherited from an alternate, then
+                * we cannot guarantee that the multi-pack-index would
+                * have full coverage of all objects. We thus disable
+                * writing bitmaps in that case.
+                */
+               warning(_("disabling bitmap writing, as some objects are not being packed"));
+               write_bitmaps = 0;
+       }
+
        if (write_midx && write_bitmaps) {
                struct strbuf path = STRBUF_INIT;
 
@@ -875,7 +921,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        if (geometric_factor) {
                if (pack_everything)
                        die(_("options '%s' and '%s' cannot be used together"), "--geometric", "-A/-a");
-               init_pack_geometry(&geometry, &existing_kept_packs);
+               init_pack_geometry(&geometry, &existing_kept_packs, &po_args);
                split_pack_geometry(geometry, geometric_factor);
        }
 
@@ -1180,7 +1226,7 @@ cleanup:
        string_list_clear(&names, 1);
        string_list_clear(&existing_nonkept_packs, 0);
        string_list_clear(&existing_kept_packs, 0);
-       clear_pack_geometry(geometry);
+       free_pack_geometry(geometry);
 
        return ret;
 }
index d2adc8ab613401db7dcd8bf05aff5830ded984c7..da59600ad22fda16155a278a210478fb55d0d94e 100644 (file)
@@ -8,19 +8,23 @@
  * git-tag.sh and mktag.c by Linus Torvalds.
  */
 
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
+#include "editor.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
 #include "parse-options.h"
+#include "path.h"
 #include "run-command.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "repository.h"
 #include "tag.h"
+#include "wildmatch.h"
 
 static const char * const git_replace_usage[] = {
        N_("git replace [-f] <object> <replacement>"),
@@ -45,7 +49,7 @@ struct show_data {
 
 static int show_reference(struct repository *r, const char *refname,
                          const struct object_id *oid,
-                         int flag, void *cb_data)
+                         int flag UNUSED, void *cb_data)
 {
        struct show_data *data = cb_data;
 
@@ -405,7 +409,7 @@ struct check_mergetag_data {
        const char **argv;
 };
 
-static int check_one_mergetag(struct commit *commit,
+static int check_one_mergetag(struct commit *commit UNUSED,
                               struct commit_extra_header *extra,
                               void *data)
 {
@@ -563,7 +567,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
-       read_replace_refs = 0;
+       disable_replace_refs();
        git_config(git_default_config, NULL);
 
        argc = parse_options(argc, argv, prefix, options, git_replace_usage, 0);
index d4a03707b1af6bea5689e01eb35200ebfa9f40c7..07a9d37275cbbc52cc8cddbae4a6143df2e49a82 100644 (file)
@@ -1,12 +1,11 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "repository.h"
 #include "string-list.h"
 #include "rerere.h"
-#include "wrapper.h"
 #include "xdiff/xdiff.h"
 #include "xdiff-interface.h"
 #include "pathspec.h"
index 0ed329236c88e3f92692d5c3b6d2c69064bdb242..4b018d20e3b2200e44a04f1f759837a571e4bc4f 100644 (file)
@@ -9,9 +9,11 @@
  */
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
+#include "advice.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "tag.h"
 #include "diffcore.h"
 #include "tree.h"
 #include "branch.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "unpack-trees.h"
 #include "cache-tree.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "trace.h"
+#include "trace2.h"
 #include "dir.h"
 #include "add-interactive.h"
 
@@ -308,12 +315,13 @@ static int reset_refs(const char *rev, const struct object_id *oid)
        return update_ref_status;
 }
 
-static int git_reset_config(const char *var, const char *value, void *cb)
+static int git_reset_config(const char *var, const char *value,
+                           const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "submodule.recurse"))
                return git_default_submodule_config(var, value, cb);
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 int cmd_reset(int argc, const char **argv, const char *prefix)
@@ -330,18 +338,25 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
                OPT__QUIET(&quiet, N_("be quiet, only report errors")),
                OPT_BOOL(0, "no-refresh", &no_refresh,
                                N_("skip refreshing the index after reset")),
-               OPT_SET_INT(0, "mixed", &reset_type,
-                                               N_("reset HEAD and index"), MIXED),
-               OPT_SET_INT(0, "soft", &reset_type, N_("reset only HEAD"), SOFT),
-               OPT_SET_INT(0, "hard", &reset_type,
-                               N_("reset HEAD, index and working tree"), HARD),
-               OPT_SET_INT(0, "merge", &reset_type,
-                               N_("reset HEAD, index and working tree"), MERGE),
-               OPT_SET_INT(0, "keep", &reset_type,
-                               N_("reset HEAD but keep local changes"), KEEP),
+               OPT_SET_INT_F(0, "mixed", &reset_type,
+                             N_("reset HEAD and index"),
+                             MIXED, PARSE_OPT_NONEG),
+               OPT_SET_INT_F(0, "soft", &reset_type,
+                             N_("reset only HEAD"),
+                             SOFT, PARSE_OPT_NONEG),
+               OPT_SET_INT_F(0, "hard", &reset_type,
+                             N_("reset HEAD, index and working tree"),
+                             HARD, PARSE_OPT_NONEG),
+               OPT_SET_INT_F(0, "merge", &reset_type,
+                             N_("reset HEAD, index and working tree"),
+                             MERGE, PARSE_OPT_NONEG),
+               OPT_SET_INT_F(0, "keep", &reset_type,
+                             N_("reset HEAD but keep local changes"),
+                             KEEP, PARSE_OPT_NONEG),
                OPT_CALLBACK_F(0, "recurse-submodules", NULL,
-                           "reset", "control recursive updating of submodules",
-                           PARSE_OPT_OPTARG, option_parse_recurse_submodules_worktree_updater),
+                              "reset", "control recursive updating of submodules",
+                              PARSE_OPT_OPTARG,
+                              option_parse_recurse_submodules_worktree_updater),
                OPT_BOOL('p', "patch", &patch_mode, N_("select hunks interactively")),
                OPT_BOOL('N', "intent-to-add", &intent_to_add,
                                N_("record only the fact that removed paths will be added later")),
index a3dbbb6338ebe5ac297b807c87f0d06effd48a86..ff715d6918f004265cf8801879f13fc189f09709 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "commit.h"
 #include "diff.h"
 #include "list-objects-filter.h"
 #include "list-objects-filter-options.h"
 #include "object.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "pack.h"
 #include "pack-bitmap.h"
-#include "builtin.h"
 #include "log-tree.h"
 #include "graph.h"
 #include "bisect.h"
index 1af2089f9bd04810cb057b94371f67e45523ad0b..fde8861ca4e07990078258843890aef6334dd4c9 100644 (file)
@@ -4,19 +4,21 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "commit.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "refs.h"
 #include "quote.h"
-#include "builtin.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "diff.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "setup.h"
 #include "split-index.h"
@@ -155,9 +157,12 @@ static void show_rev(int type, const struct object_id *oid, const char *name)
                                 */
                                break;
                        case 1: /* happy */
-                               if (abbrev_ref)
+                               if (abbrev_ref) {
+                                       char *old = full;
                                        full = shorten_unambiguous_ref(full,
                                                abbrev_ref_strict);
+                                       free(old);
+                               }
                                show_with_type(type, full);
                                break;
                        default: /* ambiguous */
@@ -220,7 +225,7 @@ static int anti_reference(const char *refname, const struct object_id *oid,
        return 0;
 }
 
-static int show_abbrev(const struct object_id *oid, void *cb_data)
+static int show_abbrev(const struct object_id *oid, void *cb_data UNUSED)
 {
        show_rev(NORMAL, oid, NULL);
        return 0;
index 0240ec8593b27dbb44e9d5720340c8362bcec025..e6f9a1ad26721c450258849cb8e415156052e442 100644 (file)
@@ -1,10 +1,10 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "builtin.h"
 #include "parse-options.h"
 #include "diff.h"
 #include "gettext.h"
+#include "repository.h"
 #include "revision.h"
 #include "rerere.h"
 #include "dir.h"
index 6be92817429a880130b8d3604c43d75115b9b5e3..dff819ae5098ff2ee0c72bae00b35da39bf4979d 100644 (file)
@@ -5,17 +5,21 @@
  */
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "alloc.h"
 #include "advice.h"
 #include "config.h"
 #include "lockfile.h"
 #include "dir.h"
 #include "cache-tree.h"
 #include "gettext.h"
+#include "hash.h"
 #include "tree-walk.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "read-cache.h"
+#include "repository.h"
 #include "string-list.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "submodule.h"
 #include "pathspec.h"
 
index 4784143004df1875cba4529e510679c7d058f921..cd6d9e41129a21d7f9c21cebae0a322812ebcbcd 100644 (file)
@@ -131,7 +131,8 @@ static void print_helper_status(struct ref *ref)
        strbuf_release(&buf);
 }
 
-static int send_pack_config(const char *k, const char *v, void *cb)
+static int send_pack_config(const char *k, const char *v,
+                           const struct config_context *ctx, void *cb)
 {
        if (!strcmp(k, "push.gpgsign")) {
                const char *value;
@@ -151,7 +152,7 @@ static int send_pack_config(const char *k, const char *v, void *cb)
                        }
                }
        }
-       return git_default_config(k, v, cb);
+       return git_default_config(k, v, ctx, cb);
 }
 
 int cmd_send_pack(int argc, const char **argv, const char *prefix)
index 46f4e0832ac6258e636f8064365811da6d55c449..1307ed2b88a77dbb93d38528b8d39e2b87452d07 100644 (file)
@@ -1,11 +1,11 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "commit.h"
 #include "diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "string-list.h"
+#include "repository.h"
 #include "revision.h"
 #include "utf8.h"
 #include "mailmap.h"
index 463a8d11c317cd5d47facf1cbe9386c474decf8e..b01ec761d2596c6a524994b99e1ef0aa719735d2 100644 (file)
@@ -1,17 +1,20 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "pretty.h"
 #include "refs.h"
-#include "builtin.h"
 #include "color.h"
 #include "strvec.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "repository.h"
 #include "dir.h"
 #include "commit-slab.h"
 #include "date.h"
+#include "wildmatch.h"
 
 static const char* show_branch_usage[] = {
     N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
@@ -556,7 +559,8 @@ static void append_one_rev(const char *av)
        die("bad sha1 reference %s", av);
 }
 
-static int git_show_branch_config(const char *var, const char *value, void *cb)
+static int git_show_branch_config(const char *var, const char *value,
+                                 const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "showbranch.default")) {
                if (!value)
@@ -576,7 +580,10 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_color_default_config(var, value, cb);
+       if (git_color_config(var, value, cb) < 0)
+               return -1;
+
+       return git_default_config(var, value, ctx, cb);
 }
 
 static int omit_in_dense(struct commit *commit, struct commit **rev, int n)
@@ -642,7 +649,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
        int with_current_branch = 0;
        int head_at = -1;
        int topics = 0;
-       int dense = 1;
+       int sparse = 0;
        const char *reflog_base = NULL;
        struct option builtin_show_branch_options[] = {
                OPT_BOOL('a', "all", &all_heads,
@@ -664,17 +671,17 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                         N_("show possible merge bases")),
                OPT_BOOL(0, "independent", &independent,
                            N_("show refs unreachable from any other ref")),
-               OPT_SET_INT(0, "topo-order", &sort_order,
-                           N_("show commits in topological order"),
-                           REV_SORT_IN_GRAPH_ORDER),
+               OPT_SET_INT_F(0, "topo-order", &sort_order,
+                             N_("show commits in topological order"),
+                             REV_SORT_IN_GRAPH_ORDER, PARSE_OPT_NONEG),
                OPT_BOOL(0, "topics", &topics,
                         N_("show only commits not on the first branch")),
-               OPT_SET_INT(0, "sparse", &dense,
-                           N_("show merges reachable from only one tip"), 0),
-               OPT_SET_INT(0, "date-order", &sort_order,
-                           N_("topologically sort, maintaining date order "
-                              "where possible"),
-                           REV_SORT_BY_COMMIT_DATE),
+               OPT_SET_INT(0, "sparse", &sparse,
+                           N_("show merges reachable from only one tip"), 1),
+               OPT_SET_INT_F(0, "date-order", &sort_order,
+                             N_("topologically sort, maintaining date order "
+                                "where possible"),
+                             REV_SORT_BY_COMMIT_DATE, PARSE_OPT_NONEG),
                OPT_CALLBACK_F('g', "reflog", &reflog_base, N_("<n>[,<base>]"),
                            N_("show <n> most recent ref-log entries starting at "
                               "base"),
@@ -933,7 +940,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                            !is_merge_point &&
                            (this_flag & (1u << REV_SHIFT)))
                                continue;
-                       if (dense && is_merge &&
+                       if (!sparse && is_merge &&
                            omit_in_dense(commit, rev, num_rev))
                                continue;
                        for (i = 0; i < num_rev; i++) {
index d4bbbbcd6ce8447b9174806a4d9711d60689fd75..540dc3dad1c1e3e4308c5058151dfb1dcaee6d21 100644 (file)
@@ -1,9 +1,10 @@
 #include "builtin.h"
-#include "cache.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "pack.h"
 #include "parse-options.h"
+#include "repository.h"
 
 static const char *const show_index_usage[] = {
        "git show-index [--object-format=<hash-algorithm>]",
index 138d30a005e2de9067cc2f280ea5bf205a7b11be..5110814f7960870aa4f1df60965f2234088f859f 100644 (file)
@@ -1,10 +1,10 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "tag.h"
 #include "string-list.h"
index 5e917ead7bc304956faa789a60b8a6663d1d6123..5c8ffb1f7598b056fadcdd8fb98182d34928e6f3 100644 (file)
@@ -1,9 +1,10 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
+#include "object-file.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "pathspec.h"
 #include "repository.h"
index 735d27039e1865369018f127666a009928e8fda4..fe64cde9ce3010e812f789dfbe040c64f16bec45 100644 (file)
@@ -4,7 +4,9 @@
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "refs.h"
 #include "lockfile.h"
 #include "run-command.h"
 #include "dir.h"
 #include "entry.h"
+#include "preload-index.h"
+#include "read-cache.h"
 #include "rerere.h"
 #include "revision.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "log-tree.h"
 #include "diffcore.h"
 #include "exec-cmd.h"
@@ -836,7 +841,8 @@ static int show_stat = 1;
 static int show_patch;
 static int show_include_untracked;
 
-static int git_stash_config(const char *var, const char *value, void *cb)
+static int git_stash_config(const char *var, const char *value,
+                           const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "stash.showstat")) {
                show_stat = git_config_bool(var, value);
@@ -850,7 +856,7 @@ static int git_stash_config(const char *var, const char *value, void *cb)
                show_include_untracked = git_config_bool(var, value);
                return 0;
        }
-       return git_diff_basic_config(var, value, cb);
+       return git_diff_basic_config(var, value, ctx, cb);
 }
 
 static void diff_include_untracked(const struct stash_info *info, struct diff_options *diff_opt)
index 9451eb69ff4771931118e948669114e9f3d4e63d..7b700a9fb1c2a355af6ee6935edbeec49f3f4135 100644 (file)
@@ -1,6 +1,6 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
+#include "environment.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "setup.h"
@@ -13,7 +13,7 @@ static void comment_lines(struct strbuf *buf)
        size_t len;
 
        msg = strbuf_detach(buf, &len);
-       strbuf_add_commented_lines(buf, msg, len);
+       strbuf_add_commented_lines(buf, msg, len, comment_line_char);
        free(msg);
 }
 
@@ -58,7 +58,8 @@ int cmd_stripspace(int argc, const char **argv, const char *prefix)
                die_errno("could not read the input");
 
        if (mode == STRIP_DEFAULT || mode == STRIP_COMMENTS)
-               strbuf_stripspace(&buf, mode == STRIP_COMMENTS);
+               strbuf_stripspace(&buf,
+                         mode == STRIP_COMMENTS ? comment_line_char : '\0');
        else
                comment_lines(&buf);
 
index 569068e6a2c90cda1006143eae8bdba41fa951a3..f6871efd95dbca6da051f2d1b3b81b3c5c52b0b5 100644 (file)
@@ -1,18 +1,20 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "repository.h"
-#include "cache.h"
 #include "config.h"
 #include "parse-options.h"
 #include "quote.h"
+#include "path.h"
 #include "pathspec.h"
+#include "preload-index.h"
 #include "dir.h"
+#include "read-cache.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "string-list.h"
@@ -24,7 +26,9 @@
 #include "revision.h"
 #include "diffcore.h"
 #include "diff.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "advice.h"
 #include "branch.h"
 #include "list-objects-filter-options.h"
@@ -2022,14 +2026,17 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
        strbuf_reset(&sb);
        strbuf_addf(&sb, "submodule.%s.url", sub->name);
        if (repo_config_get_string_tmp(the_repository, sb.buf, &url)) {
-               if (starts_with_dot_slash(sub->url) ||
-                   starts_with_dot_dot_slash(sub->url)) {
+               if (sub->url && (starts_with_dot_slash(sub->url) ||
+                                starts_with_dot_dot_slash(sub->url))) {
                        url = resolve_relative_url(sub->url, NULL, 0);
                        need_free_url = 1;
                } else
                        url = sub->url;
        }
 
+       if (!url)
+               die(_("cannot clone submodule '%s' without a URL"), sub->name);
+
        strbuf_reset(&sb);
        strbuf_addf(&sb, "%s/.git", ce->name);
        needs_cloning = !file_exists(sb.buf);
@@ -2187,12 +2194,13 @@ static int update_clone_task_finished(int result,
 }
 
 static int git_update_clone_config(const char *var, const char *value,
+                                  const struct config_context *ctx,
                                   void *cb)
 {
        int *max_jobs = cb;
 
        if (!strcmp(var, "submodule.fetchjobs"))
-               *max_jobs = parse_submodule_fetchjobs(var, value);
+               *max_jobs = parse_submodule_fetchjobs(var, value, ctx->kvi);
        return 0;
 }
 
index 10198a74faee55d0dfcfccb36b75c2e5bc5da8f5..c9defe4d2e4ff057bce4dc31330ae1f964225ede 100644 (file)
@@ -1,9 +1,9 @@
 #include "builtin.h"
 #include "config.h"
-#include "cache.h"
 #include "gettext.h"
 #include "refs.h"
 #include "parse-options.h"
+#include "strbuf.h"
 
 static const char * const git_symbolic_ref_usage[] = {
        N_("git symbolic-ref [-m <reason>] <name> <ref>"),
index ab5f5c74f437288797383ccd2aab199435f28266..3918eacbb57bd9e0d2b90ecbbf6cc07c16fad73b 100644 (file)
@@ -6,14 +6,17 @@
  * Based on git-tag.sh and mktag.c by Linus Torvalds.
  */
 
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "advice.h"
+#include "config.h"
+#include "editor.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "tag.h"
 #include "run-command.h"
 #include "parse-options.h"
@@ -118,7 +121,7 @@ static int for_each_tag_name(const char **argv, each_tag_name_fn fn,
        return had_error;
 }
 
-static int collect_tags(const char *name, const char *ref,
+static int collect_tags(const char *name UNUSED, const char *ref,
                        const struct object_id *oid, void *cb_data)
 {
        struct string_list *ref_list = cb_data;
@@ -152,7 +155,7 @@ static int delete_tags(const char **argv)
        return result;
 }
 
-static int verify_tag(const char *name, const char *ref,
+static int verify_tag(const char *name, const char *ref UNUSED,
                      const struct object_id *oid, void *cb_data)
 {
        int flags;
@@ -185,7 +188,8 @@ static const char tag_template_nocleanup[] =
        "Lines starting with '%c' will be kept; you may remove them"
        " yourself if you want to.\n");
 
-static int git_tag_config(const char *var, const char *value, void *cb)
+static int git_tag_config(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "tag.gpgsign")) {
                config_sign_tag = git_config_bool(var, value);
@@ -206,7 +210,11 @@ static int git_tag_config(const char *var, const char *value, void *cb)
 
        if (starts_with(var, "column."))
                return git_column_config(var, value, "tag", &colopts);
-       return git_color_default_config(var, value, cb);
+
+       if (git_color_config(var, value, cb) < 0)
+               return -1;
+
+       return git_default_config(var, value, ctx, cb);
 }
 
 static void write_tag_body(int fd, const struct object_id *oid)
@@ -268,11 +276,10 @@ static const char message_advice_nested_tag[] =
 static void create_tag(const struct object_id *object, const char *object_ref,
                       const char *tag,
                       struct strbuf *buf, struct create_tag_options *opt,
-                      struct object_id *prev, struct object_id *result)
+                      struct object_id *prev, struct object_id *result, char *path)
 {
        enum object_type type;
        struct strbuf header = STRBUF_INIT;
-       char *path = NULL;
 
        type = oid_object_info(the_repository, object, NULL);
        if (type <= OBJ_NONE)
@@ -296,7 +303,6 @@ static void create_tag(const struct object_id *object, const char *object_ref,
                int fd;
 
                /* write the template message before editing: */
-               path = git_pathdup("TAG_EDITMSG");
                fd = xopen(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
 
                if (opt->message_given) {
@@ -308,9 +314,11 @@ static void create_tag(const struct object_id *object, const char *object_ref,
                        struct strbuf buf = STRBUF_INIT;
                        strbuf_addch(&buf, '\n');
                        if (opt->cleanup_mode == CLEANUP_ALL)
-                               strbuf_commented_addf(&buf, _(tag_template), tag, comment_line_char);
+                               strbuf_commented_addf(&buf, comment_line_char,
+                                     _(tag_template), tag, comment_line_char);
                        else
-                               strbuf_commented_addf(&buf, _(tag_template_nocleanup), tag, comment_line_char);
+                               strbuf_commented_addf(&buf, comment_line_char,
+                                     _(tag_template_nocleanup), tag, comment_line_char);
                        write_or_die(fd, buf.buf, buf.len);
                        strbuf_release(&buf);
                }
@@ -324,7 +332,8 @@ static void create_tag(const struct object_id *object, const char *object_ref,
        }
 
        if (opt->cleanup_mode != CLEANUP_NONE)
-               strbuf_stripspace(buf, opt->cleanup_mode == CLEANUP_ALL);
+               strbuf_stripspace(buf,
+                 opt->cleanup_mode == CLEANUP_ALL ? comment_line_char : '\0');
 
        if (!opt->message_given && !buf->len)
                die(_("no tag message?"));
@@ -338,10 +347,6 @@ static void create_tag(const struct object_id *object, const char *object_ref,
                                path);
                exit(128);
        }
-       if (path) {
-               unlink_or_warn(path);
-               free(path);
-       }
 }
 
 static void create_reflog_msg(const struct object_id *oid, struct strbuf *sb)
@@ -440,7 +445,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
        struct msg_arg msg = { .buf = STRBUF_INIT };
        struct ref_transaction *transaction;
        struct strbuf err = STRBUF_INIT;
-       struct ref_filter filter;
+       struct ref_filter filter = REF_FILTER_INIT;
        struct ref_sorting *sorting;
        struct string_list sorting_options = STRING_LIST_INIT_DUP;
        struct ref_format format = REF_FORMAT_INIT;
@@ -492,13 +497,13 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
        };
        int ret = 0;
        const char *only_in_list = NULL;
+       char *path = NULL;
 
        setup_ref_filter_porcelain_msg();
 
        git_config(git_tag_config, &sorting_options);
 
        memset(&opt, 0, sizeof(opt));
-       memset(&filter, 0, sizeof(filter));
        filter.lines = -1;
        opt.sign = -1;
 
@@ -626,7 +631,9 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
        if (create_tag_object) {
                if (force_sign_annotate && !annotate)
                        opt.sign = 1;
-               create_tag(&object, object_ref, tag, &buf, &opt, &prev, &object);
+               path = git_pathdup("TAG_EDITMSG");
+               create_tag(&object, object_ref, tag, &buf, &opt, &prev, &object,
+                          path);
        }
 
        transaction = ref_transaction_begin(&err);
@@ -634,8 +641,17 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
            ref_transaction_update(transaction, ref.buf, &object, &prev,
                                   create_reflog ? REF_FORCE_CREATE_REFLOG : 0,
                                   reflog_msg.buf, &err) ||
-           ref_transaction_commit(transaction, &err))
+           ref_transaction_commit(transaction, &err)) {
+               if (path)
+                       fprintf(stderr,
+                               _("The tag message has been left in %s\n"),
+                               path);
                die("%s", err.buf);
+       }
+       if (path) {
+               unlink_or_warn(path);
+               free(path);
+       }
        ref_transaction_free(transaction);
        if (force && !is_null_oid(&prev) && !oideq(&prev, &object))
                printf(_("Updated tag '%s' (was %s)\n"), tag,
@@ -643,6 +659,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
 cleanup:
        ref_sorting_release(sorting);
+       ref_filter_clear(&filter);
        strbuf_release(&buf);
        strbuf_release(&ref);
        strbuf_release(&reflog_msg);
index 00179180c7dfd0d57a4ade4bee842d6af9636900..c129e2bb6cbffaf80898c8a9c1c4e49fdeb001a4 100644 (file)
@@ -1,8 +1,8 @@
 #include "builtin.h"
 #include "config.h"
 #include "hex.h"
-#include "object-store.h"
-#include "wrapper.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 
 static char *create_temp_file(struct object_id *oid)
 {
index 585e81b1069007625409c5e1bd2a4d304c306ca6..32505255a0097b84080dd8af37454aeb01ee8001 100644 (file)
@@ -1,17 +1,18 @@
 #include "builtin.h"
-#include "cache.h"
 #include "bulk-checkin.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "git-zlib.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "delta.h"
 #include "pack.h"
 #include "blob.h"
 #include "commit.h"
 #include "replace-object.h"
+#include "strbuf.h"
 #include "tag.h"
 #include "tree.h"
 #include "tree-walk.h"
@@ -214,7 +215,8 @@ static void write_cached_object(struct object *obj, struct obj_buffer *obj_buf)
  * Verify its reachability and validity recursively and write it out.
  */
 static int check_object(struct object *obj, enum object_type type,
-                       void *data, struct fsck_options *options)
+                       void *data UNUSED,
+                       struct fsck_options *options UNUSED)
 {
        struct obj_buffer *obj_buf;
 
@@ -608,7 +610,7 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix UNUSED)
        int i;
        struct object_id oid;
 
-       read_replace_refs = 0;
+       disable_replace_refs();
 
        git_config(git_default_config, NULL);
 
index 03cda5e60d2bd17c6de251c815d9c2bdd319429b..aee3cb8cbd3a03cedaf0c3e317e8c860049dbb74 100644 (file)
@@ -4,24 +4,29 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "bulk-checkin.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "quote.h"
 #include "cache-tree.h"
 #include "tree-walk.h"
-#include "builtin.h"
+#include "object-file.h"
 #include "refs.h"
 #include "resolve-undo.h"
 #include "parse-options.h"
 #include "pathspec.h"
 #include "dir.h"
+#include "read-cache.h"
+#include "repository.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "split-index.h"
+#include "symlinks.h"
 #include "fsmonitor.h"
 #include "write-or-die.h"
 
index 3ffd75b3e78ca96a4d8266b89588d29e9cffaa99..242102273eea02a096e7d4c31b5110d592f5d6af 100644 (file)
@@ -1,10 +1,12 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
+#include "hash.h"
 #include "refs.h"
-#include "builtin.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "quote.h"
+#include "repository.h"
 #include "strvec.h"
 
 static const char * const git_update_ref_usage[] = {
index e7bff27ae4053d94ef4557c9688c1f6875d3f6a3..1dc3971edeb3837a1479ce519197880d28ba7699 100644 (file)
@@ -1,8 +1,8 @@
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "server-info.h"
 
 static const char * const update_server_info_usage[] = {
        "git update-server-info [-f | --force]",
index 7f9320ac6d0bdc36bb543bcf8c9491e8741173e3..1b09e5e1aa3f08e91bf6de731b111864ef405573 100644 (file)
@@ -1,11 +1,12 @@
 /*
  * Copyright (c) 2006 Franck Bui-Huu
  */
-#include "cache.h"
 #include "builtin.h"
 #include "archive.h"
+#include "path.h"
 #include "pkt-line.h"
 #include "sideband.h"
+#include "repository.h"
 #include "run-command.h"
 #include "strvec.h"
 
index beb9dd08610000f94d2365437e43bf0518c20c55..9b021ef026c28c97ece12b924833dff87c15a103 100644 (file)
@@ -1,9 +1,9 @@
-#include "cache.h"
 #include "builtin.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "pkt-line.h"
 #include "parse-options.h"
+#include "path.h"
 #include "protocol.h"
 #include "replace-object.h"
 #include "upload-pack.h"
@@ -36,7 +36,7 @@ int cmd_upload_pack(int argc, const char **argv, const char *prefix)
        };
 
        packet_trace_identity("upload-pack");
-       read_replace_refs = 0;
+       disable_replace_refs();
 
        argc = parse_options(argc, argv, prefix, options, upload_pack_usage, 0);
 
index acb988d2d56fec4645c7d905023027f203c43911..74161bdf1c61b5248150bac284898e3c03c79111 100644 (file)
  * Copyright (C) Eric Biederman, 2005
  */
 #include "builtin.h"
+#include "attr.h"
 #include "config.h"
+#include "editor.h"
 #include "ident.h"
+#include "pager.h"
 #include "refs.h"
+#include "path.h"
+#include "strbuf.h"
 
 static const char var_usage[] = "git var (-l | <variable>)";
 
-static const char *editor(int flag)
+static char *committer(int ident_flag)
 {
-       return git_editor();
+       return xstrdup_or_null(git_committer_info(ident_flag));
 }
 
-static const char *sequence_editor(int flag)
+static char *author(int ident_flag)
 {
-       return git_sequence_editor();
+       return xstrdup_or_null(git_author_info(ident_flag));
 }
 
-static const char *pager(int flag)
+static char *editor(int ident_flag UNUSED)
+{
+       return xstrdup_or_null(git_editor());
+}
+
+static char *sequence_editor(int ident_flag UNUSED)
+{
+       return xstrdup_or_null(git_sequence_editor());
+}
+
+static char *pager(int ident_flag UNUSED)
 {
        const char *pgm = git_pager(1);
 
        if (!pgm)
                pgm = "cat";
-       return pgm;
+       return xstrdup(pgm);
+}
+
+static char *default_branch(int ident_flag UNUSED)
+{
+       return xstrdup_or_null(git_default_branch_name(1));
+}
+
+static char *shell_path(int ident_flag UNUSED)
+{
+       return xstrdup(SHELL_PATH);
 }
 
-static const char *default_branch(int flag)
+static char *git_attr_val_system(int ident_flag UNUSED)
 {
-       return git_default_branch_name(1);
+       if (git_attr_system_is_enabled()) {
+               char *file = xstrdup(git_attr_system_file());
+               normalize_path_copy(file, file);
+               return file;
+       }
+       return NULL;
+}
+
+static char *git_attr_val_global(int ident_flag UNUSED)
+{
+       char *file = xstrdup(git_attr_global_file());
+       if (file) {
+               normalize_path_copy(file, file);
+               return file;
+       }
+       return NULL;
+}
+
+static char *git_config_val_system(int ident_flag UNUSED)
+{
+       if (git_config_system()) {
+               char *file = git_system_config();
+               normalize_path_copy(file, file);
+               return file;
+       }
+       return NULL;
+}
+
+static char *git_config_val_global(int ident_flag UNUSED)
+{
+       struct strbuf buf = STRBUF_INIT;
+       char *user, *xdg;
+       size_t unused;
+
+       git_global_config(&user, &xdg);
+       if (xdg && *xdg) {
+               normalize_path_copy(xdg, xdg);
+               strbuf_addf(&buf, "%s\n", xdg);
+       }
+       if (user && *user) {
+               normalize_path_copy(user, user);
+               strbuf_addf(&buf, "%s\n", user);
+       }
+       free(xdg);
+       free(user);
+       strbuf_trim_trailing_newline(&buf);
+       if (buf.len == 0) {
+               strbuf_release(&buf);
+               return NULL;
+       }
+       return strbuf_detach(&buf, &unused);
 }
 
 struct git_var {
        const char *name;
-       const char *(*read)(int);
+       char *(*read)(int);
+       int multivalued;
 };
 static struct git_var git_vars[] = {
-       { "GIT_COMMITTER_IDENT", git_committer_info },
-       { "GIT_AUTHOR_IDENT",   git_author_info },
-       { "GIT_EDITOR", editor },
-       { "GIT_SEQUENCE_EDITOR", sequence_editor },
-       { "GIT_PAGER", pager },
-       { "GIT_DEFAULT_BRANCH", default_branch },
-       { "", NULL },
+       {
+               .name = "GIT_COMMITTER_IDENT",
+               .read = committer,
+       },
+       {
+               .name = "GIT_AUTHOR_IDENT",
+               .read = author,
+       },
+       {
+               .name = "GIT_EDITOR",
+               .read = editor,
+       },
+       {
+               .name = "GIT_SEQUENCE_EDITOR",
+               .read = sequence_editor,
+       },
+       {
+               .name = "GIT_PAGER",
+               .read = pager,
+       },
+       {
+               .name = "GIT_DEFAULT_BRANCH",
+               .read = default_branch,
+       },
+       {
+               .name = "GIT_SHELL_PATH",
+               .read = shell_path,
+       },
+       {
+               .name = "GIT_ATTR_SYSTEM",
+               .read = git_attr_val_system,
+       },
+       {
+               .name = "GIT_ATTR_GLOBAL",
+               .read = git_attr_val_global,
+       },
+       {
+               .name = "GIT_CONFIG_SYSTEM",
+               .read = git_config_val_system,
+       },
+       {
+               .name = "GIT_CONFIG_GLOBAL",
+               .read = git_config_val_global,
+               .multivalued = 1,
+       },
+       {
+               .name = "",
+               .read = NULL,
+       },
 };
 
 static void list_vars(void)
 {
        struct git_var *ptr;
-       const char *val;
+       char *val;
 
        for (ptr = git_vars; ptr->read; ptr++)
-               if ((val = ptr->read(0)))
-                       printf("%s=%s\n", ptr->name, val);
+               if ((val = ptr->read(0))) {
+                       if (ptr->multivalued && *val) {
+                               struct string_list list = STRING_LIST_INIT_DUP;
+                               int i;
+
+                               string_list_split(&list, val, '\n', -1);
+                               for (i = 0; i < list.nr; i++)
+                                       printf("%s=%s\n", ptr->name, list.items[i].string);
+                               string_list_clear(&list, 0);
+                       } else {
+                               printf("%s=%s\n", ptr->name, val);
+                       }
+                       free(val);
+               }
 }
 
 static const struct git_var *get_git_var(const char *var)
@@ -69,19 +199,20 @@ static const struct git_var *get_git_var(const char *var)
        return NULL;
 }
 
-static int show_config(const char *var, const char *value, void *cb)
+static int show_config(const char *var, const char *value,
+                      const struct config_context *ctx, void *cb)
 {
        if (value)
                printf("%s=%s\n", var, value);
        else
                printf("%s\n", var);
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 int cmd_var(int argc, const char **argv, const char *prefix UNUSED)
 {
        const struct git_var *git_var;
-       const char *val;
+       char *val;
 
        if (argc != 2)
                usage(var_usage);
@@ -102,6 +233,7 @@ int cmd_var(int argc, const char **argv, const char *prefix UNUSED)
                return 1;
 
        printf("%s\n", val);
+       free(val);
 
        return 0;
 }
index 4d10aa98b109c04aa554647fea42144dd1596505..9680b5870130615b7b4432a5ce456279db750aa4 100644 (file)
@@ -5,11 +5,11 @@
  *
  * Based on git-verify-tag
  */
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "commit.h"
 #include "run-command.h"
index 190fd6954092fe16f5e5e59dc01ba10445f30d45..011dddd2dc329292c363fbcfb10b71c218ffa034 100644 (file)
@@ -1,9 +1,9 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "run-command.h"
 #include "parse-options.h"
+#include "strbuf.h"
 
 #define VERIFY_PACK_VERBOSE 01
 #define VERIFY_PACK_STAT_ONLY 02
index 28d0da684542deaa68f71326300c4bae0f83ab9f..d8753270ebee4df6eed4b2dd5037f3fee97eb2c6 100644 (file)
@@ -5,12 +5,12 @@
  *
  * Based on git-verify-tag.sh
  */
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
 #include "tag.h"
 #include "run-command.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "gpg-interface.h"
 #include "ref-filter.h"
index 39e9e5c9ce8239df42cfcf566d6e51d829db3a3d..4cd01842de79fb43b842032eeffb1a181f788c6e 100644 (file)
@@ -1,28 +1,35 @@
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
+#include "advice.h"
 #include "checkout.h"
 #include "config.h"
-#include "builtin.h"
+#include "copy.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-file.h"
+#include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "strvec.h"
 #include "branch.h"
+#include "read-cache-ll.h"
 #include "refs.h"
+#include "remote.h"
+#include "repository.h"
 #include "run-command.h"
 #include "hook.h"
 #include "sigchain.h"
 #include "submodule.h"
 #include "utf8.h"
 #include "worktree.h"
-#include "wrapper.h"
 #include "quote.h"
 
 #define BUILTIN_WORKTREE_ADD_USAGE \
        N_("git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n" \
-          "                 [-b <new-branch>] <path> [<commit-ish>]")
+          "                 [--orphan] [(-b | -B) <new-branch>] <path> [<commit-ish>]")
+
 #define BUILTIN_WORKTREE_LIST_USAGE \
        N_("git worktree list [-v | --porcelain [-z]]")
 #define BUILTIN_WORKTREE_LOCK_USAGE \
 #define BUILTIN_WORKTREE_UNLOCK_USAGE \
        N_("git worktree unlock <worktree>")
 
+#define WORKTREE_ADD_DWIM_ORPHAN_INFER_TEXT \
+       _("No possible source branch, inferring '--orphan'")
+
+#define WORKTREE_ADD_ORPHAN_WITH_DASH_B_HINT_TEXT \
+       _("If you meant to create a worktree containing a new orphan branch\n" \
+       "(branch with no commits) for this repository, you can do so\n" \
+       "using the --orphan flag:\n" \
+       "\n" \
+       "    git worktree add --orphan -b %s %s\n")
+
+#define WORKTREE_ADD_ORPHAN_NO_DASH_B_HINT_TEXT \
+       _("If you meant to create a worktree containing a new orphan branch\n" \
+       "(branch with no commits) for this repository, you can do so\n" \
+       "using the --orphan flag:\n" \
+       "\n" \
+       "    git worktree add --orphan %s\n")
+
 static const char * const git_worktree_usage[] = {
        BUILTIN_WORKTREE_ADD_USAGE,
        BUILTIN_WORKTREE_LIST_USAGE,
@@ -95,6 +119,7 @@ struct add_opts {
        int detach;
        int quiet;
        int checkout;
+       int orphan;
        const char *keep_locked;
 };
 
@@ -103,14 +128,15 @@ static int verbose;
 static int guess_remote;
 static timestamp_t expire;
 
-static int git_worktree_config(const char *var, const char *value, void *cb)
+static int git_worktree_config(const char *var, const char *value,
+                              const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "worktree.guessremote")) {
                guess_remote = git_config_bool(var, value);
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static int delete_git_dir(const char *id)
@@ -368,6 +394,22 @@ static int checkout_worktree(const struct add_opts *opts,
        return run_command(&cp);
 }
 
+static int make_worktree_orphan(const char * ref, const struct add_opts *opts,
+                               struct strvec *child_env)
+{
+       struct strbuf symref = STRBUF_INIT;
+       struct child_process cp = CHILD_PROCESS_INIT;
+
+       validate_new_branchname(ref, &symref, 0);
+       strvec_pushl(&cp.args, "symbolic-ref", "HEAD", symref.buf, NULL);
+       if (opts->quiet)
+               strvec_push(&cp.args, "--quiet");
+       strvec_pushv(&cp.env, child_env->v);
+       strbuf_release(&symref);
+       cp.git_cmd = 1;
+       return run_command(&cp);
+}
+
 static int add_worktree(const char *path, const char *refname,
                        const struct add_opts *opts)
 {
@@ -397,7 +439,7 @@ static int add_worktree(const char *path, const char *refname,
                        die_if_checked_out(symref.buf, 0);
        }
        commit = lookup_commit_reference_by_name(refname);
-       if (!commit)
+       if (!commit && !opts->orphan)
                die(_("invalid reference: %s"), refname);
 
        name = worktree_basename(path, &len);
@@ -479,17 +521,17 @@ static int add_worktree(const char *path, const char *refname,
         * values from the current worktree into the new one, that way the
         * new worktree behaves the same as this one.
         */
-       if (repository_format_worktree_config)
+       if (the_repository->repository_format_worktree_config)
                copy_filtered_worktree_config(sb_repo.buf);
 
        strvec_pushf(&child_env, "%s=%s", GIT_DIR_ENVIRONMENT, sb_git.buf);
        strvec_pushf(&child_env, "%s=%s", GIT_WORK_TREE_ENVIRONMENT, path);
        cp.git_cmd = 1;
 
-       if (!is_branch)
+       if (!is_branch && commit) {
                strvec_pushl(&cp.args, "update-ref", "HEAD",
                             oid_to_hex(&commit->object.oid), NULL);
-       else {
+       else {
                strvec_pushl(&cp.args, "symbolic-ref", "HEAD",
                             symref.buf, NULL);
                if (opts->quiet)
@@ -501,6 +543,10 @@ static int add_worktree(const char *path, const char *refname,
        if (ret)
                goto done;
 
+       if (opts->orphan &&
+           (ret = make_worktree_orphan(refname, opts, &child_env)))
+               goto done;
+
        if (opts->checkout &&
            (ret = checkout_worktree(opts, &child_env)))
                goto done;
@@ -520,7 +566,7 @@ done:
         * Hook failure does not warrant worktree deletion, so run hook after
         * is_junk is cleared, but do return appropriate code when hook fails.
         */
-       if (!ret && opts->checkout) {
+       if (!ret && opts->checkout && !opts->orphan) {
                struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
 
                strvec_pushl(&opt.env, "GIT_DIR", "GIT_WORK_TREE", NULL);
@@ -568,7 +614,7 @@ static void print_preparing_worktree_line(int detach,
                else {
                        struct commit *commit = lookup_commit_reference_by_name(branch);
                        if (!commit)
-                               die(_("invalid reference: %s"), branch);
+                               BUG(_("unreachable: invalid reference: %s"), branch);
                        fprintf_ln(stderr, _("Preparing worktree (detached HEAD %s)"),
                                  repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
                }
@@ -576,6 +622,123 @@ static void print_preparing_worktree_line(int detach,
        }
 }
 
+/**
+ * Callback to short circuit iteration over refs on the first reference
+ * corresponding to a valid oid.
+ *
+ * Returns 0 on failure and non-zero on success.
+ */
+static int first_valid_ref(const char *refname,
+                          const struct object_id *oid,
+                          int flags,
+                          void *cb_data)
+{
+       return 1;
+}
+
+/**
+ * Verifies HEAD and determines whether there exist any valid local references.
+ *
+ * - Checks whether HEAD points to a valid reference.
+ *
+ * - Checks whether any valid local branches exist.
+ *
+ * - Emits a warning if there exist any valid branches but HEAD does not point
+ *   to a valid reference.
+ *
+ * Returns 1 if any of the previous checks are true, otherwise returns 0.
+ */
+static int can_use_local_refs(const struct add_opts *opts)
+{
+       if (head_ref(first_valid_ref, NULL)) {
+               return 1;
+       } else if (for_each_branch_ref(first_valid_ref, NULL)) {
+               if (!opts->quiet) {
+                       struct strbuf path = STRBUF_INIT;
+                       struct strbuf contents = STRBUF_INIT;
+
+                       strbuf_add_real_path(&path, get_worktree_git_dir(NULL));
+                       strbuf_addstr(&path, "/HEAD");
+                       strbuf_read_file(&contents, path.buf, 64);
+                       strbuf_stripspace(&contents, 0);
+                       strbuf_strip_suffix(&contents, "\n");
+
+                       warning(_("HEAD points to an invalid (or orphaned) reference.\n"
+                                 "HEAD path: '%s'\n"
+                                 "HEAD contents: '%s'"),
+                                 path.buf, contents.buf);
+                       strbuf_release(&path);
+                       strbuf_release(&contents);
+               }
+               return 1;
+       }
+       return 0;
+}
+
+/**
+ * Reports whether the necessary flags were set and whether the repository has
+ * remote references to attempt DWIM tracking of upstream branches.
+ *
+ * 1. Checks that `--guess-remote` was used or `worktree.guessRemote = true`.
+ *
+ * 2. Checks whether any valid remote branches exist.
+ *
+ * 3. Checks that there exists at least one remote and emits a warning/error
+ *    if both checks 1. and 2. are false (can be bypassed with `--force`).
+ *
+ * Returns 1 if checks 1. and 2. are true, otherwise 0.
+ */
+static int can_use_remote_refs(const struct add_opts *opts)
+{
+       if (!guess_remote) {
+               return 0;
+       } else if (for_each_remote_ref(first_valid_ref, NULL)) {
+               return 1;
+       } else if (!opts->force && remote_get(NULL)) {
+               die(_("No local or remote refs exist despite at least one remote\n"
+                     "present, stopping; use 'add -f' to overide or fetch a remote first"));
+       }
+       return 0;
+}
+
+/**
+ * Determines whether `--orphan` should be inferred in the evaluation of
+ * `worktree add path/` or `worktree add -b branch path/` and emits an error
+ * if the supplied arguments would produce an illegal combination when the
+ * `--orphan` flag is included.
+ *
+ * `opts` and `opt_track` contain the other options & flags supplied to the
+ * command.
+ *
+ * remote determines whether to check `can_use_remote_refs()` or not. This
+ * is primarily to differentiate between the basic `add` DWIM and `add -b`.
+ *
+ * Returns 1 when inferring `--orphan`, 0 otherwise, and emits an error when
+ * `--orphan` is inferred but doing so produces an illegal combination of
+ * options and flags. Additionally produces an error when remote refs are
+ * checked and the repo is in a state that looks like the user added a remote
+ * but forgot to fetch (and did not override the warning with -f).
+ */
+static int dwim_orphan(const struct add_opts *opts, int opt_track, int remote)
+{
+       if (can_use_local_refs(opts)) {
+               return 0;
+       } else if (remote && can_use_remote_refs(opts)) {
+               return 0;
+       } else if (!opts->quiet) {
+               fprintf_ln(stderr, WORKTREE_ADD_DWIM_ORPHAN_INFER_TEXT);
+       }
+
+       if (opt_track) {
+               die(_("'%s' and '%s' cannot be used together"), "--orphan",
+                   "--track");
+       } else if (!opts->checkout) {
+               die(_("'%s' and '%s' cannot be used together"), "--orphan",
+                   "--no-checkout");
+       }
+       return 1;
+}
+
 static const char *dwim_branch(const char *path, const char **new_branch)
 {
        int n;
@@ -612,6 +775,7 @@ static int add(int ac, const char **av, const char *prefix)
        const char *opt_track = NULL;
        const char *lock_reason = NULL;
        int keep_locked = 0;
+       int used_new_branch_options;
        struct option options[] = {
                OPT__FORCE(&opts.force,
                           N_("checkout <branch> even if already checked out in other worktree"),
@@ -620,6 +784,7 @@ static int add(int ac, const char **av, const char *prefix)
                           N_("create a new branch")),
                OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
                           N_("create or reset a branch")),
+               OPT_BOOL(0, "orphan", &opts.orphan, N_("create unborn/orphaned branch")),
                OPT_BOOL('d', "detach", &opts.detach, N_("detach HEAD at named commit")),
                OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree")),
                OPT_BOOL(0, "lock", &keep_locked, N_("keep the new working tree locked")),
@@ -640,6 +805,17 @@ static int add(int ac, const char **av, const char *prefix)
        ac = parse_options(ac, av, prefix, options, git_worktree_add_usage, 0);
        if (!!opts.detach + !!new_branch + !!new_branch_force > 1)
                die(_("options '%s', '%s', and '%s' cannot be used together"), "-b", "-B", "--detach");
+       if (opts.detach && opts.orphan)
+               die(_("options '%s', and '%s' cannot be used together"),
+                   "--orphan", "--detach");
+       if (opts.orphan && opt_track)
+               die(_("'%s' and '%s' cannot be used together"), "--orphan", "--track");
+       if (opts.orphan && !opts.checkout)
+               die(_("'%s' and '%s' cannot be used together"), "--orphan",
+                   "--no-checkout");
+       if (opts.orphan && ac == 2)
+               die(_("'%s' and '%s' cannot be used together"), "--orphan",
+                   _("<commit-ish>"));
        if (lock_reason && !keep_locked)
                die(_("the option '%s' requires '%s'"), "--reason", "--lock");
        if (lock_reason)
@@ -652,6 +828,7 @@ static int add(int ac, const char **av, const char *prefix)
 
        path = prefix_filename(prefix, av[0]);
        branch = ac < 2 ? "HEAD" : av[1];
+       used_new_branch_options = new_branch || new_branch_force;
 
        if (!strcmp(branch, "-"))
                branch = "@{-1}";
@@ -668,13 +845,28 @@ static int add(int ac, const char **av, const char *prefix)
                strbuf_release(&symref);
        }
 
-       if (ac < 2 && !new_branch && !opts.detach) {
+       if (opts.orphan && !new_branch) {
+               int n;
+               const char *s = worktree_basename(path, &n);
+               new_branch = xstrndup(s, n);
+       } else if (opts.orphan) {
+               // No-op
+       } else if (opts.detach) {
+               // Check HEAD
+               if (!strcmp(branch, "HEAD"))
+                       can_use_local_refs(&opts);
+       } else if (ac < 2 && new_branch) {
+               // DWIM: Infer --orphan when repo has no refs.
+               opts.orphan = dwim_orphan(&opts, !!opt_track, 0);
+       } else if (ac < 2) {
+               // DWIM: Guess branch name from path.
                const char *s = dwim_branch(path, &new_branch);
                if (s)
                        branch = s;
-       }
 
-       if (ac == 2 && !new_branch && !opts.detach) {
+               // DWIM: Infer --orphan when repo has no refs.
+               opts.orphan = (!s) && dwim_orphan(&opts, !!opt_track, 1);
+       } else if (ac == 2) {
                struct object_id oid;
                struct commit *commit;
                const char *remote;
@@ -687,11 +879,31 @@ static int add(int ac, const char **av, const char *prefix)
                                branch = remote;
                        }
                }
+
+               if (!strcmp(branch, "HEAD"))
+                       can_use_local_refs(&opts);
+
+       }
+
+       if (!opts.orphan && !lookup_commit_reference_by_name(branch)) {
+               int attempt_hint = !opts.quiet && (ac < 2);
+               if (attempt_hint && used_new_branch_options) {
+                       advise_if_enabled(ADVICE_WORKTREE_ADD_ORPHAN,
+                               WORKTREE_ADD_ORPHAN_WITH_DASH_B_HINT_TEXT,
+                               new_branch, path);
+               } else if (attempt_hint) {
+                       advise_if_enabled(ADVICE_WORKTREE_ADD_ORPHAN,
+                               WORKTREE_ADD_ORPHAN_NO_DASH_B_HINT_TEXT, path);
+               }
+               die(_("invalid reference: %s"), branch);
        }
+
        if (!opts.quiet)
                print_preparing_worktree_line(opts.detach, branch, new_branch, !!new_branch_force);
 
-       if (new_branch) {
+       if (opts.orphan) {
+               branch = new_branch;
+       } else if (new_branch) {
                struct child_process cp = CHILD_PROCESS_INIT;
                cp.git_cmd = 1;
                strvec_push(&cp.args, "branch");
@@ -1196,5 +1408,9 @@ int cmd_worktree(int ac, const char **av, const char *prefix)
                prefix = "";
 
        ac = parse_options(ac, av, prefix, options, git_worktree_usage, 0);
+
+       prepare_repo_settings(the_repository);
+       the_repository->settings.command_requires_full_index = 0;
+
        return fn(ac, av, prefix);
 }
index 32e302a813d56a22320c988ae26a69f98aa22a94..66e83d0ecba04c90d1e12a2529cc40210808035c 100644 (file)
@@ -5,7 +5,6 @@
  */
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -13,6 +12,7 @@
 #include "tree.h"
 #include "cache-tree.h"
 #include "parse-options.h"
+#include "repository.h"
 
 static const char * const write_tree_usage[] = {
        N_("git write-tree [--missing-ok] [--prefix=<prefix>/]"),
index 6362b6aabc7f4f363e0e628869cb2213040b4ed1..73bff3a23d27bb2d9b6825bceccc9912aa2c50ce 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * Copyright (c) 2011, Google Inc.
  */
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "bulk-checkin.h"
 #include "environment.h"
 #include "gettext.h"
@@ -15,7 +14,8 @@
 #include "string-list.h"
 #include "tmp-objdir.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 
 static int odb_transaction_nesting;
 
index e2b267cc02bb1a46f349ae06a406923d438462c8..4b5c49b93d28f080865e23688cc09a0d6dd7d70a 100644 (file)
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "bundle-uri.h"
 #include "bundle.h"
+#include "copy.h"
 #include "environment.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "refs.h"
 #include "run-command.h"
 #include "hashmap.h"
@@ -223,7 +224,9 @@ static int bundle_list_update(const char *key, const char *value,
        return 0;
 }
 
-static int config_to_bundle_list(const char *key, const char *value, void *data)
+static int config_to_bundle_list(const char *key, const char *value,
+                                const struct config_context *ctx UNUSED,
+                                void *data)
 {
        struct bundle_list *list = data;
        return bundle_list_update(key, value, list);
@@ -252,6 +255,7 @@ int bundle_uri_parse_config_format(const char *uri,
        }
        result = git_config_from_file_with_options(config_to_bundle_list,
                                                   filename, list,
+                                                  CONFIG_SCOPE_UNKNOWN,
                                                   &opts);
 
        if (!result && list->mode == BUNDLE_MODE_NONE) {
@@ -795,10 +799,10 @@ int fetch_bundle_uri(struct repository *r, const char *uri,
        init_bundle_list(&list);
 
        /*
-        * Do not fetch a NULL or empty bundle URI. An empty bundle URI
+        * Do not fetch an empty bundle URI. An empty bundle URI
         * could signal that a configured bundle URI has been disabled.
         */
-       if (!uri || !*uri) {
+       if (!*uri) {
                result = 0;
                goto cleanup;
        }
@@ -870,7 +874,9 @@ cached:
        return advertise_bundle_uri;
 }
 
-static int config_to_packet_line(const char *key, const char *value, void *data)
+static int config_to_packet_line(const char *key, const char *value,
+                                const struct config_context *ctx UNUSED,
+                                void *data)
 {
        struct packet_reader *writer = data;
 
index 6471489975a52bf3e498d49d02a36728bbe2fb5e..a9744da255c6d527e53e65b71c1f4b9a9d6db4bd 100644 (file)
--- a/bundle.c
+++ b/bundle.c
@@ -1,10 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "lockfile.h"
 #include "bundle.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "object.h"
 #include "commit.h"
@@ -271,10 +271,10 @@ int verify_bundle(struct repository *r,
                        list_refs(r, 0, NULL);
                }
 
-               printf_ln("The bundle uses this hash algorithm: %s",
+               printf_ln(_("The bundle uses this hash algorithm: %s"),
                          header->hash_algo->name);
                if (header->filter.choice)
-                       printf_ln("The bundle uses this filter: %s",
+                       printf_ln(_("The bundle uses this filter: %s"),
                                  list_objects_filter_spec(&header->filter));
        }
 cleanup:
index ff14b527da38acc6968d88df65a1e1ebfd854b5b..641427ed410af39be80be22460a103dbad2d3d35 100644 (file)
@@ -1,5 +1,4 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "hex.h"
 #include "lockfile.h"
@@ -7,10 +6,14 @@
 #include "tree-walk.h"
 #include "cache-tree.h"
 #include "bulk-checkin.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "read-cache-ll.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
 #include "sparse-index.h"
+#include "trace.h"
+#include "trace2.h"
 
 #ifndef DEBUG_CACHE_TREE
 #define DEBUG_CACHE_TREE 0
diff --git a/cache.h b/cache.h
deleted file mode 100644 (file)
index 82d7b11..0000000
--- a/cache.h
+++ /dev/null
@@ -1,1086 +0,0 @@
-#ifndef CACHE_H
-#define CACHE_H
-
-#include "git-compat-util.h"
-#include "strbuf.h"
-#include "hashmap.h"
-#include "list.h"
-#include "advice.h"
-#include "gettext.h"
-#include "convert.h"
-#include "trace.h"
-#include "trace2.h"
-#include "string-list.h"
-#include "pack-revindex.h"
-#include "hash.h"
-#include "path.h"
-#include "pathspec.h"
-#include "object.h"
-#include "oid-array.h"
-#include "repository.h"
-#include "statinfo.h"
-#include "mem-pool.h"
-
-typedef struct git_zstream {
-       z_stream z;
-       unsigned long avail_in;
-       unsigned long avail_out;
-       unsigned long total_in;
-       unsigned long total_out;
-       unsigned char *next_in;
-       unsigned char *next_out;
-} git_zstream;
-
-void git_inflate_init(git_zstream *);
-void git_inflate_init_gzip_only(git_zstream *);
-void git_inflate_end(git_zstream *);
-int git_inflate(git_zstream *, int flush);
-
-void git_deflate_init(git_zstream *, int level);
-void git_deflate_init_gzip(git_zstream *, int level);
-void git_deflate_init_raw(git_zstream *, int level);
-void git_deflate_end(git_zstream *);
-int git_deflate_abort(git_zstream *);
-int git_deflate_end_gently(git_zstream *);
-int git_deflate(git_zstream *, int flush);
-unsigned long git_deflate_bound(git_zstream *, unsigned long);
-
-#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
-#define DTYPE(de)      ((de)->d_type)
-#else
-#undef DT_UNKNOWN
-#undef DT_DIR
-#undef DT_REG
-#undef DT_LNK
-#define DT_UNKNOWN     0
-#define DT_DIR         1
-#define DT_REG         2
-#define DT_LNK         3
-#define DTYPE(de)      DT_UNKNOWN
-#endif
-
-/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */
-#define S_IFINVALID     0030000
-
-/*
- * A "directory link" is a link to another git directory.
- *
- * The value 0160000 is not normally a valid mode, and
- * also just happens to be S_IFDIR + S_IFLNK
- */
-#define S_IFGITLINK    0160000
-#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
-
-/*
- * Some mode bits are also used internally for computations.
- *
- * They *must* not overlap with any valid modes, and they *must* not be emitted
- * to outside world - i.e. appear on disk or network. In other words, it's just
- * temporary fields, which we internally use, but they have to stay in-house.
- *
- * ( such approach is valid, as standard S_IF* fits into 16 bits, and in Git
- *   codebase mode is `unsigned int` which is assumed to be at least 32 bits )
- */
-
-/* used internally in tree-diff */
-#define S_DIFFTREE_IFXMIN_NEQ  0x80000000
-
-
-/*
- * Intensive research over the course of many years has shown that
- * port 9418 is totally unused by anything else. Or
- *
- *     Your search - "port 9418" - did not match any documents.
- *
- * as www.google.com puts it.
- *
- * This port has been properly assigned for git use by IANA:
- * git (Assigned-9418) [I06-050728-0001].
- *
- *     git  9418/tcp   git pack transfer service
- *     git  9418/udp   git pack transfer service
- *
- * with Linus Torvalds <torvalds@osdl.org> as the point of
- * contact. September 2005.
- *
- * See http://www.iana.org/assignments/port-numbers
- */
-#define DEFAULT_GIT_PORT 9418
-
-/*
- * Basic data structures for the directory cache
- */
-
-#define CACHE_SIGNATURE 0x44495243     /* "DIRC" */
-struct cache_header {
-       uint32_t hdr_signature;
-       uint32_t hdr_version;
-       uint32_t hdr_entries;
-};
-
-#define INDEX_FORMAT_LB 2
-#define INDEX_FORMAT_UB 4
-
-struct cache_entry {
-       struct hashmap_entry ent;
-       struct stat_data ce_stat_data;
-       unsigned int ce_mode;
-       unsigned int ce_flags;
-       unsigned int mem_pool_allocated;
-       unsigned int ce_namelen;
-       unsigned int index;     /* for link extension */
-       struct object_id oid;
-       char name[FLEX_ARRAY]; /* more */
-};
-
-#define CE_STAGEMASK (0x3000)
-#define CE_EXTENDED  (0x4000)
-#define CE_VALID     (0x8000)
-#define CE_STAGESHIFT 12
-
-/*
- * Range 0xFFFF0FFF in ce_flags is divided into
- * two parts: in-memory flags and on-disk ones.
- * Flags in CE_EXTENDED_FLAGS will get saved on-disk
- * if you want to save a new flag, add it in
- * CE_EXTENDED_FLAGS
- *
- * In-memory only flags
- */
-#define CE_UPDATE            (1 << 16)
-#define CE_REMOVE            (1 << 17)
-#define CE_UPTODATE          (1 << 18)
-#define CE_ADDED             (1 << 19)
-
-#define CE_HASHED            (1 << 20)
-#define CE_FSMONITOR_VALID   (1 << 21)
-#define CE_WT_REMOVE         (1 << 22) /* remove in work directory */
-#define CE_CONFLICTED        (1 << 23)
-
-#define CE_UNPACKED          (1 << 24)
-#define CE_NEW_SKIP_WORKTREE (1 << 25)
-
-/* used to temporarily mark paths matched by pathspecs */
-#define CE_MATCHED           (1 << 26)
-
-#define CE_UPDATE_IN_BASE    (1 << 27)
-#define CE_STRIP_NAME        (1 << 28)
-
-/*
- * Extended on-disk flags
- */
-#define CE_INTENT_TO_ADD     (1 << 29)
-#define CE_SKIP_WORKTREE     (1 << 30)
-/* CE_EXTENDED2 is for future extension */
-#define CE_EXTENDED2         (1U << 31)
-
-#define CE_EXTENDED_FLAGS (CE_INTENT_TO_ADD | CE_SKIP_WORKTREE)
-
-/*
- * Safeguard to avoid saving wrong flags:
- *  - CE_EXTENDED2 won't get saved until its semantic is known
- *  - Bits in 0x0000FFFF have been saved in ce_flags already
- *  - Bits in 0x003F0000 are currently in-memory flags
- */
-#if CE_EXTENDED_FLAGS & 0x803FFFFF
-#error "CE_EXTENDED_FLAGS out of range"
-#endif
-
-#define S_ISSPARSEDIR(m) ((m) == S_IFDIR)
-
-/* Forward structure decls */
-struct pathspec;
-struct child_process;
-struct tree;
-
-/*
- * Copy the sha1 and stat state of a cache entry from one to
- * another. But we never change the name, or the hash state!
- */
-static inline void copy_cache_entry(struct cache_entry *dst,
-                                   const struct cache_entry *src)
-{
-       unsigned int state = dst->ce_flags & CE_HASHED;
-       int mem_pool_allocated = dst->mem_pool_allocated;
-
-       /* Don't copy hash chain and name */
-       memcpy(&dst->ce_stat_data, &src->ce_stat_data,
-                       offsetof(struct cache_entry, name) -
-                       offsetof(struct cache_entry, ce_stat_data));
-
-       /* Restore the hash state */
-       dst->ce_flags = (dst->ce_flags & ~CE_HASHED) | state;
-
-       /* Restore the mem_pool_allocated flag */
-       dst->mem_pool_allocated = mem_pool_allocated;
-}
-
-static inline unsigned create_ce_flags(unsigned stage)
-{
-       return (stage << CE_STAGESHIFT);
-}
-
-#define ce_namelen(ce) ((ce)->ce_namelen)
-#define ce_size(ce) cache_entry_size(ce_namelen(ce))
-#define ce_stage(ce) ((CE_STAGEMASK & (ce)->ce_flags) >> CE_STAGESHIFT)
-#define ce_uptodate(ce) ((ce)->ce_flags & CE_UPTODATE)
-#define ce_skip_worktree(ce) ((ce)->ce_flags & CE_SKIP_WORKTREE)
-#define ce_mark_uptodate(ce) ((ce)->ce_flags |= CE_UPTODATE)
-#define ce_intent_to_add(ce) ((ce)->ce_flags & CE_INTENT_TO_ADD)
-
-#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
-static inline unsigned int create_ce_mode(unsigned int mode)
-{
-       if (S_ISLNK(mode))
-               return S_IFLNK;
-       if (S_ISSPARSEDIR(mode))
-               return S_IFDIR;
-       if (S_ISDIR(mode) || S_ISGITLINK(mode))
-               return S_IFGITLINK;
-       return S_IFREG | ce_permissions(mode);
-}
-static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce,
-                                            unsigned int mode)
-{
-       extern int trust_executable_bit, has_symlinks;
-       if (!has_symlinks && S_ISREG(mode) &&
-           ce && S_ISLNK(ce->ce_mode))
-               return ce->ce_mode;
-       if (!trust_executable_bit && S_ISREG(mode)) {
-               if (ce && S_ISREG(ce->ce_mode))
-                       return ce->ce_mode;
-               return create_ce_mode(0666);
-       }
-       return create_ce_mode(mode);
-}
-static inline int ce_to_dtype(const struct cache_entry *ce)
-{
-       unsigned ce_mode = ntohl(ce->ce_mode);
-       if (S_ISREG(ce_mode))
-               return DT_REG;
-       else if (S_ISDIR(ce_mode) || S_ISGITLINK(ce_mode))
-               return DT_DIR;
-       else if (S_ISLNK(ce_mode))
-               return DT_LNK;
-       else
-               return DT_UNKNOWN;
-}
-static inline unsigned int canon_mode(unsigned int mode)
-{
-       if (S_ISREG(mode))
-               return S_IFREG | ce_permissions(mode);
-       if (S_ISLNK(mode))
-               return S_IFLNK;
-       if (S_ISDIR(mode))
-               return S_IFDIR;
-       return S_IFGITLINK;
-}
-
-static inline int ce_path_match(struct index_state *istate,
-                               const struct cache_entry *ce,
-                               const struct pathspec *pathspec,
-                               char *seen)
-{
-       return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
-                             S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
-}
-
-#define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1)
-
-#define SOMETHING_CHANGED      (1 << 0) /* unclassified changes go here */
-#define CE_ENTRY_CHANGED       (1 << 1)
-#define CE_ENTRY_REMOVED       (1 << 2)
-#define CE_ENTRY_ADDED         (1 << 3)
-#define RESOLVE_UNDO_CHANGED   (1 << 4)
-#define CACHE_TREE_CHANGED     (1 << 5)
-#define SPLIT_INDEX_ORDERED    (1 << 6)
-#define UNTRACKED_CHANGED      (1 << 7)
-#define FSMONITOR_CHANGED      (1 << 8)
-
-struct split_index;
-struct untracked_cache;
-struct progress;
-struct pattern_list;
-
-enum sparse_index_mode {
-       /*
-        * There are no sparse directories in the index at all.
-        *
-        * Repositories that don't use cone-mode sparse-checkout will
-        * always have their indexes in this mode.
-        */
-       INDEX_EXPANDED = 0,
-
-       /*
-        * The index has already been collapsed to sparse directories
-        * whereever possible.
-        */
-       INDEX_COLLAPSED,
-
-       /*
-        * The sparse directories that exist are outside the
-        * sparse-checkout boundary, but it is possible that some file
-        * entries could collapse to sparse directory entries.
-        */
-       INDEX_PARTIALLY_SPARSE,
-};
-
-struct index_state {
-       struct cache_entry **cache;
-       unsigned int version;
-       unsigned int cache_nr, cache_alloc, cache_changed;
-       struct string_list *resolve_undo;
-       struct cache_tree *cache_tree;
-       struct split_index *split_index;
-       struct cache_time timestamp;
-       unsigned name_hash_initialized : 1,
-                initialized : 1,
-                drop_cache_tree : 1,
-                updated_workdir : 1,
-                updated_skipworktree : 1,
-                fsmonitor_has_run_once : 1;
-       enum sparse_index_mode sparse_index;
-       struct hashmap name_hash;
-       struct hashmap dir_hash;
-       struct object_id oid;
-       struct untracked_cache *untracked;
-       char *fsmonitor_last_update;
-       struct ewah_bitmap *fsmonitor_dirty;
-       struct mem_pool *ce_mem_pool;
-       struct progress *progress;
-       struct repository *repo;
-       struct pattern_list *sparse_checkout_patterns;
-};
-
-/**
- * A "struct index_state istate" must be initialized with
- * INDEX_STATE_INIT or the corresponding index_state_init().
- *
- * If the variable won't be used again, use release_index() to free()
- * its resources. If it needs to be used again use discard_index(),
- * which does the same thing, but will use use index_state_init() at
- * the end. The discard_index() will use its own "istate->repo" as the
- * "r" argument to index_state_init() in that case.
- */
-#define INDEX_STATE_INIT(r) { \
-       .repo = (r), \
-}
-void index_state_init(struct index_state *istate, struct repository *r);
-void release_index(struct index_state *istate);
-
-/* Name hashing */
-int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
-void add_name_hash(struct index_state *istate, struct cache_entry *ce);
-void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
-void free_name_hash(struct index_state *istate);
-
-/* Cache entry creation and cleanup */
-
-/*
- * Create cache_entry intended for use in the specified index. Caller
- * is responsible for discarding the cache_entry with
- * `discard_cache_entry`.
- */
-struct cache_entry *make_cache_entry(struct index_state *istate,
-                                    unsigned int mode,
-                                    const struct object_id *oid,
-                                    const char *path,
-                                    int stage,
-                                    unsigned int refresh_options);
-
-struct cache_entry *make_empty_cache_entry(struct index_state *istate,
-                                          size_t name_len);
-
-/*
- * Create a cache_entry that is not intended to be added to an index. If
- * `ce_mem_pool` is not NULL, the entry is allocated within the given memory
- * pool. Caller is responsible for discarding "loose" entries with
- * `discard_cache_entry()` and the memory pool with
- * `mem_pool_discard(ce_mem_pool, should_validate_cache_entries())`.
- */
-struct cache_entry *make_transient_cache_entry(unsigned int mode,
-                                              const struct object_id *oid,
-                                              const char *path,
-                                              int stage,
-                                              struct mem_pool *ce_mem_pool);
-
-struct cache_entry *make_empty_transient_cache_entry(size_t len,
-                                                    struct mem_pool *ce_mem_pool);
-
-/*
- * Discard cache entry.
- */
-void discard_cache_entry(struct cache_entry *ce);
-
-/*
- * Check configuration if we should perform extra validation on cache
- * entries.
- */
-int should_validate_cache_entries(void);
-
-/*
- * Duplicate a cache_entry. Allocate memory for the new entry from a
- * memory_pool. Takes into account cache_entry fields that are meant
- * for managing the underlying memory allocation of the cache_entry.
- */
-struct cache_entry *dup_cache_entry(const struct cache_entry *ce, struct index_state *istate);
-
-/*
- * Validate the cache entries in the index.  This is an internal
- * consistency check that the cache_entry structs are allocated from
- * the expected memory pool.
- */
-void validate_cache_entries(const struct index_state *istate);
-
-/*
- * Bulk prefetch all missing cache entries that are not GITLINKs and that match
- * the given predicate. This function should only be called if
- * repo_has_promisor_remote() returns true.
- */
-typedef int (*must_prefetch_predicate)(const struct cache_entry *);
-void prefetch_cache_entries(const struct index_state *istate,
-                           must_prefetch_predicate must_prefetch);
-
-#ifdef USE_THE_INDEX_VARIABLE
-extern struct index_state the_index;
-#endif
-
-static inline enum object_type object_type(unsigned int mode)
-{
-       return S_ISDIR(mode) ? OBJ_TREE :
-               S_ISGITLINK(mode) ? OBJ_COMMIT :
-               OBJ_BLOB;
-}
-
-#define INIT_DB_QUIET 0x0001
-#define INIT_DB_EXIST_OK 0x0002
-
-int init_db(const char *git_dir, const char *real_git_dir,
-           const char *template_dir, int hash_algo,
-           const char *initial_branch, unsigned int flags);
-void initialize_repository_version(int hash_algo, int reinit);
-
-/* Initialize and use the cache information */
-struct lock_file;
-void preload_index(struct index_state *index,
-                  const struct pathspec *pathspec,
-                  unsigned int refresh_flags);
-int do_read_index(struct index_state *istate, const char *path,
-                 int must_exist); /* for testting only! */
-int read_index_from(struct index_state *, const char *path,
-                   const char *gitdir);
-int is_index_unborn(struct index_state *);
-
-void ensure_full_index(struct index_state *istate);
-
-/* For use with `write_locked_index()`. */
-#define COMMIT_LOCK            (1 << 0)
-#define SKIP_IF_UNCHANGED      (1 << 1)
-
-/*
- * Write the index while holding an already-taken lock. Close the lock,
- * and if `COMMIT_LOCK` is given, commit it.
- *
- * Unless a split index is in use, write the index into the lockfile.
- *
- * With a split index, write the shared index to a temporary file,
- * adjust its permissions and rename it into place, then write the
- * split index to the lockfile. If the temporary file for the shared
- * index cannot be created, fall back to the behavior described in
- * the previous paragraph.
- *
- * With `COMMIT_LOCK`, the lock is always committed or rolled back.
- * Without it, the lock is closed, but neither committed nor rolled
- * back.
- *
- * If `SKIP_IF_UNCHANGED` is given and the index is unchanged, nothing
- * is written (and the lock is rolled back if `COMMIT_LOCK` is given).
- */
-int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags);
-
-void discard_index(struct index_state *);
-void move_index_extensions(struct index_state *dst, struct index_state *src);
-int unmerged_index(const struct index_state *);
-
-/**
- * Returns 1 if istate differs from tree, 0 otherwise.  If tree is NULL,
- * compares istate to HEAD.  If tree is NULL and on an unborn branch,
- * returns 1 if there are entries in istate, 0 otherwise.  If an strbuf is
- * provided, the space-separated list of files that differ will be appended
- * to it.
- */
-int repo_index_has_changes(struct repository *repo,
-                          struct tree *tree,
-                          struct strbuf *sb);
-
-int verify_path(const char *path, unsigned mode);
-int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
-int index_dir_exists(struct index_state *istate, const char *name, int namelen);
-void adjust_dirname_case(struct index_state *istate, char *name);
-struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
-
-/*
- * Searches for an entry defined by name and namelen in the given index.
- * If the return value is positive (including 0) it is the position of an
- * exact match. If the return value is negative, the negated value minus 1
- * is the position where the entry would be inserted.
- * Example: The current index consists of these files and its stages:
- *
- *   b#0, d#0, f#1, f#3
- *
- * index_name_pos(&index, "a", 1) -> -1
- * index_name_pos(&index, "b", 1) ->  0
- * index_name_pos(&index, "c", 1) -> -2
- * index_name_pos(&index, "d", 1) ->  1
- * index_name_pos(&index, "e", 1) -> -3
- * index_name_pos(&index, "f", 1) -> -3
- * index_name_pos(&index, "g", 1) -> -5
- */
-int index_name_pos(struct index_state *, const char *name, int namelen);
-
-/*
- * Like index_name_pos, returns the position of an entry of the given name in
- * the index if one exists, otherwise returns a negative value where the negated
- * value minus 1 is the position where the index entry would be inserted. Unlike
- * index_name_pos, however, a sparse index is not expanded to find an entry
- * inside a sparse directory.
- */
-int index_name_pos_sparse(struct index_state *, const char *name, int namelen);
-
-/*
- * Determines whether an entry with the given name exists within the
- * given index. The return value is 1 if an exact match is found, otherwise
- * it is 0. Note that, unlike index_name_pos, this function does not expand
- * the index if it is sparse. If an item exists within the full index but it
- * is contained within a sparse directory (and not in the sparse index), 0 is
- * returned.
- */
-int index_entry_exists(struct index_state *, const char *name, int namelen);
-
-/*
- * Some functions return the negative complement of an insert position when a
- * precise match was not found but a position was found where the entry would
- * need to be inserted. This helper protects that logic from any integer
- * underflow.
- */
-static inline int index_pos_to_insert_pos(uintmax_t pos)
-{
-       if (pos > INT_MAX)
-               die("overflow: -1 - %"PRIuMAX, pos);
-       return -1 - (int)pos;
-}
-
-#define ADD_CACHE_OK_TO_ADD 1          /* Ok to add */
-#define ADD_CACHE_OK_TO_REPLACE 2      /* Ok to replace file/directory */
-#define ADD_CACHE_SKIP_DFCHECK 4       /* Ok to skip DF conflict checks */
-#define ADD_CACHE_JUST_APPEND 8                /* Append only */
-#define ADD_CACHE_NEW_ONLY 16          /* Do not replace existing ones */
-#define ADD_CACHE_KEEP_CACHE_TREE 32   /* Do not invalidate cache-tree */
-#define ADD_CACHE_RENORMALIZE 64        /* Pass along HASH_RENORMALIZE */
-int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
-void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
-
-/* Remove entry, return true if there are more entries to go. */
-int remove_index_entry_at(struct index_state *, int pos);
-
-void remove_marked_cache_entries(struct index_state *istate, int invalidate);
-int remove_file_from_index(struct index_state *, const char *path);
-#define ADD_CACHE_VERBOSE 1
-#define ADD_CACHE_PRETEND 2
-#define ADD_CACHE_IGNORE_ERRORS        4
-#define ADD_CACHE_IGNORE_REMOVAL 8
-#define ADD_CACHE_INTENT 16
-/*
- * These two are used to add the contents of the file at path
- * to the index, marking the working tree up-to-date by storing
- * the cached stat info in the resulting cache entry.  A caller
- * that has already run lstat(2) on the path can call
- * add_to_index(), and all others can call add_file_to_index();
- * the latter will do necessary lstat(2) internally before
- * calling the former.
- */
-int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
-int add_file_to_index(struct index_state *, const char *path, int flags);
-
-int chmod_index_entry(struct index_state *, struct cache_entry *ce, char flip);
-int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
-void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
-int index_name_is_other(struct index_state *, const char *, int);
-void *read_blob_data_from_index(struct index_state *, const char *, unsigned long *);
-
-/* do stat comparison even if CE_VALID is true */
-#define CE_MATCH_IGNORE_VALID          01
-/* do not check the contents but report dirty on racily-clean entries */
-#define CE_MATCH_RACY_IS_DIRTY         02
-/* do stat comparison even if CE_SKIP_WORKTREE is true */
-#define CE_MATCH_IGNORE_SKIP_WORKTREE  04
-/* ignore non-existent files during stat update  */
-#define CE_MATCH_IGNORE_MISSING                0x08
-/* enable stat refresh */
-#define CE_MATCH_REFRESH               0x10
-/* don't refresh_fsmonitor state or do stat comparison even if CE_FSMONITOR_VALID is true */
-#define CE_MATCH_IGNORE_FSMONITOR 0X20
-int is_racy_timestamp(const struct index_state *istate,
-                     const struct cache_entry *ce);
-int has_racy_timestamp(struct index_state *istate);
-int ie_match_stat(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
-int ie_modified(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
-
-#define HASH_WRITE_OBJECT 1
-#define HASH_FORMAT_CHECK 2
-#define HASH_RENORMALIZE  4
-#define HASH_SILENT 8
-int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
-int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
-
-/*
- * Record to sd the data from st that we use to check whether a file
- * might have changed.
- */
-void fill_stat_data(struct stat_data *sd, struct stat *st);
-
-/*
- * Return 0 if st is consistent with a file not having been changed
- * since sd was filled.  If there are differences, return a
- * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
- * INODE_CHANGED, and DATA_CHANGED.
- */
-int match_stat_data(const struct stat_data *sd, struct stat *st);
-int match_stat_data_racy(const struct index_state *istate,
-                        const struct stat_data *sd, struct stat *st);
-
-void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, struct stat *st);
-
-#define REFRESH_REALLY                   (1 << 0) /* ignore_valid */
-#define REFRESH_UNMERGED                 (1 << 1) /* allow unmerged */
-#define REFRESH_QUIET                    (1 << 2) /* be quiet about it */
-#define REFRESH_IGNORE_MISSING           (1 << 3) /* ignore non-existent */
-#define REFRESH_IGNORE_SUBMODULES        (1 << 4) /* ignore submodules */
-#define REFRESH_IN_PORCELAIN             (1 << 5) /* user friendly output, not "needs update" */
-#define REFRESH_PROGRESS                 (1 << 6) /* show progress bar if stderr is tty */
-#define REFRESH_IGNORE_SKIP_WORKTREE     (1 << 7) /* ignore skip_worktree entries */
-int refresh_index(struct index_state *, unsigned int flags, const struct pathspec *pathspec, char *seen, const char *header_msg);
-/*
- * Refresh the index and write it to disk.
- *
- * 'refresh_flags' is passed directly to 'refresh_index()', while
- * 'COMMIT_LOCK | write_flags' is passed to 'write_locked_index()', so
- * the lockfile is always either committed or rolled back.
- *
- * If 'gentle' is passed, errors locking the index are ignored.
- *
- * Return 1 if refreshing the index returns an error, -1 if writing
- * the index to disk fails, 0 on success.
- *
- * Note that if refreshing the index returns an error, we still write
- * out the index (unless locking fails).
- */
-int repo_refresh_and_write_index(struct repository*, unsigned int refresh_flags, unsigned int write_flags, int gentle, const struct pathspec *, char *seen, const char *header_msg);
-
-struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
-
-void set_alternate_index_output(const char *);
-
-extern int verify_index_checksum;
-extern int verify_ce_order;
-
-extern int quote_path_fully;
-
-#define MTIME_CHANGED  0x0001
-#define CTIME_CHANGED  0x0002
-#define OWNER_CHANGED  0x0004
-#define MODE_CHANGED    0x0008
-#define INODE_CHANGED   0x0010
-#define DATA_CHANGED    0x0020
-#define TYPE_CHANGED    0x0040
-
-/*
- * Return an abbreviated sha1 unique within this repository's object database.
- * The result will be at least `len` characters long, and will be NUL
- * terminated.
- *
- * The non-`_r` version returns a static buffer which remains valid until 4
- * more calls to repo_find_unique_abbrev are made.
- *
- * The `_r` variant writes to a buffer supplied by the caller, which must be at
- * least `GIT_MAX_HEXSZ + 1` bytes. The return value is the number of bytes
- * written (excluding the NUL terminator).
- *
- * Note that while this version avoids the static buffer, it is not fully
- * reentrant, as it calls into other non-reentrant git code.
- */
-const char *repo_find_unique_abbrev(struct repository *r, const struct object_id *oid, int len);
-int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
-
-/*
- * Create the directory containing the named path, using care to be
- * somewhat safe against races. Return one of the scld_error values to
- * indicate success/failure. On error, set errno to describe the
- * problem.
- *
- * SCLD_VANISHED indicates that one of the ancestor directories of the
- * path existed at one point during the function call and then
- * suddenly vanished, probably because another process pruned the
- * directory while we were working.  To be robust against this kind of
- * race, callers might want to try invoking the function again when it
- * returns SCLD_VANISHED.
- *
- * 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. 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,
-       SCLD_FAILED = -1,
-       SCLD_PERMS = -2,
-       SCLD_EXISTS = -3,
-       SCLD_VANISHED = -4
-};
-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);
-
-int mkdir_in_gitdir(const char *path);
-
-int git_open_cloexec(const char *name, int flags);
-#define git_open(name) git_open_cloexec(name, O_RDONLY)
-
-/**
- * unpack_loose_header() initializes the data stream needed to unpack
- * a loose object header.
- *
- * Returns:
- *
- * - ULHR_OK on success
- * - ULHR_BAD on error
- * - ULHR_TOO_LONG if the header was too long
- *
- * It will only parse up to MAX_HEADER_LEN bytes unless an optional
- * "hdrbuf" argument is non-NULL. This is intended for use with
- * OBJECT_INFO_ALLOW_UNKNOWN_TYPE to extract the bad type for (error)
- * reporting. The full header will be extracted to "hdrbuf" for use
- * with parse_loose_header(), ULHR_TOO_LONG will still be returned
- * from this function to indicate that the header was too long.
- */
-enum unpack_loose_header_result {
-       ULHR_OK,
-       ULHR_BAD,
-       ULHR_TOO_LONG,
-};
-enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
-                                                   unsigned char *map,
-                                                   unsigned long mapsize,
-                                                   void *buffer,
-                                                   unsigned long bufsiz,
-                                                   struct strbuf *hdrbuf);
-
-/**
- * parse_loose_header() parses the starting "<type> <len>\0" of an
- * object. If it doesn't follow that format -1 is returned. To check
- * the validity of the <type> populate the "typep" in the "struct
- * object_info". It will be OBJ_BAD if the object type is unknown. The
- * parsed <len> can be retrieved via "oi->sizep", and from there
- * passed to unpack_loose_rest().
- */
-struct object_info;
-int parse_loose_header(const char *hdr, struct object_info *oi);
-
-/**
- * With in-core object data in "buf", rehash it to make sure the
- * object name actually matches "oid" to detect object corruption.
- *
- * A negative value indicates an error, usually that the OID is not
- * what we expected, but it might also indicate another error.
- */
-int check_object_signature(struct repository *r, const struct object_id *oid,
-                          void *map, unsigned long size,
-                          enum object_type type);
-
-/**
- * A streaming version of check_object_signature().
- * Try reading the object named with "oid" using
- * the streaming interface and rehash it to do the same.
- */
-int stream_object_signature(struct repository *r, const struct object_id *oid);
-
-int finalize_object_file(const char *tmpfile, const char *filename);
-
-/* Helper to check and "touch" a file */
-int check_and_freshen_file(const char *fn, int freshen);
-
-/* Convert to/from hex/sha1 representation */
-#define MINIMUM_ABBREV minimum_abbrev
-#define DEFAULT_ABBREV default_abbrev
-
-/* used when the code does not know or care what the default abbrev is */
-#define FALLBACK_DEFAULT_ABBREV 7
-
-struct object_context {
-       unsigned short mode;
-       /*
-        * symlink_path is only used by get_tree_entry_follow_symlinks,
-        * and only for symlinks that point outside the repository.
-        */
-       struct strbuf symlink_path;
-       /*
-        * If GET_OID_RECORD_PATH is set, this will record path (if any)
-        * found when resolving the name. The caller is responsible for
-        * releasing the memory.
-        */
-       char *path;
-};
-
-int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
-__attribute__((format (printf, 2, 3)))
-int get_oidf(struct object_id *oid, const char *fmt, ...);
-int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_tree(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_treeish(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_blob(struct repository *r, const char *str, struct object_id *oid);
-int repo_get_oid_mb(struct repository *r, const char *str, struct object_id *oid);
-void maybe_die_on_misspelt_object_name(struct repository *repo,
-                                      const char *name,
-                                      const char *prefix);
-enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
-                                        unsigned flags, struct object_id *oid,
-                                        struct object_context *oc);
-
-typedef int each_abbrev_fn(const struct object_id *oid, void *);
-int repo_for_each_abbrev(struct repository *r, const char *prefix, each_abbrev_fn, void *);
-
-int set_disambiguate_hint_config(const char *var, const char *value);
-
-/*
- * This reads short-hand syntax that not only evaluates to a commit
- * object name, but also can act as if the end user spelled the name
- * of the branch from the command line.
- *
- * - "@{-N}" finds the name of the Nth previous branch we were on, and
- *   places the name of the branch in the given buf and returns the
- *   number of characters parsed if successful.
- *
- * - "<branch>@{upstream}" finds the name of the other ref that
- *   <branch> is configured to merge with (missing <branch> defaults
- *   to the current branch), and places the name of the branch in the
- *   given buf and returns the number of characters parsed if
- *   successful.
- *
- * If the input is not of the accepted format, it returns a negative
- * number to signal an error.
- *
- * If the input was ok but there are not N branch switches in the
- * reflog, it returns 0.
- */
-#define INTERPRET_BRANCH_LOCAL (1<<0)
-#define INTERPRET_BRANCH_REMOTE (1<<1)
-#define INTERPRET_BRANCH_HEAD (1<<2)
-struct interpret_branch_name_options {
-       /*
-        * If "allowed" is non-zero, it is a treated as a bitfield of allowable
-        * expansions: local branches ("refs/heads/"), remote branches
-        * ("refs/remotes/"), or "HEAD". If no "allowed" bits are set, any expansion is
-        * allowed, even ones to refs outside of those namespaces.
-        */
-       unsigned allowed;
-
-       /*
-        * If ^{upstream} or ^{push} (or equivalent) is requested, and the
-        * branch in question does not have such a reference, return -1 instead
-        * of die()-ing.
-        */
-       unsigned nonfatal_dangling_mark : 1;
-};
-int repo_interpret_branch_name(struct repository *r,
-                              const char *str, int len,
-                              struct strbuf *buf,
-                              const struct interpret_branch_name_options *options);
-
-int base_name_compare(const char *name1, size_t len1, int mode1,
-                     const char *name2, size_t len2, int mode2);
-int df_name_compare(const char *name1, size_t len1, int mode1,
-                   const char *name2, size_t len2, int mode2);
-int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
-int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
-
-void *read_object_with_reference(struct repository *r,
-                                const struct object_id *oid,
-                                enum object_type required_type,
-                                unsigned long *size,
-                                struct object_id *oid_ret);
-
-struct object *repo_peel_to_type(struct repository *r,
-                                const char *name, int namelen,
-                                struct object *o, enum object_type);
-
-const char *git_editor(void);
-const char *git_sequence_editor(void);
-const char *git_pager(int stdout_is_tty);
-int is_terminal_dumb(void);
-
-struct cache_def {
-       struct strbuf path;
-       int flags;
-       int track_flags;
-       int prefix_len_stat_func;
-};
-#define CACHE_DEF_INIT { \
-       .path = STRBUF_INIT, \
-}
-static inline void cache_def_clear(struct cache_def *cache)
-{
-       strbuf_release(&cache->path);
-}
-
-int has_symlink_leading_path(const char *name, int len);
-int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
-int check_leading_path(const char *name, int len, int warn_on_lstat_err);
-int has_dirs_only_path(const char *name, int len, int prefix_len);
-void invalidate_lstat_cache(void);
-void schedule_dir_for_removal(const char *name, int len);
-void remove_scheduled_dirs(void);
-
-struct pack_window {
-       struct pack_window *next;
-       unsigned char *base;
-       off_t offset;
-       size_t len;
-       unsigned int last_used;
-       unsigned int inuse_cnt;
-};
-
-struct pack_entry {
-       off_t offset;
-       struct packed_git *p;
-};
-
-/*
- * Set this to 0 to prevent oid_object_info_extended() from fetching missing
- * blobs. This has a difference only if extensions.partialClone is set.
- *
- * Its default value is 1.
- */
-extern int fetch_if_missing;
-
-/* Dumb servers support */
-int update_server_info(int);
-
-extern const char *git_mailmap_file;
-extern const char *git_mailmap_blob;
-
-#define COPY_READ_ERROR (-2)
-#define COPY_WRITE_ERROR (-3)
-int copy_fd(int ifd, int ofd);
-int copy_file(const char *dst, const char *src, int mode);
-int copy_file_with_time(const char *dst, const char *src, int mode);
-
-/* pager.c */
-void setup_pager(void);
-int pager_in_use(void);
-extern int pager_use_color;
-int term_columns(void);
-void term_clear_line(void);
-int decimal_width(uintmax_t);
-int check_pager_config(const char *cmd);
-void prepare_pager_args(struct child_process *, const char *pager);
-
-/* base85 */
-int decode_85(char *dst, const char *line, int linelen);
-void encode_85(char *buf, const unsigned char *data, int bytes);
-
-/* pkt-line.c */
-void packet_trace_identity(const char *prog);
-
-/* add */
-/*
- * return 0 if success, 1 - if addition of a file failed and
- * ADD_FILES_IGNORE_ERRORS was specified in flags
- */
-int add_files_to_cache(const char *prefix, const struct pathspec *pathspec, int flags);
-
-/* diff.c */
-extern int diff_auto_refresh_index;
-
-/* match-trees.c */
-void shift_tree(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, int);
-void shift_tree_by(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, const char *);
-
-/*
- * whitespace rules.
- * used by both diff and apply
- * last two digits are tab width
- */
-#define WS_BLANK_AT_EOL         0100
-#define WS_SPACE_BEFORE_TAB     0200
-#define WS_INDENT_WITH_NON_TAB  0400
-#define WS_CR_AT_EOL           01000
-#define WS_BLANK_AT_EOF        02000
-#define WS_TAB_IN_INDENT       04000
-#define WS_TRAILING_SPACE      (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
-#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8)
-#define WS_TAB_WIDTH_MASK        077
-/* All WS_* -- when extended, adapt diff.c emit_symbol */
-#define WS_RULE_MASK           07777
-extern unsigned whitespace_rule_cfg;
-unsigned whitespace_rule(struct index_state *, const char *);
-unsigned parse_whitespace_rule(const char *);
-unsigned ws_check(const char *line, int len, unsigned ws_rule);
-void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
-char *whitespace_error_string(unsigned ws);
-void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
-int ws_blank_line(const char *line, int len);
-#define ws_tab_width(rule)     ((rule) & WS_TAB_WIDTH_MASK)
-
-/* ls-files */
-void overlay_tree_on_index(struct index_state *istate,
-                          const char *tree_name, const char *prefix);
-
-/* merge.c */
-struct commit_list;
-int try_merge_command(struct repository *r,
-               const char *strategy, size_t xopts_nr,
-               const char **xopts, struct commit_list *common,
-               const char *head_arg, struct commit_list *remotes);
-int checkout_fast_forward(struct repository *r,
-                         const struct object_id *from,
-                         const struct object_id *to,
-                         int overwrite_ignore);
-
-
-int sane_execvp(const char *file, char *const argv[]);
-
-/*
- * A struct to encapsulate the concept of whether a file has changed
- * since we last checked it. This uses criteria similar to those used
- * for the index.
- */
-struct stat_validity {
-       struct stat_data *sd;
-};
-
-void stat_validity_clear(struct stat_validity *sv);
-
-/*
- * Returns 1 if the path is a regular file (or a symlink to a regular
- * file) and matches the saved stat_validity, 0 otherwise.  A missing
- * or inaccessible file is considered a match if the struct was just
- * initialized, or if the previous update found an inaccessible file.
- */
-int stat_validity_check(struct stat_validity *sv, const char *path);
-
-/*
- * Update the stat_validity from a file opened at descriptor fd. If
- * the file is missing, inaccessible, or not a regular file, then
- * future calls to stat_validity_check will match iff one of those
- * conditions continues to be true.
- */
-void stat_validity_update(struct stat_validity *sv, int fd);
-
-int versioncmp(const char *s1, const char *s2);
-
-#endif /* CACHE_H */
index 929ec01b3a24435f56380f9497064ecc405c375f..0d7bc0460747b2973f913b746c4b9ef0ba6b9028 100644 (file)
@@ -1,8 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "chdir-notify.h"
 #include "list.h"
+#include "path.h"
 #include "strbuf.h"
+#include "trace.h"
 
 struct chdir_notify_entry {
        const char *name;
index 1247b8822481a6face3fc47a45ec2ce1bf298c06..4256e71a7c41cd4fdfbcd832727c21548b52b740 100644 (file)
@@ -1,8 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "object-name.h"
 #include "remote.h"
 #include "refspec.h"
+#include "repository.h"
 #include "checkout.h"
 #include "config.h"
+#include "strbuf.h"
 
 struct tracking_name_data {
        /* const */ char *src_ref;
index 1917f3b32300abf113bf3128450da26eb2efd9b4..3c514a5ab4f923db5e412fe5552960d8382ea9f5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef CHECKOUT_H
 #define CHECKOUT_H
 
-#include "hash.h"
+#include "hash-ll.h"
 
 /*
  * Check if the branch name uniquely matches a branch name on a remote
index 60a73c1b1403a67a551057509b54f2e92d32568b..140dfa0dcc4629fec59f723d025ec36019ff29eb 100644 (file)
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "chunk-format.h"
 #include "csum-file.h"
 #include "gettext.h"
+#include "hash.h"
 #include "trace2.h"
 
 /*
index 025c38f938ed38bd4fdb0c280b3ddc23af8dd525..c7794e84adda364bc0ad14a3d1d61467d73eaadd 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef CHUNK_FORMAT_H
 #define CHUNK_FORMAT_H
 
-#include "hash.h"
+#include "hash-ll.h"
 
 struct hashfile;
 struct chunkfile;
index db7105e8a8dcdff1432d5ec972e3262e4f787c16..369d462f1306fbca89442df9be35925ccc272489 100755 (executable)
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -278,11 +278,8 @@ linux-leaks)
        export GIT_TEST_PASSING_SANITIZE_LEAK=true
        export GIT_TEST_SANITIZE_LEAK_LOG=true
        ;;
-linux-asan)
-       export SANITIZE=address
-       ;;
-linux-ubsan)
-       export SANITIZE=undefined
+linux-asan-ubsan)
+       export SANITIZE=address,undefined
        ;;
 esac
 
index b098e10f52aed2f9d8928958fd393cbd574ddf8b..2528f25e31d3c860d1f2dc435af320a4f1b4973c 100755 (executable)
@@ -27,8 +27,9 @@ linux-TEST-vars)
        export GIT_TEST_MULTI_PACK_INDEX=1
        export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1
        export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
-       export GIT_TEST_WRITE_REV_INDEX=1
+       export GIT_TEST_NO_WRITE_REV_INDEX=1
        export GIT_TEST_CHECKOUT_WORKERS=2
+       export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1
        ;;
 linux-clang)
        export GIT_TEST_DEFAULT_HASH=sha1
diff --git a/color.c b/color.c
index 672dcbb73a6a982a4a4c8086b6f6585fde4377a6..b24b19566b99eb498859ed315b74cabcf6df37c1 100644 (file)
--- a/color.c
+++ b/color.c
@@ -1,8 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "color.h"
+#include "editor.h"
 #include "gettext.h"
 #include "hex.h"
+#include "pager.h"
+#include "strbuf.h"
 
 static int git_use_color_default = GIT_COLOR_AUTO;
 int color_stdout_is_tty = -1;
@@ -427,14 +430,6 @@ int git_color_config(const char *var, const char *value, void *cb UNUSED)
        return 0;
 }
 
-int git_color_default_config(const char *var, const char *value, void *cb)
-{
-       if (git_color_config(var, value, cb) < 0)
-               return -1;
-
-       return git_default_config(var, value, cb);
-}
-
 void color_print_strbuf(FILE *fp, const char *color, const struct strbuf *sb)
 {
        if (*color)
diff --git a/color.h b/color.h
index cfc8f841b237c72a0a2ea8b7e42d58dc1cab5f9f..bb28343be210643b57201c6a68ac4f718fa8ebc8 100644 (file)
--- a/color.h
+++ b/color.h
@@ -88,12 +88,8 @@ extern const int column_colors_ansi_max;
  */
 extern int color_stdout_is_tty;
 
-/*
- * Use the first one if you need only color config; the second is a convenience
- * if you are just going to change to git_default_config, too.
- */
+/* Parse color config. */
 int git_color_config(const char *var, const char *value, void *cb);
-int git_color_default_config(const char *var, const char *value, void *cb);
 
 /*
  * Parse a config option, which can be a boolean or one of
index fbf88639aaed931602b203f012468cdeefda284f..ff2f0abf39930c85a515283625a98152d85bc492 100644 (file)
--- a/column.c
+++ b/column.c
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "column.h"
 #include "string-list.h"
+#include "pager.h"
 #include "parse-options.h"
 #include "run-command.h"
 #include "utf8.h"
index 44ef6a1a812b02153f0d35137489930440357573..f90f442482932e618cc7399924c00ddde8c50eaf 100644 (file)
@@ -1,16 +1,19 @@
-#include "cache.h"
-#include "object-store.h"
+#include "git-compat-util.h"
+#include "object-store-ll.h"
 #include "commit.h"
+#include "convert.h"
 #include "blob.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "environment.h"
 #include "hex.h"
+#include "object-name.h"
 #include "quote.h"
 #include "xdiff-interface.h"
 #include "xdiff/xmacros.h"
 #include "log-tree.h"
 #include "refs.h"
+#include "tree.h"
 #include "userdiff.h"
 #include "oid-array.h"
 #include "revision.h"
index b1e737c01b1df701af6f0c0b8b814ea91ab9424b..0aa1640d15aca59b90617677afd30ef7c8d247c1 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
 #include "revision.h"
 #include "hash-lookup.h"
 #include "commit-graph.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
+#include "path.h"
 #include "alloc.h"
 #include "hashmap.h"
 #include "replace-object.h"
@@ -21,8 +24,8 @@
 #include "shallow.h"
 #include "json-writer.h"
 #include "trace2.h"
+#include "tree.h"
 #include "chunk-format.h"
-#include "wrapper.h"
 
 void git_test_write_commit_graph_or_die(void)
 {
@@ -201,14 +204,12 @@ static struct commit_graph *alloc_commit_graph(void)
        return g;
 }
 
-extern int read_replace_refs;
-
 static int commit_graph_compatible(struct repository *r)
 {
        if (!r->gitdir)
                return 0;
 
-       if (read_replace_refs) {
+       if (replace_refs_enabled(r)) {
                prepare_replace_object(r);
                if (hashmap_get_size(&r->objects->replace_map->map))
                        return 0;
@@ -479,7 +480,7 @@ static int add_graph_to_chain(struct commit_graph *g,
 
                if (!cur_g ||
                    !oideq(&oids[n], &cur_g->oid) ||
-                   !hasheq(oids[n].hash, g->chunk_base_graphs + g->hash_len * n)) {
+                   !hasheq(oids[n].hash, g->chunk_base_graphs + st_mult(g->hash_len, n))) {
                        warning(_("commit-graph chain does not match"));
                        return 0;
                }
@@ -489,8 +490,15 @@ static int add_graph_to_chain(struct commit_graph *g,
 
        g->base_graph = chain;
 
-       if (chain)
+       if (chain) {
+               if (unsigned_add_overflows(chain->num_commits,
+                                          chain->num_commits_in_base)) {
+                       warning(_("commit count in base graph too high: %"PRIuMAX),
+                               (uintmax_t)chain->num_commits_in_base);
+                       return 0;
+               }
                g->num_commits_in_base = chain->num_commits + chain->num_commits_in_base;
+       }
 
        return 1;
 }
@@ -744,7 +752,7 @@ static void load_oid_from_graph(struct commit_graph *g,
 
        lex_index = pos - g->num_commits_in_base;
 
-       oidread(oid, g->chunk_oid_lookup + g->hash_len * lex_index);
+       oidread(oid, g->chunk_oid_lookup + st_mult(g->hash_len, lex_index));
 }
 
 static struct commit_list **insert_parent_or_die(struct repository *r,
@@ -780,7 +788,7 @@ static void fill_commit_graph_info(struct commit *item, struct commit_graph *g,
                die(_("invalid commit position. commit-graph is likely corrupt"));
 
        lex_index = pos - g->num_commits_in_base;
-       commit_data = g->chunk_commit_data + GRAPH_DATA_WIDTH * lex_index;
+       commit_data = g->chunk_commit_data + st_mult(GRAPH_DATA_WIDTH, lex_index);
 
        graph_data = commit_graph_data_at(item);
        graph_data->graph_pos = pos;
@@ -790,14 +798,14 @@ static void fill_commit_graph_info(struct commit *item, struct commit_graph *g,
        item->date = (timestamp_t)((date_high << 32) | date_low);
 
        if (g->read_generation_data) {
-               offset = (timestamp_t)get_be32(g->chunk_generation_data + sizeof(uint32_t) * lex_index);
+               offset = (timestamp_t)get_be32(g->chunk_generation_data + st_mult(sizeof(uint32_t), lex_index));
 
                if (offset & CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW) {
                        if (!g->chunk_generation_data_overflow)
                                die(_("commit-graph requires overflow generation data but has none"));
 
                        offset_pos = offset ^ CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW;
-                       graph_data->generation = item->date + get_be64(g->chunk_generation_data_overflow + 8 * offset_pos);
+                       graph_data->generation = item->date + get_be64(g->chunk_generation_data_overflow + st_mult(8, offset_pos));
                } else
                        graph_data->generation = item->date + offset;
        } else
@@ -828,7 +836,7 @@ static int fill_commit_in_graph(struct repository *r,
        fill_commit_graph_info(item, g, pos);
 
        lex_index = pos - g->num_commits_in_base;
-       commit_data = g->chunk_commit_data + (g->hash_len + 16) * lex_index;
+       commit_data = g->chunk_commit_data + st_mult(g->hash_len + 16, lex_index);
 
        item->object.parsed = 1;
 
@@ -850,7 +858,7 @@ static int fill_commit_in_graph(struct repository *r,
        }
 
        parent_data_ptr = (uint32_t*)(g->chunk_extra_edges +
-                         4 * (uint64_t)(edge_value & GRAPH_EDGE_LAST_MASK));
+                         st_mult(4, edge_value & GRAPH_EDGE_LAST_MASK));
        do {
                edge_value = get_be32(parent_data_ptr);
                pptr = insert_parent_or_die(r, g,
@@ -970,7 +978,7 @@ static struct tree *load_tree_for_commit(struct repository *r,
                g = g->base_graph;
 
        commit_data = g->chunk_commit_data +
-                       GRAPH_DATA_WIDTH * (graph_pos - g->num_commits_in_base);
+                       st_mult(GRAPH_DATA_WIDTH, graph_pos - g->num_commits_in_base);
 
        oidread(&oid, commit_data);
        set_commit_tree(c, lookup_tree(r, &oid));
@@ -1950,35 +1958,35 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
 
        add_chunk(cf, GRAPH_CHUNKID_OIDFANOUT, GRAPH_FANOUT_SIZE,
                  write_graph_chunk_fanout);
-       add_chunk(cf, GRAPH_CHUNKID_OIDLOOKUP, hashsz * ctx->commits.nr,
+       add_chunk(cf, GRAPH_CHUNKID_OIDLOOKUP, st_mult(hashsz, ctx->commits.nr),
                  write_graph_chunk_oids);
-       add_chunk(cf, GRAPH_CHUNKID_DATA, (hashsz + 16) * ctx->commits.nr,
+       add_chunk(cf, GRAPH_CHUNKID_DATA, st_mult(hashsz + 16, ctx->commits.nr),
                  write_graph_chunk_data);
 
        if (ctx->write_generation_data)
                add_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA,
-                         sizeof(uint32_t) * ctx->commits.nr,
+                         st_mult(sizeof(uint32_t), ctx->commits.nr),
                          write_graph_chunk_generation_data);
        if (ctx->num_generation_data_overflows)
                add_chunk(cf, GRAPH_CHUNKID_GENERATION_DATA_OVERFLOW,
-                         sizeof(timestamp_t) * ctx->num_generation_data_overflows,
+                         st_mult(sizeof(timestamp_t), ctx->num_generation_data_overflows),
                          write_graph_chunk_generation_data_overflow);
        if (ctx->num_extra_edges)
                add_chunk(cf, GRAPH_CHUNKID_EXTRAEDGES,
-                         4 * ctx->num_extra_edges,
+                         st_mult(4, ctx->num_extra_edges),
                          write_graph_chunk_extra_edges);
        if (ctx->changed_paths) {
                add_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES,
-                         sizeof(uint32_t) * ctx->commits.nr,
+                         st_mult(sizeof(uint32_t), ctx->commits.nr),
                          write_graph_chunk_bloom_indexes);
                add_chunk(cf, GRAPH_CHUNKID_BLOOMDATA,
-                         sizeof(uint32_t) * 3
-                               + ctx->total_bloom_filter_data_size,
+                         st_add(sizeof(uint32_t) * 3,
+                                ctx->total_bloom_filter_data_size),
                          write_graph_chunk_bloom_data);
        }
        if (ctx->num_commit_graphs_after > 1)
                add_chunk(cf, GRAPH_CHUNKID_BASE,
-                         hashsz * (ctx->num_commit_graphs_after - 1),
+                         st_mult(hashsz, ctx->num_commit_graphs_after - 1),
                          write_graph_chunk_base);
 
        hashwrite_be32(f, GRAPH_SIGNATURE);
@@ -1996,7 +2004,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
                            get_num_chunks(cf));
                ctx->progress = start_delayed_progress(
                        progress_title.buf,
-                       get_num_chunks(cf) * ctx->commits.nr);
+                       st_mult(get_num_chunks(cf), ctx->commits.nr));
        }
 
        write_chunkfile(cf, ctx);
@@ -2102,11 +2110,16 @@ static void split_graph_merge_strategy(struct write_commit_graph_context *ctx)
 
        if (flags != COMMIT_GRAPH_SPLIT_MERGE_PROHIBITED &&
            flags != COMMIT_GRAPH_SPLIT_REPLACE) {
-               while (g && (g->num_commits <= size_mult * num_commits ||
+               while (g && (g->num_commits <= st_mult(size_mult, num_commits) ||
                            (max_commits && num_commits > max_commits))) {
                        if (g->odb != ctx->odb)
                                break;
 
+                       if (unsigned_add_overflows(num_commits, g->num_commits))
+                               die(_("cannot merge graphs with %"PRIuMAX", "
+                                     "%"PRIuMAX" commits"),
+                                   (uintmax_t)num_commits,
+                                   (uintmax_t)g->num_commits);
                        num_commits += g->num_commits;
                        g = g->base_graph;
 
@@ -2164,6 +2177,11 @@ static void merge_commit_graph(struct write_commit_graph_context *ctx,
        uint32_t i;
        uint32_t offset = g->num_commits_in_base;
 
+       if (unsigned_add_overflows(ctx->commits.nr, g->num_commits))
+               die(_("cannot merge graph %s, too many commits: %"PRIuMAX),
+                   oid_to_hex(&g->oid),
+                   (uintmax_t)st_add(ctx->commits.nr, g->num_commits));
+
        ALLOC_GROW(ctx->commits.list, ctx->commits.nr + g->num_commits, ctx->commits.alloc);
 
        for (i = 0; i < g->num_commits; i++) {
@@ -2434,7 +2452,7 @@ int write_commit_graph(struct object_directory *odb,
                struct commit_graph *g = ctx->r->objects->commit_graph;
                for (i = 0; i < g->num_commits; i++) {
                        struct object_id oid;
-                       oidread(&oid, g->chunk_oid_lookup + g->hash_len * i);
+                       oidread(&oid, g->chunk_oid_lookup + st_mult(g->hash_len, i));
                        oid_array_append(&ctx->oids, &oid);
                }
        }
@@ -2540,18 +2558,14 @@ static int commit_graph_checksum_valid(struct commit_graph *g)
        return hashfile_checksum_valid(g->data, g->data_len);
 }
 
-int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
+static int verify_one_commit_graph(struct repository *r,
+                                  struct commit_graph *g,
+                                  struct progress *progress,
+                                  uint64_t *seen)
 {
        uint32_t i, cur_fanout_pos = 0;
        struct object_id prev_oid, cur_oid;
        int generation_zero = 0;
-       struct progress *progress = NULL;
-       int local_error = 0;
-
-       if (!g) {
-               graph_report("no commit-graph file loaded");
-               return 1;
-       }
 
        verify_commit_graph_error = verify_commit_graph_lite(g);
        if (verify_commit_graph_error)
@@ -2565,7 +2579,7 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
        for (i = 0; i < g->num_commits; i++) {
                struct commit *graph_commit;
 
-               oidread(&cur_oid, g->chunk_oid_lookup + g->hash_len * i);
+               oidread(&cur_oid, g->chunk_oid_lookup + st_mult(g->hash_len, i));
 
                if (i && oidcmp(&prev_oid, &cur_oid) >= 0)
                        graph_report(_("commit-graph has incorrect OID order: %s then %s"),
@@ -2602,18 +2616,14 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
        if (verify_commit_graph_error & ~VERIFY_COMMIT_GRAPH_ERROR_HASH)
                return verify_commit_graph_error;
 
-       if (flags & COMMIT_GRAPH_WRITE_PROGRESS)
-               progress = start_progress(_("Verifying commits in commit graph"),
-                                       g->num_commits);
-
        for (i = 0; i < g->num_commits; i++) {
                struct commit *graph_commit, *odb_commit;
                struct commit_list *graph_parents, *odb_parents;
                timestamp_t max_generation = 0;
                timestamp_t generation;
 
-               display_progress(progress, i + 1);
-               oidread(&cur_oid, g->chunk_oid_lookup + g->hash_len * i);
+               display_progress(progress, ++(*seen));
+               oidread(&cur_oid, g->chunk_oid_lookup + st_mult(g->hash_len, i));
 
                graph_commit = lookup_commit(r, &cur_oid);
                odb_commit = (struct commit *)create_object(r, &cur_oid, alloc_commit_node(r));
@@ -2695,12 +2705,37 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
                                     graph_commit->date,
                                     odb_commit->date);
        }
-       stop_progress(&progress);
 
-       local_error = verify_commit_graph_error;
+       return verify_commit_graph_error;
+}
 
-       if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW) && g->base_graph)
-               local_error |= verify_commit_graph(r, g->base_graph, flags);
+int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
+{
+       struct progress *progress = NULL;
+       int local_error = 0;
+       uint64_t seen = 0;
+
+       if (!g) {
+               graph_report("no commit-graph file loaded");
+               return 1;
+       }
+
+       if (flags & COMMIT_GRAPH_WRITE_PROGRESS) {
+               uint64_t total = g->num_commits;
+               if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW))
+                       total += g->num_commits_in_base;
+
+               progress = start_progress(_("Verifying commits in commit graph"),
+                                         total);
+       }
+
+       for (; g; g = g->base_graph) {
+               local_error |= verify_one_commit_graph(r, g, progress, &seen);
+               if (flags & COMMIT_GRAPH_VERIFY_SHALLOW)
+                       break;
+       }
+
+       stop_progress(&progress);
 
        return local_error;
 }
index 83aaa1dbb929c4f16acbe8ccb2593d104af2b7f0..5e534f0fcc8d131a6e759ed1658b0e0984123a6e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef COMMIT_GRAPH_H
 #define COMMIT_GRAPH_H
 
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oidset.h"
 
 #define GIT_TEST_COMMIT_GRAPH "GIT_TEST_COMMIT_GRAPH"
index 70bde8af05b294c86881a79b740d9fd087ebbad8..4b7c233fd468f9ad2a60abf5b9202f5c4fbad3c4 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "commit.h"
 #include "commit-graph.h"
 #include "decorate.h"
@@ -944,6 +943,8 @@ struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
                }
        }
 
+       clear_prio_queue(&queue);
+
        clear_commit_marks_many(nr_to, to, PARENT1);
        clear_commit_marks_many(nr_from, from, PARENT2);
 
index 6d844da9a6b4f7c86f77e5945803c5a6bd211155..b3223478bc2a3ac98751e41ba133a41d3ba34bc0 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "tag.h"
 #include "commit.h"
 #include "commit-graph.h"
@@ -6,7 +6,8 @@
 #include "gettext.h"
 #include "hex.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "pkt-line.h"
 #include "utf8.h"
 #include "diff.h"
@@ -25,6 +26,7 @@
 #include "run-command.h"
 #include "setup.h"
 #include "shallow.h"
+#include "tree.h"
 #include "hook.h"
 
 static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);
@@ -95,6 +97,7 @@ struct commit *lookup_commit_reference_by_name(const char *name)
 static timestamp_t parse_commit_date(const char *buf, const char *tail)
 {
        const char *dateptr;
+       const char *eol;
 
        if (buf + 6 >= tail)
                return 0;
@@ -106,16 +109,56 @@ static timestamp_t parse_commit_date(const char *buf, const char *tail)
                return 0;
        if (memcmp(buf, "committer", 9))
                return 0;
-       while (buf < tail && *buf++ != '>')
-               /* nada */;
-       if (buf >= tail)
+
+       /*
+        * Jump to end-of-line so that we can walk backwards to find the
+        * end-of-email ">". This is more forgiving of malformed cases
+        * because unexpected characters tend to be in the name and email
+        * fields.
+        */
+       eol = memchr(buf, '\n', tail - buf);
+       if (!eol)
                return 0;
-       dateptr = buf;
-       while (buf < tail && *buf++ != '\n')
-               /* nada */;
-       if (buf >= tail)
+       dateptr = eol;
+       while (dateptr > buf && dateptr[-1] != '>')
+               dateptr--;
+       if (dateptr == buf)
                return 0;
-       /* dateptr < buf && buf[-1] == '\n', so parsing will stop at buf-1 */
+
+       /*
+        * Trim leading whitespace, but make sure we have at least one
+        * non-whitespace character, as parse_timestamp() will otherwise walk
+        * right past the newline we found in "eol" when skipping whitespace
+        * itself.
+        *
+        * In theory it would be sufficient to allow any character not matched
+        * by isspace(), but there's a catch: our isspace() does not
+        * necessarily match the behavior of parse_timestamp(), as the latter
+        * is implemented by system routines which match more exotic control
+        * codes, or even locale-dependent sequences.
+        *
+        * Since we expect the timestamp to be a number, we can check for that.
+        * Anything else (e.g., a non-numeric token like "foo") would just
+        * cause parse_timestamp() to return 0 anyway.
+        */
+       while (dateptr < eol && isspace(*dateptr))
+               dateptr++;
+       if (!isdigit(*dateptr) && *dateptr != '-')
+               return 0;
+
+       /*
+        * We know there is at least one digit (or dash), so we'll begin
+        * parsing there and stop at worst case at eol.
+        *
+        * Note that we may feed parse_timestamp() extra characters here if the
+        * commit is malformed, and it will parse as far as it can. For
+        * example, "123foo456" would return "123". That might be questionable
+        * (versus returning "0"), but it would help in a hypothetical case
+        * like "123456+0100", where the whitespace from the timezone is
+        * missing. Since such syntactic errors may be baked into history and
+        * hard to correct now, let's err on trying to make our best guess
+        * here, rather than insist on perfect syntax.
+        */
        return parse_timestamp(dateptr, NULL, 10);
 }
 
@@ -473,7 +516,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b
                 * The clone is shallow if nr_parent < 0, and we must
                 * not traverse its real parents even when we unhide them.
                 */
-               if (graft && (graft->nr_parent < 0 || grafts_replace_parents))
+               if (graft && (graft->nr_parent < 0 || !grafts_keep_true_parents))
                        continue;
                new_parent = lookup_commit(r, &parent);
                if (!new_parent)
index 69b2f376e9d91de7ecc554fcb1610332ac205d3a..28928833c544081f9c08971f7a4450e97154ebb3 100644 (file)
--- a/commit.h
+++ b/commit.h
@@ -2,13 +2,10 @@
 #define COMMIT_H
 
 #include "object.h"
-#include "tree.h"
-#include "strbuf.h"
-#include "decorate.h"
-#include "gpg-interface.h"
-#include "string-list.h"
-#include "pretty.h"
-#include "commit-slab.h"
+
+struct signature_check;
+struct strbuf;
+struct tree;
 
 #define COMMIT_NOT_FROM_GRAPH 0xFFFFFFFF
 #define GENERATION_NUMBER_INFINITY ((1ULL << 63) - 1)
index b83cb5cf066732be125e8a5912d56405fed741d3..033778b3c56a3557e191d3bb74592fd00497853b 100644 (file)
@@ -1,8 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "attr.h"
+#include "repository.h"
 #include "setup.h"
+#include "strbuf.h"
+#include "trace2.h"
 
 /*
  * Many parts of Git have subprograms communicate via pipe, expect the
index b9f709e854833f67b45725e1684abe2ef06e16ca..5b1709d63f729b173d89152e37567dcb3459117a 100644 (file)
@@ -1,6 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsm-health.h"
 #include "fsmonitor--daemon.h"
 
index fe11bdd9ce6d3bbe96f6fdec7c6b417b96cc680b..2d4e245beb18b8f3573ea33526274d3f8f45b675 100644 (file)
@@ -1,6 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsm-health.h"
 #include "fsmonitor--daemon.h"
 #include "gettext.h"
index eb25123fa124866d7438b0dc155e8ea4932edc9f..6f3a95410cc1002a08b4af63bc9fff0d1e1e75ea 100644 (file)
@@ -1,8 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
+#include "gettext.h"
 #include "hex.h"
+#include "path.h"
+#include "repository.h"
 #include "strbuf.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-ipc.h"
 #include "fsmonitor-path-utils.h"
 
index c9536dfb666318468612701481d7216fd3b723e9..8928fa93ce223968ab59279ddac50a3dd2b15239 100644 (file)
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "fsmonitor-ipc.h"
+#include "path.h"
 
 const char *fsmonitor_ipc__get_path(struct repository *r) {
        static char *ret;
index 5eb6402ab822cf8e68ff0552980d1641e2076827..36c7e13281c675cba46d7a219f31f238f361c17c 100644 (file)
 #endif
 #endif
 
-#include "cache.h"
-#include "fsmonitor.h"
+#include "git-compat-util.h"
+#include "fsmonitor-ll.h"
 #include "fsm-listen.h"
 #include "fsmonitor--daemon.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
+#include "string-list.h"
+#include "trace.h"
 
 struct fsm_listen_data
 {
index 7b07b74ba5bd0d20f504f1d5b1e3e5d6dd3e4c21..a361a7db20edbf406219922acebf2291f315b22c 100644 (file)
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsm-listen.h"
 #include "fsmonitor--daemon.h"
 #include "gettext.h"
+#include "trace2.h"
 
 /*
  * The documentation of ReadDirectoryChangesW() states that the maximum
index 45eb4a9b9e75552cf124e050b5cfdd06cda46a2d..049f97eaaf249a0206c934d8b7ae1493115246d4 100644 (file)
@@ -1,6 +1,8 @@
-#include "fsmonitor.h"
+#include "git-compat-util.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
+#include "trace.h"
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
index 4024baafb9768f953b43c48ce247cb12ed3766c3..c8a3e9dcdbb655eab0fbea2d42c1973ee67e16f7 100644 (file)
@@ -1,7 +1,8 @@
-#include "cache.h"
-#include "fsmonitor.h"
+#include "git-compat-util.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
+#include "trace.h"
 
 /*
  * Check remote working directory protocol.
index 58b623fbb9a3bf598e44d6fe377340d960e004f4..a38259063517144690122454970f399ae504708e 100644 (file)
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-ipc.h"
 #include "fsmonitor-settings.h"
 #include "fsmonitor-path-utils.h"
index a8af31b71de05cab939c1d8223194fa91d0cbd6a..b6f67444944b5ff60ed3823dc64fc10d36f2a778 100644 (file)
@@ -1,7 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "repository.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-settings.h"
 #include "fsmonitor-path-utils.h"
 
index 94c5a1daa40cde53093b62f0c2c3c67da12ffd9e..ec5280da160135170e2d778cfcb19cea1752c211 100644 (file)
@@ -6,12 +6,13 @@
 #include <wchar.h>
 #include "../strbuf.h"
 #include "../run-command.h"
-#include "../cache.h"
 #include "../abspath.h"
 #include "../alloc.h"
 #include "win32/lazyload.h"
 #include "../config.h"
 #include "../environment.h"
+#include "../trace2.h"
+#include "../symlinks.h"
 #include "../wrapper.h"
 #include "dir.h"
 #include "gettext.h"
@@ -242,7 +243,8 @@ static int core_restrict_inherited_handles = -1;
 static enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
 static char *unset_environment_variables;
 
-int mingw_core_config(const char *var, const char *value, void *cb)
+int mingw_core_config(const char *var, const char *value,
+                     const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "core.hidedotfiles")) {
                if (value && !strcasecmp(value, "dotgitonly"))
@@ -1345,6 +1347,11 @@ static char *path_lookup(const char *cmd, int exe_only)
        return prog;
 }
 
+char *mingw_locate_in_PATH(const char *cmd)
+{
+       return path_lookup(cmd, 0);
+}
+
 static const wchar_t *wcschrnul(const wchar_t *s, wchar_t c)
 {
        while (*s && *s != c)
index 209cf7cebadd1746c8b79e1105bac103b8a72910..6aec50e4124e145d6d43f584418288d3fc29f481 100644 (file)
@@ -11,7 +11,9 @@ typedef _sigset_t sigset_t;
 #undef _POSIX_THREAD_SAFE_FUNCTIONS
 #endif
 
-int mingw_core_config(const char *var, const char *value, void *cb);
+struct config_context;
+int mingw_core_config(const char *var, const char *value,
+                     const struct config_context *ctx, void *cb);
 #define platform_core_config mingw_core_config
 
 /*
@@ -175,6 +177,9 @@ pid_t waitpid(pid_t pid, int *status, int options);
 #define kill mingw_kill
 int mingw_kill(pid_t pid, int sig);
 
+#define locate_in_PATH mingw_locate_in_PATH
+char *mingw_locate_in_PATH(const char *cmd);
+
 #ifndef NO_OPENSSL
 #include <openssl/ssl.h>
 static inline int mingw_SSL_set_fd(SSL *ssl, int fd)
index 978cac4ec91e6bb2f81539d85422bb37e4941a51..484e6d4c716ef6b6c3e5b24ff5a1879db3039d5d 100644 (file)
@@ -1,4 +1,5 @@
 #include "../git-compat-util.h"
+#include "../wrapper.h"
 
 ssize_t git_pread(int fd, void *buf, size_t count, off_t offset)
 {
index 8a9881db077320c292714595714f1604462c1504..0bd5c24250a4fb717f61db6e03e40326ca1fad07 100644 (file)
@@ -5,10 +5,12 @@
 
 #define PRECOMPOSE_UNICODE_C
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "path.h"
+#include "strbuf.h"
 #include "utf8.h"
 #include "precompose_utf8.h"
 
index 6adfcfd54051617fd4cbdd0e5d8a904c2a839152..a4a6f930d7b14a473d5e47a9a90b84a7557054af 100644 (file)
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hash-ll.h"
 
 int git_SHA1_Update_Chunked(platform_SHA_CTX *c, const void *data, size_t len)
 {
index 152db60a311c2784ab5c90a346769a2785ca8cac..b2f4f22ce44f51f6f8f18e0d7ca6a2ed22de183b 100644 (file)
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "strbuf.h"
 #include "pkt-line.h"
 #include "thread-utils.h"
+#include "trace2.h"
 #include "unix-socket.h"
 #include "unix-stream-server.h"
 
index 997f6144344d883584b2991f2684ff383a7c9e55..8bfe51248e552e6915acec34abea31a3d3dc279e 100644 (file)
@@ -1,10 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "strbuf.h"
 #include "pkt-line.h"
 #include "thread-utils.h"
+#include "trace.h"
+#include "trace2.h"
 #include "accctrl.h"
 #include "aclapi.h"
 
index d87e32118929742db0373fe71502bc969426c09e..83d95e8656301d29b287801d74bc4dc42af52683 100644 (file)
@@ -6,7 +6,6 @@
 #include "run-command.h"
 #include "string-list.h"
 #include "hashmap.h"
-#include "wrapper.h"
 
 #if defined(HAVE_DEV_TTY) || defined(GIT_WINDOWS_NATIVE)
 
diff --git a/compat/win32/headless.c b/compat/win32/headless.c
new file mode 100644 (file)
index 0000000..8b00dfe
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * headless Git - run Git without opening a console window on Windows
+ */
+
+#define STRICT
+#define WIN32_LEAN_AND_MEAN
+#define UNICODE
+#define _UNICODE
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <wchar.h>
+
+/*
+ * If `dir` contains the path to a Git exec directory, extend `PATH` to
+ * include the corresponding `bin/` directory (which is where all those
+ * `.dll` files needed by `git.exe` are, on Windows).
+ */
+static int extend_path(wchar_t *dir, size_t dir_len)
+{
+       const wchar_t *suffix = L"\\libexec\\git-core";
+       size_t suffix_len = wcslen(suffix);
+       wchar_t *env;
+       DWORD len;
+
+       if (dir_len < suffix_len)
+               return 0;
+
+       dir_len -= suffix_len;
+       if (memcmp(dir + dir_len, suffix, suffix_len * sizeof(wchar_t)))
+               return 0;
+
+       len = GetEnvironmentVariableW(L"PATH", NULL, 0);
+       if (!len)
+               return 0;
+
+       env = _alloca((dir_len + 5 + len) * sizeof(wchar_t));
+       wcsncpy(env, dir, dir_len);
+       wcscpy(env + dir_len, L"\\bin;");
+       if (!GetEnvironmentVariableW(L"PATH", env + dir_len + 5, len))
+               return 0;
+
+       SetEnvironmentVariableW(L"PATH", env);
+       return 1;
+}
+
+int WINAPI wWinMain(_In_ HINSTANCE instance,
+                   _In_opt_ HINSTANCE previous_instance,
+                   _In_ LPWSTR command_line, _In_ int show)
+{
+       wchar_t git_command_line[32768];
+       size_t size = sizeof(git_command_line) / sizeof(wchar_t);
+       const wchar_t *needs_quotes = L"";
+       int slash = 0, i;
+
+       STARTUPINFO startup_info = {
+               .cb = sizeof(STARTUPINFO),
+               .dwFlags = STARTF_USESHOWWINDOW,
+               .wShowWindow = SW_HIDE,
+       };
+       PROCESS_INFORMATION process_info = { 0 };
+       DWORD creation_flags = CREATE_UNICODE_ENVIRONMENT |
+               CREATE_NEW_CONSOLE | CREATE_NO_WINDOW;
+       DWORD exit_code;
+
+       /* First, determine the full path of argv[0] */
+       for (i = 0; _wpgmptr[i]; i++)
+               if (_wpgmptr[i] == L' ')
+                       needs_quotes = L"\"";
+               else if (_wpgmptr[i] == L'\\')
+                       slash = i;
+
+       if (slash >= size - 11)
+               return 127; /* Too long path */
+
+       /* If it is in Git's exec path, add the bin/ directory to the PATH */
+       extend_path(_wpgmptr, slash);
+
+       /* Then, add the full path of `git.exe` as argv[0] */
+       i = swprintf_s(git_command_line, size, L"%ls%.*ls\\git.exe%ls",
+                      needs_quotes, slash, _wpgmptr, needs_quotes);
+       if (i < 0)
+               return 127; /* Too long path */
+
+       if (*command_line) {
+               /* Now, append the command-line arguments */
+               i = swprintf_s(git_command_line + i, size - i,
+                              L" %ls", command_line);
+               if (i < 0)
+                       return 127;
+       }
+
+       startup_info.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+       startup_info.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+       startup_info.hStdError = GetStdHandle(STD_ERROR_HANDLE);
+
+       if (!CreateProcess(NULL, /* infer argv[0] from the command line */
+                          git_command_line, /* modified command line */
+                          NULL, /* inherit process handles? */
+                          NULL, /* inherit thread handles? */
+                          FALSE, /* handles inheritable? */
+                          creation_flags,
+                          NULL, /* use this process' environment */
+                          NULL, /* use this process' working directory */
+                          &startup_info, &process_info))
+               return 129; /* could not start */
+       WaitForSingleObject(process_info.hProcess, INFINITE);
+       if (!GetExitCodeProcess(process_info.hProcess, &exit_code))
+               exit_code = 130; /* Could not determine exit code? */
+
+       CloseHandle(process_info.hProcess);
+       CloseHandle(process_info.hThread);
+
+       return (int)exit_code;
+}
index a53fd924340f7d6da04e5197363fe831b9d19bf3..3ef0936f6ff9711caed8c22c8aebd92eb4be6e30 100644 (file)
@@ -1,8 +1,10 @@
-#include "../../cache.h"
+#include "../../git-compat-util.h"
 #include "../../json-writer.h"
+#include "../../repository.h"
+#include "../../trace2.h"
 #include "lazyload.h"
-#include <Psapi.h>
-#include <tlHelp32.h>
+#include <psapi.h>
+#include <tlhelp32.h>
 
 /*
  * An arbitrarily chosen value to limit the size of the ancestor
index 493f47df8ae6a56ff1abf37090df20e2ee665b3e..3846a37be971c92153eb1ceeb65c6e612c8e173c 100644 (file)
--- a/config.c
+++ b/config.c
@@ -5,31 +5,39 @@
  * Copyright (C) Johannes Schindelin, 2005
  *
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
+#include "advice.h"
 #include "date.h"
 #include "branch.h"
 #include "config.h"
+#include "convert.h"
 #include "environment.h"
 #include "gettext.h"
 #include "ident.h"
 #include "repository.h"
 #include "lockfile.h"
+#include "mailmap.h"
 #include "exec-cmd.h"
 #include "strbuf.h"
 #include "quote.h"
 #include "hashmap.h"
 #include "string-list.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "pager.h"
+#include "path.h"
 #include "utf8.h"
 #include "dir.h"
 #include "color.h"
 #include "replace-object.h"
 #include "refs.h"
 #include "setup.h"
+#include "strvec.h"
+#include "trace2.h"
+#include "wildmatch.h"
 #include "worktree.h"
-#include "wrapper.h"
+#include "ws.h"
 #include "write-or-die.h"
 
 struct config_source {
@@ -59,78 +67,6 @@ struct config_source {
 };
 #define CONFIG_SOURCE_INIT { 0 }
 
-struct config_reader {
-       /*
-        * These members record the "current" config source, which can be
-        * accessed by parsing callbacks.
-        *
-        * The "source" variable will be non-NULL only when we are actually
-        * parsing a real config source (file, blob, cmdline, etc).
-        *
-        * The "config_kvi" variable will be non-NULL only when we are feeding
-        * cached config from a configset into a callback.
-        *
-        * They cannot be non-NULL at the same time. If they are both NULL, then
-        * we aren't parsing anything (and depending on the function looking at
-        * the variables, it's either a bug for it to be called in the first
-        * place, or it's a function which can be reused for non-config
-        * purposes, and should fall back to some sane behavior).
-        */
-       struct config_source *source;
-       struct key_value_info *config_kvi;
-       /*
-        * The "scope" of the current config source being parsed (repo, global,
-        * etc). Like "source", this is only set when parsing a config source.
-        * It's not part of "source" because it transcends a single file (i.e.,
-        * a file included from .git/config is still in "repo" scope).
-        *
-        * When iterating through a configset, the equivalent value is
-        * "config_kvi.scope" (see above).
-        */
-       enum config_scope parsing_scope;
-};
-/*
- * Where possible, prefer to accept "struct config_reader" as an arg than to use
- * "the_reader". "the_reader" should only be used if that is infeasible, e.g. in
- * a public function.
- */
-static struct config_reader the_reader;
-
-static inline void config_reader_push_source(struct config_reader *reader,
-                                            struct config_source *top)
-{
-       if (reader->config_kvi)
-               BUG("source should not be set while iterating a config set");
-       top->prev = reader->source;
-       reader->source = top;
-}
-
-static inline struct config_source *config_reader_pop_source(struct config_reader *reader)
-{
-       struct config_source *ret;
-       if (!reader->source)
-               BUG("tried to pop config source, but we weren't reading config");
-       ret = reader->source;
-       reader->source = reader->source->prev;
-       return ret;
-}
-
-static inline void config_reader_set_kvi(struct config_reader *reader,
-                                        struct key_value_info *kvi)
-{
-       if (kvi && (reader->source || reader->parsing_scope))
-               BUG("kvi should not be set while parsing a config source");
-       reader->config_kvi = kvi;
-}
-
-static inline void config_reader_set_scope(struct config_reader *reader,
-                                          enum config_scope scope)
-{
-       if (scope && reader->config_kvi)
-               BUG("scope should only be set when iterating through a config source");
-       reader->parsing_scope = scope;
-}
-
 static int pack_compression_seen;
 static int zlib_compression_seen;
 
@@ -192,7 +128,7 @@ struct config_include_data {
        void *data;
        const struct config_options *opts;
        struct git_config_source *config_source;
-       struct config_reader *config_reader;
+       struct repository *repo;
 
        /*
         * All remote URLs discovered when reading all config files.
@@ -201,7 +137,8 @@ struct config_include_data {
 };
 #define CONFIG_INCLUDE_INIT { 0 }
 
-static int git_config_include(const char *var, const char *value, void *data);
+static int git_config_include(const char *var, const char *value,
+                             const struct config_context *ctx, void *data);
 
 #define MAX_INCLUDE_DEPTH 10
 static const char include_depth_advice[] = N_(
@@ -210,7 +147,8 @@ static const char include_depth_advice[] = N_(
 "from\n"
 "      %s\n"
 "This might be due to circular includes.");
-static int handle_path_include(struct config_source *cs, const char *path,
+static int handle_path_include(const struct key_value_info *kvi,
+                              const char *path,
                               struct config_include_data *inc)
 {
        int ret = 0;
@@ -232,14 +170,14 @@ static int handle_path_include(struct config_source *cs, const char *path,
        if (!is_absolute_path(path)) {
                char *slash;
 
-               if (!cs || !cs->path) {
+               if (!kvi || !kvi->path) {
                        ret = error(_("relative config includes must come from files"));
                        goto cleanup;
                }
 
-               slash = find_last_dir_sep(cs->path);
+               slash = find_last_dir_sep(kvi->path);
                if (slash)
-                       strbuf_add(&buf, cs->path, slash - cs->path + 1);
+                       strbuf_add(&buf, kvi->path, slash - kvi->path + 1);
                strbuf_addstr(&buf, path);
                path = buf.buf;
        }
@@ -247,10 +185,11 @@ static int handle_path_include(struct config_source *cs, const char *path,
        if (!access_or_die(path, R_OK, 0)) {
                if (++inc->depth > MAX_INCLUDE_DEPTH)
                        die(_(include_depth_advice), MAX_INCLUDE_DEPTH, path,
-                           !cs ? "<unknown>" :
-                           cs->name ? cs->name :
+                           !kvi ? "<unknown>" :
+                           kvi->filename ? kvi->filename :
                            "the command line");
-               ret = git_config_from_file(git_config_include, path, inc);
+               ret = git_config_from_file_with_options(git_config_include, path, inc,
+                                                       kvi->scope, NULL);
                inc->depth--;
        }
 cleanup:
@@ -265,7 +204,7 @@ static void add_trailing_starstar_for_dir(struct strbuf *pat)
                strbuf_addstr(pat, "**");
 }
 
-static int prepare_include_condition_pattern(struct config_source *cs,
+static int prepare_include_condition_pattern(const struct key_value_info *kvi,
                                             struct strbuf *pat)
 {
        struct strbuf path = STRBUF_INIT;
@@ -282,11 +221,11 @@ static int prepare_include_condition_pattern(struct config_source *cs,
        if (pat->buf[0] == '.' && is_dir_sep(pat->buf[1])) {
                const char *slash;
 
-               if (!cs || !cs->path)
+               if (!kvi || !kvi->path)
                        return error(_("relative config include "
                                       "conditionals must come from files"));
 
-               strbuf_realpath(&path, cs->path, 1);
+               strbuf_realpath(&path, kvi->path, 1);
                slash = find_last_dir_sep(path.buf);
                if (!slash)
                        BUG("how is this possible?");
@@ -301,7 +240,7 @@ static int prepare_include_condition_pattern(struct config_source *cs,
        return prefix;
 }
 
-static int include_by_gitdir(struct config_source *cs,
+static int include_by_gitdir(const struct key_value_info *kvi,
                             const struct config_options *opts,
                             const char *cond, size_t cond_len, int icase)
 {
@@ -318,7 +257,7 @@ static int include_by_gitdir(struct config_source *cs,
 
        strbuf_realpath(&text, git_dir, 1);
        strbuf_add(&pattern, cond, cond_len);
-       prefix = prepare_include_condition_pattern(cs, &pattern);
+       prefix = prepare_include_condition_pattern(kvi, &pattern);
 
 again:
        if (prefix < 0)
@@ -380,7 +319,8 @@ static int include_by_branch(const char *cond, size_t cond_len)
        return ret;
 }
 
-static int add_remote_url(const char *var, const char *value, void *data)
+static int add_remote_url(const char *var, const char *value,
+                         const struct config_context *ctx UNUSED, void *data)
 {
        struct string_list *remote_urls = data;
        const char *remote_name;
@@ -399,21 +339,17 @@ static void populate_remote_urls(struct config_include_data *inc)
 {
        struct config_options opts;
 
-       enum config_scope store_scope = inc->config_reader->parsing_scope;
-
        opts = *inc->opts;
        opts.unconditional_remote_url = 1;
 
-       config_reader_set_scope(inc->config_reader, 0);
-
        inc->remote_urls = xmalloc(sizeof(*inc->remote_urls));
        string_list_init_dup(inc->remote_urls);
-       config_with_options(add_remote_url, inc->remote_urls, inc->config_source, &opts);
-
-       config_reader_set_scope(inc->config_reader, store_scope);
+       config_with_options(add_remote_url, inc->remote_urls,
+                           inc->config_source, inc->repo, &opts);
 }
 
 static int forbid_remote_url(const char *var, const char *value UNUSED,
+                            const struct config_context *ctx UNUSED,
                             void *data UNUSED)
 {
        const char *remote_name;
@@ -457,16 +393,16 @@ static int include_by_remote_url(struct config_include_data *inc,
                                             inc->remote_urls);
 }
 
-static int include_condition_is_true(struct config_source *cs,
+static int include_condition_is_true(const struct key_value_info *kvi,
                                     struct config_include_data *inc,
                                     const char *cond, size_t cond_len)
 {
        const struct config_options *opts = inc->opts;
 
        if (skip_prefix_mem(cond, cond_len, "gitdir:", &cond, &cond_len))
-               return include_by_gitdir(cs, opts, cond, cond_len, 0);
+               return include_by_gitdir(kvi, opts, cond, cond_len, 0);
        else if (skip_prefix_mem(cond, cond_len, "gitdir/i:", &cond, &cond_len))
-               return include_by_gitdir(cs, opts, cond, cond_len, 1);
+               return include_by_gitdir(kvi, opts, cond, cond_len, 1);
        else if (skip_prefix_mem(cond, cond_len, "onbranch:", &cond, &cond_len))
                return include_by_branch(cond, cond_len);
        else if (skip_prefix_mem(cond, cond_len, "hasconfig:remote.*.url:", &cond,
@@ -477,10 +413,11 @@ static int include_condition_is_true(struct config_source *cs,
        return 0;
 }
 
-static int git_config_include(const char *var, const char *value, void *data)
+static int git_config_include(const char *var, const char *value,
+                             const struct config_context *ctx,
+                             void *data)
 {
        struct config_include_data *inc = data;
-       struct config_source *cs = inc->config_reader->source;
        const char *cond, *key;
        size_t cond_len;
        int ret;
@@ -489,21 +426,21 @@ static int git_config_include(const char *var, const char *value, void *data)
         * Pass along all values, including "include" directives; this makes it
         * possible to query information on the includes themselves.
         */
-       ret = inc->fn(var, value, inc->data);
+       ret = inc->fn(var, value, ctx, inc->data);
        if (ret < 0)
                return ret;
 
        if (!strcmp(var, "include.path"))
-               ret = handle_path_include(cs, value, inc);
+               ret = handle_path_include(ctx->kvi, value, inc);
 
        if (!parse_config_key(var, "includeif", &cond, &cond_len, &key) &&
-           cond && include_condition_is_true(cs, inc, cond, cond_len) &&
+           cond && include_condition_is_true(ctx->kvi, inc, cond, cond_len) &&
            !strcmp(key, "path")) {
                config_fn_t old_fn = inc->fn;
 
                if (inc->opts->unconditional_remote_url)
                        inc->fn = forbid_remote_url;
-               ret = handle_path_include(cs, value, inc);
+               ret = handle_path_include(ctx->kvi, value, inc);
                inc->fn = old_fn;
        }
 
@@ -661,27 +598,45 @@ out_free_ret_1:
 }
 
 static int config_parse_pair(const char *key, const char *value,
-                         config_fn_t fn, void *data)
+                            struct key_value_info *kvi,
+                            config_fn_t fn, void *data)
 {
        char *canonical_name;
        int ret;
+       struct config_context ctx = {
+               .kvi = kvi,
+       };
 
        if (!strlen(key))
                return error(_("empty config key"));
        if (git_config_parse_key(key, &canonical_name, NULL))
                return -1;
 
-       ret = (fn(canonical_name, value, data) < 0) ? -1 : 0;
+       ret = (fn(canonical_name, value, &ctx, data) < 0) ? -1 : 0;
        free(canonical_name);
        return ret;
 }
 
+
+/* for values read from `git_config_from_parameters()` */
+void kvi_from_param(struct key_value_info *out)
+{
+       out->filename = NULL;
+       out->linenr = -1;
+       out->origin_type = CONFIG_ORIGIN_CMDLINE;
+       out->scope = CONFIG_SCOPE_COMMAND;
+       out->path = NULL;
+}
+
 int git_config_parse_parameter(const char *text,
                               config_fn_t fn, void *data)
 {
        const char *value;
        struct strbuf **pair;
        int ret;
+       struct key_value_info kvi = KVI_INIT;
+
+       kvi_from_param(&kvi);
 
        pair = strbuf_split_str(text, '=', 2);
        if (!pair[0])
@@ -700,12 +655,13 @@ int git_config_parse_parameter(const char *text,
                return error(_("bogus config parameter: %s"), text);
        }
 
-       ret = config_parse_pair(pair[0]->buf, value, fn, data);
+       ret = config_parse_pair(pair[0]->buf, value, &kvi, fn, data);
        strbuf_list_free(pair);
        return ret;
 }
 
-static int parse_config_env_list(char *env, config_fn_t fn, void *data)
+static int parse_config_env_list(char *env, struct key_value_info *kvi,
+                                config_fn_t fn, void *data)
 {
        char *cur = env;
        while (cur && *cur) {
@@ -739,7 +695,7 @@ static int parse_config_env_list(char *env, config_fn_t fn, void *data)
                                             CONFIG_DATA_ENVIRONMENT);
                        }
 
-                       if (config_parse_pair(key, value, fn, data) < 0)
+                       if (config_parse_pair(key, value, kvi, fn, data) < 0)
                                return -1;
                }
                else {
@@ -763,11 +719,9 @@ int git_config_from_parameters(config_fn_t fn, void *data)
        struct strvec to_free = STRVEC_INIT;
        int ret = 0;
        char *envw = NULL;
-       struct config_source source = CONFIG_SOURCE_INIT;
-
-       source.origin_type = CONFIG_ORIGIN_CMDLINE;
-       config_reader_push_source(&the_reader, &source);
+       struct key_value_info kvi = KVI_INIT;
 
+       kvi_from_param(&kvi);
        env = getenv(CONFIG_COUNT_ENVIRONMENT);
        if (env) {
                unsigned long count;
@@ -803,7 +757,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)
                        }
                        strbuf_reset(&envvar);
 
-                       if (config_parse_pair(key, value, fn, data) < 0) {
+                       if (config_parse_pair(key, value, &kvi, fn, data) < 0) {
                                ret = -1;
                                goto out;
                        }
@@ -814,7 +768,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)
        if (env) {
                /* sq_dequote will write over it */
                envw = xstrdup(env);
-               if (parse_config_env_list(envw, fn, data) < 0) {
+               if (parse_config_env_list(envw, &kvi, fn, data) < 0) {
                        ret = -1;
                        goto out;
                }
@@ -824,7 +778,6 @@ out:
        strbuf_release(&envvar);
        strvec_clear(&to_free);
        free(envw);
-       config_reader_pop_source(&the_reader);
        return ret;
 }
 
@@ -925,12 +878,15 @@ static char *parse_value(struct config_source *cs)
        }
 }
 
-static int get_value(struct config_source *cs, config_fn_t fn, void *data,
-                    struct strbuf *name)
+static int get_value(struct config_source *cs, struct key_value_info *kvi,
+                    config_fn_t fn, void *data, struct strbuf *name)
 {
        int c;
        char *value;
        int ret;
+       struct config_context ctx = {
+               .kvi = kvi,
+       };
 
        /* Get the full name */
        for (;;) {
@@ -959,7 +915,8 @@ static int get_value(struct config_source *cs, config_fn_t fn, void *data,
         * accurate line number in error messages.
         */
        cs->linenr--;
-       ret = fn(name->buf, value, data);
+       kvi->linenr = cs->linenr;
+       ret = fn(name->buf, value, &ctx, data);
        if (ret >= 0)
                cs->linenr++;
        return ret;
@@ -1049,7 +1006,7 @@ static int do_event(struct config_source *cs, enum config_event_t type,
 
        if (data->previous_type != CONFIG_EVENT_EOF &&
            data->opts->event_fn(data->previous_type, data->previous_offset,
-                                offset, data->opts->event_fn_data) < 0)
+                                offset, cs, data->opts->event_fn_data) < 0)
                return -1;
 
        data->previous_type = type;
@@ -1058,8 +1015,20 @@ static int do_event(struct config_source *cs, enum config_event_t type,
        return 0;
 }
 
+static void kvi_from_source(struct config_source *cs,
+                           enum config_scope scope,
+                           struct key_value_info *out)
+{
+       out->filename = strintern(cs->name);
+       out->origin_type = cs->origin_type;
+       out->linenr = cs->linenr;
+       out->scope = scope;
+       out->path = cs->path;
+}
+
 static int git_parse_source(struct config_source *cs, config_fn_t fn,
-                           void *data, const struct config_options *opts)
+                           struct key_value_info *kvi, void *data,
+                           const struct config_options *opts)
 {
        int comment = 0;
        size_t baselen = 0;
@@ -1143,7 +1112,7 @@ static int git_parse_source(struct config_source *cs, config_fn_t fn,
                 */
                strbuf_setlen(var, baselen);
                strbuf_addch(var, tolower(c));
-               if (get_value(cs, fn, data, var) < 0)
+               if (get_value(cs, kvi, fn, data, var) < 0)
                        break;
        }
 
@@ -1319,80 +1288,78 @@ int git_parse_ssize_t(const char *value, ssize_t *ret)
        return 1;
 }
 
-static int reader_config_name(struct config_reader *reader, const char **out);
-static int reader_origin_type(struct config_reader *reader,
-                             enum config_origin_type *type);
 NORETURN
-static void die_bad_number(struct config_reader *reader, const char *name,
-                          const char *value)
+static void die_bad_number(const char *name, const char *value,
+                          const struct key_value_info *kvi)
 {
        const char *error_type = (errno == ERANGE) ?
                N_("out of range") : N_("invalid unit");
        const char *bad_numeric = N_("bad numeric config value '%s' for '%s': %s");
-       const char *config_name = NULL;
-       enum config_origin_type config_origin = CONFIG_ORIGIN_UNKNOWN;
+
+       if (!kvi)
+               BUG("kvi should not be NULL");
 
        if (!value)
                value = "";
 
-       /* Ignoring the return value is okay since we handle missing values. */
-       reader_config_name(reader, &config_name);
-       reader_origin_type(reader, &config_origin);
-
-       if (!config_name)
+       if (!kvi->filename)
                die(_(bad_numeric), value, name, _(error_type));
 
-       switch (config_origin) {
+       switch (kvi->origin_type) {
        case CONFIG_ORIGIN_BLOB:
                die(_("bad numeric config value '%s' for '%s' in blob %s: %s"),
-                   value, name, config_name, _(error_type));
+                   value, name, kvi->filename, _(error_type));
        case CONFIG_ORIGIN_FILE:
                die(_("bad numeric config value '%s' for '%s' in file %s: %s"),
-                   value, name, config_name, _(error_type));
+                   value, name, kvi->filename, _(error_type));
        case CONFIG_ORIGIN_STDIN:
                die(_("bad numeric config value '%s' for '%s' in standard input: %s"),
                    value, name, _(error_type));
        case CONFIG_ORIGIN_SUBMODULE_BLOB:
                die(_("bad numeric config value '%s' for '%s' in submodule-blob %s: %s"),
-                   value, name, config_name, _(error_type));
+                   value, name, kvi->filename, _(error_type));
        case CONFIG_ORIGIN_CMDLINE:
                die(_("bad numeric config value '%s' for '%s' in command line %s: %s"),
-                   value, name, config_name, _(error_type));
+                   value, name, kvi->filename, _(error_type));
        default:
                die(_("bad numeric config value '%s' for '%s' in %s: %s"),
-                   value, name, config_name, _(error_type));
+                   value, name, kvi->filename, _(error_type));
        }
 }
 
-int git_config_int(const char *name, const char *value)
+int git_config_int(const char *name, const char *value,
+                  const struct key_value_info *kvi)
 {
        int ret;
        if (!git_parse_int(value, &ret))
-               die_bad_number(&the_reader, name, value);
+               die_bad_number(name, value, kvi);
        return ret;
 }
 
-int64_t git_config_int64(const char *name, const char *value)
+int64_t git_config_int64(const char *name, const char *value,
+                        const struct key_value_info *kvi)
 {
        int64_t ret;
        if (!git_parse_int64(value, &ret))
-               die_bad_number(&the_reader, name, value);
+               die_bad_number(name, value, kvi);
        return ret;
 }
 
-unsigned long git_config_ulong(const char *name, const char *value)
+unsigned long git_config_ulong(const char *name, const char *value,
+                              const struct key_value_info *kvi)
 {
        unsigned long ret;
        if (!git_parse_ulong(value, &ret))
-               die_bad_number(&the_reader, name, value);
+               die_bad_number(name, value, kvi);
        return ret;
 }
 
-ssize_t git_config_ssize_t(const char *name, const char *value)
+ssize_t git_config_ssize_t(const char *name, const char *value,
+                          const struct key_value_info *kvi)
 {
        ssize_t ret;
        if (!git_parse_ssize_t(value, &ret))
-               die_bad_number(&the_reader, name, value);
+               die_bad_number(name, value, kvi);
        return ret;
 }
 
@@ -1497,7 +1464,8 @@ int git_parse_maybe_bool(const char *value)
        return -1;
 }
 
-int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
+int git_config_bool_or_int(const char *name, const char *value,
+                          const struct key_value_info *kvi, int *is_bool)
 {
        int v = git_parse_maybe_bool_text(value);
        if (0 <= v) {
@@ -1505,7 +1473,7 @@ int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
                return v;
        }
        *is_bool = 0;
-       return git_config_int(name, value);
+       return git_config_int(name, value, kvi);
 }
 
 int git_config_bool(const char *name, const char *value)
@@ -1553,7 +1521,8 @@ int git_config_color(char *dest, const char *var, const char *value)
        return 0;
 }
 
-static int git_default_core_config(const char *var, const char *value, void *cb)
+static int git_default_core_config(const char *var, const char *value,
+                                  const struct config_context *ctx, void *cb)
 {
        /* This needs a better name */
        if (!strcmp(var, "core.filemode")) {
@@ -1630,7 +1599,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
                else if (!git_parse_maybe_bool_text(value))
                        default_abbrev = the_hash_algo->hexsz;
                else {
-                       int abbrev = git_config_int(var, value);
+                       int abbrev = git_config_int(var, value, ctx->kvi);
                        if (abbrev < minimum_abbrev || abbrev > the_hash_algo->hexsz)
                                return error(_("abbrev length out of range: %d"), abbrev);
                        default_abbrev = abbrev;
@@ -1642,7 +1611,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
                return set_disambiguate_hint_config(var, value);
 
        if (!strcmp(var, "core.loosecompression")) {
-               int level = git_config_int(var, value);
+               int level = git_config_int(var, value, ctx->kvi);
                if (level == -1)
                        level = Z_DEFAULT_COMPRESSION;
                else if (level < 0 || level > Z_BEST_COMPRESSION)
@@ -1653,7 +1622,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
        }
 
        if (!strcmp(var, "core.compression")) {
-               int level = git_config_int(var, value);
+               int level = git_config_int(var, value, ctx->kvi);
                if (level == -1)
                        level = Z_DEFAULT_COMPRESSION;
                else if (level < 0 || level > Z_BEST_COMPRESSION)
@@ -1667,7 +1636,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
 
        if (!strcmp(var, "core.packedgitwindowsize")) {
                int pgsz_x2 = getpagesize() * 2;
-               packed_git_window_size = git_config_ulong(var, value);
+               packed_git_window_size = git_config_ulong(var, value, ctx->kvi);
 
                /* This value must be multiple of (pagesize * 2) */
                packed_git_window_size /= pgsz_x2;
@@ -1678,17 +1647,17 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
        }
 
        if (!strcmp(var, "core.bigfilethreshold")) {
-               big_file_threshold = git_config_ulong(var, value);
+               big_file_threshold = git_config_ulong(var, value, ctx->kvi);
                return 0;
        }
 
        if (!strcmp(var, "core.packedgitlimit")) {
-               packed_git_limit = git_config_ulong(var, value);
+               packed_git_limit = git_config_ulong(var, value, ctx->kvi);
                return 0;
        }
 
        if (!strcmp(var, "core.deltabasecachelimit")) {
-               delta_base_cache_limit = git_config_ulong(var, value);
+               delta_base_cache_limit = git_config_ulong(var, value, ctx->kvi);
                return 0;
        }
 
@@ -1832,13 +1801,8 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       if (!strcmp(var, "core.usereplacerefs")) {
-               read_replace_refs = git_config_bool(var, value);
-               return 0;
-       }
-
        /* Add other config variables here and to Documentation/config.txt. */
-       return platform_core_config(var, value, cb);
+       return platform_core_config(var, value, ctx, cb);
 }
 
 static int git_default_sparse_config(const char *var, const char *value)
@@ -1940,15 +1904,16 @@ static int git_default_mailmap_config(const char *var, const char *value)
        return 0;
 }
 
-int git_default_config(const char *var, const char *value, void *cb)
+int git_default_config(const char *var, const char *value,
+                      const struct config_context *ctx, void *cb)
 {
        if (starts_with(var, "core."))
-               return git_default_core_config(var, value, cb);
+               return git_default_core_config(var, value, ctx, cb);
 
        if (starts_with(var, "user.") ||
            starts_with(var, "author.") ||
            starts_with(var, "committer."))
-               return git_ident_config(var, value, cb);
+               return git_ident_config(var, value, ctx, cb);
 
        if (starts_with(var, "i18n."))
                return git_default_i18n_config(var, value);
@@ -1971,12 +1936,12 @@ int git_default_config(const char *var, const char *value, void *cb)
        }
 
        if (!strcmp(var, "pack.packsizelimit")) {
-               pack_size_limit_cfg = git_config_ulong(var, value);
+               pack_size_limit_cfg = git_config_ulong(var, value, ctx->kvi);
                return 0;
        }
 
        if (!strcmp(var, "pack.compression")) {
-               int level = git_config_int(var, value);
+               int level = git_config_int(var, value, ctx->kvi);
                if (level == -1)
                        level = Z_DEFAULT_COMPRESSION;
                else if (level < 0 || level > Z_BEST_COMPRESSION)
@@ -1998,10 +1963,11 @@ int git_default_config(const char *var, const char *value, void *cb)
  * fgetc, ungetc, ftell of top need to be initialized before calling
  * this function.
  */
-static int do_config_from(struct config_reader *reader,
-                         struct config_source *top, config_fn_t fn, void *data,
+static int do_config_from(struct config_source *top, config_fn_t fn,
+                         void *data, enum config_scope scope,
                          const struct config_options *opts)
 {
+       struct key_value_info kvi = KVI_INIT;
        int ret;
 
        /* push config-file parsing state stack */
@@ -2010,23 +1976,21 @@ static int do_config_from(struct config_reader *reader,
        top->total_len = 0;
        strbuf_init(&top->value, 1024);
        strbuf_init(&top->var, 1024);
-       config_reader_push_source(reader, top);
+       kvi_from_source(top, scope, &kvi);
 
-       ret = git_parse_source(top, fn, data, opts);
+       ret = git_parse_source(top, fn, &kvi, data, opts);
 
-       /* pop config-file parsing state stack */
        strbuf_release(&top->value);
        strbuf_release(&top->var);
-       config_reader_pop_source(reader);
 
        return ret;
 }
 
-static int do_config_from_file(struct config_reader *reader,
-                              config_fn_t fn,
+static int do_config_from_file(config_fn_t fn,
                               const enum config_origin_type origin_type,
                               const char *name, const char *path, FILE *f,
-                              void *data, const struct config_options *opts)
+                              void *data, enum config_scope scope,
+                              const struct config_options *opts)
 {
        struct config_source top = CONFIG_SOURCE_INIT;
        int ret;
@@ -2041,19 +2005,20 @@ static int do_config_from_file(struct config_reader *reader,
        top.do_ftell = config_file_ftell;
 
        flockfile(f);
-       ret = do_config_from(reader, &top, fn, data, opts);
+       ret = do_config_from(&top, fn, data, scope, opts);
        funlockfile(f);
        return ret;
 }
 
-static int git_config_from_stdin(config_fn_t fn, void *data)
+static int git_config_from_stdin(config_fn_t fn, void *data,
+                                enum config_scope scope)
 {
-       return do_config_from_file(&the_reader, fn, CONFIG_ORIGIN_STDIN, "",
-                                  NULL, stdin, data, NULL);
+       return do_config_from_file(fn, CONFIG_ORIGIN_STDIN, "", NULL, stdin,
+                                  data, scope, NULL);
 }
 
 int git_config_from_file_with_options(config_fn_t fn, const char *filename,
-                                     void *data,
+                                     void *data, enum config_scope scope,
                                      const struct config_options *opts)
 {
        int ret = -1;
@@ -2063,8 +2028,8 @@ int git_config_from_file_with_options(config_fn_t fn, const char *filename,
                BUG("filename cannot be NULL");
        f = fopen_or_warn(filename, "r");
        if (f) {
-               ret = do_config_from_file(&the_reader, fn, CONFIG_ORIGIN_FILE,
-                                         filename, filename, f, data, opts);
+               ret = do_config_from_file(fn, CONFIG_ORIGIN_FILE, filename,
+                                         filename, f, data, scope, opts);
                fclose(f);
        }
        return ret;
@@ -2072,13 +2037,15 @@ int git_config_from_file_with_options(config_fn_t fn, const char *filename,
 
 int git_config_from_file(config_fn_t fn, const char *filename, void *data)
 {
-       return git_config_from_file_with_options(fn, filename, data, NULL);
+       return git_config_from_file_with_options(fn, filename, data,
+                                                CONFIG_SCOPE_UNKNOWN, NULL);
 }
 
 int git_config_from_mem(config_fn_t fn,
                        const enum config_origin_type origin_type,
                        const char *name, const char *buf, size_t len,
-                       void *data, const struct config_options *opts)
+                       void *data, enum config_scope scope,
+                       const struct config_options *opts)
 {
        struct config_source top = CONFIG_SOURCE_INIT;
 
@@ -2093,14 +2060,15 @@ int git_config_from_mem(config_fn_t fn,
        top.do_ungetc = config_buf_ungetc;
        top.do_ftell = config_buf_ftell;
 
-       return do_config_from(&the_reader, &top, fn, data, opts);
+       return do_config_from(&top, fn, data, scope, opts);
 }
 
 int git_config_from_blob_oid(config_fn_t fn,
                              const char *name,
                              struct repository *repo,
                              const struct object_id *oid,
-                             void *data)
+                             void *data,
+                             enum config_scope scope)
 {
        enum object_type type;
        char *buf;
@@ -2116,7 +2084,7 @@ int git_config_from_blob_oid(config_fn_t fn,
        }
 
        ret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size,
-                                 data, NULL);
+                                 data, scope, NULL);
        free(buf);
 
        return ret;
@@ -2125,13 +2093,14 @@ int git_config_from_blob_oid(config_fn_t fn,
 static int git_config_from_blob_ref(config_fn_t fn,
                                    struct repository *repo,
                                    const char *name,
-                                   void *data)
+                                   void *data,
+                                   enum config_scope scope)
 {
        struct object_id oid;
 
        if (repo_get_oid(repo, name, &oid) < 0)
                return error(_("unable to resolve config blob '%s'"), name);
-       return git_config_from_blob_oid(fn, name, repo, &oid, data);
+       return git_config_from_blob_oid(fn, name, repo, &oid, data, scope);
 }
 
 char *git_system_config(void)
@@ -2184,8 +2153,8 @@ int git_config_system(void)
        return !git_env_bool("GIT_CONFIG_NOSYSTEM", 0);
 }
 
-static int do_git_config_sequence(struct config_reader *reader,
-                                 const struct config_options *opts,
+static int do_git_config_sequence(const struct config_options *opts,
+                                 const struct repository *repo,
                                  config_fn_t fn, void *data)
 {
        int ret = 0;
@@ -2193,122 +2162,125 @@ static int do_git_config_sequence(struct config_reader *reader,
        char *xdg_config = NULL;
        char *user_config = NULL;
        char *repo_config;
-       enum config_scope prev_parsing_scope = reader->parsing_scope;
+       char *worktree_config;
+
+       /*
+        * Ensure that either:
+        * - the git_dir and commondir are both set, or
+        * - the git_dir and commondir are both NULL
+        */
+       if (!opts->git_dir != !opts->commondir)
+               BUG("only one of commondir and git_dir is non-NULL");
 
-       if (opts->commondir)
+       if (opts->commondir) {
                repo_config = mkpathdup("%s/config", opts->commondir);
-       else if (opts->git_dir)
-               BUG("git_dir without commondir");
-       else
+               worktree_config = mkpathdup("%s/config.worktree", opts->git_dir);
+       } else {
                repo_config = NULL;
+               worktree_config = NULL;
+       }
 
-       config_reader_set_scope(reader, CONFIG_SCOPE_SYSTEM);
        if (git_config_system() && system_config &&
            !access_or_die(system_config, R_OK,
                           opts->system_gently ? ACCESS_EACCES_OK : 0))
-               ret += git_config_from_file(fn, system_config, data);
+               ret += git_config_from_file_with_options(fn, system_config,
+                                                        data, CONFIG_SCOPE_SYSTEM,
+                                                        NULL);
 
-       config_reader_set_scope(reader, CONFIG_SCOPE_GLOBAL);
        git_global_config(&user_config, &xdg_config);
 
        if (xdg_config && !access_or_die(xdg_config, R_OK, ACCESS_EACCES_OK))
-               ret += git_config_from_file(fn, xdg_config, data);
+               ret += git_config_from_file_with_options(fn, xdg_config, data,
+                                                        CONFIG_SCOPE_GLOBAL, NULL);
 
        if (user_config && !access_or_die(user_config, R_OK, ACCESS_EACCES_OK))
-               ret += git_config_from_file(fn, user_config, data);
+               ret += git_config_from_file_with_options(fn, user_config, data,
+                                                        CONFIG_SCOPE_GLOBAL, NULL);
 
-       config_reader_set_scope(reader, CONFIG_SCOPE_LOCAL);
        if (!opts->ignore_repo && repo_config &&
            !access_or_die(repo_config, R_OK, 0))
-               ret += git_config_from_file(fn, repo_config, data);
+               ret += git_config_from_file_with_options(fn, repo_config, data,
+                                                        CONFIG_SCOPE_LOCAL, NULL);
 
-       config_reader_set_scope(reader, CONFIG_SCOPE_WORKTREE);
-       if (!opts->ignore_worktree && repository_format_worktree_config) {
-               char *path = git_pathdup("config.worktree");
-               if (!access_or_die(path, R_OK, 0))
-                       ret += git_config_from_file(fn, path, data);
-               free(path);
+       if (!opts->ignore_worktree && worktree_config &&
+           repo && repo->repository_format_worktree_config &&
+           !access_or_die(worktree_config, R_OK, 0)) {
+                       ret += git_config_from_file_with_options(fn, worktree_config, data,
+                                                                CONFIG_SCOPE_WORKTREE,
+                                                                NULL);
        }
 
-       config_reader_set_scope(reader, CONFIG_SCOPE_COMMAND);
        if (!opts->ignore_cmdline && git_config_from_parameters(fn, data) < 0)
                die(_("unable to parse command-line config"));
 
-       config_reader_set_scope(reader, prev_parsing_scope);
        free(system_config);
        free(xdg_config);
        free(user_config);
        free(repo_config);
+       free(worktree_config);
        return ret;
 }
 
 int config_with_options(config_fn_t fn, void *data,
                        struct git_config_source *config_source,
+                       struct repository *repo,
                        const struct config_options *opts)
 {
        struct config_include_data inc = CONFIG_INCLUDE_INIT;
-       enum config_scope prev_scope = the_reader.parsing_scope;
        int ret;
 
        if (opts->respect_includes) {
                inc.fn = fn;
                inc.data = data;
                inc.opts = opts;
+               inc.repo = repo;
                inc.config_source = config_source;
-               inc.config_reader = &the_reader;
                fn = git_config_include;
                data = &inc;
        }
 
-       if (config_source)
-               config_reader_set_scope(&the_reader, config_source->scope);
-
        /*
         * If we have a specific filename, use it. Otherwise, follow the
         * regular lookup sequence.
         */
        if (config_source && config_source->use_stdin) {
-               ret = git_config_from_stdin(fn, data);
+               ret = git_config_from_stdin(fn, data, config_source->scope);
        } else if (config_source && config_source->file) {
-               ret = git_config_from_file(fn, config_source->file, data);
+               ret = git_config_from_file_with_options(fn, config_source->file,
+                                                       data, config_source->scope,
+                                                       NULL);
        } else if (config_source && config_source->blob) {
-               struct repository *repo = config_source->repo ?
-                       config_source->repo : the_repository;
                ret = git_config_from_blob_ref(fn, repo, config_source->blob,
-                                               data);
+                                              data, config_source->scope);
        } else {
-               ret = do_git_config_sequence(&the_reader, opts, fn, data);
+               ret = do_git_config_sequence(opts, repo, fn, data);
        }
 
        if (inc.remote_urls) {
                string_list_clear(inc.remote_urls, 0);
                FREE_AND_NULL(inc.remote_urls);
        }
-       config_reader_set_scope(&the_reader, prev_scope);
        return ret;
 }
 
-static void configset_iter(struct config_reader *reader, struct config_set *set,
-                          config_fn_t fn, void *data)
+static void configset_iter(struct config_set *set, config_fn_t fn, void *data)
 {
        int i, value_index;
        struct string_list *values;
        struct config_set_element *entry;
        struct configset_list *list = &set->list;
+       struct config_context ctx = CONFIG_CONTEXT_INIT;
 
        for (i = 0; i < list->nr; i++) {
                entry = list->items[i].e;
                value_index = list->items[i].value_index;
                values = &entry->value_list;
 
-               config_reader_set_kvi(reader, values->items[value_index].util);
-
-               if (fn(entry->key, values->items[value_index].string, data) < 0)
+               ctx.kvi = values->items[value_index].util;
+               if (fn(entry->key, values->items[value_index].string, &ctx, data) < 0)
                        git_die_config_linenr(entry->key,
-                                             reader->config_kvi->filename,
-                                             reader->config_kvi->linenr);
-
-               config_reader_set_kvi(reader, NULL);
+                                             ctx.kvi->filename,
+                                             ctx.kvi->linenr);
        }
 }
 
@@ -2336,7 +2308,7 @@ void read_early_config(config_fn_t cb, void *data)
                opts.git_dir = gitdir.buf;
        }
 
-       config_with_options(cb, data, NULL, &opts);
+       config_with_options(cb, data, NULL, NULL, &opts);
 
        strbuf_release(&commondir);
        strbuf_release(&gitdir);
@@ -2356,7 +2328,7 @@ void read_very_early_config(config_fn_t cb, void *data)
        opts.ignore_cmdline = 1;
        opts.system_gently = 1;
 
-       config_with_options(cb, data, NULL, &opts);
+       config_with_options(cb, data, NULL, NULL, &opts);
 }
 
 RESULT_MUST_BE_USED
@@ -2384,7 +2356,7 @@ static int configset_find_element(struct config_set *set, const char *key,
        return 0;
 }
 
-static int configset_add_value(struct config_reader *reader,
+static int configset_add_value(const struct key_value_info *kvi_p,
                               struct config_set *set, const char *key,
                               const char *value)
 {
@@ -2415,19 +2387,7 @@ static int configset_add_value(struct config_reader *reader,
        l_item->e = e;
        l_item->value_index = e->value_list.nr - 1;
 
-       if (!reader->source)
-               BUG("configset_add_value has no source");
-       if (reader->source->name) {
-               kv_info->filename = strintern(reader->source->name);
-               kv_info->linenr = reader->source->linenr;
-               kv_info->origin_type = reader->source->origin_type;
-       } else {
-               /* for values read from `git_config_from_parameters()` */
-               kv_info->filename = NULL;
-               kv_info->linenr = -1;
-               kv_info->origin_type = CONFIG_ORIGIN_CMDLINE;
-       }
-       kv_info->scope = reader->parsing_scope;
+       *kv_info = *kvi_p;
        si->util = kv_info;
 
        return 0;
@@ -2475,32 +2435,26 @@ void git_configset_clear(struct config_set *set)
        set->list.items = NULL;
 }
 
-struct configset_add_data {
-       struct config_set *config_set;
-       struct config_reader *config_reader;
-};
-#define CONFIGSET_ADD_INIT { 0 }
-
-static int config_set_callback(const char *key, const char *value, void *cb)
+static int config_set_callback(const char *key, const char *value,
+                              const struct config_context *ctx,
+                              void *cb)
 {
-       struct configset_add_data *data = cb;
-       configset_add_value(data->config_reader, data->config_set, key, value);
+       struct config_set *set = cb;
+       configset_add_value(ctx->kvi, set, key, value);
        return 0;
 }
 
 int git_configset_add_file(struct config_set *set, const char *filename)
 {
-       struct configset_add_data data = CONFIGSET_ADD_INIT;
-       data.config_reader = &the_reader;
-       data.config_set = set;
-       return git_config_from_file(config_set_callback, filename, &data);
+       return git_config_from_file(config_set_callback, filename, set);
 }
 
-int git_configset_get_value(struct config_set *set, const char *key, const char **value)
+int git_configset_get_value(struct config_set *set, const char *key,
+                           const char **value, struct key_value_info *kvi)
 {
        const struct string_list *values = NULL;
        int ret;
-
+       struct string_list_item item;
        /*
         * Follows "last one wins" semantic, i.e., if there are multiple matches for the
         * queried key in the files of the configset, the value returned will be the last
@@ -2510,7 +2464,10 @@ int git_configset_get_value(struct config_set *set, const char *key, const char
                return ret;
 
        assert(values->nr > 0);
-       *value = values->items[values->nr - 1].string;
+       item = values->items[values->nr - 1];
+       *value = item.string;
+       if (kvi)
+               *kvi = *((struct key_value_info *)item.util);
        return 0;
 }
 
@@ -2563,7 +2520,7 @@ int git_configset_get(struct config_set *set, const char *key)
 int git_configset_get_string(struct config_set *set, const char *key, char **dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value))
+       if (!git_configset_get_value(set, key, &value, NULL))
                return git_config_string((const char **)dest, key, value);
        else
                return 1;
@@ -2573,7 +2530,7 @@ static int git_configset_get_string_tmp(struct config_set *set, const char *key,
                                        const char **dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value)) {
+       if (!git_configset_get_value(set, key, &value, NULL)) {
                if (!value)
                        return config_error_nonbool(key);
                *dest = value;
@@ -2586,8 +2543,10 @@ static int git_configset_get_string_tmp(struct config_set *set, const char *key,
 int git_configset_get_int(struct config_set *set, const char *key, int *dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value)) {
-               *dest = git_config_int(key, value);
+       struct key_value_info kvi;
+
+       if (!git_configset_get_value(set, key, &value, &kvi)) {
+               *dest = git_config_int(key, value, &kvi);
                return 0;
        } else
                return 1;
@@ -2596,8 +2555,10 @@ int git_configset_get_int(struct config_set *set, const char *key, int *dest)
 int git_configset_get_ulong(struct config_set *set, const char *key, unsigned long *dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value)) {
-               *dest = git_config_ulong(key, value);
+       struct key_value_info kvi;
+
+       if (!git_configset_get_value(set, key, &value, &kvi)) {
+               *dest = git_config_ulong(key, value, &kvi);
                return 0;
        } else
                return 1;
@@ -2606,7 +2567,7 @@ int git_configset_get_ulong(struct config_set *set, const char *key, unsigned lo
 int git_configset_get_bool(struct config_set *set, const char *key, int *dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value)) {
+       if (!git_configset_get_value(set, key, &value, NULL)) {
                *dest = git_config_bool(key, value);
                return 0;
        } else
@@ -2617,8 +2578,10 @@ int git_configset_get_bool_or_int(struct config_set *set, const char *key,
                                int *is_bool, int *dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value)) {
-               *dest = git_config_bool_or_int(key, value, is_bool);
+       struct key_value_info kvi;
+
+       if (!git_configset_get_value(set, key, &value, &kvi)) {
+               *dest = git_config_bool_or_int(key, value, &kvi, is_bool);
                return 0;
        } else
                return 1;
@@ -2627,7 +2590,7 @@ int git_configset_get_bool_or_int(struct config_set *set, const char *key,
 int git_configset_get_maybe_bool(struct config_set *set, const char *key, int *dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value)) {
+       if (!git_configset_get_value(set, key, &value, NULL)) {
                *dest = git_parse_maybe_bool(value);
                if (*dest == -1)
                        return -1;
@@ -2639,7 +2602,7 @@ int git_configset_get_maybe_bool(struct config_set *set, const char *key, int *d
 int git_configset_get_pathname(struct config_set *set, const char *key, const char **dest)
 {
        const char *value;
-       if (!git_configset_get_value(set, key, &value))
+       if (!git_configset_get_value(set, key, &value, NULL))
                return git_config_pathname(dest, key, value);
        else
                return 1;
@@ -2649,7 +2612,6 @@ int git_configset_get_pathname(struct config_set *set, const char *key, const ch
 static void repo_read_config(struct repository *repo)
 {
        struct config_options opts = { 0 };
-       struct configset_add_data data = CONFIGSET_ADD_INIT;
 
        opts.respect_includes = 1;
        opts.commondir = repo->commondir;
@@ -2661,10 +2623,8 @@ static void repo_read_config(struct repository *repo)
                git_configset_clear(repo->config);
 
        git_configset_init(repo->config);
-       data.config_set = repo->config;
-       data.config_reader = &the_reader;
-
-       if (config_with_options(config_set_callback, &data, NULL, &opts) < 0)
+       if (config_with_options(config_set_callback, repo->config, NULL,
+                               repo, &opts) < 0)
                /*
                 * config_with_options() normally returns only
                 * zero, as most errors are fatal, and
@@ -2696,7 +2656,7 @@ static void repo_config_clear(struct repository *repo)
 void repo_config(struct repository *repo, config_fn_t fn, void *data)
 {
        git_config_check_init(repo);
-       configset_iter(&the_reader, repo->config, fn, data);
+       configset_iter(repo->config, fn, data);
 }
 
 int repo_config_get(struct repository *repo, const char *key)
@@ -2709,7 +2669,7 @@ int repo_config_get_value(struct repository *repo,
                          const char *key, const char **value)
 {
        git_config_check_init(repo);
-       return git_configset_get_value(repo->config, key, value);
+       return git_configset_get_value(repo->config, key, value, NULL);
 }
 
 int repo_config_get_value_multi(struct repository *repo, const char *key,
@@ -2803,19 +2763,17 @@ static void read_protected_config(void)
                .ignore_worktree = 1,
                .system_gently = 1,
        };
-       struct configset_add_data data = CONFIGSET_ADD_INIT;
 
        git_configset_init(&protected_config);
-       data.config_set = &protected_config;
-       data.config_reader = &the_reader;
-       config_with_options(config_set_callback, &data, NULL, &opts);
+       config_with_options(config_set_callback, &protected_config, NULL,
+                           NULL, &opts);
 }
 
 void git_protected_config(config_fn_t fn, void *data)
 {
        if (!protected_config.hash_initialized)
                read_protected_config();
-       configset_iter(&the_reader, &protected_config, fn, data);
+       configset_iter(&protected_config, fn, data);
 }
 
 /* Functions used historically to read configuration from 'the_repository' */
@@ -3005,7 +2963,6 @@ void git_die_config(const char *key, const char *err, ...)
  */
 
 struct config_store_data {
-       struct config_reader *config_reader;
        size_t baselen;
        char *key;
        int do_not_match;
@@ -3051,11 +3008,10 @@ static int matches(const char *key, const char *value,
                (value && !regexec(store->value_pattern, value, 0, NULL, 0));
 }
 
-static int store_aux_event(enum config_event_t type,
-                          size_t begin, size_t end, void *data)
+static int store_aux_event(enum config_event_t type, size_t begin, size_t end,
+                          struct config_source *cs, void *data)
 {
        struct config_store_data *store = data;
-       struct config_source *cs = store->config_reader->source;
 
        ALLOC_GROW(store->parsed, store->parsed_nr + 1, store->parsed_alloc);
        store->parsed[store->parsed_nr].begin = begin;
@@ -3091,7 +3047,8 @@ static int store_aux_event(enum config_event_t type,
        return 0;
 }
 
-static int store_aux(const char *key, const char *value, void *cb)
+static int store_aux(const char *key, const char *value,
+                    const struct config_context *ctx UNUSED, void *cb)
 {
        struct config_store_data *store = cb;
 
@@ -3320,7 +3277,7 @@ int repo_config_set_worktree_gently(struct repository *r,
                                    const char *key, const char *value)
 {
        /* Only use worktree-specific config if it is already enabled. */
-       if (repository_format_worktree_config) {
+       if (r->repository_format_worktree_config) {
                char *file = repo_git_path(r, "config.worktree");
                int ret = git_config_set_multivar_in_file_gently(
                                        file, key, value, NULL, 0);
@@ -3375,8 +3332,6 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
        size_t contents_sz;
        struct config_store_data store = CONFIG_STORE_INIT;
 
-       store.config_reader = &the_reader;
-
        /* parse-key returns negative; flip the sign to feed exit(3) */
        ret = 0 - git_config_parse_key(key, &store.key, &store.baselen);
        if (ret)
@@ -3465,7 +3420,8 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
                 */
                if (git_config_from_file_with_options(store_aux,
                                                      config_filename,
-                                                     &store, &opts)) {
+                                                     &store, CONFIG_SCOPE_UNKNOWN,
+                                                     &opts)) {
                        error(_("invalid config file %s"), config_filename);
                        ret = CONFIG_INVALID_FILE;
                        goto out_free;
@@ -3652,9 +3608,10 @@ void git_config_set_multivar(const char *key, const char *value,
                                        flags);
 }
 
-static int section_name_match (const char *buf, const char *name)
+static size_t section_name_match (const char *buf, const char *name)
 {
-       int i = 0, j = 0, dot = 0;
+       size_t i = 0, j = 0;
+       int dot = 0;
        if (buf[i] != '[')
                return 0;
        for (i = 1; buf[i] && buf[i] != ']'; i++) {
@@ -3707,6 +3664,8 @@ static int section_name_is_ok(const char *name)
        return 1;
 }
 
+#define GIT_CONFIG_MAX_LINE_LEN (512 * 1024)
+
 /* if new_name == NULL, the section is removed instead */
 static int git_config_copy_or_rename_section_in_file(const char *config_filename,
                                      const char *old_name,
@@ -3716,11 +3675,12 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
        char *filename_buf = NULL;
        struct lock_file lock = LOCK_INIT;
        int out_fd;
-       char buf[1024];
+       struct strbuf buf = STRBUF_INIT;
        FILE *config_file = NULL;
        struct stat st;
        struct strbuf copystr = STRBUF_INIT;
        struct config_store_data store;
+       uint32_t line_nr = 0;
 
        memset(&store, 0, sizeof(store));
 
@@ -3757,16 +3717,25 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
                goto out;
        }
 
-       while (fgets(buf, sizeof(buf), config_file)) {
-               unsigned i;
-               int length;
+       while (!strbuf_getwholeline(&buf, config_file, '\n')) {
+               size_t i, length;
                int is_section = 0;
-               char *output = buf;
-               for (i = 0; buf[i] && isspace(buf[i]); i++)
+               char *output = buf.buf;
+
+               line_nr++;
+
+               if (buf.len >= GIT_CONFIG_MAX_LINE_LEN) {
+                       ret = error(_("refusing to work with overly long line "
+                                     "in '%s' on line %"PRIuMAX),
+                                   config_filename, (uintmax_t)line_nr);
+                       goto out;
+               }
+
+               for (i = 0; buf.buf[i] && isspace(buf.buf[i]); i++)
                        ; /* do nothing */
-               if (buf[i] == '[') {
+               if (buf.buf[i] == '[') {
                        /* it's a section */
-                       int offset;
+                       size_t offset;
                        is_section = 1;
 
                        /*
@@ -3783,7 +3752,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
                                strbuf_reset(&copystr);
                        }
 
-                       offset = section_name_match(&buf[i], old_name);
+                       offset = section_name_match(&buf.buf[i], old_name);
                        if (offset > 0) {
                                ret++;
                                if (!new_name) {
@@ -3813,6 +3782,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
                                                output[0] = '\t';
                                        }
                                } else {
+                                       strbuf_release(&copystr);
                                        copystr = store_create_section(new_name, &store);
                                }
                        }
@@ -3858,6 +3828,8 @@ out:
 out_no_rollback:
        free(filename_buf);
        config_store_data_clear(&store);
+       strbuf_release(&buf);
+       strbuf_release(&copystr);
        return ret;
 }
 
@@ -3931,25 +3903,8 @@ int parse_config_key(const char *var,
        return 0;
 }
 
-static int reader_origin_type(struct config_reader *reader,
-                             enum config_origin_type *type)
-{
-       if (the_reader.config_kvi)
-               *type = reader->config_kvi->origin_type;
-       else if(the_reader.source)
-               *type = reader->source->origin_type;
-       else
-               return 1;
-       return 0;
-}
-
-const char *current_config_origin_type(void)
+const char *config_origin_type_name(enum config_origin_type type)
 {
-       enum config_origin_type type = CONFIG_ORIGIN_UNKNOWN;
-
-       if (reader_origin_type(&the_reader, &type))
-               BUG("current_config_origin_type called outside config callback");
-
        switch (type) {
        case CONFIG_ORIGIN_BLOB:
                return "blob";
@@ -3986,41 +3941,6 @@ const char *config_scope_name(enum config_scope scope)
        }
 }
 
-static int reader_config_name(struct config_reader *reader, const char **out)
-{
-       if (the_reader.config_kvi)
-               *out = reader->config_kvi->filename;
-       else if (the_reader.source)
-               *out = reader->source->name;
-       else
-               return 1;
-       return 0;
-}
-
-const char *current_config_name(void)
-{
-       const char *name;
-       if (reader_config_name(&the_reader, &name))
-               BUG("current_config_name called outside config callback");
-       return name ? name : "";
-}
-
-enum config_scope current_config_scope(void)
-{
-       if (the_reader.config_kvi)
-               return the_reader.config_kvi->scope;
-       else
-               return the_reader.parsing_scope;
-}
-
-int current_config_line(void)
-{
-       if (the_reader.config_kvi)
-               return the_reader.config_kvi->linenr;
-       else
-               return the_reader.source->linenr;
-}
-
 int lookup_config(const char **mapping, int nr_mapping, const char *var)
 {
        int i;
index 247b572b37bc28e46a88118e3484795078c99b1a..6332d749047764aff33000d01fc78f75ddfe03b1 100644 (file)
--- a/config.h
+++ b/config.h
@@ -3,6 +3,7 @@
 
 #include "hashmap.h"
 #include "string-list.h"
+#include "repository.h"
 
 
 /**
@@ -49,8 +50,6 @@ const char *config_scope_name(enum config_scope scope);
 struct git_config_source {
        unsigned int use_stdin:1;
        const char *file;
-       /* The repository if blob is not NULL; leave blank for the_repository */
-       struct repository *repo;
        const char *blob;
        enum config_scope scope;
 };
@@ -73,6 +72,7 @@ enum config_event_t {
        CONFIG_EVENT_ERROR
 };
 
+struct config_source;
 /*
  * The parser event function (if not NULL) is called with the event type and
  * the begin/end offsets of the parsed elements.
@@ -82,6 +82,7 @@ enum config_event_t {
  */
 typedef int (*config_parser_event_fn_t)(enum config_event_t type,
                                        size_t begin_offset, size_t end_offset,
+                                       struct config_source *cs,
                                        void *event_fn_data);
 
 struct config_options {
@@ -101,6 +102,10 @@ struct config_options {
 
        const char *commondir;
        const char *git_dir;
+       /*
+        * event_fn and event_fn_data are for internal use only. Handles events
+        * emitted by the config parser.
+        */
        config_parser_event_fn_t event_fn;
        void *event_fn_data;
        enum config_error_action {
@@ -111,8 +116,31 @@ struct config_options {
        } error_action;
 };
 
+/* Config source metadata for a given config key-value pair */
+struct key_value_info {
+       const char *filename;
+       int linenr;
+       enum config_origin_type origin_type;
+       enum config_scope scope;
+       const char *path;
+};
+#define KVI_INIT { \
+       .filename = NULL, \
+       .linenr = -1, \
+       .origin_type = CONFIG_ORIGIN_UNKNOWN, \
+       .scope = CONFIG_SCOPE_UNKNOWN, \
+       .path = NULL, \
+}
+
+/* Captures additional information that a config callback can use. */
+struct config_context {
+       /* Config source metadata for key and value. */
+       const struct key_value_info *kvi;
+};
+#define CONFIG_CONTEXT_INIT { 0 }
+
 /**
- * A config callback function takes three parameters:
+ * A config callback function takes four parameters:
  *
  * - the name of the parsed variable. This is in canonical "flat" form: the
  *   section, subsection, and variable segments will be separated by dots,
@@ -123,15 +151,22 @@ struct config_options {
  *   value specified, the value will be NULL (typically this means it
  *   should be interpreted as boolean true).
  *
+ * - the 'config context', that is, additional information about the config
+ *   iteration operation provided by the config machinery. For example, this
+ *   includes information about the config source being parsed (e.g. the
+ *   filename).
+ *
  * - a void pointer passed in by the caller of the config API; this can
  *   contain callback-specific data
  *
  * A config callback should return 0 for success, or -1 if the variable
  * could not be parsed properly.
  */
-typedef int (*config_fn_t)(const char *, const char *, void *);
+typedef int (*config_fn_t)(const char *, const char *,
+                          const struct config_context *, void *);
 
-int git_default_config(const char *, const char *, void *);
+int git_default_config(const char *, const char *,
+                      const struct config_context *, void *);
 
 /**
  * Read a specific file in git-config format.
@@ -142,16 +177,18 @@ int git_default_config(const char *, const char *, void *);
 int git_config_from_file(config_fn_t fn, const char *, void *);
 
 int git_config_from_file_with_options(config_fn_t fn, const char *,
-                                     void *,
+                                     void *, enum config_scope,
                                      const struct config_options *);
 int git_config_from_mem(config_fn_t fn,
                        const enum config_origin_type,
                        const char *name,
                        const char *buf, size_t len,
-                       void *data, const struct config_options *opts);
+                       void *data, enum config_scope scope,
+                       const struct config_options *opts);
 int git_config_from_blob_oid(config_fn_t fn, const char *name,
                             struct repository *repo,
-                            const struct object_id *oid, void *data);
+                            const struct object_id *oid, void *data,
+                            enum config_scope scope);
 void git_config_push_parameter(const char *text);
 void git_config_push_env(const char *spec);
 int git_config_from_parameters(config_fn_t fn, void *data);
@@ -196,6 +233,7 @@ void git_config(config_fn_t fn, void *);
  */
 int config_with_options(config_fn_t fn, void *,
                        struct git_config_source *config_source,
+                       struct repository *repo,
                        const struct config_options *opts);
 
 /**
@@ -219,22 +257,26 @@ int git_parse_maybe_bool(const char *);
  * Parse the string to an integer, including unit factors. Dies on error;
  * otherwise, returns the parsed result.
  */
-int git_config_int(const char *, const char *);
+int git_config_int(const char *, const char *, const struct key_value_info *);
 
-int64_t git_config_int64(const char *, const char *);
+int64_t git_config_int64(const char *, const char *,
+                        const struct key_value_info *);
 
 /**
  * Identical to `git_config_int`, but for unsigned longs.
  */
-unsigned long git_config_ulong(const char *, const char *);
+unsigned long git_config_ulong(const char *, const char *,
+                              const struct key_value_info *);
 
-ssize_t git_config_ssize_t(const char *, const char *);
+ssize_t git_config_ssize_t(const char *, const char *,
+                          const struct key_value_info *);
 
 /**
  * Same as `git_config_bool`, except that integers are returned as-is, and
  * an `is_bool` flag is unset.
  */
-int git_config_bool_or_int(const char *, const char *, int *);
+int git_config_bool_or_int(const char *, const char *,
+                          const struct key_value_info *, int *);
 
 /**
  * Parse a string into a boolean value, respecting keywords like "true" and
@@ -356,10 +398,8 @@ void git_global_config(char **user, char **xdg);
 
 int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
 
-enum config_scope current_config_scope(void);
-const char *current_config_origin_type(void);
-const char *current_config_name(void);
-int current_config_line(void);
+const char *config_origin_type_name(enum config_origin_type type);
+void kvi_from_param(struct key_value_info *out);
 
 /*
  * Match and parse a config key of the form:
@@ -501,7 +541,8 @@ int git_configset_get(struct config_set *cs, const char *key);
  * touching `value`. The caller should not free or modify `value`, as it
  * is owned by the cache.
  */
-int git_configset_get_value(struct config_set *cs, const char *key, const char **dest);
+int git_configset_get_value(struct config_set *cs, const char *key,
+                           const char **dest, struct key_value_info *kvi);
 
 int git_configset_get_string(struct config_set *cs, const char *key, char **dest);
 int git_configset_get_int(struct config_set *cs, const char *key, int *dest);
@@ -667,13 +708,6 @@ int git_config_get_expiry(const char *key, const char **output);
 /* parse either "this many days" integer, or "5.days.ago" approxidate */
 int git_config_get_expiry_in_days(const char *key, timestamp_t *, timestamp_t now);
 
-struct key_value_info {
-       const char *filename;
-       int linenr;
-       enum config_origin_type origin_type;
-       enum config_scope scope;
-};
-
 /**
  * First prints the error message specified by the caller in `err` and then
  * dies printing the line number and the file name of the highest priority
index 64c44db8058e0ca530519814bd5f4a3714d49695..3bb03f423a08102f837c52dcbe7a3b581104e0cb 100644 (file)
@@ -526,6 +526,8 @@ else
 endif
        X = .exe
 
+       EXTRA_PROGRAMS += headless-git$X
+
 compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS
 endif
 ifeq ($(uname_S),Interix)
@@ -705,6 +707,7 @@ ifeq ($(uname_S),MINGW)
        COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
                -fstack-protector-strong
        EXTLIBS += -lntdll
+       EXTRA_PROGRAMS += headless-git$X
        INSTALL = /bin/install
        INTERNAL_QSORT = YesPlease
        HAVE_LIBCHARSET_H = YesPlease
index 38ff86678a03a96dffa57507364a6f706ddb44d0..276593cd9dd935a283620f3b9d25b09987c04bf2 100644 (file)
@@ -546,6 +546,8 @@ fi
 # git-http-push are not built, and you cannot use http:// and https://
 # transports.
 
+if test -z "$NO_CURL"; then
+
 GIT_STASH_FLAGS($CURLDIR)
 
 AC_CHECK_LIB([curl], [curl_global_init],
@@ -554,6 +556,8 @@ AC_CHECK_LIB([curl], [curl_global_init],
 
 GIT_UNSTASH_FLAGS($CURLDIR)
 
+fi
+
 GIT_CONF_SUBST([NO_CURL])
 
 if test -z "$NO_CURL"; then
@@ -581,6 +585,8 @@ fi
 # Define NO_EXPAT if you do not have expat installed.  git-http-push is
 # not built, and you cannot push using http:// and https:// transports.
 
+if test -z "$NO_EXPAT"; then
+
 GIT_STASH_FLAGS($EXPATDIR)
 
 AC_CHECK_LIB([expat], [XML_ParserCreate],
@@ -589,6 +595,8 @@ AC_CHECK_LIB([expat], [XML_ParserCreate],
 
 GIT_UNSTASH_FLAGS($EXPATDIR)
 
+fi
+
 GIT_CONF_SUBST([NO_EXPAT])
 
 #
@@ -636,7 +644,6 @@ LIBS="$old_LIBS"
 GIT_UNSTASH_FLAGS($ICONVDIR)
 
 GIT_CONF_SUBST([NEEDS_LIBICONV])
-GIT_CONF_SUBST([NO_ICONV])
 
 if test -n "$NO_ICONV"; then
     NEEDS_LIBICONV=
@@ -644,6 +651,8 @@ fi
 
 fi
 
+GIT_CONF_SUBST([NO_ICONV])
+
 #
 # Define NO_DEFLATE_BOUND if deflateBound is missing from zlib.
 
index c0c8a38178cec786ff4dfc721e0b9e389a3c5888..0d77737a5363c39fd71376c0f483bc8808538754 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "cache.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -13,7 +12,9 @@
 #include "url.h"
 #include "string-list.h"
 #include "oid-array.h"
+#include "path.h"
 #include "transport.h"
+#include "trace2.h"
 #include "strbuf.h"
 #include "version.h"
 #include "protocol.h"
@@ -22,7 +23,7 @@
 
 static char *server_capabilities_v1;
 static struct strvec server_capabilities_v2 = STRVEC_INIT;
-static const char *next_server_feature_value(const char *feature, int *len, int *offset);
+static const char *next_server_feature_value(const char *feature, size_t *len, size_t *offset);
 
 static int check_ref(const char *name, unsigned int flags)
 {
@@ -205,10 +206,10 @@ reject:
 static void annotate_refs_with_symref_info(struct ref *ref)
 {
        struct string_list symref = STRING_LIST_INIT_DUP;
-       int offset = 0;
+       size_t offset = 0;
 
        while (1) {
-               int len;
+               size_t len;
                const char *val;
 
                val = next_server_feature_value("symref", &len, &offset);
@@ -231,7 +232,7 @@ static void annotate_refs_with_symref_info(struct ref *ref)
 static void process_capabilities(struct packet_reader *reader, int *linelen)
 {
        const char *feat_val;
-       int feat_len;
+       size_t feat_len;
        const char *line = reader->line;
        int nul_location = strlen(line);
        if (nul_location == *linelen)
@@ -263,7 +264,8 @@ static int process_dummy_ref(const struct packet_reader *reader)
                return 0;
        name++;
 
-       return oideq(null_oid(), &oid) && !strcmp(name, "capabilities^{}");
+       return oideq(reader->hash_algo->null_oid, &oid) &&
+               !strcmp(name, "capabilities^{}");
 }
 
 static void check_no_capabilities(const char *line, int len)
@@ -595,9 +597,10 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
        return list;
 }
 
-const char *parse_feature_value(const char *feature_list, const char *feature, int *lenp, int *offset)
+const char *parse_feature_value(const char *feature_list, const char *feature, size_t *lenp, size_t *offset)
 {
-       int len;
+       const char *orig_start = feature_list;
+       size_t len;
 
        if (!feature_list)
                return NULL;
@@ -616,19 +619,19 @@ const char *parse_feature_value(const char *feature_list, const char *feature, i
                                if (lenp)
                                        *lenp = 0;
                                if (offset)
-                                       *offset = found + len - feature_list;
+                                       *offset = found + len - orig_start;
                                return value;
                        }
                        /* feature with a value (e.g., "agent=git/1.2.3") */
                        else if (*value == '=') {
-                               int end;
+                               size_t end;
 
                                value++;
                                end = strcspn(value, " \t\n");
                                if (lenp)
                                        *lenp = end;
                                if (offset)
-                                       *offset = value + end - feature_list;
+                                       *offset = value + end - orig_start;
                                return value;
                        }
                        /*
@@ -643,8 +646,8 @@ const char *parse_feature_value(const char *feature_list, const char *feature, i
 
 int server_supports_hash(const char *desired, int *feature_supported)
 {
-       int offset = 0;
-       int len;
+       size_t offset = 0;
+       size_t len;
        const char *hash;
 
        hash = next_server_feature_value("object-format", &len, &offset);
@@ -668,12 +671,12 @@ int parse_feature_request(const char *feature_list, const char *feature)
        return !!parse_feature_value(feature_list, feature, NULL, NULL);
 }
 
-static const char *next_server_feature_value(const char *feature, int *len, int *offset)
+static const char *next_server_feature_value(const char *feature, size_t *len, size_t *offset)
 {
        return parse_feature_value(server_capabilities_v1, feature, len, offset);
 }
 
-const char *server_feature_value(const char *feature, int *len)
+const char *server_feature_value(const char *feature, size_t *len)
 {
        return parse_feature_value(server_capabilities_v1, feature, len, NULL);
 }
@@ -962,7 +965,7 @@ static struct child_process *git_tcp_connect(int fd[2], char *host, int flags)
 static char *git_proxy_command;
 
 static int git_proxy_command_options(const char *var, const char *value,
-               void *cb)
+               const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "core.gitproxy")) {
                const char *for_pos;
@@ -1008,7 +1011,7 @@ static int git_proxy_command_options(const char *var, const char *value,
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static int git_use_proxy(const char *host)
index f41a0b4c1fb766523d6bee7964989063a6ceeaa2..1645126c17f889659d84174210a43939ef67507f 100644 (file)
--- a/connect.h
+++ b/connect.h
@@ -12,14 +12,14 @@ int finish_connect(struct child_process *conn);
 int git_connection_is_socket(struct child_process *conn);
 int server_supports(const char *feature);
 int parse_feature_request(const char *features, const char *feature);
-const char *server_feature_value(const char *feature, int *len_ret);
+const char *server_feature_value(const char *feature, size_t *len_ret);
 int url_is_local_not_ssh(const char *url);
 
 struct packet_reader;
 enum protocol_version discover_version(struct packet_reader *reader);
 
 int server_supports_hash(const char *desired, int *feature_supported);
-const char *parse_feature_value(const char *feature_list, const char *feature, int *lenp, int *offset);
+const char *parse_feature_value(const char *feature_list, const char *feature, size_t *lenp, size_t *offset);
 int server_supports_v2(const char *c);
 void ensure_server_supports_v2(const char *c);
 int server_feature_v2(const char *c, const char **v);
index d672521da41d524f49556aefc29427b20836b8d2..8f89376dbcf30cd2cf69c3d2eaa446e47c9f4ae8 100644 (file)
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "connected.h"
index 2f6e0197ffa489ccc14b0665cdf78dba43b39e3e..6b819e2fbdf357f8401a29b5f8daa29e43284cfe 100644 (file)
@@ -227,7 +227,7 @@ add_compile_definitions(GIT_HOST_CPU="${CMAKE_SYSTEM_PROCESSOR}")
 add_compile_definitions(SHA256_BLK INTERNAL_QSORT RUNTIME_PREFIX)
 add_compile_definitions(NO_OPENSSL SHA1_DC SHA1DC_NO_STANDARD_INCLUDES
                        SHA1DC_INIT_SAFE_HASH_DEFAULT=0
-                       SHA1DC_CUSTOM_INCLUDE_SHA1_C="cache.h"
+                       SHA1DC_CUSTOM_INCLUDE_SHA1_C="git-compat-util.h"
                        SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="git-compat-util.h" )
 list(APPEND compat_SOURCES sha1dc_git.c sha1dc/sha1.c sha1dc/ubc_check.c block-sha1/sha1.c sha256/block/sha256.c compat/qsort_s.c)
 
@@ -738,6 +738,15 @@ if(WIN32)
        else()
                message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
        endif()
+
+       add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
+       if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
+               target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
+       elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+               target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
+       else()
+               message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
+       endif()
 elseif(UNIX)
        target_link_libraries(common-main pthread rt)
 endif()
index 1a25789d28513bb5f9dc9b0a625d75fac6e89092..b2e68a16715e3987f7bb05d69cad39e6b457a30c 100644 (file)
@@ -76,7 +76,7 @@ sub createProject {
 
     my $libs_release = "\n    ";
     my $libs_debug = "\n    ";
-    if (!$static_library) {
+    if (!$static_library && $name ne 'headless-git') {
       $libs_release = join(";", sort(grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib|reftable\/libreftable\.lib)/, @{$$build_structure{"$prefix${name}_LIBS"}}));
       $libs_debug = $libs_release;
       $libs_debug =~ s/zlib\.lib/zlibd\.lib/g;
@@ -230,7 +230,7 @@ EOM
     print F << "EOM";
   </ItemGroup>
 EOM
-    if (!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') {
+    if ((!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') && !($name =~ /headless-git/)) {
       my $uuid_libgit = $$build_structure{"LIBS_libgit_GUID"};
       my $uuid_libreftable = $$build_structure{"LIBS_reftable/libreftable_GUID"};
       my $uuid_xdiff_lib = $$build_structure{"LIBS_xdiff/lib_GUID"};
index ed6c45988a38b0f45a2b67a15cb18a221ad911c7..069be7e4befcd793430b338f930d103e41c4802a 100755 (executable)
@@ -371,6 +371,7 @@ sub handleLinkLine
 #    exit(1);
     foreach (@objfiles) {
         my $sourcefile = $_;
+        $sourcefile =~ s/^headless-git\.o$/compat\/win32\/headless.c/;
         $sourcefile =~ s/\.o$/.c/;
         push(@sources, $sourcefile);
         push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
index d1daa1f62639a1bbd37e4aedf6f51c1d8d831b63..055ad0e06a70e2a23c88c1cf34782d679d42426a 100644 (file)
@@ -1,7 +1,9 @@
-This directory provides examples of Coccinelle (http://coccinelle.lip6.fr/)
-semantic patches that might be useful to developers.
+= coccinelle
 
-There are two types of semantic patches:
+This directory provides Coccinelle (http://coccinelle.lip6.fr/) semantic patches
+that might be useful to developers.
+
+==  Types of semantic patches
 
  * Using the semantic transformation to check for bad patterns in the code;
    The target 'make coccicheck' is designed to check for these patterns and
@@ -42,7 +44,7 @@ There are two types of semantic patches:
    This allows to expose plans of pending large scale refactorings without
    impacting the bad pattern checks.
 
-Git-specific tips & things to know about how we run "spatch":
+== Git-specific tips & things to know about how we run "spatch":
 
  * The "make coccicheck" will piggy-back on
    "COMPUTE_HEADER_DEPENDENCIES". If you've built a given object file
@@ -90,3 +92,33 @@ Git-specific tips & things to know about how we run "spatch":
 
    The absolute times will differ for you, but the relative speedup
    from caching should be on that order.
+
+== Authoring and reviewing coccinelle changes
+
+* When a .cocci is made, both the Git changes and .cocci file should be
+  reviewed. When reviewing such a change, do your best to understand the .cocci
+  changes (e.g. by asking the author to explain the change) and be explicit
+  about your understanding of the changes. This helps us decide whether input
+  from coccinelle experts is needed or not. If you aren't sure of the cocci
+  changes, indicate what changes you actively endorse and leave an Acked-by
+  (instead of Reviewed-by).
+
+* Authors should consider that reviewers may not be coccinelle experts, thus the
+  the .cocci changes may not be self-evident. A plain text description of the
+  changes is strongly encouraged, especially when using more esoteric features
+  of the language.
+
+* .cocci rules should target only the problem it is trying to solve; "collateral
+  damage" is not allowed. Reviewers should look out and flag overly-broad rules.
+
+* Consider the cost-benefit ratio of .cocci changes. In particular, consider the
+  effect on the runtime of "make coccicheck", and how often your .cocci check
+  will catch something valuable. As a rule of thumb, rules that can bail early
+  if a file doesn't have a particular token will have a small impact on runtime,
+  and vice-versa.
+
+* .cocci files used for refactoring should be temporarily kept in-tree to aid
+  the refactoring of out-of-tree code (e.g. in-flight topics). Periodically
+  evaluate the cost-benefit ratio to determine when the file should be removed.
+  For example, consider how many out-of-tree users are left and how much this
+  slows down "make coccicheck".
diff --git a/contrib/coccinelle/config_fn_ctx.pending.cocci b/contrib/coccinelle/config_fn_ctx.pending.cocci
new file mode 100644 (file)
index 0000000..6d3d100
--- /dev/null
@@ -0,0 +1,144 @@
+@ get_fn @
+identifier fn, R;
+@@
+(
+(
+git_config_from_file
+|
+git_config_from_file_with_options
+|
+git_config_from_mem
+|
+git_config_from_blob_oid
+|
+read_early_config
+|
+read_very_early_config
+|
+config_with_options
+|
+git_config
+|
+git_protected_config
+|
+config_from_gitmodules
+)
+  (fn, ...)
+|
+repo_config(R, fn, ...)
+)
+
+@ extends get_fn @
+identifier C1, C2, D;
+@@
+int fn(const char *C1, const char *C2,
++ const struct config_context *ctx,
+  void *D);
+
+@ extends get_fn @
+@@
+int fn(const char *, const char *,
++ const struct config_context *,
+  void *);
+
+@ extends get_fn @
+// Don't change fns that look like callback fns but aren't
+identifier fn2 != tar_filter_config && != git_diff_heuristic_config &&
+  != git_default_submodule_config && != git_color_config &&
+  != bundle_list_update && != parse_object_filter_config;
+identifier C1, C2, D1, D2, S;
+attribute name UNUSED;
+@@
+int fn(const char *C1, const char *C2,
++ const struct config_context *ctx,
+  void *D1) {
+<+...
+(
+fn2(C1, C2
++ , ctx
+, D2);
+|
+if(fn2(C1, C2
++ , ctx
+, D2) < 0) { ... }
+|
+return fn2(C1, C2
++ , ctx
+, D2);
+|
+S = fn2(C1, C2
++ , ctx
+, D2);
+)
+...+>
+  }
+
+@ extends get_fn@
+identifier C1, C2, D;
+attribute name UNUSED;
+@@
+int fn(const char *C1, const char *C2,
++ const struct config_context *ctx UNUSED,
+  void *D) {...}
+
+
+// The previous rules don't catch all callbacks, especially if they're defined
+// in a separate file from the git_config() call. Fix these manually.
+@@
+identifier C1, C2, D;
+attribute name UNUSED;
+@@
+int
+(
+git_ident_config
+|
+urlmatch_collect_fn
+|
+write_one_config
+|
+forbid_remote_url
+|
+credential_config_callback
+)
+  (const char *C1, const char *C2,
++ const struct config_context *ctx UNUSED,
+  void *D) {...}
+
+@@
+identifier C1, C2, D, D2, S, fn2;
+@@
+int
+(
+http_options
+|
+git_status_config
+|
+git_commit_config
+|
+git_default_core_config
+|
+grep_config
+)
+  (const char *C1, const char *C2,
++ const struct config_context *ctx,
+  void *D) {
+<+...
+(
+fn2(C1, C2
++ , ctx
+, D2);
+|
+if(fn2(C1, C2
++ , ctx
+, D2) < 0) { ... }
+|
+return fn2(C1, C2
++ , ctx
+, D2);
+|
+S = fn2(C1, C2
++ , ctx
+, D2);
+)
+...+>
+  }
diff --git a/contrib/coccinelle/git_config_number.cocci b/contrib/coccinelle/git_config_number.cocci
new file mode 100644 (file)
index 0000000..7b57dce
--- /dev/null
@@ -0,0 +1,27 @@
+@@
+identifier C1, C2, C3;
+@@
+(
+(
+git_config_int
+|
+git_config_int64
+|
+git_config_ulong
+|
+git_config_ssize_t
+)
+  (C1, C2
++ , ctx->kvi
+  )
+|
+(
+git_configset_get_value
+|
+git_config_bool_or_int
+)
+  (C1, C2
++ , ctx->kvi
+ , C3
+  )
+)
diff --git a/contrib/coccinelle/tests/unused.c b/contrib/coccinelle/tests/unused.c
deleted file mode 100644 (file)
index 8294d73..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-void test_strbuf(void)
-{
-       struct strbuf sb1 = STRBUF_INIT;
-       struct strbuf sb2 = STRBUF_INIT;
-       struct strbuf sb3 = STRBUF_INIT;
-       struct strbuf sb4 = STRBUF_INIT;
-       struct strbuf sb5;
-       struct strbuf sb6 = { 0 };
-       struct strbuf sb7 = STRBUF_INIT;
-       struct strbuf sb8 = STRBUF_INIT;
-       struct strbuf *sp1;
-       struct strbuf *sp2;
-       struct strbuf *sp3;
-       struct strbuf *sp4 = xmalloc(sizeof(struct strbuf));
-       struct strbuf *sp5 = xmalloc(sizeof(struct strbuf));
-       struct strbuf *sp6 = xmalloc(sizeof(struct strbuf));
-       struct strbuf *sp7;
-
-       strbuf_init(&sb5, 0);
-       strbuf_init(sp1, 0);
-       strbuf_init(sp2, 0);
-       strbuf_init(sp3, 0);
-       strbuf_init(sp4, 0);
-       strbuf_init(sp5, 0);
-       strbuf_init(sp6, 0);
-       strbuf_init(sp7, 0);
-       sp7 = xmalloc(sizeof(struct strbuf));
-
-       use_before(&sb3);
-       use_as_str("%s", sb7.buf);
-       use_as_str("%s", sp1->buf);
-       use_as_str("%s", sp6->buf);
-       pass_pp(&sp3);
-
-       strbuf_release(&sb1);
-       strbuf_reset(&sb2);
-       strbuf_release(&sb3);
-       strbuf_release(&sb4);
-       strbuf_release(&sb5);
-       strbuf_release(&sb6);
-       strbuf_release(&sb7);
-       strbuf_release(sp1);
-       strbuf_release(sp2);
-       strbuf_release(sp3);
-       strbuf_release(sp4);
-       strbuf_release(sp5);
-       strbuf_release(sp6);
-       strbuf_release(sp7);
-
-       use_after(&sb4);
-
-       if (when_strict())
-               return;
-       strbuf_release(&sb8);
-}
-
-void test_other(void)
-{
-       struct string_list l = STRING_LIST_INIT_DUP;
-       struct strbuf sb = STRBUF_INIT;
-
-       string_list_clear(&l, 0);
-       string_list_clear(&sb, 0);
-}
-
-void test_worktrees(void)
-{
-       struct worktree **w1 = get_worktrees();
-       struct worktree **w2 = get_worktrees();
-       struct worktree **w3;
-       struct worktree **w4;
-
-       w3 = get_worktrees();
-       w4 = get_worktrees();
-
-       use_it(w4);
-
-       free_worktrees(w1);
-       free_worktrees(w2);
-       free_worktrees(w3);
-       free_worktrees(w4);
-}
diff --git a/contrib/coccinelle/tests/unused.res b/contrib/coccinelle/tests/unused.res
deleted file mode 100644 (file)
index 6d3e745..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-void test_strbuf(void)
-{
-       struct strbuf sb3 = STRBUF_INIT;
-       struct strbuf sb4 = STRBUF_INIT;
-       struct strbuf sb7 = STRBUF_INIT;
-       struct strbuf *sp1;
-       struct strbuf *sp3;
-       struct strbuf *sp6 = xmalloc(sizeof(struct strbuf));
-       strbuf_init(sp1, 0);
-       strbuf_init(sp3, 0);
-       strbuf_init(sp6, 0);
-
-       use_before(&sb3);
-       use_as_str("%s", sb7.buf);
-       use_as_str("%s", sp1->buf);
-       use_as_str("%s", sp6->buf);
-       pass_pp(&sp3);
-
-       strbuf_release(&sb3);
-       strbuf_release(&sb4);
-       strbuf_release(&sb7);
-       strbuf_release(sp1);
-       strbuf_release(sp3);
-       strbuf_release(sp6);
-
-       use_after(&sb4);
-
-       if (when_strict())
-               return;
-}
-
-void test_other(void)
-{
-}
-
-void test_worktrees(void)
-{
-       struct worktree **w4;
-
-       w4 = get_worktrees();
-
-       use_it(w4);
-
-       free_worktrees(w4);
-}
diff --git a/contrib/coccinelle/unused.cocci b/contrib/coccinelle/unused.cocci
deleted file mode 100644 (file)
index d84046f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// This rule finds sequences of "unused" declerations and uses of a
-// variable, where "unused" is defined to include only calling the
-// equivalent of alloc, init & free functions on the variable.
-@@
-type T;
-identifier I;
-// STRBUF_INIT, but also e.g. STRING_LIST_INIT_DUP (so no anchoring)
-constant INIT_MACRO =~ "_INIT";
-identifier MALLOC1 =~ "^x?[mc]alloc$";
-identifier INIT_ASSIGN1 =~ "^get_worktrees$";
-identifier INIT_CALL1 =~ "^[a-z_]*_init$";
-identifier REL1 =~ "^[a-z_]*_(release|reset|clear|free)$";
-identifier REL2 =~ "^(release|clear|free)_[a-z_]*$";
-@@
-
-(
-- T I;
-|
-- T I = { 0 };
-|
-- T I = INIT_MACRO;
-|
-- T I = MALLOC1(...);
-|
-- T I = INIT_ASSIGN1(...);
-)
-
-<... when != \( I \| &I \)
-(
-- \( INIT_CALL1 \)( \( I \| &I \), ...);
-|
-- I = \( INIT_ASSIGN1 \)(...);
-|
-- I = MALLOC1(...);
-)
-...>
-
-(
-- \( REL1 \| REL2 \)( \( I \| &I \), ...);
-|
-- \( REL1 \| REL2 \)( \( &I \| I \) );
-)
-  ... when != \( I \| &I \)
index dc95c34cc853557efd2a59a33825f834e8d934cf..133ec92bfae72186721b4a51c50922f6d542be80 100644 (file)
@@ -767,7 +767,7 @@ __git_refs ()
                        track=""
                        ;;
                *)
-                       for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD; do
+                       for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD REVERT_HEAD BISECT_HEAD AUTO_MERGE; do
                                case "$i" in
                                $match*|$umatch*)
                                        if [ -e "$dir/$i" ]; then
@@ -1733,32 +1733,44 @@ __git_color_moved_opts="no default plain blocks zebra dimmed-zebra"
 __git_color_moved_ws_opts="no ignore-space-at-eol ignore-space-change
                        ignore-all-space allow-indentation-change"
 
+__git_ws_error_highlight_opts="context old new all default"
+
+# Options for the diff machinery (diff, log, show, stash, range-diff, ...)
 __git_diff_common_options="--stat --numstat --shortstat --summary
                        --patch-with-stat --name-only --name-status --color
                        --no-color --color-words --no-renames --check
                        --color-moved --color-moved= --no-color-moved
                        --color-moved-ws= --no-color-moved-ws
                        --full-index --binary --abbrev --diff-filter=
+                       --find-copies --find-object --find-renames
+                       --no-relative --relative
                        --find-copies-harder --ignore-cr-at-eol
                        --text --ignore-space-at-eol --ignore-space-change
                        --ignore-all-space --ignore-blank-lines --exit-code
-                       --quiet --ext-diff --no-ext-diff
+                       --quiet --ext-diff --no-ext-diff --unified=
                        --no-prefix --src-prefix= --dst-prefix=
-                       --inter-hunk-context=
+                       --inter-hunk-context= --function-context
                        --patience --histogram --minimal
                        --raw --word-diff --word-diff-regex=
                        --dirstat --dirstat= --dirstat-by-file
                        --dirstat-by-file= --cumulative
-                       --diff-algorithm=
+                       --diff-algorithm= --default-prefix
                        --submodule --submodule= --ignore-submodules
                        --indent-heuristic --no-indent-heuristic
-                       --textconv --no-textconv
-                       --patch --no-patch
-                       --anchored=
+                       --textconv --no-textconv --break-rewrites
+                       --patch --no-patch --cc --combined-all-paths
+                       --anchored= --compact-summary --ignore-matching-lines=
+                       --irreversible-delete --line-prefix --no-stat
+                       --output= --output-indicator-context=
+                       --output-indicator-new= --output-indicator-old=
+                       --ws-error-highlight=
+                       --pickaxe-all --pickaxe-regex
 "
 
-__git_diff_difftool_options="--cached --staged --pickaxe-all --pickaxe-regex
-                       --base --ours --theirs --no-index --relative --merge-base
+# Options for diff/difftool
+__git_diff_difftool_options="--cached --staged
+                       --base --ours --theirs --no-index --merge-base
+                       --ita-invisible-in-index --ita-visible-in-index
                        $__git_diff_common_options"
 
 _git_diff ()
@@ -1782,6 +1794,10 @@ _git_diff ()
                __gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}"
                return
                ;;
+       --ws-error-highlight=*)
+               __gitcomp "$__git_ws_error_highlight_opts" "" "${cur##--ws-error-highlight=}"
+               return
+               ;;
        --*)
                __gitcomp "$__git_diff_difftool_options"
                return
@@ -2024,6 +2040,12 @@ __git_log_shortlog_options="
        --author= --committer= --grep=
        --all-match --invert-grep
 "
+# Options accepted by log and show
+__git_log_show_options="
+       --diff-merges --diff-merges= --no-diff-merges --remerge-diff
+"
+
+__git_diff_merges_opts="off none on first-parent 1 separate m combined c dense-combined cc remerge r"
 
 __git_log_pretty_formats="oneline short medium full fuller reference email raw format: tformat: mboxrd"
 __git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default human raw unix auto: format:"
@@ -2072,15 +2094,24 @@ _git_log ()
                __gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
                return
                ;;
+       --ws-error-highlight=*)
+               __gitcomp "$__git_ws_error_highlight_opts" "" "${cur##--ws-error-highlight=}"
+               return
+               ;;
        --no-walk=*)
                __gitcomp "sorted unsorted" "" "${cur##--no-walk=}"
                return
                ;;
+       --diff-merges=*)
+                __gitcomp "$__git_diff_merges_opts" "" "${cur##--diff-merges=}"
+                return
+                ;;
        --*)
                __gitcomp "
                        $__git_log_common_options
                        $__git_log_shortlog_options
                        $__git_log_gitk_options
+                       $__git_log_show_options
                        --root --topo-order --date-order --reverse
                        --follow --full-diff
                        --abbrev-commit --no-abbrev-commit --abbrev=
@@ -2097,7 +2128,6 @@ _git_log ()
                        --expand-tabs --expand-tabs= --no-expand-tabs
                        $merge
                        $__git_diff_common_options
-                       --pickaxe-all --pickaxe-regex
                        "
                return
                ;;
@@ -2992,10 +3022,19 @@ _git_show ()
                __gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}"
                return
                ;;
+       --ws-error-highlight=*)
+               __gitcomp "$__git_ws_error_highlight_opts" "" "${cur##--ws-error-highlight=}"
+               return
+               ;;
+       --diff-merges=*)
+                __gitcomp "$__git_diff_merges_opts" "" "${cur##--diff-merges=}"
+                return
+                ;;
        --*)
                __gitcomp "--pretty= --format= --abbrev-commit --no-abbrev-commit
                        --oneline --show-signature
                        --expand-tabs --expand-tabs= --no-expand-tabs
+                       $__git_log_show_options
                        $__git_diff_common_options
                        "
                return
index 76ee4ab1e54965f6bf02afb5b562eb327d66ebac..2c030050aea1c67472570a9d86d69d55e31e7714 100644 (file)
@@ -298,7 +298,7 @@ __git_ps1_colorize_gitstring ()
 # variable, in that order.
 __git_eread ()
 {
-       test -r "$1" && IFS=$'\r\n' read "$2" <"$1"
+       test -r "$1" && IFS=$'\r\n' read -r "$2" <"$1"
 }
 
 # see if a cherry-pick or revert is in progress, if the user has committed a
diff --git a/contrib/credential/gnome-keyring/.gitignore b/contrib/credential/gnome-keyring/.gitignore
deleted file mode 100644 (file)
index 88d8fcd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-git-credential-gnome-keyring
diff --git a/contrib/credential/gnome-keyring/Makefile b/contrib/credential/gnome-keyring/Makefile
deleted file mode 100644 (file)
index 22c19df..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-MAIN:=git-credential-gnome-keyring
-all:: $(MAIN)
-
-CC = gcc
-RM = rm -f
-CFLAGS = -g -O2 -Wall
-PKG_CONFIG = pkg-config
-
--include ../../../config.mak.autogen
--include ../../../config.mak
-
-INCS:=$(shell $(PKG_CONFIG) --cflags gnome-keyring-1 glib-2.0)
-LIBS:=$(shell $(PKG_CONFIG) --libs gnome-keyring-1 glib-2.0)
-
-SRCS:=$(MAIN).c
-OBJS:=$(SRCS:.c=.o)
-
-%.o: %.c
-       $(CC) $(CFLAGS) $(CPPFLAGS) $(INCS) -o $@ -c $<
-
-$(MAIN): $(OBJS)
-       $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
-
-clean:
-       @$(RM) $(MAIN) $(OBJS)
diff --git a/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c b/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c
deleted file mode 100644 (file)
index 5927e27..0000000
+++ /dev/null
@@ -1,470 +0,0 @@
-/*
- * Copyright (C) 2011 John Szakmeister <john@szakmeister.net>
- *               2012 Philipp A. Hartmann <pah@qo.cx>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Credits:
- * - GNOME Keyring API handling originally written by John Szakmeister
- * - ported to credential helper API by Philipp A. Hartmann
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <gnome-keyring.h>
-
-#ifdef GNOME_KEYRING_DEFAULT
-
-   /* Modern gnome-keyring */
-
-#include <gnome-keyring-memory.h>
-
-#else
-
-   /*
-    * Support ancient gnome-keyring, circ. RHEL 5.X.
-    * GNOME_KEYRING_DEFAULT seems to have been introduced with Gnome 2.22,
-    * and the other features roughly around Gnome 2.20, 6 months before.
-    * Ubuntu 8.04 used Gnome 2.22 (I think).  Not sure any distro used 2.20.
-    * So the existence/non-existence of GNOME_KEYRING_DEFAULT seems like
-    * a decent thing to use as an indicator.
-    */
-
-#define GNOME_KEYRING_DEFAULT NULL
-
-/*
- * ancient gnome-keyring returns DENIED when an entry is not found.
- * Setting NO_MATCH to DENIED will prevent us from reporting DENIED
- * errors during get and erase operations, but we will still report
- * DENIED errors during a store.
- */
-#define GNOME_KEYRING_RESULT_NO_MATCH GNOME_KEYRING_RESULT_DENIED
-
-#define gnome_keyring_memory_alloc g_malloc
-#define gnome_keyring_memory_free gnome_keyring_free_password
-#define gnome_keyring_memory_strdup g_strdup
-
-static const char *gnome_keyring_result_to_message(GnomeKeyringResult result)
-{
-       switch (result) {
-       case GNOME_KEYRING_RESULT_OK:
-               return "OK";
-       case GNOME_KEYRING_RESULT_DENIED:
-               return "Denied";
-       case GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON:
-               return "No Keyring Daemon";
-       case GNOME_KEYRING_RESULT_ALREADY_UNLOCKED:
-               return "Already UnLocked";
-       case GNOME_KEYRING_RESULT_NO_SUCH_KEYRING:
-               return "No Such Keyring";
-       case GNOME_KEYRING_RESULT_BAD_ARGUMENTS:
-               return "Bad Arguments";
-       case GNOME_KEYRING_RESULT_IO_ERROR:
-               return "IO Error";
-       case GNOME_KEYRING_RESULT_CANCELLED:
-               return "Cancelled";
-       case GNOME_KEYRING_RESULT_ALREADY_EXISTS:
-               return "Already Exists";
-       default:
-               return "Unknown Error";
-       }
-}
-
-/*
- * Support really ancient gnome-keyring, circ. RHEL 4.X.
- * Just a guess for the Glib version.  Glib 2.8 was roughly Gnome 2.12 ?
- * Which was released with gnome-keyring 0.4.3 ??
- */
-#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 8
-
-static void gnome_keyring_done_cb(GnomeKeyringResult result, gpointer user_data)
-{
-       gpointer *data = (gpointer *)user_data;
-       int *done = (int *)data[0];
-       GnomeKeyringResult *r = (GnomeKeyringResult *)data[1];
-
-       *r = result;
-       *done = 1;
-}
-
-static void wait_for_request_completion(int *done)
-{
-       GMainContext *mc = g_main_context_default();
-       while (!*done)
-               g_main_context_iteration(mc, TRUE);
-}
-
-static GnomeKeyringResult gnome_keyring_item_delete_sync(const char *keyring, guint32 id)
-{
-       int done = 0;
-       GnomeKeyringResult result;
-       gpointer data[] = { &done, &result };
-
-       gnome_keyring_item_delete(keyring, id, gnome_keyring_done_cb, data,
-               NULL);
-
-       wait_for_request_completion(&done);
-
-       return result;
-}
-
-#endif
-#endif
-
-/*
- * This credential struct and API is simplified from git's credential.{h,c}
- */
-struct credential {
-       char *protocol;
-       char *host;
-       unsigned short port;
-       char *path;
-       char *username;
-       char *password;
-};
-
-#define CREDENTIAL_INIT { 0 }
-
-typedef int (*credential_op_cb)(struct credential *);
-
-struct credential_operation {
-       char *name;
-       credential_op_cb op;
-};
-
-#define CREDENTIAL_OP_END { NULL, NULL }
-
-/* ----------------- GNOME Keyring functions ----------------- */
-
-/* create a special keyring option string, if path is given */
-static char *keyring_object(struct credential *c)
-{
-       if (!c->path)
-               return NULL;
-
-       if (c->port)
-               return g_strdup_printf("%s:%hd/%s", c->host, c->port, c->path);
-
-       return g_strdup_printf("%s/%s", c->host, c->path);
-}
-
-static int keyring_get(struct credential *c)
-{
-       char *object = NULL;
-       GList *entries;
-       GnomeKeyringNetworkPasswordData *password_data;
-       GnomeKeyringResult result;
-
-       if (!c->protocol || !(c->host || c->path))
-               return EXIT_FAILURE;
-
-       object = keyring_object(c);
-
-       result = gnome_keyring_find_network_password_sync(
-                               c->username,
-                               NULL /* domain */,
-                               c->host,
-                               object,
-                               c->protocol,
-                               NULL /* authtype */,
-                               c->port,
-                               &entries);
-
-       g_free(object);
-
-       if (result == GNOME_KEYRING_RESULT_NO_MATCH)
-               return EXIT_SUCCESS;
-
-       if (result == GNOME_KEYRING_RESULT_CANCELLED)
-               return EXIT_SUCCESS;
-
-       if (result != GNOME_KEYRING_RESULT_OK) {
-               g_critical("%s", gnome_keyring_result_to_message(result));
-               return EXIT_FAILURE;
-       }
-
-       /* pick the first one from the list */
-       password_data = (GnomeKeyringNetworkPasswordData *)entries->data;
-
-       gnome_keyring_memory_free(c->password);
-       c->password = gnome_keyring_memory_strdup(password_data->password);
-
-       if (!c->username)
-               c->username = g_strdup(password_data->user);
-
-       gnome_keyring_network_password_list_free(entries);
-
-       return EXIT_SUCCESS;
-}
-
-
-static int keyring_store(struct credential *c)
-{
-       guint32 item_id;
-       char *object = NULL;
-       GnomeKeyringResult result;
-
-       /*
-        * Sanity check that what we are storing is actually sensible.
-        * In particular, we can't make a URL without a protocol field.
-        * Without either a host or pathname (depending on the scheme),
-        * we have no primary key. And without a username and password,
-        * we are not actually storing a credential.
-        */
-       if (!c->protocol || !(c->host || c->path) ||
-           !c->username || !c->password)
-               return EXIT_FAILURE;
-
-       object = keyring_object(c);
-
-       result = gnome_keyring_set_network_password_sync(
-                               GNOME_KEYRING_DEFAULT,
-                               c->username,
-                               NULL /* domain */,
-                               c->host,
-                               object,
-                               c->protocol,
-                               NULL /* authtype */,
-                               c->port,
-                               c->password,
-                               &item_id);
-
-       g_free(object);
-
-       if (result != GNOME_KEYRING_RESULT_OK &&
-           result != GNOME_KEYRING_RESULT_CANCELLED) {
-               g_critical("%s", gnome_keyring_result_to_message(result));
-               return EXIT_FAILURE;
-       }
-
-       return EXIT_SUCCESS;
-}
-
-static int keyring_erase(struct credential *c)
-{
-       char *object = NULL;
-       GList *entries;
-       GnomeKeyringNetworkPasswordData *password_data;
-       GnomeKeyringResult result;
-
-       /*
-        * Sanity check that we actually have something to match
-        * against. The input we get is a restrictive pattern,
-        * so technically a blank credential means "erase everything".
-        * But it is too easy to accidentally send this, since it is equivalent
-        * to empty input. So explicitly disallow it, and require that the
-        * pattern have some actual content to match.
-        */
-       if (!c->protocol && !c->host && !c->path && !c->username)
-               return EXIT_FAILURE;
-
-       object = keyring_object(c);
-
-       result = gnome_keyring_find_network_password_sync(
-                               c->username,
-                               NULL /* domain */,
-                               c->host,
-                               object,
-                               c->protocol,
-                               NULL /* authtype */,
-                               c->port,
-                               &entries);
-
-       g_free(object);
-
-       if (result == GNOME_KEYRING_RESULT_NO_MATCH)
-               return EXIT_SUCCESS;
-
-       if (result == GNOME_KEYRING_RESULT_CANCELLED)
-               return EXIT_SUCCESS;
-
-       if (result != GNOME_KEYRING_RESULT_OK) {
-               g_critical("%s", gnome_keyring_result_to_message(result));
-               return EXIT_FAILURE;
-       }
-
-       /* pick the first one from the list (delete all matches?) */
-       password_data = (GnomeKeyringNetworkPasswordData *)entries->data;
-
-       result = gnome_keyring_item_delete_sync(
-               password_data->keyring, password_data->item_id);
-
-       gnome_keyring_network_password_list_free(entries);
-
-       if (result != GNOME_KEYRING_RESULT_OK) {
-               g_critical("%s", gnome_keyring_result_to_message(result));
-               return EXIT_FAILURE;
-       }
-
-       return EXIT_SUCCESS;
-}
-
-/*
- * Table with helper operation callbacks, used by generic
- * credential helper main function.
- */
-static struct credential_operation const credential_helper_ops[] = {
-       { "get",   keyring_get },
-       { "store", keyring_store },
-       { "erase", keyring_erase },
-       CREDENTIAL_OP_END
-};
-
-/* ------------------ credential functions ------------------ */
-
-static void credential_init(struct credential *c)
-{
-       memset(c, 0, sizeof(*c));
-}
-
-static void credential_clear(struct credential *c)
-{
-       g_free(c->protocol);
-       g_free(c->host);
-       g_free(c->path);
-       g_free(c->username);
-       gnome_keyring_memory_free(c->password);
-
-       credential_init(c);
-}
-
-static int credential_read(struct credential *c)
-{
-       char *buf;
-       size_t line_len;
-       char *key;
-       char *value;
-
-       key = buf = gnome_keyring_memory_alloc(1024);
-
-       while (fgets(buf, 1024, stdin)) {
-               line_len = strlen(buf);
-
-               if (line_len && buf[line_len-1] == '\n')
-                       buf[--line_len] = '\0';
-
-               if (!line_len)
-                       break;
-
-               value = strchr(buf, '=');
-               if (!value) {
-                       g_warning("invalid credential line: %s", key);
-                       gnome_keyring_memory_free(buf);
-                       return -1;
-               }
-               *value++ = '\0';
-
-               if (!strcmp(key, "protocol")) {
-                       g_free(c->protocol);
-                       c->protocol = g_strdup(value);
-               } else if (!strcmp(key, "host")) {
-                       g_free(c->host);
-                       c->host = g_strdup(value);
-                       value = strrchr(c->host, ':');
-                       if (value) {
-                               *value++ = '\0';
-                               c->port = atoi(value);
-                       }
-               } else if (!strcmp(key, "path")) {
-                       g_free(c->path);
-                       c->path = g_strdup(value);
-               } else if (!strcmp(key, "username")) {
-                       g_free(c->username);
-                       c->username = g_strdup(value);
-               } else if (!strcmp(key, "password")) {
-                       gnome_keyring_memory_free(c->password);
-                       c->password = gnome_keyring_memory_strdup(value);
-                       while (*value)
-                               *value++ = '\0';
-               }
-               /*
-                * Ignore other lines; we don't know what they mean, but
-                * this future-proofs us when later versions of git do
-                * learn new lines, and the helpers are updated to match.
-                */
-       }
-
-       gnome_keyring_memory_free(buf);
-
-       return 0;
-}
-
-static void credential_write_item(FILE *fp, const char *key, const char *value)
-{
-       if (!value)
-               return;
-       fprintf(fp, "%s=%s\n", key, value);
-}
-
-static void credential_write(const struct credential *c)
-{
-       /* only write username/password, if set */
-       credential_write_item(stdout, "username", c->username);
-       credential_write_item(stdout, "password", c->password);
-}
-
-static void usage(const char *name)
-{
-       struct credential_operation const *try_op = credential_helper_ops;
-       const char *basename = strrchr(name, '/');
-
-       basename = (basename) ? basename + 1 : name;
-       fprintf(stderr, "usage: %s <", basename);
-       while (try_op->name) {
-               fprintf(stderr, "%s", (try_op++)->name);
-               if (try_op->name)
-                       fprintf(stderr, "%s", "|");
-       }
-       fprintf(stderr, "%s", ">\n");
-}
-
-int main(int argc, char *argv[])
-{
-       int ret = EXIT_SUCCESS;
-
-       struct credential_operation const *try_op = credential_helper_ops;
-       struct credential cred = CREDENTIAL_INIT;
-
-       if (!argv[1]) {
-               usage(argv[0]);
-               exit(EXIT_FAILURE);
-       }
-
-       g_set_application_name("Git Credential Helper");
-
-       /* lookup operation callback */
-       while (try_op->name && strcmp(argv[1], try_op->name))
-               try_op++;
-
-       /* unsupported operation given -- ignore silently */
-       if (!try_op->name || !try_op->op)
-               goto out;
-
-       ret = credential_read(&cred);
-       if (ret)
-               goto out;
-
-       /* perform credential operation */
-       ret = (*try_op->op)(&cred);
-
-       credential_write(&cred);
-
-out:
-       credential_clear(&cred);
-       return ret;
-}
diff --git a/contrib/credential/libsecret/.gitignore b/contrib/credential/libsecret/.gitignore
new file mode 100644 (file)
index 0000000..4fa2235
--- /dev/null
@@ -0,0 +1 @@
+git-credential-libsecret
index 2c5d76d789f0fabbdcd30d2684a4021b647731db..ef681f29d5ba12dd5c6f7f11baa42cb1e6aab7d5 100644 (file)
@@ -244,17 +244,16 @@ static void credential_clear(struct credential *c)
 
 static int credential_read(struct credential *c)
 {
-       char *buf;
-       size_t line_len;
+       char *buf = NULL;
+       size_t alloc;
+       ssize_t line_len;
        char *key;
        char *value;
 
-       key = buf = g_malloc(1024);
+       while ((line_len = getline(&buf, &alloc, stdin)) > 0) {
+               key = buf;
 
-       while (fgets(buf, 1024, stdin)) {
-               line_len = strlen(buf);
-
-               if (line_len && buf[line_len-1] == '\n')
+               if (buf[line_len-1] == '\n')
                        buf[--line_len] = '\0';
 
                if (!line_len)
@@ -298,7 +297,7 @@ static int credential_read(struct credential *c)
                 */
        }
 
-       g_free(buf);
+       free(buf);
 
        return 0;
 }
index e29cc28779dbb846de8446d4dce3a86dfe0ece5f..5f2e5f16c889ff278bc51553816c54acb41be21e 100644 (file)
@@ -113,14 +113,16 @@ static void add_internet_password(void)
 
 static void read_credential(void)
 {
-       char buf[1024];
+       char *buf = NULL;
+       size_t alloc;
+       ssize_t line_len;
 
-       while (fgets(buf, sizeof(buf), stdin)) {
+       while ((line_len = getline(&buf, &alloc, stdin)) > 0) {
                char *v;
 
                if (!strcmp(buf, "\n"))
                        break;
-               buf[strlen(buf)-1] = '\0';
+               buf[line_len-1] = '\0';
 
                v = strchr(buf, '=');
                if (!v)
@@ -165,6 +167,8 @@ static void read_credential(void)
                 * learn new lines, and the helpers are updated to match.
                 */
        }
+
+       free(buf);
 }
 
 int main(int argc, const char **argv)
index ead6e267c78120f06bfd2e74def8bbe2f4b66e50..96f10613aee29b7c360b25308927564df1551388 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <io.h>
 #include <fcntl.h>
+#include <wincred.h>
 
 /* common helpers */
 
@@ -33,65 +34,8 @@ static void *xmalloc(size_t size)
        return ret;
 }
 
-/* MinGW doesn't have wincred.h, so we need to define stuff */
-
-typedef struct _CREDENTIAL_ATTRIBUTEW {
-       LPWSTR Keyword;
-       DWORD  Flags;
-       DWORD  ValueSize;
-       LPBYTE Value;
-} CREDENTIAL_ATTRIBUTEW, *PCREDENTIAL_ATTRIBUTEW;
-
-typedef struct _CREDENTIALW {
-       DWORD                  Flags;
-       DWORD                  Type;
-       LPWSTR                 TargetName;
-       LPWSTR                 Comment;
-       FILETIME               LastWritten;
-       DWORD                  CredentialBlobSize;
-       LPBYTE                 CredentialBlob;
-       DWORD                  Persist;
-       DWORD                  AttributeCount;
-       PCREDENTIAL_ATTRIBUTEW Attributes;
-       LPWSTR                 TargetAlias;
-       LPWSTR                 UserName;
-} CREDENTIALW, *PCREDENTIALW;
-
-#define CRED_TYPE_GENERIC 1
-#define CRED_PERSIST_LOCAL_MACHINE 2
-#define CRED_MAX_ATTRIBUTES 64
-
-typedef BOOL (WINAPI *CredWriteWT)(PCREDENTIALW, DWORD);
-typedef BOOL (WINAPI *CredEnumerateWT)(LPCWSTR, DWORD, DWORD *,
-    PCREDENTIALW **);
-typedef VOID (WINAPI *CredFreeT)(PVOID);
-typedef BOOL (WINAPI *CredDeleteWT)(LPCWSTR, DWORD, DWORD);
-
-static HMODULE advapi;
-static CredWriteWT CredWriteW;
-static CredEnumerateWT CredEnumerateW;
-static CredFreeT CredFree;
-static CredDeleteWT CredDeleteW;
-
-static void load_cred_funcs(void)
-{
-       /* load DLLs */
-       advapi = LoadLibraryExA("advapi32.dll", NULL,
-                               LOAD_LIBRARY_SEARCH_SYSTEM32);
-       if (!advapi)
-               die("failed to load advapi32.dll");
-
-       /* get function pointers */
-       CredWriteW = (CredWriteWT)GetProcAddress(advapi, "CredWriteW");
-       CredEnumerateW = (CredEnumerateWT)GetProcAddress(advapi,
-           "CredEnumerateW");
-       CredFree = (CredFreeT)GetProcAddress(advapi, "CredFree");
-       CredDeleteW = (CredDeleteWT)GetProcAddress(advapi, "CredDeleteW");
-       if (!CredWriteW || !CredEnumerateW || !CredFree || !CredDeleteW)
-               die("failed to load functions");
-}
-
-static WCHAR *wusername, *password, *protocol, *host, *path, target[1024];
+static WCHAR *wusername, *password, *protocol, *host, *path, target[1024],
+       *password_expiry_utc;
 
 static void write_item(const char *what, LPCWSTR wbuf, int wlen)
 {
@@ -183,6 +127,7 @@ static void get_credential(void)
        CREDENTIALW **creds;
        DWORD num_creds;
        int i;
+       CREDENTIAL_ATTRIBUTEW *attr;
 
        if (!CredEnumerateW(L"git:*", 0, &num_creds, &creds))
                return;
@@ -195,6 +140,14 @@ static void get_credential(void)
                        write_item("password",
                                (LPCWSTR)creds[i]->CredentialBlob,
                                creds[i]->CredentialBlobSize / sizeof(WCHAR));
+                       for (int j = 0; j < creds[i]->AttributeCount; j++) {
+                               attr = creds[i]->Attributes + j;
+                               if (!wcscmp(attr->Keyword, L"git_password_expiry_utc")) {
+                                       write_item("password_expiry_utc", (LPCWSTR)attr->Value,
+                                       attr->ValueSize / sizeof(WCHAR));
+                                       break;
+                               }
+                       }
                        break;
                }
 
@@ -204,6 +157,7 @@ static void get_credential(void)
 static void store_credential(void)
 {
        CREDENTIALW cred;
+       CREDENTIAL_ATTRIBUTEW expiry_attr;
 
        if (!wusername || !password)
                return;
@@ -217,6 +171,14 @@ static void store_credential(void)
        cred.Persist = CRED_PERSIST_LOCAL_MACHINE;
        cred.AttributeCount = 0;
        cred.Attributes = NULL;
+       if (password_expiry_utc != NULL) {
+               expiry_attr.Keyword = L"git_password_expiry_utc";
+               expiry_attr.Value = (LPVOID)password_expiry_utc;
+               expiry_attr.ValueSize = (wcslen(password_expiry_utc)) * sizeof(WCHAR);
+               expiry_attr.Flags = 0;
+               cred.Attributes = &expiry_attr;
+               cred.AttributeCount = 1;
+       }
        cred.TargetAlias = NULL;
        cred.UserName = wusername;
 
@@ -249,17 +211,28 @@ static WCHAR *utf8_to_utf16_dup(const char *str)
        return wstr;
 }
 
+#define KB (1024)
+
 static void read_credential(void)
 {
-       char buf[1024];
+       size_t alloc = 100 * KB;
+       char *buf = calloc(alloc, sizeof(*buf));
 
-       while (fgets(buf, sizeof(buf), stdin)) {
+       while (fgets(buf, alloc, stdin)) {
                char *v;
-               int len = strlen(buf);
+               size_t len = strlen(buf);
+               int ends_in_newline = 0;
                /* strip trailing CR / LF */
-               while (len && strchr("\r\n", buf[len - 1]))
+               if (len && buf[len - 1] == '\n') {
+                       buf[--len] = 0;
+                       ends_in_newline = 1;
+               }
+               if (len && buf[len - 1] == '\r')
                        buf[--len] = 0;
 
+               if (!ends_in_newline)
+                       die("bad input: %s", buf);
+
                if (!*buf)
                        break;
 
@@ -278,12 +251,16 @@ static void read_credential(void)
                        wusername = utf8_to_utf16_dup(v);
                } else if (!strcmp(buf, "password"))
                        password = utf8_to_utf16_dup(v);
+               else if (!strcmp(buf, "password_expiry_utc"))
+                       password_expiry_utc = utf8_to_utf16_dup(v);
                /*
                 * Ignore other lines; we don't know what they mean, but
                 * this future-proofs us when later versions of git do
                 * learn new lines, and the helpers are updated to match.
                 */
        }
+
+       free(buf);
 }
 
 int main(int argc, char *argv[])
@@ -292,7 +269,7 @@ int main(int argc, char *argv[])
            "usage: git credential-wincred <get|store|erase>\n";
 
        if (!argv[1])
-               die(usage);
+               die("%s", usage);
 
        /* git use binary pipes to avoid CRLF-issues */
        _setmode(_fileno(stdin), _O_BINARY);
@@ -300,8 +277,6 @@ int main(int argc, char *argv[])
 
        read_credential();
 
-       load_cred_funcs();
-
        if (!protocol || !(host || path))
                return 0;
 
index 10c9c87839a4cf4e78fe8f270eac18d9942b783c..7db4c45676d304869bba126bd57e7f553aec2008 100755 (executable)
@@ -34,8 +34,8 @@ git subtree pull  --prefix=<prefix> <repository> <ref>
 git subtree push  --prefix=<prefix> <repository> <refspec>
 --
 h,help        show the help
-q             quiet
-d             show debug messages
+q,quiet       quiet
+d,debug       show debug messages
 P,prefix=     the name of the subdir to split out
  options for 'split' (also: 'push')
 annotate=     add a prefix to commit message of new commits
index da06e2f51cb0ff83b989106c32e94b5921de496c..a8870baff36a4a3042baf31c730793b45f6b6442 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1,17 +1,21 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
 #include "config.h"
+#include "convert.h"
+#include "copy.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "attr.h"
 #include "run-command.h"
 #include "quote.h"
+#include "read-cache-ll.h"
 #include "sigchain.h"
 #include "pkt-line.h"
 #include "sub-process.h"
+#include "trace.h"
 #include "utf8.h"
-#include "ll-merge.h"
-#include "wrapper.h"
+#include "merge-ll.h"
 
 /*
  * convert.c - convert a file when checking it out and checking it in.
@@ -629,23 +633,21 @@ static int filter_buffer_or_fd(int in UNUSED, int out, void *data)
         */
        struct child_process child_process = CHILD_PROCESS_INIT;
        struct filter_params *params = (struct filter_params *)data;
+       const char *format = params->cmd;
        int write_err, status;
 
        /* apply % substitution to cmd */
        struct strbuf cmd = STRBUF_INIT;
-       struct strbuf path = STRBUF_INIT;
-       struct strbuf_expand_dict_entry dict[] = {
-               { "f", NULL, },
-               { NULL, NULL, },
-       };
-
-       /* quote the path to preserve spaces, etc. */
-       sq_quote_buf(&path, params->path);
-       dict[0].value = path.buf;
 
-       /* expand all %f with the quoted path */
-       strbuf_expand(&cmd, params->cmd, strbuf_expand_dict_cb, &dict);
-       strbuf_release(&path);
+       /* expand all %f with the quoted path; quote to preserve space, etc. */
+       while (strbuf_expand_step(&cmd, &format)) {
+               if (skip_prefix(format, "%", &format))
+                       strbuf_addch(&cmd, '%');
+               else if (skip_prefix(format, "f", &format))
+                       sq_quote_buf(&cmd, params->path);
+               else
+                       strbuf_addch(&cmd, '%');
+       }
 
        strvec_push(&child_process.args, cmd.buf);
        child_process.use_shell = 1;
@@ -1011,7 +1013,9 @@ static int apply_filter(const char *path, const char *src, size_t len,
        return 0;
 }
 
-static int read_convert_config(const char *var, const char *value, void *cb UNUSED)
+static int read_convert_config(const char *var, const char *value,
+                              const struct config_context *ctx UNUSED,
+                              void *cb UNUSED)
 {
        const char *key, *name;
        size_t namelen;
@@ -1311,7 +1315,7 @@ void convert_attrs(struct index_state *istate,
                git_config(read_convert_config, NULL);
        }
 
-       git_check_attr(istate, NULL, path, check);
+       git_check_attr(istate, path, check);
        ccheck = check->items;
        ca->crlf_action = git_path_check_crlf(ccheck + 4);
        if (ca->crlf_action == CRLF_UNDEFINED)
index 0a6e4086b8f93257df513a20a4cc55062d218212..d925589444b90a11058abe87286df3d5add592f8 100644 (file)
--- a/convert.h
+++ b/convert.h
@@ -4,7 +4,7 @@
 #ifndef CONVERT_H
 #define CONVERT_H
 
-#include "hash.h"
+#include "hash-ll.h"
 #include "string-list.h"
 
 struct index_state;
diff --git a/copy.c b/copy.c
index c3250f08221b338e3843f5aa72f42f973beb1a38..23d84c6c1db554bcc7a33804d58821dfb3fb7634 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -1,5 +1,6 @@
-#include "cache.h"
-#include "wrapper.h"
+#include "git-compat-util.h"
+#include "copy.h"
+#include "path.h"
 
 int copy_fd(int ifd, int ofd)
 {
diff --git a/copy.h b/copy.h
new file mode 100644 (file)
index 0000000..2af77cb
--- /dev/null
+++ b/copy.h
@@ -0,0 +1,10 @@
+#ifndef COPY_H
+#define COPY_H
+
+#define COPY_READ_ERROR (-2)
+#define COPY_WRITE_ERROR (-3)
+int copy_fd(int ifd, int ofd);
+int copy_file(const char *dst, const char *src, int mode);
+int copy_file_with_time(const char *dst, const char *src, int mode);
+
+#endif /* COPY_H */
index e6417bf88046e3afc28bc66460efc626e523ffd2..d6647541634f3850ea147cebc681a5944d8e5ee9 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
 #include "credential.h"
@@ -8,6 +8,7 @@
 #include "url.h"
 #include "prompt.h"
 #include "sigchain.h"
+#include "strbuf.h"
 #include "urlmatch.h"
 #include "git-compat-util.h"
 
@@ -24,6 +25,7 @@ void credential_clear(struct credential *c)
        free(c->path);
        free(c->username);
        free(c->password);
+       free(c->oauth_refresh_token);
        string_list_clear(&c->helpers, 0);
        strvec_clear(&c->wwwauth_headers);
 
@@ -31,13 +33,14 @@ void credential_clear(struct credential *c)
 }
 
 int credential_match(const struct credential *want,
-                    const struct credential *have)
+                    const struct credential *have, int match_password)
 {
 #define CHECK(x) (!want->x || (have->x && !strcmp(want->x, have->x)))
        return CHECK(protocol) &&
               CHECK(host) &&
               CHECK(path) &&
-              CHECK(username);
+              CHECK(username) &&
+              (!match_password || CHECK(password));
 #undef CHECK
 }
 
@@ -46,6 +49,7 @@ static int credential_from_potentially_partial_url(struct credential *c,
                                                   const char *url);
 
 static int credential_config_callback(const char *var, const char *value,
+                                     const struct config_context *ctx UNUSED,
                                      void *data)
 {
        struct credential *c = data;
@@ -100,7 +104,7 @@ static int match_partial_url(const char *url, void *cb)
                warning(_("skipping credential lookup for key: credential.%s"),
                        url);
        else
-               matches = credential_match(&want, c);
+               matches = credential_match(&want, c, 0);
        credential_clear(&want);
 
        return matches;
@@ -238,11 +242,16 @@ int credential_read(struct credential *c, FILE *fp)
                } else if (!strcmp(key, "path")) {
                        free(c->path);
                        c->path = xstrdup(value);
+               } else if (!strcmp(key, "wwwauth[]")) {
+                       strvec_push(&c->wwwauth_headers, value);
                } else if (!strcmp(key, "password_expiry_utc")) {
                        errno = 0;
                        c->password_expiry_utc = parse_timestamp(value, NULL, 10);
                        if (c->password_expiry_utc == 0 || errno == ERANGE)
                                c->password_expiry_utc = TIME_MAX;
+               } else if (!strcmp(key, "oauth_refresh_token")) {
+                       free(c->oauth_refresh_token);
+                       c->oauth_refresh_token = xstrdup(value);
                } else if (!strcmp(key, "url")) {
                        credential_from_url(c, value);
                } else if (!strcmp(key, "quit")) {
@@ -278,6 +287,7 @@ void credential_write(const struct credential *c, FILE *fp)
        credential_write_item(fp, "path", c->path, 0);
        credential_write_item(fp, "username", c->username, 0);
        credential_write_item(fp, "password", c->password, 0);
+       credential_write_item(fp, "oauth_refresh_token", c->oauth_refresh_token, 0);
        if (c->password_expiry_utc != TIME_MAX) {
                char *s = xstrfmt("%"PRItime, c->password_expiry_utc);
                credential_write_item(fp, "password_expiry_utc", s, 0);
@@ -403,6 +413,7 @@ void credential_reject(struct credential *c)
 
        FREE_AND_NULL(c->username);
        FREE_AND_NULL(c->password);
+       FREE_AND_NULL(c->oauth_refresh_token);
        c->password_expiry_utc = TIME_MAX;
        c->approved = 0;
 }
index 2b5958cd431706026b243057cdb68f4274300703..acc41adf5481a21148a6b4797f9a8267feb5d8b6 100644 (file)
@@ -141,6 +141,7 @@ struct credential {
        char *protocol;
        char *host;
        char *path;
+       char *oauth_refresh_token;
        timestamp_t password_expiry_utc;
 };
 
@@ -210,6 +211,6 @@ void credential_from_url(struct credential *, const char *url);
 int credential_from_url_gently(struct credential *, const char *url, int quiet);
 
 int credential_match(const struct credential *want,
-                    const struct credential *have);
+                    const struct credential *have, int match_password);
 
 #endif /* CREDENTIAL_H */
index 82ae2973d30de5c3873df808f76935aed7405bc4..cd017132448d1ec340f137d6b882ee9bc420509a 100644 (file)
@@ -10,7 +10,7 @@
 #include "git-compat-util.h"
 #include "progress.h"
 #include "csum-file.h"
-#include "wrapper.h"
+#include "hash.h"
 
 static void verify_buffer_or_die(struct hashfile *f,
                                 const void *buf,
index 566e05cbd25a04be9977356e3cfb5a77637bf4c8..bc5bec27acbab4a3303f4ea11575b0c1accda806 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef CSUM_FILE_H
 #define CSUM_FILE_H
 
-#include "hash.h"
+#include "hash-ll.h"
 #include "write-or-die.h"
 
 struct progress;
diff --git a/ctype.c b/ctype.c
index fc0225cebd1a4b43654772270826e06fd941a128..345174555077984f695dba702593e08fbed95031 100644 (file)
--- a/ctype.c
+++ b/ctype.c
@@ -28,39 +28,3 @@ const unsigned char sane_ctype[256] = {
        A, A, A, A, A, A, A, A, A, A, A, R, R, U, P, X,         /* 112..127 */
        /* Nothing in the 128.. range */
 };
-
-/* For case-insensitive kwset */
-const unsigned char tolower_trans_tbl[256] = {
-       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
-        ' ',  '!',  '"',  '#',  '$',  '%',  '&', 0x27,
-        '(',  ')',  '*',  '+',  ',',  '-',  '.',  '/',
-        '0',  '1',  '2',  '3',  '4',  '5',  '6',  '7',
-        '8',  '9',  ':',  ';',  '<',  '=',  '>',  '?',
-        '@',  'a',  'b',  'c',  'd',  'e',  'f',  'g',
-        'h',  'i',  'j',  'k',  'l',  'm',  'n',  'o',
-        'p',  'q',  'r',  's',  't',  'u',  'v',  'w',
-        'x',  'y',  'z',  '[', 0x5c,  ']',  '^',  '_',
-        '`',  'a',  'b',  'c',  'd',  'e',  'f',  'g',
-        'h',  'i',  'j',  'k',  'l',  'm',  'n',  'o',
-        'p',  'q',  'r',  's',  't',  'u',  'v',  'w',
-        'x',  'y',  'z',  '{',  '|',  '}',  '~', 0x7f,
-       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
-       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
-       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
-       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
-       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
-       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
-       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
-       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
-       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
-       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
-       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
-       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
-       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-};
index db8a31a6ea2145a4c3c2a44caaa82d0ed9e9c278..f5e597114b671fc79cd0acf63c63e5ac427af8bf 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1,14 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
+#include "path.h"
 #include "pkt-line.h"
+#include "protocol.h"
 #include "run-command.h"
 #include "setup.h"
 #include "strbuf.h"
 #include "string-list.h"
-#include "wrapper.h"
 
 #ifdef NO_INITGROUPS
 #define initgroups(x, y) (0) /* nothing */
@@ -142,42 +142,6 @@ static void NORETURN daemon_die(const char *err, va_list params)
        exit(1);
 }
 
-struct expand_path_context {
-       const char *directory;
-       struct hostinfo *hostinfo;
-};
-
-static size_t expand_path(struct strbuf *sb, const char *placeholder, void *ctx)
-{
-       struct expand_path_context *context = ctx;
-       struct hostinfo *hi = context->hostinfo;
-
-       switch (placeholder[0]) {
-       case 'H':
-               strbuf_addbuf(sb, &hi->hostname);
-               return 1;
-       case 'C':
-               if (placeholder[1] == 'H') {
-                       strbuf_addstr(sb, get_canon_hostname(hi));
-                       return 2;
-               }
-               break;
-       case 'I':
-               if (placeholder[1] == 'P') {
-                       strbuf_addstr(sb, get_ip_address(hi));
-                       return 2;
-               }
-               break;
-       case 'P':
-               strbuf_addbuf(sb, &hi->tcp_port);
-               return 1;
-       case 'D':
-               strbuf_addstr(sb, context->directory);
-               return 1;
-       }
-       return 0;
-}
-
 static const char *path_ok(const char *directory, struct hostinfo *hi)
 {
        static char rpath[PATH_MAX];
@@ -221,10 +185,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
        }
        else if (interpolated_path && hi->saw_extended_args) {
                struct strbuf expanded_path = STRBUF_INIT;
-               struct expand_path_context context;
-
-               context.directory = directory;
-               context.hostinfo = hi;
+               const char *format = interpolated_path;
 
                if (*dir != '/') {
                        /* Allow only absolute */
@@ -232,8 +193,24 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
                        return NULL;
                }
 
-               strbuf_expand(&expanded_path, interpolated_path,
-                             expand_path, &context);
+               while (strbuf_expand_step(&expanded_path, &format)) {
+                       if (skip_prefix(format, "%", &format))
+                               strbuf_addch(&expanded_path, '%');
+                       else if (skip_prefix(format, "H", &format))
+                               strbuf_addbuf(&expanded_path, &hi->hostname);
+                       else if (skip_prefix(format, "CH", &format))
+                               strbuf_addstr(&expanded_path,
+                                             get_canon_hostname(hi));
+                       else if (skip_prefix(format, "IP", &format))
+                               strbuf_addstr(&expanded_path,
+                                             get_ip_address(hi));
+                       else if (skip_prefix(format, "P", &format))
+                               strbuf_addbuf(&expanded_path, &hi->tcp_port);
+                       else if (skip_prefix(format, "D", &format))
+                               strbuf_addstr(&expanded_path, directory);
+                       else
+                               strbuf_addch(&expanded_path, '%');
+               }
 
                rlen = strlcpy(interp_path, expanded_path.buf,
                               sizeof(interp_path));
diff --git a/date.c b/date.c
index 7c8650f79967a32d16f4e2a133b43ef0358eacb0..619ada5b20442046ef50a38d4e88136b14419a42 100644 (file)
--- a/date.c
+++ b/date.c
@@ -4,9 +4,11 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "date.h"
 #include "gettext.h"
+#include "pager.h"
+#include "strbuf.h"
 
 /*
  * This is like mktime, but without normalization of tm_wday and tm_yday.
index 71e79daa8259684f836f0addade83d644af91601..a5c43c0c1461761bb808b4d6b833222b181843a6 100644 (file)
@@ -3,7 +3,6 @@
  * data.
  */
 #include "git-compat-util.h"
-#include "hashmap.h"
 #include "object.h"
 #include "decorate.h"
 
index 40f2ccfb55049d434935d83e7494fdb281fe3ec4..5de5759f3f13da13465ec6c9bfa6abeb44ceaee3 100644 (file)
@@ -1,5 +1,4 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "attr.h"
 #include "object.h"
 #include "blob.h"
@@ -341,7 +340,9 @@ static void free_remote_islands(kh_str_t *remote_islands)
        kh_destroy_str(remote_islands);
 }
 
-static int island_config_callback(const char *k, const char *v, void *cb)
+static int island_config_callback(const char *k, const char *v,
+                                 const struct config_context *ctx UNUSED,
+                                 void *cb)
 {
        struct island_load_data *ild = cb;
 
index 50087f567062c4ff858bd6cae83fb3c59a0e4038..a87650b71bb095d403993486a7f2af6967be4d55 100755 (executable)
@@ -17,7 +17,15 @@ get_family() {
 }
 
 get_version() {
-       get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/'
+       # A string that begins with a digit up to the next SP
+       ver=$(get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/')
+
+       # There are known -variant suffixes that do not affect the
+       # meaning of the main version number.  Strip them.
+       ver=${ver%-win32}
+       ver=${ver%-posix}
+
+       echo "$ver"
 }
 
 print_flags() {
index f1aebf0b507fcdeeb311d2b8e2a42e6926fc10a3..8430064000bcba96506e4b9c99c9efe60ba072f4 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "diagnose.h"
 #include "compat/disk.h"
 #include "archive.h"
@@ -7,7 +7,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "strvec.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 #include "parse-options.h"
 #include "write-or-die.h"
index 4169dd8cb1329a55c7f47674ed694293185f0b2a..6b0c6a7180cc0432a7e919271dfad74405d30096 100644 (file)
@@ -1,18 +1,24 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "quote.h"
 #include "commit.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
+#include "object-name.h"
+#include "read-cache.h"
 #include "revision.h"
 #include "cache-tree.h"
 #include "unpack-trees.h"
 #include "refs.h"
+#include "repository.h"
 #include "submodule.h"
+#include "symlinks.h"
+#include "trace.h"
 #include "dir.h"
 #include "fsmonitor.h"
 #include "commit-reach.h"
@@ -666,8 +672,15 @@ int index_differs_from(struct repository *r,
        setup_revisions(0, NULL, &rev, &opt);
        rev.diffopt.flags.quick = 1;
        rev.diffopt.flags.exit_with_status = 1;
-       if (flags)
+       if (flags) {
                diff_flags_or(&rev.diffopt.flags, flags);
+               /*
+                * Now that flags are merged, honor override_submodule_config
+                * and ignore_submodules from passed flags.
+                */
+               if (flags->override_submodule_config)
+                       rev.diffopt.flags.ignore_submodules = flags->ignore_submodules;
+       }
        rev.diffopt.ita_invisible_in_index = ita_invisible_in_index;
        run_diff_index(&rev, 1);
        has_changes = rev.diffopt.flags.has_changes;
index 934a24bee5851ac0d3da1492d3deba6189402faf..4771cf02aa8588b9e7cb162c38e109e42332cf46 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2008 by Junio C Hamano
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "color.h"
 #include "commit.h"
@@ -41,42 +41,81 @@ static int read_directory_contents(const char *path, struct string_list *list)
  */
 static const char file_from_standard_input[] = "-";
 
-static int get_mode(const char *path, int *mode)
+/*
+ * For paths given on the command-line we treat "-" as stdin and named
+ * pipes and symbolic links to named pipes specially.
+ */
+enum special {
+       SPECIAL_NONE,
+       SPECIAL_STDIN,
+       SPECIAL_PIPE,
+};
+
+static int get_mode(const char *path, int *mode, enum special *special)
 {
        struct stat st;
 
-       if (!path || !strcmp(path, "/dev/null"))
+       if (!path || !strcmp(path, "/dev/null")) {
                *mode = 0;
 #ifdef GIT_WINDOWS_NATIVE
-       else if (!strcasecmp(path, "nul"))
+       } else if (!strcasecmp(path, "nul")) {
                *mode = 0;
 #endif
-       else if (path == file_from_standard_input)
+       } else if (path == file_from_standard_input) {
                *mode = create_ce_mode(0666);
-       else if (lstat(path, &st))
+               *special = SPECIAL_STDIN;
+       } else if (lstat(path, &st)) {
                return error("Could not access '%s'", path);
-       else
+       } else {
                *mode = st.st_mode;
+       }
+       /*
+        * For paths on the command-line treat named pipes and symbolic
+        * links that resolve to a named pipe specially.
+        */
+       if (special &&
+           (S_ISFIFO(*mode) ||
+            (S_ISLNK(*mode) && !stat(path, &st) && S_ISFIFO(st.st_mode)))) {
+               *mode = create_ce_mode(0666);
+               *special = SPECIAL_PIPE;
+       }
+
        return 0;
 }
 
-static int populate_from_stdin(struct diff_filespec *s)
+static void populate_common(struct diff_filespec *s, struct strbuf *buf)
 {
-       struct strbuf buf = STRBUF_INIT;
        size_t size = 0;
 
-       if (strbuf_read(&buf, 0, 0) < 0)
-               return error_errno("error while reading from stdin");
-
        s->should_munmap = 0;
-       s->data = strbuf_detach(&buf, &size);
+       s->data = strbuf_detach(buf, &size);
        s->size = size;
        s->should_free = 1;
        s->is_stdin = 1;
-       return 0;
 }
 
-static struct diff_filespec *noindex_filespec(const char *name, int mode)
+static void populate_from_pipe(struct diff_filespec *s)
+{
+       struct strbuf buf = STRBUF_INIT;
+       int fd = xopen(s->path, O_RDONLY);
+
+       if (strbuf_read(&buf, fd, 0) < 0)
+               die_errno("error while reading from '%s'", s->path);
+       close(fd);
+       populate_common(s, &buf);
+}
+
+static void populate_from_stdin(struct diff_filespec *s)
+{
+       struct strbuf buf = STRBUF_INIT;
+
+       if (strbuf_read(&buf, 0, 0) < 0)
+               die_errno("error while reading from stdin");
+       populate_common(s, &buf);
+}
+
+static struct diff_filespec *noindex_filespec(const char *name, int mode,
+                                             enum special special)
 {
        struct diff_filespec *s;
 
@@ -84,17 +123,22 @@ static struct diff_filespec *noindex_filespec(const char *name, int mode)
                name = "/dev/null";
        s = alloc_filespec(name);
        fill_filespec(s, null_oid(), 0, mode);
-       if (name == file_from_standard_input)
+       if (special == SPECIAL_STDIN)
                populate_from_stdin(s);
+       else if (special == SPECIAL_PIPE)
+               populate_from_pipe(s);
        return s;
 }
 
 static int queue_diff(struct diff_options *o,
-                     const char *name1, const char *name2)
+                     const char *name1, const char *name2, int recursing)
 {
        int mode1 = 0, mode2 = 0;
+       enum special special1 = SPECIAL_NONE, special2 = SPECIAL_NONE;
 
-       if (get_mode(name1, &mode1) || get_mode(name2, &mode2))
+       /* Paths can only be special if we're not recursing. */
+       if (get_mode(name1, &mode1, recursing ? NULL : &special1) ||
+           get_mode(name2, &mode2, recursing ? NULL : &special2))
                return -1;
 
        if (mode1 && mode2 && S_ISDIR(mode1) != S_ISDIR(mode2)) {
@@ -102,14 +146,14 @@ static int queue_diff(struct diff_options *o,
 
                if (S_ISDIR(mode1)) {
                        /* 2 is file that is created */
-                       d1 = noindex_filespec(NULL, 0);
-                       d2 = noindex_filespec(name2, mode2);
+                       d1 = noindex_filespec(NULL, 0, SPECIAL_NONE);
+                       d2 = noindex_filespec(name2, mode2, special2);
                        name2 = NULL;
                        mode2 = 0;
                } else {
                        /* 1 is file that is deleted */
-                       d1 = noindex_filespec(name1, mode1);
-                       d2 = noindex_filespec(NULL, 0);
+                       d1 = noindex_filespec(name1, mode1, special1);
+                       d2 = noindex_filespec(NULL, 0, SPECIAL_NONE);
                        name1 = NULL;
                        mode1 = 0;
                }
@@ -174,7 +218,7 @@ static int queue_diff(struct diff_options *o,
                                n2 = buffer2.buf;
                        }
 
-                       ret = queue_diff(o, n1, n2);
+                       ret = queue_diff(o, n1, n2, 1);
                }
                string_list_clear(&p1, 0);
                string_list_clear(&p2, 0);
@@ -190,8 +234,8 @@ static int queue_diff(struct diff_options *o,
                        SWAP(name1, name2);
                }
 
-               d1 = noindex_filespec(name1, mode1);
-               d2 = noindex_filespec(name2, mode2);
+               d1 = noindex_filespec(name1, mode1, special1);
+               d2 = noindex_filespec(name2, mode2, special2);
                diff_queue(&diff_queued_diff, d1, d2);
                return 0;
        }
@@ -216,13 +260,27 @@ static void append_basename(struct strbuf *path, const char *dir, const char *fi
  */
 static void fixup_paths(const char **path, struct strbuf *replacement)
 {
-       unsigned int isdir0, isdir1;
+       struct stat st;
+       unsigned int isdir0 = 0, isdir1 = 0;
+       unsigned int ispipe0 = 0, ispipe1 = 0;
+
+       if (path[0] != file_from_standard_input && !stat(path[0], &st)) {
+               isdir0 = S_ISDIR(st.st_mode);
+               ispipe0 = S_ISFIFO(st.st_mode);
+       }
+
+       if (path[1] != file_from_standard_input && !stat(path[1], &st)) {
+               isdir1 = S_ISDIR(st.st_mode);
+               ispipe1 = S_ISFIFO(st.st_mode);
+       }
+
+       if ((path[0] == file_from_standard_input && isdir1) ||
+           (isdir0 && path[1] == file_from_standard_input))
+               die(_("cannot compare stdin to a directory"));
+
+       if ((isdir0 && ispipe1) || (ispipe0 && isdir1))
+               die(_("cannot compare a named pipe to a directory"));
 
-       if (path[0] == file_from_standard_input ||
-           path[1] == file_from_standard_input)
-               return;
-       isdir0 = is_directory(path[0]);
-       isdir1 = is_directory(path[1]);
        if (isdir0 == isdir1)
                return;
        if (isdir0) {
@@ -296,7 +354,7 @@ int diff_no_index(struct rev_info *revs,
        setup_diff_pager(&revs->diffopt);
        revs->diffopt.flags.exit_with_status = 1;
 
-       if (queue_diff(&revs->diffopt, paths[0], paths[1]))
+       if (queue_diff(&revs->diffopt, paths[0], paths[1], 0))
                goto out;
        diff_set_mnemonic_prefix(&revs->diffopt, "1/", "2/");
        diffcore_std(&revs->diffopt);
diff --git a/diff.c b/diff.c
index 78b0fdd8caa2664337e25572abc2e698197357cc..ee3eb629e3dc5e3010342ed988678d9f0cedd0bd 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1,10 +1,11 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
+#include "base85.h"
 #include "config.h"
+#include "convert.h"
 #include "environment.h"
 #include "gettext.h"
 #include "tempfile.h"
 #include "attr.h"
 #include "run-command.h"
 #include "utf8.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "userdiff.h"
 #include "submodule-config.h"
 #include "submodule.h"
 #include "hashmap.h"
 #include "mem-pool.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "string-list.h"
 #include "strvec.h"
 #include "graph.h"
+#include "oid-array.h"
 #include "packfile.h"
+#include "pager.h"
 #include "parse-options.h"
 #include "help.h"
 #include "promisor-remote.h"
 #include "dir.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "strmap.h"
-#include "wrapper.h"
+#include "ws.h"
 
 #ifdef NO_FAST_WORKING_DIRECTORY
 #define FAST_WORKING_DIRECTORY 0
@@ -134,7 +140,7 @@ static int parse_dirstat_params(struct diff_options *options, const char *params
        int i;
 
        if (*params_copy)
-               string_list_split_in_place(&params, params_copy, ',', -1);
+               string_list_split_in_place(&params, params_copy, ",", -1);
        for (i = 0; i < params.nr; i++) {
                const char *p = params.items[i].string;
                if (!strcmp(p, "changes")) {
@@ -350,7 +356,8 @@ static unsigned parse_color_moved_ws(const char *arg)
        return ret;
 }
 
-int git_diff_ui_config(const char *var, const char *value, void *cb)
+int git_diff_ui_config(const char *var, const char *value,
+                      const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
                diff_use_color_default = git_config_colorbool(var, value);
@@ -371,13 +378,14 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
                return 0;
        }
        if (!strcmp(var, "diff.context")) {
-               diff_context_default = git_config_int(var, value);
+               diff_context_default = git_config_int(var, value, ctx->kvi);
                if (diff_context_default < 0)
                        return -1;
                return 0;
        }
        if (!strcmp(var, "diff.interhunkcontext")) {
-               diff_interhunk_context_default = git_config_int(var, value);
+               diff_interhunk_context_default = git_config_int(var, value,
+                                                               ctx->kvi);
                if (diff_interhunk_context_default < 0)
                        return -1;
                return 0;
@@ -403,7 +411,7 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
                return 0;
        }
        if (!strcmp(var, "diff.statgraphwidth")) {
-               diff_stat_graph_width = git_config_int(var, value);
+               diff_stat_graph_width = git_config_int(var, value, ctx->kvi);
                return 0;
        }
        if (!strcmp(var, "diff.external"))
@@ -433,15 +441,16 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
        if (git_color_config(var, value, cb) < 0)
                return -1;
 
-       return git_diff_basic_config(var, value, cb);
+       return git_diff_basic_config(var, value, ctx, cb);
 }
 
-int git_diff_basic_config(const char *var, const char *value, void *cb)
+int git_diff_basic_config(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb)
 {
        const char *name;
 
        if (!strcmp(var, "diff.renamelimit")) {
-               diff_rename_limit_default = git_config_int(var, value);
+               diff_rename_limit_default = git_config_int(var, value, ctx->kvi);
                return 0;
        }
 
@@ -488,7 +497,7 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
        if (git_diff_heuristic_config(var, value, cb) < 0)
                return -1;
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static char *quote_two(const char *one, const char *two)
@@ -3000,6 +3009,24 @@ static int dirstat_compare(const void *_a, const void *_b)
        return strcmp(a->name, b->name);
 }
 
+static void conclude_dirstat(struct diff_options *options,
+                            struct dirstat_dir *dir,
+                            unsigned long changed)
+{
+       struct dirstat_file *to_free = dir->files;
+
+       if (!changed) {
+               /* This can happen even with many files, if everything was renames */
+               ;
+       } else {
+               /* Show all directories with more than x% of the changes */
+               QSORT(dir->files, dir->nr, dirstat_compare);
+               gather_dirstat(options, dir, changed, "", 0);
+       }
+
+       free(to_free);
+}
+
 static void show_dirstat(struct diff_options *options)
 {
        int i;
@@ -3089,13 +3116,7 @@ found_damage:
                dir.nr++;
        }
 
-       /* This can happen even with many files, if everything was renames */
-       if (!changed)
-               return;
-
-       /* Show all directories with more than x% of the changes */
-       QSORT(dir.files, dir.nr, dirstat_compare);
-       gather_dirstat(options, &dir, changed, "", 0);
+       conclude_dirstat(options, &dir, changed);
 }
 
 static void show_dirstat_by_line(struct diffstat_t *data, struct diff_options *options)
@@ -3133,13 +3154,7 @@ static void show_dirstat_by_line(struct diffstat_t *data, struct diff_options *o
                dir.nr++;
        }
 
-       /* This can happen even with many files, if everything was renames */
-       if (!changed)
-               return;
-
-       /* Show all directories with more than x% of the changes */
-       QSORT(dir.files, dir.nr, dirstat_compare);
-       gather_dirstat(options, &dir, changed, "", 0);
+       conclude_dirstat(options, &dir, changed);
 }
 
 static void free_diffstat_file(struct diffstat_file *f)
@@ -4738,6 +4753,31 @@ unsigned diff_filter_bit(char status)
        return filter_bit[(int) status];
 }
 
+int diff_check_follow_pathspec(struct pathspec *ps, int die_on_error)
+{
+       unsigned forbidden_magic;
+
+       if (ps->nr != 1) {
+               if (die_on_error)
+                       die(_("--follow requires exactly one pathspec"));
+               return 0;
+       }
+
+       forbidden_magic = ps->items[0].magic & ~(PATHSPEC_FROMTOP |
+                                                PATHSPEC_LITERAL);
+       if (forbidden_magic) {
+               if (die_on_error) {
+                       struct strbuf sb = STRBUF_INIT;
+                       pathspec_magic_names(forbidden_magic, &sb);
+                       die(_("pathspec magic not supported by --follow: %s"),
+                           sb.buf);
+               }
+               return 0;
+       }
+
+       return 1;
+}
+
 void diff_setup_done(struct diff_options *options)
 {
        unsigned check_mask = DIFF_FORMAT_NAME |
@@ -4845,8 +4885,8 @@ void diff_setup_done(struct diff_options *options)
 
        options->diff_path_counter = 0;
 
-       if (options->flags.follow_renames && options->pathspec.nr != 1)
-               die(_("--follow requires exactly one pathspec"));
+       if (options->flags.follow_renames)
+               diff_check_follow_pathspec(&options->pathspec, 1);
 
        if (!options->use_color || external_diff())
                options->color_moved = 0;
@@ -4923,6 +4963,7 @@ static int diff_opt_stat(const struct option *opt, const char *value, int unset)
        } else
                BUG("%s should not get here", opt->long_name);
 
+       options->output_format &= ~DIFF_FORMAT_NO_OUTPUT;
        options->output_format |= DIFF_FORMAT_DIFFSTAT;
        options->stat_name_width = name_width;
        options->stat_graph_width = graph_width;
@@ -4942,6 +4983,7 @@ static int parse_dirstat_opt(struct diff_options *options, const char *params)
         * The caller knows a dirstat-related option is given from the command
         * line; allow it to say "return this_function();"
         */
+       options->output_format &= ~DIFF_FORMAT_NO_OUTPUT;
        options->output_format |= DIFF_FORMAT_DIRSTAT;
        return 1;
 }
@@ -5141,6 +5183,7 @@ static int diff_opt_compact_summary(const struct option *opt,
                options->flags.stat_with_summary = 0;
        } else {
                options->flags.stat_with_summary = 1;
+               options->output_format &= ~DIFF_FORMAT_NO_OUTPUT;
                options->output_format |= DIFF_FORMAT_DIFFSTAT;
        }
        return 0;
@@ -5478,6 +5521,10 @@ static int diff_opt_rotate_to(const struct option *opt, const char *arg, int uns
        return 0;
 }
 
+/*
+ * Consider adding new flags to __git_diff_common_options
+ * in contrib/completion/git-completion.bash
+ */
 struct option *add_diff_options(const struct option *opts,
                                struct diff_options *options)
 {
@@ -5486,9 +5533,8 @@ struct option *add_diff_options(const struct option *opts,
                OPT_BITOP('p', "patch", &options->output_format,
                          N_("generate patch"),
                          DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
-               OPT_BIT_F('s', "no-patch", &options->output_format,
-                         N_("suppress diff output"),
-                         DIFF_FORMAT_NO_OUTPUT, PARSE_OPT_NONEG),
+               OPT_SET_INT('s', "no-patch", &options->output_format,
+                           N_("suppress diff output"), DIFF_FORMAT_NO_OUTPUT),
                OPT_BITOP('u', NULL, &options->output_format,
                          N_("generate patch"),
                          DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
@@ -5497,9 +5543,9 @@ struct option *add_diff_options(const struct option *opts,
                               PARSE_OPT_NONEG | PARSE_OPT_OPTARG, diff_opt_unified),
                OPT_BOOL('W', "function-context", &options->flags.funccontext,
                         N_("generate diffs with <n> lines context")),
-               OPT_BIT_F(0, "raw", &options->output_format,
+               OPT_BITOP(0, "raw", &options->output_format,
                          N_("generate the diff in raw format"),
-                         DIFF_FORMAT_RAW, PARSE_OPT_NONEG),
+                         DIFF_FORMAT_RAW, DIFF_FORMAT_NO_OUTPUT),
                OPT_BITOP(0, "patch-with-raw", &options->output_format,
                          N_("synonym for '-p --raw'"),
                          DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW,
@@ -5508,12 +5554,12 @@ struct option *add_diff_options(const struct option *opts,
                          N_("synonym for '-p --stat'"),
                          DIFF_FORMAT_PATCH | DIFF_FORMAT_DIFFSTAT,
                          DIFF_FORMAT_NO_OUTPUT),
-               OPT_BIT_F(0, "numstat", &options->output_format,
+               OPT_BITOP(0, "numstat", &options->output_format,
                          N_("machine friendly --stat"),
-                         DIFF_FORMAT_NUMSTAT, PARSE_OPT_NONEG),
-               OPT_BIT_F(0, "shortstat", &options->output_format,
+                         DIFF_FORMAT_NUMSTAT, DIFF_FORMAT_NO_OUTPUT),
+               OPT_BITOP(0, "shortstat", &options->output_format,
                          N_("output only the last line of --stat"),
-                         DIFF_FORMAT_SHORTSTAT, PARSE_OPT_NONEG),
+                         DIFF_FORMAT_SHORTSTAT, DIFF_FORMAT_NO_OUTPUT),
                OPT_CALLBACK_F('X', "dirstat", options, N_("<param1,param2>..."),
                               N_("output the distribution of relative amount of changes for each sub-directory"),
                               PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
@@ -5529,9 +5575,9 @@ struct option *add_diff_options(const struct option *opts,
                OPT_BIT_F(0, "check", &options->output_format,
                          N_("warn if changes introduce conflict markers or whitespace errors"),
                          DIFF_FORMAT_CHECKDIFF, PARSE_OPT_NONEG),
-               OPT_BIT_F(0, "summary", &options->output_format,
+               OPT_BITOP(0, "summary", &options->output_format,
                          N_("condensed summary such as creations, renames and mode changes"),
-                         DIFF_FORMAT_SUMMARY, PARSE_OPT_NONEG),
+                         DIFF_FORMAT_SUMMARY, DIFF_FORMAT_NO_OUTPUT),
                OPT_BIT_F(0, "name-only", &options->output_format,
                          N_("show only names of changed files"),
                          DIFF_FORMAT_NAME, PARSE_OPT_NONEG),
diff --git a/diff.h b/diff.h
index 6a0737b9c3421eaeed7e7e6256d90e5fb07f1ede..260c454155a21af2c133fb78254fdafc20534f7f 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -4,11 +4,12 @@
 #ifndef DIFF_H
 #define DIFF_H
 
-#include "tree-walk.h"
+#include "hash-ll.h"
 #include "pathspec.h"
-#include "oidset.h"
 #include "strbuf.h"
 
+struct oidset;
+
 /**
  * The diff API is for programs that compare two sets of files (e.g. two trees,
  * one tree and the index) and present the found difference in various ways.
@@ -532,14 +533,24 @@ void free_diffstat_info(struct diffstat_t *diffstat);
 int parse_long_opt(const char *opt, const char **argv,
                   const char **optarg);
 
-int git_diff_basic_config(const char *var, const char *value, void *cb);
+struct config_context;
+int git_diff_basic_config(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb);
 int git_diff_heuristic_config(const char *var, const char *value, void *cb);
 void init_diff_ui_defaults(void);
-int git_diff_ui_config(const char *var, const char *value, void *cb);
+int git_diff_ui_config(const char *var, const char *value,
+                      const struct config_context *ctx, void *cb);
 void repo_diff_setup(struct repository *, struct diff_options *);
 struct option *add_diff_options(const struct option *, struct diff_options *);
 int diff_opt_parse(struct diff_options *, const char **, int, const char *);
 void diff_setup_done(struct diff_options *);
+
+/*
+ * Returns true if the pathspec can work with --follow mode. If die_on_error is
+ * set, die() with a specific error message rather than returning false.
+ */
+int diff_check_follow_pathspec(struct pathspec *ps, int die_on_error);
+
 int git_config_rename(const char *var, const char *value);
 
 #define DIFF_DETECT_RENAME     1
@@ -695,4 +706,6 @@ void print_stat_summary(FILE *fp, int files,
                        int insertions, int deletions);
 void setup_diff_pager(struct diff_options *);
 
+extern int diff_auto_refresh_index;
+
 #endif /* DIFF_H */
index 5462420bbbecceedd2366fc5506d4218230181c4..f57ece2757d46ea6dee3af34a476c5fdd9908b0d 100644 (file)
@@ -1,9 +1,11 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "hash.h"
+#include "object.h"
 #include "promisor-remote.h"
 
 static int should_break(struct repository *r,
index 57ccab284645693322301e59b07f6fceb62d6224..e7d20ebd2d1b45b073ac2825b9371986d305ee29 100644 (file)
@@ -5,6 +5,7 @@
 #include "gettext.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "wildmatch.h"
 
 static char **order;
 static int order_cnt;
index 13c98a7b5e7751c8db6a9d78575a9b76e0313f92..b195fa4eb3c045c030a47c84edcaa702e447c8f8 100644 (file)
@@ -7,6 +7,7 @@
 #include "diffcore.h"
 #include "xdiff-interface.h"
 #include "kwset.h"
+#include "oidset.h"
 #include "pretty.h"
 #include "quote.h"
 
index 8e2e7a3ad738468b1738661ab00627a05d6dd129..5a6e2bcac7147e487624c1bf53e1572a54b0d93d 100644 (file)
@@ -3,10 +3,9 @@
  * Copyright (C) 2005 Junio C Hamano
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "diff.h"
 #include "diffcore.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "hashmap.h"
 #include "mem-pool.h"
 #include "oid-array.h"
index 1701ed50b9c823ffc5f06b299b92eafc7ea477a3..5ffe4ec788f84044df42b13eb847dec1f4e1fd36 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef DIFFCORE_H
 #define DIFFCORE_H
 
-#include "hash.h"
+#include "hash-ll.h"
 
 struct diff_options;
 struct mem_pool;
index fb7c47f0e8a9516d17ded95d70e3dabaa61264bb..278b04243a3f40e63df433eea9549f90aed1c34d 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "dir.h"
 #include "iterator.h"
 #include "dir-iterator.h"
diff --git a/dir.c b/dir.c
index 18fd14c46b2f61ea300b2f26e864a0c929ad8c88..8486e4d56ff50cafd14aa3ef00ee89c069d87269 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -7,12 +7,15 @@
  */
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
+#include "convert.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "name-hash.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "attr.h"
 #include "refs.h"
 #include "wildmatch.h"
 #include "utf8.h"
 #include "varint.h"
 #include "ewah/ewok.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
+#include "read-cache-ll.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "submodule-config.h"
-#include "wrapper.h"
+#include "symlinks.h"
+#include "trace2.h"
+#include "tree.h"
 
 /*
  * Tells read_directory_recursive how a file or directory should be treated.
@@ -369,7 +376,7 @@ static int match_pathspec_item(struct index_state *istate,
                return 0;
 
        if (item->attr_match_nr &&
-           !match_pathspec_attrs(istate, name, namelen, item))
+           !match_pathspec_attrs(istate, name - prefix, namelen + prefix, item))
                return 0;
 
        /* If the match was just the prefix, we matched */
diff --git a/dir.h b/dir.h
index 3d6c87387e964311783bf749dafc450809b7d512..ad06682fd54b3e7ae47d6f8a8d80048da0324f01 100644 (file)
--- a/dir.h
+++ b/dir.h
@@ -1,11 +1,14 @@
 #ifndef DIR_H
 #define DIR_H
 
+#include "hash-ll.h"
 #include "hashmap.h"
 #include "pathspec.h"
 #include "statinfo.h"
 #include "strbuf.h"
 
+struct repository;
+
 /**
  * The directory listing API is used to enumerate paths in the work tree,
  * optionally taking `.git/info/exclude` and `.gitignore` files per directory
@@ -40,6 +43,8 @@
  *
  */
 
+struct repository;
+
 struct dir_entry {
        unsigned int len;
        char name[FLEX_ARRAY]; /* more */
@@ -640,4 +645,5 @@ static inline int starts_with_dot_dot_slash_native(const char *const path)
 
        return path_match_flags(path, what | PATH_MATCH_NATIVE);
 }
+
 #endif
index d632d7906608732a1059d197d7f06a62e1f55ed2..b67b802ddf8493ea25ccbb1fc5c046240bfe917d 100644 (file)
--- a/editor.c
+++ b/editor.c
@@ -1,8 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
+#include "advice.h"
 #include "config.h"
+#include "editor.h"
 #include "environment.h"
 #include "gettext.h"
+#include "pager.h"
+#include "path.h"
 #include "strbuf.h"
 #include "strvec.h"
 #include "run-command.h"
@@ -129,3 +133,31 @@ int launch_sequence_editor(const char *path, struct strbuf *buffer,
 {
        return launch_specified_editor(git_sequence_editor(), path, buffer, env);
 }
+
+int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
+                             const char *const *env)
+{
+       char *path2 = NULL;
+       int fd, res = 0;
+
+       if (!is_absolute_path(path))
+               path = path2 = xstrdup(git_path("%s", path));
+
+       fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+       if (fd < 0)
+               res = error_errno(_("could not open '%s' for writing"), path);
+       else if (write_in_full(fd, buffer->buf, buffer->len) < 0) {
+               res = error_errno(_("could not write to '%s'"), path);
+               close(fd);
+       } else if (close(fd) < 0)
+               res = error_errno(_("could not close '%s'"), path);
+       else {
+               strbuf_reset(buffer);
+               if (launch_editor(path, buffer, env) < 0)
+                       res = error_errno(_("could not edit '%s'"), path);
+               unlink(path);
+       }
+
+       free(path2);
+       return res;
+}
diff --git a/editor.h b/editor.h
new file mode 100644 (file)
index 0000000..8016bb5
--- /dev/null
+++ b/editor.h
@@ -0,0 +1,34 @@
+#ifndef EDITOR_H
+#define EDITOR_H
+
+struct strbuf;
+
+const char *git_editor(void);
+const char *git_sequence_editor(void);
+int is_terminal_dumb(void);
+
+/**
+ * Launch the user preferred editor to edit a file and fill the buffer
+ * with the file's contents upon the user completing their editing. The
+ * third argument can be used to set the environment which the editor is
+ * run in. If the buffer is NULL the editor is launched as usual but the
+ * file's contents are not read into the buffer upon completion.
+ */
+int launch_editor(const char *path, struct strbuf *buffer,
+                 const char *const *env);
+
+int launch_sequence_editor(const char *path, struct strbuf *buffer,
+                          const char *const *env);
+
+/*
+ * In contrast to `launch_editor()`, this function writes out the contents
+ * of the specified file first, then clears the `buffer`, then launches
+ * the editor and reads back in the file contents into the `buffer`.
+ * Finally, it deletes the temporary file.
+ *
+ * If `path` is relative, it refers to a file in the `.git` directory.
+ */
+int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
+                             const char *const *env);
+
+#endif
diff --git a/entry.c b/entry.c
index d89e61fa64196c41e67053ba8b527a7345b37b18..43767f9043c0cbb97ec3257fd78b0a985e5a8f77 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -1,17 +1,19 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "blob.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "name-hash.h"
+#include "sparse-index.h"
 #include "streaming.h"
 #include "submodule.h"
+#include "symlinks.h"
 #include "progress.h"
 #include "fsmonitor.h"
 #include "entry.h"
 #include "parallel-checkout.h"
-#include "wrapper.h"
 
 static void create_directories(const char *path, int path_len,
                               const struct checkout *state)
index 63c697e7e97cca35e52df3847bb017713f6940ef..f98d76f08047f14f49e9d3c3d1a4232c500efbf1 100644 (file)
@@ -7,9 +7,10 @@
  * even if you might want to know where the git directory etc
  * are.
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "branch.h"
+#include "convert.h"
 #include "environment.h"
 #include "gettext.h"
 #include "repository.h"
 #include "fmt-merge-msg.h"
 #include "commit.h"
 #include "strvec.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "replace-object.h"
 #include "tmp-objdir.h"
 #include "chdir-notify.h"
 #include "setup.h"
 #include "shallow.h"
-#include "wrapper.h"
+#include "trace.h"
 #include "write-or-die.h"
 
 int trust_executable_bit = 1;
@@ -39,7 +42,6 @@ int is_bare_repository_cfg = -1; /* unspecified */
 int warn_ambiguous_refs = 1;
 int warn_on_object_refname_ambiguity = 1;
 int repository_format_precious_objects;
-int repository_format_worktree_config;
 const char *git_commit_encoding;
 const char *git_log_output_encoding;
 char *apply_default_whitespace;
@@ -56,16 +58,13 @@ size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
 size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
 size_t delta_base_cache_limit = 96 * 1024 * 1024;
 unsigned long big_file_threshold = 512 * 1024 * 1024;
-int pager_use_color = 1;
 const char *editor_program;
 const char *askpass_program;
 const char *excludes_file;
 enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
-int read_replace_refs = 1;
 enum eol core_eol = EOL_UNSET;
 int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
 char *check_roundtrip_encoding = "SHIFT-JIS";
-unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
 enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
 enum rebase_setup_type autorebase = AUTOREBASE_NEVER;
 enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
@@ -74,7 +73,7 @@ enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
 #endif
 enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE;
 char *notes_ref_name;
-int grafts_replace_parents = 1;
+int grafts_keep_true_parents;
 int core_apply_sparse_checkout;
 int core_sparse_checkout_cone;
 int sparse_expect_files_outside_of_patterns;
@@ -109,7 +108,7 @@ char *git_work_tree_cfg;
 static char *git_namespace;
 
 /*
- * Repository-local GIT_* environment variables; see cache.h for details.
+ * Repository-local GIT_* environment variables; see environment.h for details.
  */
 const char * const local_repo_env[] = {
        ALTERNATE_DB_ENVIRONMENT,
@@ -183,7 +182,7 @@ void setup_git_env(const char *git_dir)
        strvec_clear(&to_free);
 
        if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
-               read_replace_refs = 0;
+               disable_replace_refs();
        replace_ref_base = getenv(GIT_REPLACE_REF_BASE_ENVIRONMENT);
        git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base
                                                          : "refs/replace/");
index a63f0c6a24f79703383826ecc68b30fdd014c2c3..c5377473c683390992315f69a63c557b25c655bb 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef ENVIRONMENT_H
 #define ENVIRONMENT_H
 
-#include "strvec.h"
-
 struct repository;
+struct strvec;
 
 /*
  * The character that begins a commented line in user-editable file
@@ -55,6 +54,7 @@ const char *getenv_safe(struct strvec *argv, const char *name);
 #define GIT_QUARANTINE_ENVIRONMENT "GIT_QUARANTINE_PATH"
 #define GIT_OPTIONAL_LOCKS_ENVIRONMENT "GIT_OPTIONAL_LOCKS"
 #define GIT_TEXT_DOMAIN_DIR_ENVIRONMENT "GIT_TEXTDOMAINDIR"
+#define GIT_ATTR_SOURCE_ENVIRONMENT "GIT_ATTR_SOURCE"
 
 /*
  * Environment variable used in handshaking the wire protocol.
@@ -193,10 +193,9 @@ extern enum object_creation_mode object_creation_mode;
 
 extern char *notes_ref_name;
 
-extern int grafts_replace_parents;
+extern int grafts_keep_true_parents;
 
 extern int repository_format_precious_objects;
-extern int repository_format_worktree_config;
 
 /*
  * Create a temporary file rooted in the object database directory, or
index 12d6aa398e907f83eeaee9e9635ccbf11220ce35..7b525b1ecd896e02dfa71cdf3aab75496d998fac 100644 (file)
@@ -17,7 +17,6 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "ewok.h"
 
 #define EWAH_MASK(x) ((eword_t)1 << (x % BITS_IN_EWORD))
index c6d4ffc87cacaaaefb3edf4f81f62f7481b4b742..8785cbc54a821cd2cb89ba0226a29a233d8c19ff 100644 (file)
@@ -17,7 +17,6 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "ewok.h"
 #include "ewok_rlw.h"
 
index fae0d4b244a9d37cafb8f984311b0259bf702898..1d597e84ea7f4c3c8296cbf527bf0c5514037e99 100644 (file)
@@ -1,10 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
+#include "path.h"
 #include "quote.h"
+#include "run-command.h"
 #include "strvec.h"
+#include "trace.h"
+#include "trace2.h"
 
 #if defined(RUNTIME_PREFIX)
 
index 368f2ed25a1c40f6ab55f0b1098a8722ce930c18..65c1ff4bb4fbcdf21b4b13cd427f7a764f60d237 100644 (file)
@@ -1,7 +1,7 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "repository.h"
 #include "config.h"
+#include "date.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "remote.h"
 #include "run-command.h"
 #include "connect.h"
+#include "trace2.h"
 #include "transport.h"
 #include "version.h"
 #include "oid-array.h"
 #include "oidset.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "connected.h"
 #include "fetch-negotiator.h"
 #include "fsck.h"
@@ -31,7 +33,6 @@
 #include "commit-graph.h"
 #include "sigchain.h"
 #include "mergesort.h"
-#include "wrapper.h"
 
 static int transfer_unpack_limit = -1;
 static int fetch_unpack_limit = -1;
@@ -1099,7 +1100,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
        struct ref *ref = copy_ref_list(orig_ref);
        struct object_id oid;
        const char *agent_feature;
-       int agent_len;
+       size_t agent_len;
        struct fetch_negotiator negotiator_alloc;
        struct fetch_negotiator *negotiator;
 
@@ -1117,7 +1118,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
                agent_supported = 1;
                if (agent_len)
                        print_verbose(args, _("Server version is %.*s"),
-                                     agent_len, agent_feature);
+                                     (int)agent_len, agent_feature);
        }
 
        if (!server_supports("session-id"))
@@ -1858,7 +1859,8 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
        return ref;
 }
 
-static int fetch_pack_config_cb(const char *var, const char *value, void *cb)
+static int fetch_pack_config_cb(const char *var, const char *value,
+                               const struct config_context *ctx, void *cb)
 {
        if (strcmp(var, "fetch.fsck.skiplist") == 0) {
                const char *path;
@@ -1880,7 +1882,7 @@ static int fetch_pack_config_cb(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 static void fetch_pack_config(void)
index 1886c92ddb9cd0cda98fcc945d6fa3eecf6d4931..66e47449a092d67b66a172a0e325593d5e494efa 100644 (file)
@@ -1,9 +1,9 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "diff.h"
 #include "diff-merges.h"
 #include "hex.h"
 #include "fmt-merge-msg.h"
 #include "commit-reach.h"
 #include "gpg-interface.h"
+#include "wildmatch.h"
 
 static int use_branch_desc;
 static int suppress_dest_pattern_seen;
 static struct string_list suppress_dest_patterns = STRING_LIST_INIT_DUP;
 
-int fmt_merge_msg_config(const char *key, const char *value, void *cb)
+int fmt_merge_msg_config(const char *key, const char *value,
+                        const struct config_context *ctx, void *cb)
 {
        if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) {
                int is_bool;
-               merge_log_config = git_config_bool_or_int(key, value, &is_bool);
+               merge_log_config = git_config_bool_or_int(key, value, ctx->kvi, &is_bool);
                if (!is_bool && merge_log_config < 0)
                        return error("%s: negative length %s", key, value);
                if (is_bool && merge_log_config)
@@ -39,7 +41,7 @@ int fmt_merge_msg_config(const char *key, const char *value, void *cb)
                        string_list_append(&suppress_dest_patterns, value);
                suppress_dest_pattern_seen = 1;
        } else {
-               return git_default_config(key, value, cb);
+               return git_default_config(key, value, ctx, cb);
        }
        return 0;
 }
@@ -507,7 +509,8 @@ static void fmt_tag_signature(struct strbuf *tagbuf,
        strbuf_complete_line(tagbuf);
        if (sig->len) {
                strbuf_addch(tagbuf, '\n');
-               strbuf_add_commented_lines(tagbuf, sig->buf, sig->len);
+               strbuf_add_commented_lines(tagbuf, sig->buf, sig->len,
+                                          comment_line_char);
        }
 }
 
@@ -553,7 +556,8 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
                                strbuf_addch(&tagline, '\n');
                                strbuf_add_commented_lines(&tagline,
                                                origins.items[first_tag].string,
-                                               strlen(origins.items[first_tag].string));
+                                               strlen(origins.items[first_tag].string),
+                                               comment_line_char);
                                strbuf_insert(&tagbuf, 0, tagline.buf,
                                              tagline.len);
                                strbuf_release(&tagline);
@@ -561,7 +565,8 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
                        strbuf_addch(&tagbuf, '\n');
                        strbuf_add_commented_lines(&tagbuf,
                                        origins.items[i].string,
-                                       strlen(origins.items[i].string));
+                                       strlen(origins.items[i].string),
+                                       comment_line_char);
                        fmt_tag_signature(&tagbuf, &sig, buf, len);
                }
                strbuf_release(&payload);
index 99054042dc5e574b2ef1c00394331955239e0324..73ca3e44652204867457092954d6f9d9ff04ad95 100644 (file)
@@ -13,7 +13,8 @@ struct fmt_merge_msg_opts {
 };
 
 extern int merge_log_config;
-int fmt_merge_msg_config(const char *key, const char *value, void *cb);
+int fmt_merge_msg_config(const char *key, const char *value,
+                        const struct config_context *ctx, void *cb);
 int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
                  struct fmt_merge_msg_opts *);
 
diff --git a/fsck.c b/fsck.c
index 8ef1b0223467292aa89042a27ab99a98d90e66cb..2b1e348005b7bcc7f27bc08e126c93260cda81e4 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -1,7 +1,9 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
+#include "date.h"
+#include "dir.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "repository.h"
 #include "object.h"
 #include "attr.h"
@@ -1162,7 +1164,9 @@ struct fsck_gitmodules_data {
        int ret;
 };
 
-static int fsck_gitmodules_fn(const char *var, const char *value, void *vdata)
+static int fsck_gitmodules_fn(const char *var, const char *value,
+                             const struct config_context *ctx UNUSED,
+                             void *vdata)
 {
        struct fsck_gitmodules_data *data = vdata;
        const char *subsection, *key;
@@ -1235,7 +1239,8 @@ static int fsck_blob(const struct object_id *oid, const char *buf,
                data.ret = 0;
                config_opts.error_action = CONFIG_ERROR_SILENT;
                if (git_config_from_mem(fsck_gitmodules_fn, CONFIG_ORIGIN_BLOB,
-                                       ".gitmodules", buf, size, &data, &config_opts))
+                                       ".gitmodules", buf, size, &data,
+                                       CONFIG_SCOPE_UNKNOWN, &config_opts))
                        data.ret |= report(options, oid, OBJ_BLOB,
                                        FSCK_MSG_GITMODULES_PARSE,
                                        "could not parse gitmodules blob");
@@ -1304,9 +1309,9 @@ int fsck_buffer(const struct object_id *oid, enum object_type type,
 
 int fsck_error_function(struct fsck_options *o,
                        const struct object_id *oid,
-                       enum object_type object_type,
+                       enum object_type object_type UNUSED,
                        enum fsck_msg_type msg_type,
-                       enum fsck_msg_id msg_id,
+                       enum fsck_msg_id msg_id UNUSED,
                        const char *message)
 {
        if (msg_type == FSCK_WARN) {
@@ -1372,7 +1377,8 @@ int fsck_finish(struct fsck_options *options)
        return ret;
 }
 
-int git_fsck_config(const char *var, const char *value, void *cb)
+int git_fsck_config(const char *var, const char *value,
+                   const struct config_context *ctx, void *cb)
 {
        struct fsck_options *options = cb;
        if (strcmp(var, "fsck.skiplist") == 0) {
@@ -1393,7 +1399,7 @@ int git_fsck_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
 
 /*
diff --git a/fsck.h b/fsck.h
index e17730e9da94053f39f1610e8cd81ab80bbf8a9f..6359ba359bd24a5ece2fa4752d55f703af32388e 100644 (file)
--- a/fsck.h
+++ b/fsck.h
@@ -233,10 +233,12 @@ void fsck_put_object_name(struct fsck_options *options,
 const char *fsck_describe_object(struct fsck_options *options,
                                 const struct object_id *oid);
 
+struct key_value_info;
 /*
  * git_config() callback for use by fsck-y tools that want to support
  * fsck.<msg> fsck.skipList etc.
  */
-int git_fsck_config(const char *var, const char *value, void *cb);
+int git_fsck_config(const char *var, const char *value,
+                   const struct config_context *ctx, void *cb);
 
 #endif
index e24838f9a86acc5de6980ac1c68d9d20421c3d42..70d776c54f6d142c2efd931cec140afaa91479f4 100644 (file)
@@ -3,7 +3,6 @@
 
 #ifdef HAVE_FSMONITOR_DAEMON_BACKEND
 
-#include "cache.h"
 #include "dir.h"
 #include "run-command.h"
 #include "simple-ipc.h"
index 866828e2992c6f3e2e025f294df35ba5ba86863f..88575aa54cad07312b2aa3dab3a87cfe0ebb3693 100644 (file)
@@ -1,8 +1,9 @@
-#include "cache.h"
-#include "fsmonitor.h"
+#include "git-compat-util.h"
+#include "fsmonitor-ll.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "fsmonitor-ipc.h"
+#include "repository.h"
 #include "run-command.h"
 #include "strbuf.h"
 #include "trace2.h"
diff --git a/fsmonitor-ll.h b/fsmonitor-ll.h
new file mode 100644 (file)
index 0000000..0504ca0
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef FSMONITOR_LL_H
+#define FSMONITOR_LL_H
+
+struct index_state;
+struct strbuf;
+
+extern struct trace_key trace_fsmonitor;
+
+/*
+ * Read the fsmonitor index extension and (if configured) restore the
+ * CE_FSMONITOR_VALID state.
+ */
+int read_fsmonitor_extension(struct index_state *istate, const void *data, unsigned long sz);
+
+/*
+ * Fill the fsmonitor_dirty ewah bits with their state from the index,
+ * before it is split during writing.
+ */
+void fill_fsmonitor_bitmap(struct index_state *istate);
+
+/*
+ * Write the CE_FSMONITOR_VALID state into the fsmonitor index
+ * extension.  Reads from the fsmonitor_dirty ewah in the index.
+ */
+void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate);
+
+/*
+ * Add/remove the fsmonitor index extension
+ */
+void add_fsmonitor(struct index_state *istate);
+void remove_fsmonitor(struct index_state *istate);
+
+/*
+ * Add/remove the fsmonitor index extension as necessary based on the current
+ * core.fsmonitor setting.
+ */
+void tweak_fsmonitor(struct index_state *istate);
+
+/*
+ * Run the configured fsmonitor integration script and clear the
+ * CE_FSMONITOR_VALID bit for any files returned as dirty.  Also invalidate
+ * any corresponding untracked cache directory structures. Optimized to only
+ * run the first time it is called.
+ */
+void refresh_fsmonitor(struct index_state *istate);
+
+/*
+ * Does the received result contain the "trivial" response?
+ */
+int fsmonitor_is_trivial_response(const struct strbuf *query_result);
+
+#endif /* FSMONITOR_LL_H */
index c956a347a27a8a907deaba3030f8a725f030e3f3..f670c50937898342f693708c706a0db270be3a6d 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
@@ -7,6 +7,7 @@
 #include "fsmonitor-ipc.h"
 #include "run-command.h"
 #include "strbuf.h"
+#include "trace2.h"
 
 #define INDEX_EXTENSION_VERSION1       (1)
 #define INDEX_EXTENSION_VERSION2       (2)
index 778707b131ba01f8a800ab4f3253b1b841709d1d..5195a8624db82b27f8fbb533675b35e841a2a44b 100644 (file)
@@ -1,54 +1,12 @@
 #ifndef FSMONITOR_H
 #define FSMONITOR_H
 
-#include "cache.h"
+#include "fsmonitor-ll.h"
 #include "dir.h"
 #include "fsmonitor-settings.h"
-
-extern struct trace_key trace_fsmonitor;
-
-/*
- * Read the fsmonitor index extension and (if configured) restore the
- * CE_FSMONITOR_VALID state.
- */
-int read_fsmonitor_extension(struct index_state *istate, const void *data, unsigned long sz);
-
-/*
- * Fill the fsmonitor_dirty ewah bits with their state from the index,
- * before it is split during writing.
- */
-void fill_fsmonitor_bitmap(struct index_state *istate);
-
-/*
- * Write the CE_FSMONITOR_VALID state into the fsmonitor index
- * extension.  Reads from the fsmonitor_dirty ewah in the index.
- */
-void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate);
-
-/*
- * Add/remove the fsmonitor index extension
- */
-void add_fsmonitor(struct index_state *istate);
-void remove_fsmonitor(struct index_state *istate);
-
-/*
- * Add/remove the fsmonitor index extension as necessary based on the current
- * core.fsmonitor setting.
- */
-void tweak_fsmonitor(struct index_state *istate);
-
-/*
- * Run the configured fsmonitor integration script and clear the
- * CE_FSMONITOR_VALID bit for any files returned as dirty.  Also invalidate
- * any corresponding untracked cache directory structures. Optimized to only
- * run the first time it is called.
- */
-void refresh_fsmonitor(struct index_state *istate);
-
-/*
- * Does the received result contain the "trivial" response?
- */
-int fsmonitor_is_trivial_response(const struct strbuf *query_result);
+#include "object.h"
+#include "read-cache-ll.h"
+#include "trace.h"
 
 /*
  * Check if refresh_fsmonitor has been called at least once.
index 5f348708300e81addb7238a6c84be5e37a0ebcba..f27e94407b4c2848eecfbd827ee85525ff8c04ed 100644 (file)
--- a/gettext.c
+++ b/gettext.c
@@ -102,6 +102,8 @@ static void init_gettext_charset(const char *domain)
                setlocale(LC_CTYPE, "C");
 }
 
+int git_gettext_enabled = 0;
+
 void git_setup_gettext(void)
 {
        const char *podir = getenv(GIT_TEXT_DOMAIN_DIR_ENVIRONMENT);
@@ -121,6 +123,8 @@ void git_setup_gettext(void)
        init_gettext_charset("git");
        textdomain("git");
 
+       git_gettext_enabled = 1;
+
        free(p);
 }
 
index d209911ebb80c164fb93073d054fd1ff7acb8da3..484cafa5628850930f8536c6c4e79fb26847153d 100644 (file)
--- a/gettext.h
+++ b/gettext.h
 #define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
 
 #ifndef NO_GETTEXT
+extern int git_gettext_enabled;
 void git_setup_gettext(void);
 int gettext_width(const char *s);
 #else
+#define git_gettext_enabled (0)
 static inline void git_setup_gettext(void)
 {
 }
@@ -45,12 +47,16 @@ static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
        if (!*msgid)
                return "";
+       if (!git_gettext_enabled)
+               return msgid;
        return gettext(msgid);
 }
 
 static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2)
 const char *Q_(const char *msgid, const char *plu, unsigned long n)
 {
+       if (!git_gettext_enabled)
+               return n == 1 ? msgid : plu;
        return ngettext(msgid, plu, n);
 }
 
index 4a200a9fb41123e1d945ae9a397f09d7c0456367..d32aa754ae14f518d286a8b2205fd0e1d23b5804 100644 (file)
@@ -440,8 +440,10 @@ typedef uintmax_t timestamp_t;
 #endif
 
 #ifndef platform_core_config
+struct config_context;
 static inline int noop_core_config(const char *var UNUSED,
                                   const char *value UNUSED,
+                                  const struct config_context *ctx UNUSED,
                                   void *cb UNUSED)
 {
        return 0;
@@ -625,9 +627,7 @@ static inline int git_has_dir_sep(const char *path)
 
 #include "compat/bswap.h"
 
-#include "wildmatch.h"
-
-struct strbuf;
+#include "wrapper.h"
 
 /* General helper functions */
 NORETURN void usage(const char *err);
@@ -679,9 +679,6 @@ 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);
-int istarts_with(const char *str, const char *prefix);
-
 /*
  * If the string "str" begins with the string found in "prefix", return 1.
  * The "out" parameter is set to "str + strlen(prefix)" (i.e., to the point in
@@ -710,29 +707,6 @@ static inline int skip_prefix(const char *str, const char *prefix,
        return 0;
 }
 
-/*
- * If the string "str" is the same as the string in "prefix", then the "arg"
- * parameter is set to the "def" parameter and 1 is returned.
- * If the string "str" begins with the string found in "prefix" and then a
- * "=" sign, then the "arg" parameter is set to "str + strlen(prefix) + 1"
- * (i.e., to the point in the string right after the prefix and the "=" sign),
- * and 1 is returned.
- *
- * Otherwise, return 0 and leave "arg" untouched.
- *
- * When we accept both a "--key" and a "--key=<val>" option, this function
- * can be used instead of !strcmp(arg, "--key") and then
- * skip_prefix(arg, "--key=", &arg) to parse such an option.
- */
-int skip_to_optional_arg_default(const char *str, const char *prefix,
-                                const char **arg, const char *def);
-
-static inline int skip_to_optional_arg(const char *str, const char *prefix,
-                                      const char **arg)
-{
-       return skip_to_optional_arg_default(str, prefix, arg, "");
-}
-
 /*
  * Like skip_prefix, but promises never to read past "len" bytes of the input
  * buffer, and returns the remaining number of bytes in "out" via "outlen".
@@ -777,12 +751,6 @@ static inline int strip_suffix(const char *str, const char *suffix, size_t *len)
        return strip_suffix_mem(str, len, suffix);
 }
 
-static inline int ends_with(const char *str, const char *suffix)
-{
-       size_t len;
-       return strip_suffix(str, suffix, &len);
-}
-
 #define SWAP(a, b) do {                                                \
        void *_swap_a_ptr = &(a);                               \
        void *_swap_b_ptr = &(b);                               \
@@ -878,12 +846,6 @@ int git_lstat(const char *, struct stat *);
 #define pread git_pread
 ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
 #endif
-/*
- * Forward decl that will remind us if its twin in cache.h changes.
- * This function is used in compat/pread.c.  But we can't include
- * cache.h there.
- */
-ssize_t read_in_full(int fd, void *buf, size_t count);
 
 #ifdef NO_SETENV
 #define setenv gitsetenv
@@ -1085,36 +1047,6 @@ static inline int cast_size_t_to_int(size_t a)
 # define xalloca(size)      (xmalloc(size))
 # define xalloca_free(p)    (free(p))
 #endif
-char *xstrdup(const char *str);
-void *xmalloc(size_t size);
-void *xmallocz(size_t size);
-void *xmallocz_gently(size_t size);
-void *xmemdupz(const void *data, size_t len);
-char *xstrndup(const char *str, size_t len);
-void *xrealloc(void *ptr, size_t size);
-void *xcalloc(size_t nmemb, size_t size);
-void xsetenv(const char *name, const char *value, int overwrite);
-void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
-const char *mmap_os_err(void);
-void *xmmap_gently(void *start, size_t length, int prot, int flags, int fd, off_t offset);
-int xopen(const char *path, int flags, ...);
-ssize_t xread(int fd, void *buf, size_t len);
-ssize_t xwrite(int fd, const void *buf, size_t len);
-ssize_t xpread(int fd, void *buf, size_t len, off_t offset);
-int xdup(int fd);
-FILE *xfopen(const char *path, const char *mode);
-FILE *xfdopen(int fd, const char *mode);
-int xmkstemp(char *temp_filename);
-int xmkstemp_mode(char *temp_filename, int mode);
-char *xgetcwd(void);
-FILE *fopen_for_writing(const char *path);
-FILE *fopen_or_warn(const char *path, const char *mode);
-
-/*
- * Like strncmp, but only return zero if s is NUL-terminated and exactly len
- * characters long.  If it is not, consider it greater than t.
- */
-int xstrncmpz(const char *s, const char *t, size_t len);
 
 /*
  * FREE_AND_NULL(ptr) is like free(ptr) followed by ptr = NULL. Note
@@ -1204,6 +1136,81 @@ static inline void move_array(void *dst, const void *src, size_t n, size_t size)
 #define FLEXPTR_ALLOC_STR(x, ptrname, str) \
        FLEXPTR_ALLOC_MEM((x), ptrname, (str), strlen(str))
 
+#define alloc_nr(x) (((x)+16)*3/2)
+
+/**
+ * Dynamically growing an array using realloc() is error prone and boring.
+ *
+ * Define your array with:
+ *
+ * - a pointer (`item`) that points at the array, initialized to `NULL`
+ *   (although please name the variable based on its contents, not on its
+ *   type);
+ *
+ * - an integer variable (`alloc`) that keeps track of how big the current
+ *   allocation is, initialized to `0`;
+ *
+ * - another integer variable (`nr`) to keep track of how many elements the
+ *   array currently has, initialized to `0`.
+ *
+ * Then before adding `n`th element to the item, call `ALLOC_GROW(item, n,
+ * alloc)`.  This ensures that the array can hold at least `n` elements by
+ * calling `realloc(3)` and adjusting `alloc` variable.
+ *
+ * ------------
+ * sometype *item;
+ * size_t nr;
+ * size_t alloc
+ *
+ * for (i = 0; i < nr; i++)
+ *     if (we like item[i] already)
+ *             return;
+ *
+ * // we did not like any existing one, so add one
+ * ALLOC_GROW(item, nr + 1, alloc);
+ * item[nr++] = value you like;
+ * ------------
+ *
+ * You are responsible for updating the `nr` variable.
+ *
+ * If you need to specify the number of elements to allocate explicitly
+ * then use the macro `REALLOC_ARRAY(item, alloc)` instead of `ALLOC_GROW`.
+ *
+ * Consider using ALLOC_GROW_BY instead of ALLOC_GROW as it has some
+ * added niceties.
+ *
+ * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'.
+ */
+#define ALLOC_GROW(x, nr, alloc) \
+       do { \
+               if ((nr) > alloc) { \
+                       if (alloc_nr(alloc) < (nr)) \
+                               alloc = (nr); \
+                       else \
+                               alloc = alloc_nr(alloc); \
+                       REALLOC_ARRAY(x, alloc); \
+               } \
+       } while (0)
+
+/*
+ * Similar to ALLOC_GROW but handles updating of the nr value and
+ * zeroing the bytes of the newly-grown array elements.
+ *
+ * DO NOT USE any expression with side-effect for any of the
+ * arguments.
+ */
+#define ALLOC_GROW_BY(x, nr, increase, alloc) \
+       do { \
+               if (increase) { \
+                       size_t new_nr = nr + (increase); \
+                       if (new_nr < nr) \
+                               BUG("negative growth in ALLOC_GROW_BY"); \
+                       ALLOC_GROW(x, new_nr, alloc); \
+                       memset((x) + nr, 0, sizeof(*(x)) * (increase)); \
+                       nr = new_nr; \
+               } \
+       } while (0)
+
 static inline char *xstrdup_or_null(const char *str)
 {
        return str ? xstrdup(str) : NULL;
@@ -1216,79 +1223,11 @@ static inline size_t xsize_t(off_t len)
        return (size_t) len;
 }
 
-__attribute__((format (printf, 3, 4)))
-int xsnprintf(char *dst, size_t max, const char *fmt, ...);
-
 #ifndef HOST_NAME_MAX
 #define HOST_NAME_MAX 256
 #endif
 
-int xgethostname(char *buf, size_t len);
-
-/* in ctype.c, for kwset users */
-extern const unsigned char tolower_trans_tbl[256];
-
-/* Sane ctype - no locale, and works with signed chars */
-#undef isascii
-#undef isspace
-#undef isdigit
-#undef isalpha
-#undef isalnum
-#undef isprint
-#undef islower
-#undef isupper
-#undef tolower
-#undef toupper
-#undef iscntrl
-#undef ispunct
-#undef isxdigit
-
-extern const unsigned char sane_ctype[256];
-extern const signed char hexval_table[256];
-#define GIT_SPACE 0x01
-#define GIT_DIGIT 0x02
-#define GIT_ALPHA 0x04
-#define GIT_GLOB_SPECIAL 0x08
-#define GIT_REGEX_SPECIAL 0x10
-#define GIT_PATHSPEC_MAGIC 0x20
-#define GIT_CNTRL 0x40
-#define GIT_PUNCT 0x80
-#define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)
-#define isascii(x) (((x) & ~0x7f) == 0)
-#define isspace(x) sane_istest(x,GIT_SPACE)
-#define isdigit(x) sane_istest(x,GIT_DIGIT)
-#define isalpha(x) sane_istest(x,GIT_ALPHA)
-#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
-#define isprint(x) ((x) >= 0x20 && (x) <= 0x7e)
-#define islower(x) sane_iscase(x, 1)
-#define isupper(x) sane_iscase(x, 0)
-#define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL)
-#define is_regex_special(x) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL)
-#define iscntrl(x) (sane_istest(x,GIT_CNTRL))
-#define ispunct(x) sane_istest(x, GIT_PUNCT | GIT_REGEX_SPECIAL | \
-               GIT_GLOB_SPECIAL | GIT_PATHSPEC_MAGIC)
-#define isxdigit(x) (hexval_table[(unsigned char)(x)] != -1)
-#define tolower(x) sane_case((unsigned char)(x), 0x20)
-#define toupper(x) sane_case((unsigned char)(x), 0)
-#define is_pathspec_magic(x) sane_istest(x,GIT_PATHSPEC_MAGIC)
-
-static inline int sane_case(int x, int high)
-{
-       if (sane_istest(x, GIT_ALPHA))
-               x = (x & ~0x20) | high;
-       return x;
-}
-
-static inline int sane_iscase(int x, int is_lower)
-{
-       if (!sane_istest(x, GIT_ALPHA))
-               return 0;
-
-       if (is_lower)
-               return (x & 0x20) != 0;
-       else
-               return (x & 0x20) == 0;
-}
+#include "sane-ctype.h"
 
 /*
  * Like skip_prefix, but compare case-insensitively. Note that the comparison
@@ -1465,72 +1404,6 @@ void bug_fl(const char *file, int line, const char *fmt, ...);
 #endif
 #endif
 
-enum fsync_action {
-       FSYNC_WRITEOUT_ONLY,
-       FSYNC_HARDWARE_FLUSH
-};
-
-/*
- * Issues an fsync against the specified file according to the specified mode.
- *
- * FSYNC_WRITEOUT_ONLY attempts to use interfaces available on some operating
- * systems to flush the OS cache without issuing a flush command to the storage
- * controller. If those interfaces are unavailable, the function fails with
- * ENOSYS.
- *
- * FSYNC_HARDWARE_FLUSH does an OS writeout and hardware flush to ensure that
- * changes are durable. It is not expected to fail.
- */
-int git_fsync(int fd, enum fsync_action action);
-
-/*
- * Writes out trace statistics for fsync using the trace2 API.
- */
-void trace_git_fsync_stats(void);
-
-/*
- * Preserves errno, prints a message, but gives no warning for ENOENT.
- * Returns 0 on success, which includes trying to unlink an object that does
- * not exist.
- */
-int unlink_or_warn(const char *path);
- /*
-  * Tries to unlink file.  Returns 0 if unlink succeeded
-  * or the file already didn't exist.  Returns -1 and
-  * appends a message to err suitable for
-  * 'error("%s", err->buf)' on error.
-  */
-int unlink_or_msg(const char *file, struct strbuf *err);
-/*
- * Preserves errno, prints a message, but gives no warning for ENOENT.
- * Returns 0 on success, which includes trying to remove a directory that does
- * not exist.
- */
-int rmdir_or_warn(const char *path);
-/*
- * Calls the correct function out of {unlink,rmdir}_or_warn based on
- * the supplied file mode.
- */
-int remove_or_warn(unsigned int mode, const char *path);
-
-/*
- * Call access(2), but warn for any error except "missing file"
- * (ENOENT or ENOTDIR).
- */
-#define ACCESS_EACCES_OK (1U << 0)
-int access_or_warn(const char *path, int mode, unsigned flag);
-int access_or_die(const char *path, int mode, unsigned flag);
-
-/* Warn on an inaccessible file if errno indicates this is an error */
-int warn_on_fopen_errors(const char *path);
-
-/*
- * Open with O_NOFOLLOW, or equivalent. Note that the fallback equivalent
- * may be racy. Do not use this as protection against an attacker who can
- * simultaneously create paths.
- */
-int open_nofollow(const char *path, int flags);
-
 #ifndef SHELL_PATH
 # define SHELL_PATH "/bin/sh"
 #endif
@@ -1670,13 +1543,4 @@ 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);
-
-/*
- * Generate len bytes from the system cryptographically secure PRNG.
- * Returns 0 on success and -1 on error, setting errno.  The inability to
- * satisfy the full request is an error.
- */
-int csprng_bytes(void *buf, size_t len);
-
 #endif
index fd8cd0d46fde6cca528b8e0259c778fa4ddad9c3..897cea6564fb504ecfc4efdd59f991cfbab113e9 100755 (executable)
@@ -26,18 +26,6 @@ use Git::I18N;
 
 Getopt::Long::Configure qw/ pass_through /;
 
-package FakeTerm;
-sub new {
-       my ($class, $reason) = @_;
-       return bless \$reason, shift;
-}
-sub readline {
-       my $self = shift;
-       die "Cannot use readline on FakeTerm: $$self";
-}
-package main;
-
-
 sub usage {
        print <<EOT;
 git send-email' [<options>] <file|directory>
@@ -87,8 +75,10 @@ git send-email --dump-aliases
 
   Automating:
     --identity              <str>  * Use the sendemail.<id> options.
-    --to-cmd                <str>  * Email To: via `<str> \$patch_path`
-    --cc-cmd                <str>  * Email Cc: via `<str> \$patch_path`
+    --to-cmd                <str>  * Email To: via `<str> \$patch_path`.
+    --cc-cmd                <str>  * Email Cc: via `<str> \$patch_path`.
+    --header-cmd            <str>  * Add headers via `<str> \$patch_path`.
+    --no-header-cmd                * Disable any header command in use.
     --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, misc-by, all.
     --[no-]cc-cover                * Email Cc: addresses in the cover letter.
     --[no-]to-cover                * Email To: addresses in the cover letter.
@@ -202,7 +192,7 @@ my (@to,@cc,@xh,$envelope_sender,
        $author,$sender,$smtp_authpass,$annotate,$compose,$time);
 # Things we either get from config, *or* are overridden on the
 # command-line.
-my ($no_cc, $no_to, $no_bcc, $no_identity);
+my ($no_cc, $no_to, $no_bcc, $no_identity, $no_header_cmd);
 my (@config_to, @getopt_to);
 my (@config_cc, @getopt_cc);
 my (@config_bcc, @getopt_bcc);
@@ -269,7 +259,7 @@ sub do_edit {
 # Variables with corresponding config settings
 my ($suppress_from, $signed_off_by_cc);
 my ($cover_cc, $cover_to);
-my ($to_cmd, $cc_cmd);
+my ($to_cmd, $cc_cmd, $header_cmd);
 my ($smtp_server, $smtp_server_port, @smtp_server_options);
 my ($smtp_authuser, $smtp_encryption, $smtp_ssl_cert_path);
 my ($batch_size, $relogin_delay);
@@ -318,6 +308,7 @@ my %config_settings = (
     "tocmd" => \$to_cmd,
     "cc" => \@config_cc,
     "cccmd" => \$cc_cmd,
+    "headercmd" => \$header_cmd,
     "aliasfiletype" => \$aliasfiletype,
     "bcc" => \@config_bcc,
     "suppresscc" => \@suppress_cc,
@@ -519,6 +510,8 @@ my %options = (
                    "compose" => \$compose,
                    "quiet" => \$quiet,
                    "cc-cmd=s" => \$cc_cmd,
+                   "header-cmd=s" => \$header_cmd,
+                   "no-header-cmd" => \$no_header_cmd,
                    "suppress-from!" => \$suppress_from,
                    "no-suppress-from" => sub {$suppress_from = 0},
                    "suppress-cc=s" => \@suppress_cc,
@@ -792,16 +785,46 @@ if (@rev_list_opts) {
                                    @rev_list_opts);
 }
 
-@files = handle_backup_files(@files);
+if (defined $sender) {
+       $sender =~ s/^\s+|\s+$//g;
+       ($sender) = expand_aliases($sender);
+} else {
+       $sender = $repoauthor->() || $repocommitter->() || '';
+}
+
+# $sender could be an already sanitized address
+# (e.g. sendemail.from could be manually sanitized by user).
+# But it's a no-op to run sanitize_address on an already sanitized address.
+$sender = sanitize_address($sender);
+
+$time = time - scalar $#files;
 
 if ($validate) {
+       # FIFOs can only be read once, exclude them from validation.
+       my @real_files = ();
        foreach my $f (@files) {
                unless (-p $f) {
-                       validate_patch($f, $target_xfer_encoding);
+                       push(@real_files, $f);
                }
        }
+
+       # Run the loop once again to avoid gaps in the counter due to FIFO
+       # arguments provided by the user.
+       my $num = 1;
+       my $num_files = scalar @real_files;
+       $ENV{GIT_SENDEMAIL_FILE_TOTAL} = "$num_files";
+       foreach my $r (@real_files) {
+               $ENV{GIT_SENDEMAIL_FILE_COUNTER} = "$num";
+               pre_process_file($r, 1);
+               validate_patch($r, $target_xfer_encoding);
+               $num += 1;
+       }
+       delete $ENV{GIT_SENDEMAIL_FILE_COUNTER};
+       delete $ENV{GIT_SENDEMAIL_FILE_TOTAL};
 }
 
+@files = handle_backup_files(@files);
+
 if (@files) {
        unless ($quiet) {
                print $_,"\n" for (@files);
@@ -936,17 +959,19 @@ EOT3
        do_edit(@files);
 }
 
-sub term {
-       my $term = eval {
+{
+       # Only instantiate one $term per program run, since some
+       # Term::ReadLine providers refuse to create a second instance.
+       my $term;
+       sub term {
                require Term::ReadLine;
-               $ENV{"GIT_SEND_EMAIL_NOTTY"}
-                       ? Term::ReadLine->new('git-send-email', \*STDIN, \*STDOUT)
-                       : Term::ReadLine->new('git-send-email');
-       };
-       if ($@) {
-               $term = FakeTerm->new("$@: going non-interactive");
+               if (!defined $term) {
+                       $term = $ENV{"GIT_SEND_EMAIL_NOTTY"}
+                               ? Term::ReadLine->new('git-send-email', \*STDIN, \*STDOUT)
+                               : Term::ReadLine->new('git-send-email');
+               }
+               return $term;
        }
-       return $term;
 }
 
 sub ask {
@@ -1050,18 +1075,6 @@ if (!$force) {
        }
 }
 
-if (defined $sender) {
-       $sender =~ s/^\s+|\s+$//g;
-       ($sender) = expand_aliases($sender);
-} else {
-       $sender = $repoauthor->() || $repocommitter->() || '';
-}
-
-# $sender could be an already sanitized address
-# (e.g. sendemail.from could be manually sanitized by user).
-# But it's a no-op to run sanitize_address on an already sanitized address.
-$sender = sanitize_address($sender);
-
 my $to_whom = __("To whom should the emails be sent (if anyone)?");
 my $prompting = 0;
 if (!@initial_to && !defined $to_cmd) {
@@ -1221,10 +1234,6 @@ sub make_message_id {
        #print "new message id = $message_id\n"; # Was useful for debugging
 }
 
-
-
-$time = time - scalar $#files;
-
 sub unquote_rfc2047 {
        local ($_) = @_;
        my $charset;
@@ -1502,16 +1511,7 @@ sub file_name_is_absolute {
        return File::Spec::Functions::file_name_is_absolute($path);
 }
 
-# Prepares the email, then asks the user what to do.
-#
-# If the user chooses to send the email, it's sent and 1 is returned.
-# If the user chooses not to send the email, 0 is returned.
-# If the user decides they want to make further edits, -1 is returned and the
-# caller is expected to call send_message again after the edits are performed.
-#
-# If an error occurs sending the email, this just dies.
-
-sub send_message {
+sub gen_header {
        my @recipients = unique_email_list(@to);
        @cc = (grep { my $cc = extract_valid_address_or_die($_);
                      not grep { $cc eq $_ || $_ =~ /<\Q${cc}\E>$/ } @recipients
@@ -1553,6 +1553,22 @@ Message-ID: $message_id
        if (@xh) {
                $header .= join("\n", @xh) . "\n";
        }
+       my $recipients_ref = \@recipients;
+       return ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header);
+}
+
+# Prepares the email, then asks the user what to do.
+#
+# If the user chooses to send the email, it's sent and 1 is returned.
+# If the user chooses not to send the email, 0 is returned.
+# If the user decides they want to make further edits, -1 is returned and the
+# caller is expected to call send_message again after the edits are performed.
+#
+# If an error occurs sending the email, this just dies.
+
+sub send_message {
+       my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();
+       my @recipients = @$recipients_ref;
 
        my @sendmail_parameters = ('-i', @recipients);
        my $raw_from = $sender;
@@ -1742,11 +1758,8 @@ $in_reply_to = $initial_in_reply_to;
 $references = $initial_in_reply_to || '';
 $message_num = 0;
 
-# Prepares the email, prompts the user, sends it out
-# Returns 0 if an edit was done and the function should be called again, or 1
-# otherwise.
-sub process_file {
-       my ($t) = @_;
+sub pre_process_file {
+       my ($t, $quiet) = @_;
 
        open my $fh, "<", $t or die sprintf(__("can't open file %s"), $t);
 
@@ -1765,16 +1778,17 @@ sub process_file {
        $subject = $initial_subject;
        $message = "";
        $message_num++;
-       # First unfold multiline header fields
+       undef $message_id;
+       # Retrieve and unfold header fields.
+       my @header_lines = ();
        while(<$fh>) {
                last if /^\s*$/;
-               if (/^\s+\S/ and @header) {
-                       chomp($header[$#header]);
-                       s/^\s+/ /;
-                       $header[$#header] .= $_;
-           } else {
-                       push(@header, $_);
-               }
+               push(@header_lines, $_);
+       }
+       @header = unfold_headers(@header_lines);
+       # Add computed headers, if applicable.
+       unless ($no_header_cmd || ! $header_cmd) {
+               push @header, invoke_header_cmd($header_cmd, $t);
        }
        # Now parse the header
        foreach(@header) {
@@ -1900,9 +1914,9 @@ sub process_file {
        }
        close $fh;
 
-       push @to, recipients_cmd("to-cmd", "to", $to_cmd, $t)
+       push @to, recipients_cmd("to-cmd", "to", $to_cmd, $t, $quiet)
                if defined $to_cmd;
-       push @cc, recipients_cmd("cc-cmd", "cc", $cc_cmd, $t)
+       push @cc, recipients_cmd("cc-cmd", "cc", $cc_cmd, $t, $quiet)
                if defined $cc_cmd && !$suppress_cc{'cccmd'};
 
        if ($broken_encoding{$t} && !$has_content_type) {
@@ -1961,6 +1975,15 @@ sub process_file {
                        @initial_to = @to;
                }
        }
+}
+
+# Prepares the email, prompts the user, and sends it out
+# Returns 0 if an edit was done and the function should be called again, or 1
+# on the email being successfully sent out.
+sub process_file {
+       my ($t) = @_;
+
+        pre_process_file($t, $quiet);
 
        my $message_was_sent = send_message();
        if ($message_was_sent == -1) {
@@ -2006,15 +2029,64 @@ foreach my $t (@files) {
        }
 }
 
+# Execute a command and return its output lines as an array.  Blank
+# lines which do not appear at the end of the output are reported as
+# errors.
+sub execute_cmd {
+       my ($prefix, $cmd, $file) = @_;
+       my @lines = ();
+       my $seen_blank_line = 0;
+       open my $fh, "-|", "$cmd \Q$file\E"
+               or die sprintf(__("(%s) Could not execute '%s'"), $prefix, $cmd);
+       while (my $line = <$fh>) {
+               die sprintf(__("(%s) Malformed output from '%s'"), $prefix, $cmd)
+                   if $seen_blank_line;
+               if ($line =~ /^$/) {
+                       $seen_blank_line = $line =~ /^$/;
+                       next;
+               }
+               push @lines, $line;
+       }
+       close $fh
+           or die sprintf(__("(%s) failed to close pipe to '%s'"), $prefix, $cmd);
+       return @lines;
+}
+
+# Process headers lines, unfolding multiline headers as defined by RFC
+# 2822.
+sub unfold_headers {
+       my @headers;
+       foreach(@_) {
+               last if /^\s*$/;
+               if (/^\s+\S/ and @headers) {
+                       chomp($headers[$#headers]);
+                       s/^\s+/ /;
+                       $headers[$#headers] .= $_;
+               } else {
+                       push(@headers, $_);
+               }
+       }
+       return @headers;
+}
+
+# Invoke the provided CMD with FILE as an argument, which should
+# output RFC 2822 email headers. Fold multiline headers and return the
+# headers as an array.
+sub invoke_header_cmd {
+       my ($cmd, $file) = @_;
+       my @lines = execute_cmd("header-cmd", $header_cmd, $file);
+       return unfold_headers(@lines);
+}
+
 # Execute a command (e.g. $to_cmd) to get a list of email addresses
 # and return a results array
 sub recipients_cmd {
-       my ($prefix, $what, $cmd, $file) = @_;
-
+       my ($prefix, $what, $cmd, $file, $quiet) = @_;
+       my @lines = ();
        my @addresses = ();
-       open my $fh, "-|", "$cmd \Q$file\E"
-           or die sprintf(__("(%s) Could not execute '%s'"), $prefix, $cmd);
-       while (my $address = <$fh>) {
+
+       @lines = execute_cmd($prefix, $cmd, $file);
+       for my $address (@lines) {
                $address =~ s/^\s*//g;
                $address =~ s/\s*$//g;
                $address = sanitize_address($address);
@@ -2023,8 +2095,6 @@ sub recipients_cmd {
                printf(__("(%s) Adding %s: %s from: '%s'\n"),
                       $prefix, $what, $address, $cmd) unless $quiet;
                }
-       close $fh
-           or die sprintf(__("(%s) failed to close pipe to '%s'"), $prefix, $cmd);
        return @addresses;
 }
 
@@ -2095,10 +2165,21 @@ sub validate_patch {
                        chdir($repo->wc_path() or $repo->repo_path())
                                or die("chdir: $!");
                        local $ENV{"GIT_DIR"} = $repo->repo_path();
+
+                       my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();
+
+                       require File::Temp;
+                       my ($header_filehandle, $header_filename) = File::Temp::tempfile(
+                            TEMPLATE => ".gitsendemail.header.XXXXXX",
+                            DIR => $repo->repo_path(),
+                            UNLINK => 1,
+                        );
+                       print $header_filehandle $header;
+
                        my @cmd = ("git", "hook", "run", "--ignore-missing",
                                    $hook_name, "--");
-                       my @cmd_msg = (@cmd, "<patch>");
-                       my @cmd_run = (@cmd, $target);
+                       my @cmd_msg = (@cmd, "<patch>", "<header>");
+                       my @cmd_run = (@cmd, $target, $header_filename);
                        $hook_error = system_or_msg(\@cmd_run, undef, "@cmd_msg");
                        chdir($cwd_save) or die("chdir: $!");
                }
similarity index 99%
rename from zlib.c
rename to git-zlib.c
index d594cba3fc9d82d94b9277e886f2bee265e552f6..d43bbeb6daa4c195048f7012e0bccff8c5b4b5f1 100644 (file)
--- a/zlib.c
@@ -2,7 +2,8 @@
  * zlib wrappers to make sure we don't silently miss errors
  * at init time.
  */
-#include "cache.h"
+#include "git-compat-util.h"
+#include "git-zlib.h"
 
 static const char *zerr_to_string(int status)
 {
diff --git a/git-zlib.h b/git-zlib.h
new file mode 100644 (file)
index 0000000..d8a670a
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef GIT_ZLIB_H
+#define GIT_ZLIB_H
+
+typedef struct git_zstream {
+       z_stream z;
+       unsigned long avail_in;
+       unsigned long avail_out;
+       unsigned long total_in;
+       unsigned long total_out;
+       unsigned char *next_in;
+       unsigned char *next_out;
+} git_zstream;
+
+void git_inflate_init(git_zstream *);
+void git_inflate_init_gzip_only(git_zstream *);
+void git_inflate_end(git_zstream *);
+int git_inflate(git_zstream *, int flush);
+
+void git_deflate_init(git_zstream *, int level);
+void git_deflate_init_gzip(git_zstream *, int level);
+void git_deflate_init_raw(git_zstream *, int level);
+void git_deflate_end(git_zstream *);
+int git_deflate_abort(git_zstream *);
+int git_deflate_end_gently(git_zstream *);
+int git_deflate(git_zstream *, int flush);
+unsigned long git_deflate_bound(git_zstream *, unsigned long);
+
+#endif /* GIT_ZLIB_H */
diff --git a/git.c b/git.c
index de681f4f7cd7683a81550126318b9a2467dc6c58..c67e44dd82d2e4fc01fb841c8f863282607f6ac7 100644 (file)
--- a/git.c
+++ b/git.c
@@ -4,11 +4,16 @@
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "help.h"
+#include "pager.h"
+#include "read-cache-ll.h"
 #include "run-command.h"
 #include "alias.h"
 #include "replace-object.h"
 #include "setup.h"
+#include "attr.h"
 #include "shallow.h"
+#include "trace.h"
+#include "trace2.h"
 
 #define RUN_SETUP              (1<<0)
 #define RUN_SETUP_GENTLY       (1<<1)
@@ -182,7 +187,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                        if (envchanged)
                                *envchanged = 1;
                } else if (!strcmp(cmd, "--no-replace-objects")) {
-                       read_replace_refs = 0;
+                       disable_replace_refs();
                        setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
                        if (envchanged)
                                *envchanged = 1;
@@ -311,6 +316,21 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                        } else {
                                exit(list_cmds(cmd));
                        }
+               } else if (!strcmp(cmd, "--attr-source")) {
+                       if (*argc < 2) {
+                               fprintf(stderr, _("no attribute source given for --attr-source\n" ));
+                               usage(git_usage_string);
+                       }
+                       setenv(GIT_ATTR_SOURCE_ENVIRONMENT, (*argv)[1], 1);
+                       if (envchanged)
+                               *envchanged = 1;
+                       (*argv)++;
+                       (*argc)--;
+               } else if (skip_prefix(cmd, "--attr-source=", &cmd)) {
+                       set_git_attr_source(cmd);
+                       setenv(GIT_ATTR_SOURCE_ENVIRONMENT, cmd, 1);
+                       if (envchanged)
+                               *envchanged = 1;
                } else {
                        fprintf(stderr, _("unknown option: %s\n"), cmd);
                        usage(git_usage_string);
index 0ae7d685904b85f97a69b243e30f010671d050e3..df3ba2ea99b310c3cdcd5c7a8938eef498b3e92e 100755 (executable)
@@ -353,6 +353,16 @@ proc parseviewrevs {view revs} {
     return $ret
 }
 
+# Escapes a list of filter paths to be passed to git log via stdin. Note that
+# paths must not be quoted.
+proc escape_filter_paths {paths} {
+       set escaped [list]
+       foreach path $paths {
+               lappend escaped [string map {\\ \\\\ "\ " "\\\ "} $path]
+       }
+       return $escaped
+}
+
 # Start off a git log process and arrange to read its output
 proc start_rev_list {view} {
     global startmsecs commitidx viewcomplete curview
@@ -405,14 +415,17 @@ proc start_rev_list {view} {
         if {$revs eq {}} {
             return 0
         }
-        set args [concat $vflags($view) $revs]
+        set args $vflags($view)
     } else {
+        set revs {}
         set args $vorigargs($view)
     }
 
     if {[catch {
         set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
-                        --parents --boundary $args "--" $files] r]
+                        --parents --boundary $args --stdin \
+                        "<<[join [concat $revs "--" \
+                                [escape_filter_paths $files]] "\\n"]"] r]
     } err]} {
         error_popup "[mc "Error executing git log:"] $err"
         return 0
@@ -554,13 +567,20 @@ proc updatecommits {} {
             set revs $newrevs
             set vposids($view) [lsort -unique [concat $oldpos $vposids($view)]]
         }
-        set args [concat $vflags($view) $revs --not $oldpos]
+        set args $vflags($view)
+        foreach r $oldpos {
+                lappend revs "^$r"
+        }
     } else {
+        set revs {}
         set args $vorigargs($view)
     }
     if {[catch {
         set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
-                        --parents --boundary $args "--" $vfilelimit($view)] r]
+                        --parents --boundary $args --stdin \
+                        "<<[join [concat $revs "--" \
+                                [escape_filter_paths \
+                                        $vfilelimit($view)]] "\\n"]"] r]
     } err]} {
         error_popup "[mc "Error executing git log:"] $err"
         return
@@ -10231,10 +10251,16 @@ proc getallcommits {} {
             foreach id $seeds {
                 lappend ids "^$id"
             }
+            lappend ids "--"
         }
     }
     if {$ids ne {}} {
-        set fd [open [concat $cmd $ids] r]
+        if {$ids eq "--all"} {
+            set cmd [concat $cmd "--all"]
+        } else {
+            set cmd [concat $cmd --stdin "<<[join $ids "\\n"]"]
+        }
+        set fd [open $cmd r]
         fconfigure $fd -blocking 0
         incr allcommits
         nowbusy allcommits
index aceeb083367bd5c147e809ac8f0f4c2e155622e6..48f43c5a21d34569bdc966eefd652da38003d157 100644 (file)
@@ -1,18 +1,21 @@
 #include "git-compat-util.h"
 #include "commit.h"
 #include "config.h"
+#include "date.h"
 #include "gettext.h"
 #include "run-command.h"
 #include "strbuf.h"
 #include "dir.h"
 #include "ident.h"
 #include "gpg-interface.h"
+#include "path.h"
 #include "sigchain.h"
 #include "tempfile.h"
 #include "alias.h"
-#include "wrapper.h"
+#include "environment.h"
 
-static int git_gpg_config(const char *, const char *, void *);
+static int git_gpg_config(const char *, const char *,
+                         const struct config_context *, void *);
 
 static void gpg_interface_lazy_init(void)
 {
@@ -584,8 +587,8 @@ static int verify_ssh_signed_buffer(struct signature_check *sigc,
                }
        }
 
-       strbuf_stripspace(&ssh_keygen_out, 0);
-       strbuf_stripspace(&ssh_keygen_err, 0);
+       strbuf_stripspace(&ssh_keygen_out, '\0');
+       strbuf_stripspace(&ssh_keygen_err, '\0');
        /* Add stderr outputs to show the user actual ssh-keygen errors */
        strbuf_add(&ssh_keygen_out, ssh_principals_err.buf, ssh_principals_err.len);
        strbuf_add(&ssh_keygen_out, ssh_keygen_err.buf, ssh_keygen_err.len);
@@ -650,7 +653,7 @@ int check_signature(struct signature_check *sigc,
        gpg_interface_lazy_init();
 
        sigc->result = 'N';
-       sigc->trust_level = -1;
+       sigc->trust_level = TRUST_UNDEFINED;
 
        fmt = get_format_by_sig(signature);
        if (!fmt)
@@ -718,7 +721,9 @@ void set_signing_key(const char *key)
        configured_signing_key = xstrdup(key);
 }
 
-static int git_gpg_config(const char *var, const char *value, void *cb UNUSED)
+static int git_gpg_config(const char *var, const char *value,
+                         const struct config_context *ctx UNUSED,
+                         void *cb UNUSED)
 {
        struct gpg_format *fmt = NULL;
        char *fmtname = NULL;
diff --git a/grep.c b/grep.c
index b86462a12a9e38bf6693da5a5dbe7e8f0fa798f3..0904d55b244fb6f0e1b859cdd87be330c606d9e7 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -3,7 +3,8 @@
 #include "gettext.h"
 #include "grep.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "pretty.h"
 #include "userdiff.h"
 #include "xdiff-interface.h"
 #include "diff.h"
@@ -54,7 +55,8 @@ define_list_config_array_extra(color_grep_slots, {"match"});
  * Read the configuration file once and store it in
  * the grep_defaults template.
  */
-int grep_config(const char *var, const char *value, void *cb)
+int grep_config(const char *var, const char *value,
+               const struct config_context *ctx, void *cb)
 {
        struct grep_opt *opt = cb;
        const char *slot;
@@ -89,9 +91,9 @@ int grep_config(const char *var, const char *value, void *cb)
        if (!strcmp(var, "color.grep"))
                opt->color = git_config_colorbool(var, value);
        if (!strcmp(var, "color.grep.match")) {
-               if (grep_config("color.grep.matchcontext", value, cb) < 0)
+               if (grep_config("color.grep.matchcontext", value, ctx, cb) < 0)
                        return -1;
-               if (grep_config("color.grep.matchselected", value, cb) < 0)
+               if (grep_config("color.grep.matchselected", value, ctx, cb) < 0)
                        return -1;
        } else if (skip_prefix(var, "color.grep.", &slot)) {
                int i = LOOKUP_CONFIG(color_grep_slots, slot);
diff --git a/grep.h b/grep.h
index c59592e3bdba5205befb38b5a19881ba3c6c9ce2..926c0875c42f63f961447a30f95c39d7ae031999 100644 (file)
--- a/grep.h
+++ b/grep.h
@@ -202,7 +202,9 @@ struct grep_opt {
        .output = std_output, \
 }
 
-int grep_config(const char *var, const char *value, void *);
+struct config_context;
+int grep_config(const char *var, const char *value,
+               const struct config_context *ctx, void *data);
 void grep_init(struct grep_opt *, struct repository *repo);
 
 void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t);
diff --git a/hash-ll.h b/hash-ll.h
new file mode 100644 (file)
index 0000000..10d84cc
--- /dev/null
+++ b/hash-ll.h
@@ -0,0 +1,309 @@
+#ifndef HASH_LL_H
+#define HASH_LL_H
+
+#if defined(SHA1_APPLE)
+#include <CommonCrypto/CommonDigest.h>
+#elif defined(SHA1_OPENSSL)
+#  include <openssl/sha.h>
+#  if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3
+#    define SHA1_NEEDS_CLONE_HELPER
+#    include "sha1/openssl.h"
+#  endif
+#elif defined(SHA1_DC)
+#include "sha1dc_git.h"
+#else /* SHA1_BLK */
+#include "block-sha1/sha1.h"
+#endif
+
+#if defined(SHA256_NETTLE)
+#include "sha256/nettle.h"
+#elif defined(SHA256_GCRYPT)
+#define SHA256_NEEDS_CLONE_HELPER
+#include "sha256/gcrypt.h"
+#elif defined(SHA256_OPENSSL)
+#  include <openssl/sha.h>
+#  if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 3
+#    define SHA256_NEEDS_CLONE_HELPER
+#    include "sha256/openssl.h"
+#  endif
+#else
+#include "sha256/block/sha256.h"
+#endif
+
+#ifndef platform_SHA_CTX
+/*
+ * platform's underlying implementation of SHA-1; could be OpenSSL,
+ * blk_SHA, Apple CommonCrypto, etc...  Note that the relevant
+ * SHA-1 header may have already defined platform_SHA_CTX for our
+ * own implementations like block-sha1, so we list
+ * the default for OpenSSL compatible SHA-1 implementations here.
+ */
+#define platform_SHA_CTX       SHA_CTX
+#define platform_SHA1_Init     SHA1_Init
+#define platform_SHA1_Update   SHA1_Update
+#define platform_SHA1_Final            SHA1_Final
+#endif
+
+#define git_SHA_CTX            platform_SHA_CTX
+#define git_SHA1_Init          platform_SHA1_Init
+#define git_SHA1_Update                platform_SHA1_Update
+#define git_SHA1_Final         platform_SHA1_Final
+
+#ifdef platform_SHA1_Clone
+#define git_SHA1_Clone platform_SHA1_Clone
+#endif
+
+#ifndef platform_SHA256_CTX
+#define platform_SHA256_CTX    SHA256_CTX
+#define platform_SHA256_Init   SHA256_Init
+#define platform_SHA256_Update SHA256_Update
+#define platform_SHA256_Final  SHA256_Final
+#endif
+
+#define git_SHA256_CTX         platform_SHA256_CTX
+#define git_SHA256_Init                platform_SHA256_Init
+#define git_SHA256_Update      platform_SHA256_Update
+#define git_SHA256_Final       platform_SHA256_Final
+
+#ifdef platform_SHA256_Clone
+#define git_SHA256_Clone       platform_SHA256_Clone
+#endif
+
+#ifdef SHA1_MAX_BLOCK_SIZE
+#include "compat/sha1-chunked.h"
+#undef git_SHA1_Update
+#define git_SHA1_Update                git_SHA1_Update_Chunked
+#endif
+
+#ifndef SHA1_NEEDS_CLONE_HELPER
+static inline void git_SHA1_Clone(git_SHA_CTX *dst, const git_SHA_CTX *src)
+{
+       memcpy(dst, src, sizeof(*dst));
+}
+#endif
+
+#ifndef SHA256_NEEDS_CLONE_HELPER
+static inline void git_SHA256_Clone(git_SHA256_CTX *dst, const git_SHA256_CTX *src)
+{
+       memcpy(dst, src, sizeof(*dst));
+}
+#endif
+
+/*
+ * Note that these constants are suitable for indexing the hash_algos array and
+ * comparing against each other, but are otherwise arbitrary, so they should not
+ * be exposed to the user or serialized to disk.  To know whether a
+ * git_hash_algo struct points to some usable hash function, test the format_id
+ * field for being non-zero.  Use the name field for user-visible situations and
+ * the format_id field for fixed-length fields on disk.
+ */
+/* An unknown hash function. */
+#define GIT_HASH_UNKNOWN 0
+/* SHA-1 */
+#define GIT_HASH_SHA1 1
+/* SHA-256  */
+#define GIT_HASH_SHA256 2
+/* Number of algorithms supported (including unknown). */
+#define GIT_HASH_NALGOS (GIT_HASH_SHA256 + 1)
+
+/* "sha1", big-endian */
+#define GIT_SHA1_FORMAT_ID 0x73686131
+
+/* The length in bytes and in hex digits of an object name (SHA-1 value). */
+#define GIT_SHA1_RAWSZ 20
+#define GIT_SHA1_HEXSZ (2 * GIT_SHA1_RAWSZ)
+/* The block size of SHA-1. */
+#define GIT_SHA1_BLKSZ 64
+
+/* "s256", big-endian */
+#define GIT_SHA256_FORMAT_ID 0x73323536
+
+/* The length in bytes and in hex digits of an object name (SHA-256 value). */
+#define GIT_SHA256_RAWSZ 32
+#define GIT_SHA256_HEXSZ (2 * GIT_SHA256_RAWSZ)
+/* The block size of SHA-256. */
+#define GIT_SHA256_BLKSZ 64
+
+/* The length in byte and in hex digits of the largest possible hash value. */
+#define GIT_MAX_RAWSZ GIT_SHA256_RAWSZ
+#define GIT_MAX_HEXSZ GIT_SHA256_HEXSZ
+/* The largest possible block size for any supported hash. */
+#define GIT_MAX_BLKSZ GIT_SHA256_BLKSZ
+
+struct object_id {
+       unsigned char hash[GIT_MAX_RAWSZ];
+       int algo;       /* XXX requires 4-byte alignment */
+};
+
+#define GET_OID_QUIETLY           01
+#define GET_OID_COMMIT            02
+#define GET_OID_COMMITTISH        04
+#define GET_OID_TREE             010
+#define GET_OID_TREEISH          020
+#define GET_OID_BLOB             040
+#define GET_OID_FOLLOW_SYMLINKS 0100
+#define GET_OID_RECORD_PATH     0200
+#define GET_OID_ONLY_TO_DIE    04000
+#define GET_OID_REQUIRE_PATH  010000
+
+#define GET_OID_DISAMBIGUATORS \
+       (GET_OID_COMMIT | GET_OID_COMMITTISH | \
+       GET_OID_TREE | GET_OID_TREEISH | \
+       GET_OID_BLOB)
+
+enum get_oid_result {
+       FOUND = 0,
+       MISSING_OBJECT = -1, /* The requested object is missing */
+       SHORT_NAME_AMBIGUOUS = -2,
+       /* The following only apply when symlinks are followed */
+       DANGLING_SYMLINK = -4, /*
+                               * The initial symlink is there, but
+                               * (transitively) points to a missing
+                               * in-tree file
+                               */
+       SYMLINK_LOOP = -5,
+       NOT_DIR = -6, /*
+                      * Somewhere along the symlink chain, a path is
+                      * requested which contains a file as a
+                      * non-final element.
+                      */
+};
+
+/* A suitably aligned type for stack allocations of hash contexts. */
+union git_hash_ctx {
+       git_SHA_CTX sha1;
+       git_SHA256_CTX sha256;
+};
+typedef union git_hash_ctx git_hash_ctx;
+
+typedef void (*git_hash_init_fn)(git_hash_ctx *ctx);
+typedef void (*git_hash_clone_fn)(git_hash_ctx *dst, const git_hash_ctx *src);
+typedef void (*git_hash_update_fn)(git_hash_ctx *ctx, const void *in, size_t len);
+typedef void (*git_hash_final_fn)(unsigned char *hash, git_hash_ctx *ctx);
+typedef void (*git_hash_final_oid_fn)(struct object_id *oid, git_hash_ctx *ctx);
+
+struct git_hash_algo {
+       /*
+        * The name of the algorithm, as appears in the config file and in
+        * messages.
+        */
+       const char *name;
+
+       /* A four-byte version identifier, used in pack indices. */
+       uint32_t format_id;
+
+       /* The length of the hash in binary. */
+       size_t rawsz;
+
+       /* The length of the hash in hex characters. */
+       size_t hexsz;
+
+       /* The block size of the hash. */
+       size_t blksz;
+
+       /* The hash initialization function. */
+       git_hash_init_fn init_fn;
+
+       /* The hash context cloning function. */
+       git_hash_clone_fn clone_fn;
+
+       /* The hash update function. */
+       git_hash_update_fn update_fn;
+
+       /* The hash finalization function. */
+       git_hash_final_fn final_fn;
+
+       /* The hash finalization function for object IDs. */
+       git_hash_final_oid_fn final_oid_fn;
+
+       /* The OID of the empty tree. */
+       const struct object_id *empty_tree;
+
+       /* The OID of the empty blob. */
+       const struct object_id *empty_blob;
+
+       /* The all-zeros OID. */
+       const struct object_id *null_oid;
+};
+extern const struct git_hash_algo hash_algos[GIT_HASH_NALGOS];
+
+/*
+ * Return a GIT_HASH_* constant based on the name.  Returns GIT_HASH_UNKNOWN if
+ * the name doesn't match a known algorithm.
+ */
+int hash_algo_by_name(const char *name);
+/* Identical, except based on the format ID. */
+int hash_algo_by_id(uint32_t format_id);
+/* Identical, except based on the length. */
+int hash_algo_by_length(int len);
+/* Identical, except for a pointer to struct git_hash_algo. */
+static inline int hash_algo_by_ptr(const struct git_hash_algo *p)
+{
+       return p - hash_algos;
+}
+
+const struct object_id *null_oid(void);
+
+static inline int hashcmp_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
+{
+       /*
+        * 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 (algop->rawsz == GIT_MAX_RAWSZ)
+               return memcmp(sha1, sha2, GIT_MAX_RAWSZ);
+       return memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
+}
+
+static inline int hasheq_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
+{
+       /*
+        * We write this here instead of deferring to hashcmp so that the
+        * compiler can properly inline it and avoid calling memcmp.
+        */
+       if (algop->rawsz == GIT_MAX_RAWSZ)
+               return !memcmp(sha1, sha2, GIT_MAX_RAWSZ);
+       return !memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
+}
+
+static inline void oidcpy(struct object_id *dst, const struct object_id *src)
+{
+       memcpy(dst->hash, src->hash, GIT_MAX_RAWSZ);
+       dst->algo = src->algo;
+}
+
+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 oid_set_algo(struct object_id *oid, const struct git_hash_algo *algop)
+{
+       oid->algo = hash_algo_by_ptr(algop);
+}
+
+/*
+ * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
+ * for use in hash tables. Cryptographic hashes are supposed to have
+ * uniform distribution, so in contrast to `memhash()`, this just copies
+ * the first `sizeof(int)` bytes without shuffling any bits. Note that
+ * the results will be different on big-endian and little-endian
+ * platforms, so they should not be stored or transferred over the net.
+ */
+static inline unsigned int oidhash(const struct object_id *oid)
+{
+       /*
+        * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on
+        * platforms that don't support unaligned reads.
+        */
+       unsigned int hash;
+       memcpy(&hash, oid->hash, sizeof(hash));
+       return hash;
+}
+
+const char *empty_tree_oid_hex(void);
+const char *empty_blob_oid_hex(void);
+
+#endif
index b98ed5e11e8a3af02a99b6d2a977cc804a122414..9f0f95e2b9e0c44e79bfe6ee3ec43b61e7991f4a 100644 (file)
@@ -1,5 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hash.h"
 #include "hash-lookup.h"
+#include "read-cache-ll.h"
 
 static uint32_t take2(const struct object_id *oid, size_t ofs)
 {
diff --git a/hash.h b/hash.h
index d39f73618cb8d9e8678ccf3d0794fbef1a55243c..615ae0691d070b4bdc110fecad3a0c484d2b234c 100644 (file)
--- a/hash.h
+++ b/hash.h
 #ifndef HASH_H
 #define HASH_H
 
+#include "hash-ll.h"
 #include "repository.h"
 
-#if defined(SHA1_APPLE)
-#include <CommonCrypto/CommonDigest.h>
-#elif defined(SHA1_OPENSSL)
-#include <openssl/sha.h>
-#elif defined(SHA1_DC)
-#include "sha1dc_git.h"
-#else /* SHA1_BLK */
-#include "block-sha1/sha1.h"
-#endif
-
-#if defined(SHA256_NETTLE)
-#include "sha256/nettle.h"
-#elif defined(SHA256_GCRYPT)
-#define SHA256_NEEDS_CLONE_HELPER
-#include "sha256/gcrypt.h"
-#elif defined(SHA256_OPENSSL)
-#include <openssl/sha.h>
-#else
-#include "sha256/block/sha256.h"
-#endif
-
-#ifndef platform_SHA_CTX
-/*
- * platform's underlying implementation of SHA-1; could be OpenSSL,
- * blk_SHA, Apple CommonCrypto, etc...  Note that the relevant
- * SHA-1 header may have already defined platform_SHA_CTX for our
- * own implementations like block-sha1, so we list
- * the default for OpenSSL compatible SHA-1 implementations here.
- */
-#define platform_SHA_CTX       SHA_CTX
-#define platform_SHA1_Init     SHA1_Init
-#define platform_SHA1_Update   SHA1_Update
-#define platform_SHA1_Final            SHA1_Final
-#endif
-
-#define git_SHA_CTX            platform_SHA_CTX
-#define git_SHA1_Init          platform_SHA1_Init
-#define git_SHA1_Update                platform_SHA1_Update
-#define git_SHA1_Final         platform_SHA1_Final
-
-#ifndef platform_SHA256_CTX
-#define platform_SHA256_CTX    SHA256_CTX
-#define platform_SHA256_Init   SHA256_Init
-#define platform_SHA256_Update SHA256_Update
-#define platform_SHA256_Final  SHA256_Final
-#endif
-
-#define git_SHA256_CTX         platform_SHA256_CTX
-#define git_SHA256_Init                platform_SHA256_Init
-#define git_SHA256_Update      platform_SHA256_Update
-#define git_SHA256_Final       platform_SHA256_Final
-
-#ifdef platform_SHA256_Clone
-#define git_SHA256_Clone       platform_SHA256_Clone
-#endif
-
-#ifdef SHA1_MAX_BLOCK_SIZE
-#include "compat/sha1-chunked.h"
-#undef git_SHA1_Update
-#define git_SHA1_Update                git_SHA1_Update_Chunked
-#endif
-
-static inline void git_SHA1_Clone(git_SHA_CTX *dst, const git_SHA_CTX *src)
-{
-       memcpy(dst, src, sizeof(*dst));
-}
-
-#ifndef SHA256_NEEDS_CLONE_HELPER
-static inline void git_SHA256_Clone(git_SHA256_CTX *dst, const git_SHA256_CTX *src)
-{
-       memcpy(dst, src, sizeof(*dst));
-}
-#endif
-
-/*
- * Note that these constants are suitable for indexing the hash_algos array and
- * comparing against each other, but are otherwise arbitrary, so they should not
- * be exposed to the user or serialized to disk.  To know whether a
- * git_hash_algo struct points to some usable hash function, test the format_id
- * field for being non-zero.  Use the name field for user-visible situations and
- * the format_id field for fixed-length fields on disk.
- */
-/* An unknown hash function. */
-#define GIT_HASH_UNKNOWN 0
-/* SHA-1 */
-#define GIT_HASH_SHA1 1
-/* SHA-256  */
-#define GIT_HASH_SHA256 2
-/* Number of algorithms supported (including unknown). */
-#define GIT_HASH_NALGOS (GIT_HASH_SHA256 + 1)
-
-/* "sha1", big-endian */
-#define GIT_SHA1_FORMAT_ID 0x73686131
-
-/* The length in bytes and in hex digits of an object name (SHA-1 value). */
-#define GIT_SHA1_RAWSZ 20
-#define GIT_SHA1_HEXSZ (2 * GIT_SHA1_RAWSZ)
-/* The block size of SHA-1. */
-#define GIT_SHA1_BLKSZ 64
-
-/* "s256", big-endian */
-#define GIT_SHA256_FORMAT_ID 0x73323536
-
-/* The length in bytes and in hex digits of an object name (SHA-256 value). */
-#define GIT_SHA256_RAWSZ 32
-#define GIT_SHA256_HEXSZ (2 * GIT_SHA256_RAWSZ)
-/* The block size of SHA-256. */
-#define GIT_SHA256_BLKSZ 64
-
-/* The length in byte and in hex digits of the largest possible hash value. */
-#define GIT_MAX_RAWSZ GIT_SHA256_RAWSZ
-#define GIT_MAX_HEXSZ GIT_SHA256_HEXSZ
-/* The largest possible block size for any supported hash. */
-#define GIT_MAX_BLKSZ GIT_SHA256_BLKSZ
-
-struct object_id {
-       unsigned char hash[GIT_MAX_RAWSZ];
-       int algo;       /* XXX requires 4-byte alignment */
-};
-
-#define GET_OID_QUIETLY           01
-#define GET_OID_COMMIT            02
-#define GET_OID_COMMITTISH        04
-#define GET_OID_TREE             010
-#define GET_OID_TREEISH          020
-#define GET_OID_BLOB             040
-#define GET_OID_FOLLOW_SYMLINKS 0100
-#define GET_OID_RECORD_PATH     0200
-#define GET_OID_ONLY_TO_DIE    04000
-#define GET_OID_REQUIRE_PATH  010000
-
-#define GET_OID_DISAMBIGUATORS \
-       (GET_OID_COMMIT | GET_OID_COMMITTISH | \
-       GET_OID_TREE | GET_OID_TREEISH | \
-       GET_OID_BLOB)
-
-enum get_oid_result {
-       FOUND = 0,
-       MISSING_OBJECT = -1, /* The requested object is missing */
-       SHORT_NAME_AMBIGUOUS = -2,
-       /* The following only apply when symlinks are followed */
-       DANGLING_SYMLINK = -4, /*
-                               * The initial symlink is there, but
-                               * (transitively) points to a missing
-                               * in-tree file
-                               */
-       SYMLINK_LOOP = -5,
-       NOT_DIR = -6, /*
-                      * Somewhere along the symlink chain, a path is
-                      * requested which contains a file as a
-                      * non-final element.
-                      */
-};
-
-/* A suitably aligned type for stack allocations of hash contexts. */
-union git_hash_ctx {
-       git_SHA_CTX sha1;
-       git_SHA256_CTX sha256;
-};
-typedef union git_hash_ctx git_hash_ctx;
-
-typedef void (*git_hash_init_fn)(git_hash_ctx *ctx);
-typedef void (*git_hash_clone_fn)(git_hash_ctx *dst, const git_hash_ctx *src);
-typedef void (*git_hash_update_fn)(git_hash_ctx *ctx, const void *in, size_t len);
-typedef void (*git_hash_final_fn)(unsigned char *hash, git_hash_ctx *ctx);
-typedef void (*git_hash_final_oid_fn)(struct object_id *oid, git_hash_ctx *ctx);
-
-struct git_hash_algo {
-       /*
-        * The name of the algorithm, as appears in the config file and in
-        * messages.
-        */
-       const char *name;
-
-       /* A four-byte version identifier, used in pack indices. */
-       uint32_t format_id;
-
-       /* The length of the hash in binary. */
-       size_t rawsz;
-
-       /* The length of the hash in hex characters. */
-       size_t hexsz;
-
-       /* The block size of the hash. */
-       size_t blksz;
-
-       /* The hash initialization function. */
-       git_hash_init_fn init_fn;
-
-       /* The hash context cloning function. */
-       git_hash_clone_fn clone_fn;
-
-       /* The hash update function. */
-       git_hash_update_fn update_fn;
-
-       /* The hash finalization function. */
-       git_hash_final_fn final_fn;
-
-       /* The hash finalization function for object IDs. */
-       git_hash_final_oid_fn final_oid_fn;
-
-       /* The OID of the empty tree. */
-       const struct object_id *empty_tree;
-
-       /* The OID of the empty blob. */
-       const struct object_id *empty_blob;
-
-       /* The all-zeros OID. */
-       const struct object_id *null_oid;
-};
-extern const struct git_hash_algo hash_algos[GIT_HASH_NALGOS];
-
-/*
- * Return a GIT_HASH_* constant based on the name.  Returns GIT_HASH_UNKNOWN if
- * the name doesn't match a known algorithm.
- */
-int hash_algo_by_name(const char *name);
-/* Identical, except based on the format ID. */
-int hash_algo_by_id(uint32_t format_id);
-/* Identical, except based on the length. */
-int hash_algo_by_length(int len);
-/* Identical, except for a pointer to struct git_hash_algo. */
-static inline int hash_algo_by_ptr(const struct git_hash_algo *p)
-{
-       return p - hash_algos;
-}
-
 #define the_hash_algo the_repository->hash_algo
 
-const struct object_id *null_oid(void);
-
-static inline int hashcmp_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
-{
-       /*
-        * 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 (algop->rawsz == GIT_MAX_RAWSZ)
-               return memcmp(sha1, sha2, GIT_MAX_RAWSZ);
-       return memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
-}
-
 static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
 {
        return hashcmp_algop(sha1, sha2, the_hash_algo);
@@ -260,17 +21,6 @@ static inline int oidcmp(const struct object_id *oid1, const struct object_id *o
        return hashcmp_algop(oid1->hash, oid2->hash, algop);
 }
 
-static inline int hasheq_algop(const unsigned char *sha1, const unsigned char *sha2, const struct git_hash_algo *algop)
-{
-       /*
-        * We write this here instead of deferring to hashcmp so that the
-        * compiler can properly inline it and avoid calling memcmp.
-        */
-       if (algop->rawsz == GIT_MAX_RAWSZ)
-               return !memcmp(sha1, sha2, GIT_MAX_RAWSZ);
-       return !memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
-}
-
 static inline int hasheq(const unsigned char *sha1, const unsigned char *sha2)
 {
        return hasheq_algop(sha1, sha2, the_hash_algo);
@@ -296,12 +46,6 @@ 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);
-       dst->algo = src->algo;
-}
-
 /* Like oidcpy() but zero-pads the unused bytes in dst's hash array. */
 static inline void oidcpy_with_padding(struct object_id *dst,
                                       const struct object_id *src)
@@ -318,13 +62,6 @@ static inline void oidcpy_with_padding(struct object_id *dst,
        dst->algo = src->algo;
 }
 
-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);
@@ -362,12 +99,4 @@ static inline int is_empty_tree_oid(const struct object_id *oid)
        return oideq(oid, the_hash_algo->empty_tree);
 }
 
-static inline void oid_set_algo(struct object_id *oid, const struct git_hash_algo *algop)
-{
-       oid->algo = hash_algo_by_ptr(algop);
-}
-
-const char *empty_tree_oid_hex(void);
-const char *empty_blob_oid_hex(void);
-
 #endif
index e2cf9c78d84ff3046844af498b9539d1edb83445..c8216e47bb21171a59cdcc1f17b600ae60699dfa 100644 (file)
--- a/hashmap.h
+++ b/hashmap.h
@@ -1,8 +1,6 @@
 #ifndef HASHMAP_H
 #define HASHMAP_H
 
-#include "hash.h"
-
 /*
  * Generic implementation of hash-based key-value mappings.
  *
@@ -120,25 +118,6 @@ unsigned int memhash(const void *buf, size_t len);
 unsigned int memihash(const void *buf, size_t len);
 unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len);
 
-/*
- * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
- * for use in hash tables. Cryptographic hashes are supposed to have
- * uniform distribution, so in contrast to `memhash()`, this just copies
- * the first `sizeof(int)` bytes without shuffling any bits. Note that
- * the results will be different on big-endian and little-endian
- * platforms, so they should not be stored or transferred over the net.
- */
-static inline unsigned int oidhash(const struct object_id *oid)
-{
-       /*
-        * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on
-        * platforms that don't support unaligned reads.
-        */
-       unsigned int hash;
-       memcpy(&hash, oid->hash, sizeof(hash));
-       return hash;
-}
-
 /*
  * struct hashmap_entry is an opaque structure representing an entry in the
  * hash table.
diff --git a/help.c b/help.c
index 5d7637dce92867c1c0bee7f6f6b904852d237222..6d2ebfbd2a45f134bc45c039cb4cf26b402b8f6c 100644 (file)
--- a/help.c
+++ b/help.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "builtin.h"
 #include "exec-cmd.h"
@@ -309,7 +308,8 @@ void load_command_list(const char *prefix,
        exclude_cmds(other_cmds, main_cmds);
 }
 
-static int get_colopts(const char *var, const char *value, void *data)
+static int get_colopts(const char *var, const char *value,
+                      const struct config_context *ctx UNUSED, void *data)
 {
        unsigned int *colopts = data;
 
@@ -459,7 +459,8 @@ void list_developer_interfaces_help(void)
        putchar('\n');
 }
 
-static int get_alias(const char *var, const char *value, void *data)
+static int get_alias(const char *var, const char *value,
+                    const struct config_context *ctx UNUSED, void *data)
 {
        struct string_list *list = data;
 
@@ -543,6 +544,7 @@ static struct cmdnames aliases;
 #define AUTOCORRECT_IMMEDIATELY (-1)
 
 static int git_unknown_cmd_config(const char *var, const char *value,
+                                 const struct config_context *ctx,
                                  void *cb UNUSED)
 {
        const char *p;
@@ -557,7 +559,7 @@ static int git_unknown_cmd_config(const char *var, const char *value,
                } else if (!strcmp(value, "prompt")) {
                        autocorrect = AUTOCORRECT_PROMPT;
                } else {
-                       int v = git_config_int(var, value);
+                       int v = git_config_int(var, value, ctx->kvi);
                        autocorrect = (v < 0)
                                ? AUTOCORRECT_IMMEDIATELY : v;
                }
diff --git a/hex.c b/hex.c
index 0a1bddc1284320fa4709715d53a6d59905cc3d8c..01f17fe5c906e6f8dd225b7c07bfb725a54a48a8 100644 (file)
--- a/hex.c
+++ b/hex.c
@@ -1,4 +1,5 @@
 #include "git-compat-util.h"
+#include "hash.h"
 #include "hex.h"
 
 const signed char hexval_table[256] = {
@@ -62,7 +63,7 @@ static int get_hash_hex_algop(const char *hex, unsigned char *hash,
        return 0;
 }
 
-int get_sha1_hex(const char *hex, unsigned char *sha1)
+int get_hash_hex(const char *hex, unsigned char *sha1)
 {
        return get_hash_hex_algop(hex, sha1, the_hash_algo);
 }
diff --git a/hex.h b/hex.h
index e2abfc56faee1839f1df31d82f9ba0f60452e730..87abf6660214151a50f45197572b6749c10944cc 100644 (file)
--- a/hex.h
+++ b/hex.h
@@ -1,7 +1,7 @@
 #ifndef HEX_H
 #define HEX_H
 
-#include "hash.h"
+#include "hash-ll.h"
 
 extern const signed char hexval_table[256];
 static inline unsigned int hexval(unsigned char c)
@@ -20,14 +20,16 @@ static inline int hex2chr(const char *s)
 }
 
 /*
- * Try to read a SHA1 in hexadecimal format from the 40 characters
- * starting at hex.  Write the 20-byte result to sha1 in binary form.
+ * Try to read a hash (specified by the_hash_algo) in hexadecimal
+ * format from the 40 (or whatever length the hash algorithm uses)
+ * characters starting at hex.  Write the 20-byte (or the length of
+ * the hash) result to hash in binary form.
  * Return 0 on success.  Reading stops if a NUL is encountered in the
  * input, so it is safe to pass this function an arbitrary
  * null-terminated string.
  */
-int get_sha1_hex(const char *hex, unsigned char *sha1);
-int get_oid_hex(const char *hex, struct object_id *sha1);
+int get_hash_hex(const char *hex, unsigned char *hash);
+int get_oid_hex(const char *hex, struct object_id *oid);
 
 /* Like get_oid_hex, but for an arbitrary hash algorithm. */
 int get_oid_hex_algop(const char *hex, struct object_id *oid, const struct git_hash_algo *algop);
diff --git a/hook.c b/hook.c
index 76e322f5804852ee44850fcf8339efc1ce785260..f6306d72b31879705977a023a7865c3f1677404c 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -1,7 +1,9 @@
 #include "git-compat-util.h"
+#include "abspath.h"
 #include "advice.h"
 #include "gettext.h"
 #include "hook.h"
+#include "path.h"
 #include "run-command.h"
 #include "config.h"
 #include "strbuf.h"
index 89aad1b42c7f1e14868fb28d963c20979fe452ad..ff07b87e6461446610c35708a39f22a5e5b36aff 100644 (file)
@@ -1,8 +1,9 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
+#include "git-zlib.h"
 #include "hex.h"
+#include "path.h"
 #include "repository.h"
 #include "refs.h"
 #include "pkt-line.h"
 #include "url.h"
 #include "strvec.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "protocol.h"
 #include "date.h"
-#include "wrapper.h"
 #include "write-or-die.h"
 
 static const char content_type[] = "Content-Type";
@@ -558,7 +558,7 @@ static void get_info_refs(struct strbuf *hdr, char *arg UNUSED)
 
        } else {
                select_getanyfile(hdr);
-               for_each_namespaced_ref(show_text_ref, &buf);
+               for_each_namespaced_ref(NULL, show_text_ref, &buf);
                send_strbuf(hdr, "text/plain", &buf);
        }
        strbuf_release(&buf);
index c874d3402dd920e97704b22650e7873a2b3e3bb5..fffda592670e667e81eb92af218f9a4d95d7614d 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "exec-cmd.h"
 #include "gettext.h"
index 88b70f2c44f8291814693dbaae079445ba54bd61..a704f490fdb2c2144b47a5629ed9ee0643ab0d83 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "hex.h"
 #include "repository.h"
 #include "setup.h"
 #include "sigchain.h"
 #include "strvec.h"
+#include "tree.h"
+#include "tree-walk.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit-reach.h"
 
 #ifdef EXPAT_NEEDS_XMLPARSE_H
@@ -781,7 +783,7 @@ static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
 static void one_remote_ref(const char *refname);
 
 static void
-xml_start_tag(void *userData, const char *name, const char **atts)
+xml_start_tag(void *userData, const char *name, const char **atts UNUSED)
 {
        struct xml_ctx *ctx = (struct xml_ctx *)userData;
        const char *c = strchr(name, ':');
index e5dadae377009a642ebf446694a463b57c2b96e1..78d99f7c4b002cb95196800a62a1de8fbcce6cea 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "repository.h"
 #include "commit.h"
 #include "hex.h"
@@ -7,7 +7,7 @@
 #include "list.h"
 #include "transport.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 struct alt_base {
        char *base;
diff --git a/http.c b/http.c
index d5d82c5230f84194442634a84a894d5af74036cc..e138b4b96fb9e201623339eada35f9499b5ba371 100644 (file)
--- a/http.c
+++ b/http.c
 #include "version.h"
 #include "pkt-line.h"
 #include "gettext.h"
+#include "trace.h"
 #include "transport.h"
 #include "packfile.h"
 #include "protocol.h"
 #include "string-list.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 
 static struct trace_key trace_curl = TRACE_KEY_INIT(CURL);
 static int trace_curl_data = 1;
@@ -194,7 +196,7 @@ static inline int is_hdr_continuation(const char *ptr, const size_t size)
        return size && (*ptr == ' ' || *ptr == '\t');
 }
 
-static size_t fwrite_wwwauth(char *ptr, size_t eltsize, size_t nmemb, void *p)
+static size_t fwrite_wwwauth(char *ptr, size_t eltsize, size_t nmemb, void *p UNUSED)
 {
        size_t size = eltsize * nmemb;
        struct strvec *values = &http_auth.wwwauth_headers;
@@ -293,7 +295,8 @@ exit:
        return size;
 }
 
-size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf)
+size_t fwrite_null(char *ptr UNUSED, size_t eltsize UNUSED, size_t nmemb,
+                  void *data UNUSED)
 {
        return nmemb;
 }
@@ -361,7 +364,8 @@ static void process_curl_messages(void)
        }
 }
 
-static int http_options(const char *var, const char *value, void *cb)
+static int http_options(const char *var, const char *value,
+                       const struct config_context *ctx, void *data)
 {
        if (!strcmp("http.version", var)) {
                return git_config_string(&curl_http_version, var, value);
@@ -411,21 +415,21 @@ static int http_options(const char *var, const char *value, void *cb)
        }
 
        if (!strcmp("http.minsessions", var)) {
-               min_curl_sessions = git_config_int(var, value);
+               min_curl_sessions = git_config_int(var, value, ctx->kvi);
                if (min_curl_sessions > 1)
                        min_curl_sessions = 1;
                return 0;
        }
        if (!strcmp("http.maxrequests", var)) {
-               max_requests = git_config_int(var, value);
+               max_requests = git_config_int(var, value, ctx->kvi);
                return 0;
        }
        if (!strcmp("http.lowspeedlimit", var)) {
-               curl_low_speed_limit = (long)git_config_int(var, value);
+               curl_low_speed_limit = (long)git_config_int(var, value, ctx->kvi);
                return 0;
        }
        if (!strcmp("http.lowspeedtime", var)) {
-               curl_low_speed_time = (long)git_config_int(var, value);
+               curl_low_speed_time = (long)git_config_int(var, value, ctx->kvi);
                return 0;
        }
 
@@ -461,7 +465,7 @@ static int http_options(const char *var, const char *value, void *cb)
        }
 
        if (!strcmp("http.postbuffer", var)) {
-               http_post_buffer = git_config_ssize_t(var, value);
+               http_post_buffer = git_config_ssize_t(var, value, ctx->kvi);
                if (http_post_buffer < 0)
                        warning(_("negative value for http.postBuffer; defaulting to %d"), LARGE_PACKET_MAX);
                if (http_post_buffer < LARGE_PACKET_MAX)
@@ -532,7 +536,7 @@ static int http_options(const char *var, const char *value, void *cb)
        }
 
        /* Fall back on the default ones */
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, data);
 }
 
 static int curl_empty_auth_enabled(void)
@@ -744,7 +748,8 @@ static void redact_sensitive_info_header(struct strbuf *header)
         *   h2h3 [<header-name>: <header-val>]
         */
        if (trace_curl_redact &&
-           skip_iprefix(header->buf, "h2h3 [", &sensitive_header)) {
+           (skip_iprefix(header->buf, "h2h3 [", &sensitive_header) ||
+            skip_iprefix(header->buf, "h2 [", &sensitive_header))) {
                if (redact_sensitive_header(header, sensitive_header - header->buf)) {
                        /* redaction ate our closing bracket */
                        strbuf_addch(header, ']');
@@ -817,7 +822,9 @@ static void curl_dump_info(char *data, size_t size)
        strbuf_release(&buf);
 }
 
-static int curl_trace(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
+static int curl_trace(CURL *handle UNUSED, curl_infotype type,
+                     char *data, size_t size,
+                     void *userp UNUSED)
 {
        const char *text;
        enum { NO_FILTER = 0, DO_FILTER = 1 };
diff --git a/http.h b/http.h
index 77c042706c6597e347d1b8cc05d3f5972e2de117..3a409bccd4e6197874a97629c36b050ca923b944 100644 (file)
--- a/http.h
+++ b/http.h
@@ -1,7 +1,9 @@
 #ifndef HTTP_H
 #define HTTP_H
 
-#include "cache.h"
+struct packed_git;
+
+#include "git-zlib.h"
 
 #include <curl/curl.h>
 #include <curl/easy.h>
diff --git a/ident.c b/ident.c
index 8fad92d7007e2101d630680f4aecd9626c97d6bd..cc7afdbf8197e981e02b6257a4618197063db69f 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -203,7 +203,6 @@ void reset_ident_date(void)
 static int crud(unsigned char c)
 {
        return  c <= 32  ||
-               c == '.' ||
                c == ',' ||
                c == ':' ||
                c == ';' ||
@@ -671,7 +670,9 @@ static int set_ident(const char *var, const char *value)
        return 0;
 }
 
-int git_ident_config(const char *var, const char *value, void *data UNUSED)
+int git_ident_config(const char *var, const char *value,
+                    const struct config_context *ctx UNUSED,
+                    void *data UNUSED)
 {
        if (!strcmp(var, "user.useconfigonly")) {
                ident_use_config_only = git_config_bool(var, value);
diff --git a/ident.h b/ident.h
index 96a64896a0167381228af77cbfec4cb56c428ec7..6a79febba15feabb8418ee6441a47553e616c6ec 100644 (file)
--- a/ident.h
+++ b/ident.h
@@ -62,6 +62,8 @@ const char *fmt_name(enum want_ident);
 int committer_ident_sufficiently_given(void);
 int author_ident_sufficiently_given(void);
 
-int git_ident_config(const char *, const char *, void *);
+struct config_context;
+int git_ident_config(const char *, const char *, const struct config_context *,
+                    void *);
 
 #endif
index a62424e90a4d52e933749298529829cf267bb6b0..06386e0b3bd878b163624f49e953686d4d49f8d1 100644 (file)
@@ -29,7 +29,7 @@
 #include "run-command.h"
 #include "parse-options.h"
 #include "setup.h"
-#include "wrapper.h"
+#include "strbuf.h"
 #if defined(NO_OPENSSL) && !defined(HAVE_OPENSSL_CSPRNG)
 typedef void *SSL;
 #endif
@@ -136,12 +136,10 @@ struct imap_store {
 };
 
 struct imap_cmd_cb {
-       int (*cont)(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt);
-       void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
+       int (*cont)(struct imap_store *ctx, const char *prompt);
        void *ctx;
        char *data;
        int dlen;
-       int uid;
 };
 
 struct imap_cmd {
@@ -785,7 +783,7 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
                                if (n != (int)cmdp->cb.dlen)
                                        return RESP_BAD;
                        } else if (cmdp->cb.cont) {
-                               if (cmdp->cb.cont(ctx, cmdp, cmd))
+                               if (cmdp->cb.cont(ctx, cmd))
                                        return RESP_BAD;
                        } else {
                                fprintf(stderr, "IMAP error: unexpected command continuation request\n");
@@ -827,8 +825,6 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
                        }
                        if ((resp2 = parse_response_code(ctx, &cmdp->cb, cmd)) > resp)
                                resp = resp2;
-                       if (cmdp->cb.done)
-                               cmdp->cb.done(ctx, cmdp, resp);
                        free(cmdp->cb.data);
                        free(cmdp->cmd);
                        free(cmdp);
@@ -916,7 +912,7 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
 
 #endif
 
-static int auth_cram_md5(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt)
+static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
 {
        int ret;
        char *response;
@@ -1322,7 +1318,8 @@ static int split_msg(struct strbuf *all_msgs, struct strbuf *msg, int *ofs)
        return 1;
 }
 
-static int git_imap_config(const char *var, const char *val, void *cb)
+static int git_imap_config(const char *var, const char *val,
+                          const struct config_context *ctx, void *cb)
 {
 
        if (!strcmp("imap.sslverify", var))
@@ -1340,7 +1337,7 @@ static int git_imap_config(const char *var, const char *val, void *cb)
        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);
+               server.port = git_config_int(var, val, ctx->kvi);
        else if (!strcmp("imap.host", var)) {
                if (!val) {
                        git_die_config("imap.host", "Missing value for 'imap.host'");
@@ -1356,7 +1353,7 @@ static int git_imap_config(const char *var, const char *val, void *cb)
                        server.host = xstrdup(val);
                }
        } else
-               return git_default_config(var, val, cb);
+               return git_default_config(var, val, ctx, cb);
 
        return 0;
 }
@@ -1414,16 +1411,16 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
        if (!curl)
                die("curl_easy_init failed");
 
-       server_fill_credential(&server, cred);
-       curl_easy_setopt(curl, CURLOPT_USERNAME, server.user);
-       curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass);
+       server_fill_credential(srvc, cred);
+       curl_easy_setopt(curl, CURLOPT_USERNAME, srvc->user);
+       curl_easy_setopt(curl, CURLOPT_PASSWORD, srvc->pass);
 
-       strbuf_addstr(&path, server.use_ssl ? "imaps://" : "imap://");
-       strbuf_addstr(&path, server.host);
+       strbuf_addstr(&path, srvc->use_ssl ? "imaps://" : "imap://");
+       strbuf_addstr(&path, srvc->host);
        if (!path.len || path.buf[path.len - 1] != '/')
                strbuf_addch(&path, '/');
 
-       uri_encoded_folder = curl_easy_escape(curl, server.folder, 0);
+       uri_encoded_folder = curl_easy_escape(curl, srvc->folder, 0);
        if (!uri_encoded_folder)
                die("failed to encode server folder");
        strbuf_addstr(&path, uri_encoded_folder);
@@ -1431,25 +1428,25 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
 
        curl_easy_setopt(curl, CURLOPT_URL, path.buf);
        strbuf_release(&path);
-       curl_easy_setopt(curl, CURLOPT_PORT, server.port);
+       curl_easy_setopt(curl, CURLOPT_PORT, srvc->port);
 
-       if (server.auth_method) {
+       if (srvc->auth_method) {
 #ifndef GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS
                warning("No LOGIN_OPTIONS support in this cURL version");
 #else
                struct strbuf auth = STRBUF_INIT;
                strbuf_addstr(&auth, "AUTH=");
-               strbuf_addstr(&auth, server.auth_method);
+               strbuf_addstr(&auth, srvc->auth_method);
                curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
                strbuf_release(&auth);
 #endif
        }
 
-       if (!server.use_ssl)
+       if (!srvc->use_ssl)
                curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
 
-       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, server.ssl_verify);
-       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, server.ssl_verify);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, srvc->ssl_verify);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, srvc->ssl_verify);
 
        curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
 
diff --git a/khash.h b/khash.h
index 85362718c565e727da2beb9b10c9f32dd44a505a..ff8816317785862662b1eeb2fe5036b801be1773 100644 (file)
--- a/khash.h
+++ b/khash.h
@@ -26,7 +26,7 @@
 #ifndef __AC_KHASH_H
 #define __AC_KHASH_H
 
-#include "hashmap.h"
+#include "hash.h"
 
 #define AC_VERSION_KHASH_H "0.2.8"
 
@@ -61,7 +61,7 @@ static inline khint_t __ac_X31_hash_string(const char *s)
 static const double __ac_HASH_UPPER = 0.77;
 
 #define __KHASH_TYPE(name, khkey_t, khval_t) \
-       typedef struct { \
+       typedef struct kh_##name { \
                khint_t n_buckets, size, n_occupied, upper_bound; \
                khint32_t *flags; \
                khkey_t *keys; \
diff --git a/kwset.c b/kwset.c
index 4b14d4f86b8d1965023a49586fdd56631631cb8e..bbfcf815a567b053bd0206ddb7bb38d138731bd1 100644 (file)
--- a/kwset.c
+++ b/kwset.c
@@ -49,6 +49,42 @@ static void *obstack_chunk_alloc(long size)
 
 #define U(c) ((unsigned char) (c))
 
+/* For case-insensitive kwset */
+const unsigned char tolower_trans_tbl[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+        ' ',  '!',  '"',  '#',  '$',  '%',  '&', 0x27,
+        '(',  ')',  '*',  '+',  ',',  '-',  '.',  '/',
+        '0',  '1',  '2',  '3',  '4',  '5',  '6',  '7',
+        '8',  '9',  ':',  ';',  '<',  '=',  '>',  '?',
+        '@',  'a',  'b',  'c',  'd',  'e',  'f',  'g',
+        'h',  'i',  'j',  'k',  'l',  'm',  'n',  'o',
+        'p',  'q',  'r',  's',  't',  'u',  'v',  'w',
+        'x',  'y',  'z',  '[', 0x5c,  ']',  '^',  '_',
+        '`',  'a',  'b',  'c',  'd',  'e',  'f',  'g',
+        'h',  'i',  'j',  'k',  'l',  'm',  'n',  'o',
+        'p',  'q',  'r',  's',  't',  'u',  'v',  'w',
+        'x',  'y',  'z',  '{',  '|',  '}',  '~', 0x7f,
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
+};
+
 /* Balanced tree of edges and labels leaving a given trie node. */
 struct tree
 {
diff --git a/kwset.h b/kwset.h
index f50ecae573b9ff77e0169fa93e733e68ef9fa300..d42a793a301cb6d7ba758a5d592516cdf9d8444f 100644 (file)
--- a/kwset.h
+++ b/kwset.h
@@ -26,6 +26,8 @@
    The author may be reached (Email) at the address mike@ai.mit.edu,
    or (US mail) as Mike Haertel c/o Free Software Foundation. */
 
+extern const unsigned char tolower_trans_tbl[256];
+
 struct kwsmatch
 {
   int index;                   /* Index number of matching keyword. */
index 10c19daec4ae7430ed7a252eadbb61fc6e0e10d3..790ab732127d04df57b330f06b43785532fd68b9 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "line-range.h"
 #include "hex.h"
 #include "tag.h"
@@ -8,6 +7,7 @@
 #include "diff.h"
 #include "commit.h"
 #include "decorate.h"
+#include "repository.h"
 #include "revision.h"
 #include "xdiff-interface.h"
 #include "strbuf.h"
@@ -18,6 +18,7 @@
 #include "setup.h"
 #include "strvec.h"
 #include "bloom.h"
+#include "tree-walk.h"
 
 static void range_set_grow(struct range_set *rs, size_t extra)
 {
index 2a3b7881af2bf5960dfbd41934aa3c66ad2a90eb..8a08b7af49c1ff7750296508102bf67807027bea 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "commit.h"
 #include "config.h"
 #include "gettext.h"
index f6206125868eb06cc448182418c23b3e4c9e95a6..55fab8563d20a5a7ada0e9fd1215303808c5853d 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "gettext.h"
 #include "object.h"
-#include "string-list.h"
 #include "strbuf.h"
 
 struct option;
index 298ca08711e31a95cd594381c2d45e50079a373f..9327ccd5057cb6fffc9fcd9a92f2939a50b50253 100644 (file)
@@ -1,5 +1,4 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "dir.h"
 #include "gettext.h"
 #include "hex.h"
@@ -15,7 +14,8 @@
 #include "list-objects-filter-options.h"
 #include "oidmap.h"
 #include "oidset.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 
 /* Remember to update object flag allocation in object.h */
 /*
index df18d103063dccb4661f7d809106cc2b1c006a35..e60a6cd5b46ef8ded2dfbbe86d75cd8d107f548d 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "tag.h"
 #include "commit.h"
 #include "gettext.h"
@@ -12,7 +12,7 @@
 #include "list-objects-filter.h"
 #include "list-objects-filter-options.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "trace.h"
 
 struct traversal_context {
@@ -102,7 +102,7 @@ static void process_tree_contents(struct traversal_context *ctx,
        while (tree_entry(&desc, &entry)) {
                if (match != all_entries_interesting) {
                        match = tree_entry_interesting(ctx->revs->repo->index,
-                                                      &entry, base, 0,
+                                                      &entry, base,
                                                       &ctx->revs->diffopt.pathspec);
                        if (match == all_entries_not_interesting)
                                break;
index dbb088473e08e784ef5bc32a5f029ca627684b93..208c69cbb79021ad471467292572c5587b103a6d 100644 (file)
@@ -1,10 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "commit-reach.h"
 #include "config.h"
 #include "diff.h"
 #include "environment.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "tmp-objdir.h"
 #include "commit.h"
@@ -15,6 +16,7 @@
 #include "reflog-walk.h"
 #include "refs.h"
 #include "replace-object.h"
+#include "revision.h"
 #include "string-list.h"
 #include "color.h"
 #include "gpg-interface.h"
@@ -23,6 +25,8 @@
 #include "help.h"
 #include "range-diff.h"
 #include "strmap.h"
+#include "tree.h"
+#include "wildmatch.h"
 #include "write-or-die.h"
 
 static struct decoration name_decoration = { "object names" };
@@ -154,7 +158,7 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
 
        if (starts_with(refname, git_replace_ref_base)) {
                struct object_id original_oid;
-               if (!read_replace_refs)
+               if (!replace_refs_enabled(the_repository))
                        return 0;
                if (get_oid_hex(refname + strlen(git_replace_ref_base),
                                &original_oid)) {
index e7e4641cf83c5b7cfd4457b54a88115723ac979d..bdb64328154e519ceaa4138045ee4124c0fb3381 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef LOG_TREE_H
 #define LOG_TREE_H
 
-#include "revision.h"
+struct rev_info;
 
 struct log_info {
        struct commit *commit, *parent;
index b9f3e08ec3d6307ff0bb623434d98e46b13c371e..0e49b932c308b24a5654910d5e0197cf1388162e 100644 (file)
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "repository.h"
 #include "refs.h"
@@ -71,7 +72,7 @@ struct ls_refs_data {
        unsigned symrefs;
        struct strvec prefixes;
        struct strbuf buf;
-       struct string_list hidden_refs;
+       struct strvec hidden_refs;
        unsigned unborn : 1;
 };
 
@@ -136,6 +137,7 @@ static void send_possibly_unborn_head(struct ls_refs_data *data)
 }
 
 static int ls_refs_config(const char *var, const char *value,
+                         const struct config_context *ctx UNUSED,
                          void *cb_data)
 {
        struct ls_refs_data *data = cb_data;
@@ -154,7 +156,7 @@ int ls_refs(struct repository *r, struct packet_reader *request)
        memset(&data, 0, sizeof(data));
        strvec_init(&data.prefixes);
        strbuf_init(&data.buf, 0);
-       string_list_init_dup(&data.hidden_refs);
+       strvec_init(&data.hidden_refs);
 
        git_config(ls_refs_config, &data);
 
@@ -192,11 +194,12 @@ int ls_refs(struct repository *r, struct packet_reader *request)
                strvec_push(&data.prefixes, "");
        refs_for_each_fullref_in_prefixes(get_main_ref_store(r),
                                          get_git_namespace(), data.prefixes.v,
+                                         hidden_refs_to_excludes(&data.hidden_refs),
                                          send_ref, &data);
        packet_fflush(stdout);
        strvec_clear(&data.prefixes);
        strbuf_release(&data.buf);
-       string_list_clear(&data.hidden_refs, 0);
+       strvec_clear(&data.hidden_refs);
        return 0;
 }
 
index 2aeb20e5e6268ebbd14a1a4538bfe8842e1b11ec..931505363cde08b0475f200e9c60fd3c034413b7 100644 (file)
@@ -1241,12 +1241,13 @@ int mailinfo_parse_quoted_cr_action(const char *actionstr, int *action)
        return 0;
 }
 
-static int git_mailinfo_config(const char *var, const char *value, void *mi_)
+static int git_mailinfo_config(const char *var, const char *value,
+                              const struct config_context *ctx, void *mi_)
 {
        struct mailinfo *mi = mi_;
 
        if (!starts_with(var, "mailinfo."))
-               return git_default_config(var, value, NULL);
+               return git_default_config(var, value, ctx, NULL);
        if (!strcmp(var, "mailinfo.scissors")) {
                mi->use_scissors = git_config_bool(var, value);
                return 0;
index 74fd9db448fd6c6523eea2e29f8aacae05f17709..3d6a5e9400f4c8195d0f58ab58f3f9a4dfa0acba 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,8 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "string-list.h"
 #include "mailmap.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "setup.h"
 
 const char *git_mailmap_file;
index 7e99fccb46c92e012fa32fafb6ed27c217fdcc4d..0f8fd2c586feaccd4bb4df772b8e8393148ccf6c 100644 (file)
--- a/mailmap.h
+++ b/mailmap.h
@@ -3,6 +3,9 @@
 
 struct string_list;
 
+extern const char *git_mailmap_file;
+extern const char *git_mailmap_blob;
+
 int read_mailmap(struct string_list *map);
 void clear_mailmap(struct string_list *map);
 
index 5877fc64a8f93612ba65bfa19651d4e392695c55..0885ac681cd5055f80fb5088b04c92eed8e7f291 100644 (file)
@@ -1,8 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "hex.h"
+#include "match-trees.h"
+#include "strbuf.h"
 #include "tree.h"
 #include "tree-walk.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static int score_missing(unsigned mode)
 {
diff --git a/match-trees.h b/match-trees.h
new file mode 100644 (file)
index 0000000..e3877ac
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef MATCH_TREES_H
+#define MATCH_TREES_H
+
+struct object_id;
+struct repository;
+
+void shift_tree(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, int);
+void shift_tree_by(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, const char *);
+
+#endif /* MATCH_TREES_H */
index 5632ff6abb68146b3d6db6a96009a2454f4f339b..9293cbf75c8ab737a2cf7267d3e31ffd93a48dc8 100644 (file)
@@ -1,10 +1,10 @@
 #include "git-compat-util.h"
 #include "run-command.h"
 #include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "blob.h"
 #include "merge-blobs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
 {
similarity index 91%
rename from ll-merge.c
rename to merge-ll.c
index 8be38d3bd4176410cbb1c7d838f0982baab5d726..8fcf2d3710ed1a87bd851abe04dd22a32fafdf84 100644 (file)
@@ -4,14 +4,15 @@
  * Copyright (c) 2007 Junio C Hamano
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
+#include "convert.h"
 #include "attr.h"
 #include "xdiff-interface.h"
 #include "run-command.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "quote.h"
-#include "wrapper.h"
+#include "strbuf.h"
 
 struct ll_merge_driver;
 
@@ -190,24 +191,15 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
                        const struct ll_merge_options *opts,
                        int marker_size)
 {
-       char temp[4][50];
+       char temp[3][50];
        struct strbuf cmd = STRBUF_INIT;
-       struct strbuf_expand_dict_entry dict[6];
-       struct strbuf path_sq = STRBUF_INIT;
+       const char *format = fn->cmdline;
        struct child_process child = CHILD_PROCESS_INIT;
        int status, fd, i;
        struct stat st;
        enum ll_merge_result ret;
        assert(opts);
 
-       sq_quote_buf(&path_sq, path);
-       dict[0].placeholder = "O"; dict[0].value = temp[0];
-       dict[1].placeholder = "A"; dict[1].value = temp[1];
-       dict[2].placeholder = "B"; dict[2].value = temp[2];
-       dict[3].placeholder = "L"; dict[3].value = temp[3];
-       dict[4].placeholder = "P"; dict[4].value = path_sq.buf;
-       dict[5].placeholder = NULL; dict[5].value = NULL;
-
        if (!fn->cmdline)
                die("custom merge driver %s lacks command line.", fn->name);
 
@@ -216,9 +208,23 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
        create_temp(orig, temp[0], sizeof(temp[0]));
        create_temp(src1, temp[1], sizeof(temp[1]));
        create_temp(src2, temp[2], sizeof(temp[2]));
-       xsnprintf(temp[3], sizeof(temp[3]), "%d", marker_size);
 
-       strbuf_expand(&cmd, fn->cmdline, strbuf_expand_dict_cb, &dict);
+       while (strbuf_expand_step(&cmd, &format)) {
+               if (skip_prefix(format, "%", &format))
+                       strbuf_addch(&cmd, '%');
+               else if (skip_prefix(format, "O", &format))
+                       strbuf_addstr(&cmd, temp[0]);
+               else if (skip_prefix(format, "A", &format))
+                       strbuf_addstr(&cmd, temp[1]);
+               else if (skip_prefix(format, "B", &format))
+                       strbuf_addstr(&cmd, temp[2]);
+               else if (skip_prefix(format, "L", &format))
+                       strbuf_addf(&cmd, "%d", marker_size);
+               else if (skip_prefix(format, "P", &format))
+                       sq_quote_buf(&cmd, path);
+               else
+                       strbuf_addch(&cmd, '%');
+       }
 
        child.use_shell = 1;
        strvec_push(&child.args, cmd.buf);
@@ -240,8 +246,13 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
        for (i = 0; i < 3; i++)
                unlink_or_warn(temp[i]);
        strbuf_release(&cmd);
-       strbuf_release(&path_sq);
-       ret = (status > 0) ? LL_MERGE_CONFLICT : status;
+       if (!status)
+               ret = LL_MERGE_OK;
+       else if (status <= 128)
+               ret = LL_MERGE_CONFLICT;
+       else
+               /* died due to a signal: WTERMSIG(status) + 128 */
+               ret = LL_MERGE_ERROR;
        return ret;
 }
 
@@ -252,6 +263,7 @@ static struct ll_merge_driver *ll_user_merge, **ll_user_merge_tail;
 static const char *default_ll_merge;
 
 static int read_merge_config(const char *var, const char *value,
+                            const struct config_context *ctx UNUSED,
                             void *cb UNUSED)
 {
        struct ll_merge_driver *fn;
@@ -392,7 +404,7 @@ enum ll_merge_result ll_merge(mmbuffer_t *result_buf,
                normalize_file(theirs, path, istate);
        }
 
-       git_check_attr(istate, NULL, path, check);
+       git_check_attr(istate, path, check);
        ll_driver_name = check->items[0].value;
        if (check->items[1].value) {
                marker_size = atoi(check->items[1].value);
@@ -420,7 +432,7 @@ int ll_merge_marker_size(struct index_state *istate, const char *path)
 
        if (!check)
                check = attr_check_initl("conflict-marker-size", NULL);
-       git_check_attr(istate, NULL, path, check);
+       git_check_attr(istate, path, check);
        if (check->items[0].value) {
                marker_size = atoi(check->items[0].value);
                if (marker_size <= 0)
similarity index 100%
rename from ll-merge.h
rename to merge-ll.h
index c00dfbab1cde5fc39916e243aca2ba67b1be62f8..4acedf3c3386d7c9c2e57eebabddb1fe9ec27331 100644 (file)
@@ -1,7 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
+#include "hash.h"
 #include "merge-ort.h"
 #include "merge-ort-wrappers.h"
+#include "read-cache-ll.h"
+#include "tree.h"
 
 #include "commit.h"
 
index 5bf64354d168e3577b43ceca2ee25f8cc957f1de..8631c997002dbbdb1282619c77cc3ac8fd96f880 100644 (file)
@@ -14,7 +14,7 @@
  * "cale", "peedy", or "ins" instead of "ort"?)
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "merge-ort.h"
 
 #include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
 #include "entry.h"
-#include "ll-merge.h"
-#include "object-store.h"
+#include "merge-ll.h"
+#include "match-trees.h"
+#include "mem-pool.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
+#include "path.h"
 #include "promisor-remote.h"
+#include "read-cache-ll.h"
 #include "revision.h"
+#include "sparse-index.h"
 #include "strmap.h"
 #include "submodule-config.h"
 #include "submodule.h"
+#include "trace2.h"
 #include "tree.h"
 #include "unpack-trees.h"
 #include "xdiff-interface.h"
@@ -4718,14 +4726,14 @@ void merge_switch_to_result(struct merge_options *opt,
 void merge_finalize(struct merge_options *opt,
                    struct merge_result *result)
 {
-       struct merge_options_internal *opti = result->priv;
-
        if (opt->renormalize)
                git_attr_set_direction(GIT_ATTR_CHECKIN);
        assert(opt->priv == NULL);
 
-       clear_or_reinit_internal_opts(opti, 0);
-       FREE_AND_NULL(opti);
+       if (result->priv) {
+               clear_or_reinit_internal_opts(result->priv, 0);
+               FREE_AND_NULL(result->priv);
+       }
 }
 
 /*** Function Grouping: helper functions for merge_incore_*() ***/
index a994c9a5fcdb040b3ecb80db0489a50c1394ac75..ce56ec1a7802c5eac51d404e03220b83e52ebe1c 100644 (file)
@@ -2,7 +2,7 @@
 #define MERGE_ORT_H
 
 #include "merge-recursive.h"
-#include "hash.h"
+#include "hash-ll.h"
 
 struct commit;
 struct tree;
index ed5534eb57d4ffa874369bad189237d90a2f7cf5..6a4081bb0f522bf556610fa0e11239b5c7fcddb9 100644 (file)
@@ -3,7 +3,7 @@
  * Fredrik Kuivinen.
  * The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "merge-recursive.h"
 
 #include "advice.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "lockfile.h"
-#include "object-store.h"
+#include "match-trees.h"
+#include "name-hash.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "repository.h"
 #include "revision.h"
+#include "sparse-index.h"
 #include "string-list.h"
 #include "submodule-config.h"
 #include "submodule.h"
+#include "symlinks.h"
 #include "tag.h"
 #include "tree-walk.h"
 #include "unpack-trees.h"
-#include "wrapper.h"
 #include "xdiff-interface.h"
 
 struct merge_options_internal {
diff --git a/merge.c b/merge.c
index da7fa652c271b7990f5f6d1d82abb63dc8341261..b60925459c292bbb4a9daae46534edfbb3eca756 100644 (file)
--- a/merge.c
+++ b/merge.c
@@ -1,12 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "lockfile.h"
+#include "merge.h"
 #include "commit.h"
+#include "repository.h"
 #include "run-command.h"
 #include "resolve-undo.h"
+#include "tree.h"
 #include "tree-walk.h"
 #include "unpack-trees.h"
 #include "dir.h"
diff --git a/merge.h b/merge.h
new file mode 100644 (file)
index 0000000..21ac7ef
--- /dev/null
+++ b/merge.h
@@ -0,0 +1,17 @@
+#ifndef MERGE_H
+#define MERGE_H
+
+struct commit_list;
+struct object_id;
+struct repository;
+
+int try_merge_command(struct repository *r,
+               const char *strategy, size_t xopts_nr,
+               const char **xopts, struct commit_list *common,
+               const char *head_arg, struct commit_list *remotes);
+int checkout_fast_forward(struct repository *r,
+                         const struct object_id *from,
+                         const struct object_id *to,
+                         int overwrite_ignore);
+
+#endif /* MERGE_H */
diff --git a/midx.c b/midx.c
index 9af3e5de8899cda69ab885c74bfd0e2b72f53bdb..931f55735037fcc4de53005ef0970e9ed3781885 100644 (file)
--- a/midx.c
+++ b/midx.c
@@ -1,6 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "csum-file.h"
 #include "dir.h"
@@ -8,7 +7,8 @@
 #include "hex.h"
 #include "lockfile.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "hash-lookup.h"
 #include "midx.h"
 #include "progress.h"
@@ -253,7 +253,7 @@ struct object_id *nth_midxed_object_oid(struct object_id *oid,
        if (n >= m->num_objects)
                return NULL;
 
-       oidread(oid, m->chunk_oid_lookup + m->hash_len * n);
+       oidread(oid, m->chunk_oid_lookup + st_mult(m->hash_len, n));
        return oid;
 }
 
@@ -270,7 +270,8 @@ off_t nth_midxed_offset(struct multi_pack_index *m, uint32_t pos)
                        die(_("multi-pack-index stores a 64-bit offset, but off_t is too small"));
 
                offset32 ^= MIDX_LARGE_OFFSET_NEEDED;
-               return get_be64(m->chunk_large_offsets + sizeof(uint64_t) * offset32);
+               return get_be64(m->chunk_large_offsets +
+                               st_mult(sizeof(uint64_t), offset32));
        }
 
        return offset32;
@@ -444,14 +445,14 @@ static int idx_or_pack_name_cmp(const void *_va, const void *_vb)
 
 struct write_midx_context {
        struct pack_info *info;
-       uint32_t nr;
-       uint32_t alloc;
+       size_t nr;
+       size_t alloc;
        struct multi_pack_index *m;
        struct progress *progress;
        unsigned pack_paths_checked;
 
        struct pack_midx_entry *entries;
-       uint32_t entries_nr;
+       size_t entries_nr;
 
        uint32_t *pack_perm;
        uint32_t *pack_order;
@@ -583,12 +584,14 @@ static void fill_pack_entry(uint32_t pack_int_id,
 
 struct midx_fanout {
        struct pack_midx_entry *entries;
-       uint32_t nr;
-       uint32_t alloc;
+       size_t nr, alloc;
 };
 
-static void midx_fanout_grow(struct midx_fanout *fanout, uint32_t nr)
+static void midx_fanout_grow(struct midx_fanout *fanout, size_t nr)
 {
+       if (nr < fanout->nr)
+               BUG("negative growth in midx_fanout_grow() (%"PRIuMAX" < %"PRIuMAX")",
+                   (uintmax_t)nr, (uintmax_t)fanout->nr);
        ALLOC_GROW(fanout->entries, nr, fanout->alloc);
 }
 
@@ -667,17 +670,18 @@ static void midx_fanout_add_pack_fanout(struct midx_fanout *fanout,
 static struct pack_midx_entry *get_sorted_entries(struct multi_pack_index *m,
                                                  struct pack_info *info,
                                                  uint32_t nr_packs,
-                                                 uint32_t *nr_objects,
+                                                 size_t *nr_objects,
                                                  int preferred_pack)
 {
        uint32_t cur_fanout, cur_pack, cur_object;
-       uint32_t alloc_objects, total_objects = 0;
+       size_t alloc_objects, total_objects = 0;
        struct midx_fanout fanout = { 0 };
        struct pack_midx_entry *deduplicated_entries = NULL;
        uint32_t start_pack = m ? m->num_packs : 0;
 
        for (cur_pack = start_pack; cur_pack < nr_packs; cur_pack++)
-               total_objects += info[cur_pack].p->num_objects;
+               total_objects = st_add(total_objects,
+                                      info[cur_pack].p->num_objects);
 
        /*
         * As we de-duplicate by fanout value, we expect the fanout
@@ -720,7 +724,8 @@ static struct pack_midx_entry *get_sorted_entries(struct multi_pack_index *m,
                                                &fanout.entries[cur_object].oid))
                                continue;
 
-                       ALLOC_GROW(deduplicated_entries, *nr_objects + 1, alloc_objects);
+                       ALLOC_GROW(deduplicated_entries, st_add(*nr_objects, 1),
+                                  alloc_objects);
                        memcpy(&deduplicated_entries[*nr_objects],
                               &fanout.entries[cur_object],
                               sizeof(struct pack_midx_entry));
@@ -1330,17 +1335,17 @@ static int write_midx_internal(const char *object_dir,
        }
 
        if (preferred_pack_name) {
-               int found = 0;
+               ctx.preferred_pack_idx = -1;
+
                for (i = 0; i < ctx.nr; i++) {
                        if (!cmp_idx_or_pack_name(preferred_pack_name,
                                                  ctx.info[i].pack_name)) {
                                ctx.preferred_pack_idx = i;
-                               found = 1;
                                break;
                        }
                }
 
-               if (!found)
+               if (ctx.preferred_pack_idx == -1)
                        warning(_("unknown preferred pack: '%s'"),
                                preferred_pack_name);
        } else if (ctx.nr &&
@@ -1495,21 +1500,22 @@ static int write_midx_internal(const char *object_dir,
        add_chunk(cf, MIDX_CHUNKID_OIDFANOUT, MIDX_CHUNK_FANOUT_SIZE,
                  write_midx_oid_fanout);
        add_chunk(cf, MIDX_CHUNKID_OIDLOOKUP,
-                 (size_t)ctx.entries_nr * the_hash_algo->rawsz,
+                 st_mult(ctx.entries_nr, the_hash_algo->rawsz),
                  write_midx_oid_lookup);
        add_chunk(cf, MIDX_CHUNKID_OBJECTOFFSETS,
-                 (size_t)ctx.entries_nr * MIDX_CHUNK_OFFSET_WIDTH,
+                 st_mult(ctx.entries_nr, MIDX_CHUNK_OFFSET_WIDTH),
                  write_midx_object_offsets);
 
        if (ctx.large_offsets_needed)
                add_chunk(cf, MIDX_CHUNKID_LARGEOFFSETS,
-                       (size_t)ctx.num_large_offsets * MIDX_CHUNK_LARGE_OFFSET_WIDTH,
+                       st_mult(ctx.num_large_offsets,
+                               MIDX_CHUNK_LARGE_OFFSET_WIDTH),
                        write_midx_large_offsets);
 
        if (flags & (MIDX_WRITE_REV_INDEX | MIDX_WRITE_BITMAP)) {
                ctx.pack_order = midx_pack_order(&ctx);
                add_chunk(cf, MIDX_CHUNKID_REVINDEX,
-                         ctx.entries_nr * sizeof(uint32_t),
+                         st_mult(ctx.entries_nr, sizeof(uint32_t)),
                          write_midx_revindex);
        }
 
@@ -1987,8 +1993,8 @@ static int fill_included_packs_batch(struct repository *r,
                if (open_pack_index(p) || !p->num_objects)
                        continue;
 
-               expected_size = (size_t)(p->pack_size
-                                        * pack_info[i].referenced_objects);
+               expected_size = st_mult(p->pack_size,
+                                       pack_info[i].referenced_objects);
                expected_size /= p->num_objects;
 
                if (expected_size >= batch_size)
index 2c2861efd1cf3b3cc0b56fb40f531ac467213b46..251f036eef6983a66ac13013e5bee3ef770e8f9f 100644 (file)
@@ -5,10 +5,14 @@
  *
  * Copyright (C) 2008 Linus Torvalds
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
+#include "name-hash.h"
+#include "object.h"
+#include "read-cache-ll.h"
 #include "thread-utils.h"
+#include "trace.h"
 #include "trace2.h"
 #include "sparse-index.h"
 
diff --git a/name-hash.h b/name-hash.h
new file mode 100644 (file)
index 0000000..b1b4b0f
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef NAME_HASH_H
+#define NAME_HASH_H
+
+struct cache_entry;
+struct index_state;
+
+int index_dir_exists(struct index_state *istate, const char *name, int namelen);
+void adjust_dirname_case(struct index_state *istate, char *name);
+struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
+
+int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
+void add_name_hash(struct index_state *istate, struct cache_entry *ce);
+void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
+void free_name_hash(struct index_state *istate);
+
+#endif /* NAME_HASH_H */
index f4b78eb47ddd334fecfd53a53ad97b73bcde11ee..9a5b69632728d1d6877556a330e666ba530a894a 100644 (file)
@@ -4,6 +4,7 @@
 #include "../fetch-negotiator.h"
 #include "../prio-queue.h"
 #include "../refs.h"
+#include "../repository.h"
 #include "../tag.h"
 
 /* Remember to update object flag allocation in object.h */
@@ -55,30 +56,49 @@ static int clear_marks(const char *refname, const struct object_id *oid,
 static void mark_common(struct negotiation_state *ns, struct commit *commit,
                int ancestors_only, int dont_parse)
 {
-       if (commit != NULL && !(commit->object.flags & COMMON)) {
-               struct object *o = (struct object *)commit;
+       struct prio_queue queue = { NULL };
+
+       if (!commit || (commit->object.flags & COMMON))
+               return;
+
+       prio_queue_put(&queue, commit);
+       if (!ancestors_only) {
+               commit->object.flags |= COMMON;
 
-               if (!ancestors_only)
-                       o->flags |= COMMON;
+               if ((commit->object.flags & SEEN) && !(commit->object.flags & POPPED))
+                       ns->non_common_revs--;
+       }
+       while ((commit = prio_queue_get(&queue))) {
+               struct object *o = (struct object *)commit;
 
                if (!(o->flags & SEEN))
                        rev_list_push(ns, commit, SEEN);
                else {
                        struct commit_list *parents;
 
-                       if (!ancestors_only && !(o->flags & POPPED))
-                               ns->non_common_revs--;
                        if (!o->parsed && !dont_parse)
                                if (repo_parse_commit(the_repository, commit))
-                                       return;
+                                       continue;
 
                        for (parents = commit->parents;
                                        parents;
-                                       parents = parents->next)
-                               mark_common(ns, parents->item, 0,
-                                           dont_parse);
+                                       parents = parents->next) {
+                               struct commit *p = parents->item;
+
+                               if (p->object.flags & COMMON)
+                                       continue;
+
+                               p->object.flags |= COMMON;
+
+                               if ((p->object.flags & SEEN) && !(p->object.flags & POPPED))
+                                       ns->non_common_revs--;
+
+                               prio_queue_put(&queue, parents->item);
+                       }
                }
        }
+
+       clear_prio_queue(&queue);
 }
 
 /*
index c7d6ab39bc502d4874474052e61296e2bdf56930..5b91520430c1703762e8712e632850420cba7be8 100644 (file)
@@ -5,6 +5,7 @@
 #include "../hex.h"
 #include "../prio-queue.h"
 #include "../refs.h"
+#include "../repository.h"
 #include "../tag.h"
 
 /* Remember to update object flag allocation in object.h */
@@ -85,29 +86,37 @@ static int clear_marks(const char *refname, const struct object_id *oid,
 }
 
 /*
- * Mark this SEEN commit and all its SEEN ancestors as COMMON.
+ * Mark this SEEN commit and all its parsed SEEN ancestors as COMMON.
  */
 static void mark_common(struct data *data, struct commit *seen_commit)
 {
        struct prio_queue queue = { NULL };
        struct commit *c;
 
+       if (seen_commit->object.flags & COMMON)
+               return;
+
        prio_queue_put(&queue, seen_commit);
+       seen_commit->object.flags |= COMMON;
        while ((c = prio_queue_get(&queue))) {
                struct commit_list *p;
-               if (c->object.flags & COMMON)
-                       return;
-               c->object.flags |= COMMON;
+
                if (!(c->object.flags & POPPED))
                        data->non_common_revs--;
 
                if (!c->object.parsed)
-                       return;
+                       continue;
                for (p = c->parents; p; p = p->next) {
-                       if (p->item->object.flags & SEEN)
-                               prio_queue_put(&queue, p->item);
+                       if (!(p->item->object.flags & SEEN) ||
+                           (p->item->object.flags & COMMON))
+                               continue;
+
+                       p->item->object.flags |= COMMON;
+                       prio_queue_put(&queue, p->item);
                }
        }
+
+       clear_prio_queue(&queue);
 }
 
 /*
index fbcdfd0dfe551211353c5c677ca97ff935341921..0e1d5b1ac7a48d9bda8f76091a55be7c527e68cc 100644 (file)
@@ -1,9 +1,11 @@
 #include "git-compat-util.h"
 #include "notes-cache.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "pretty.h"
 #include "repository.h"
 #include "commit.h"
 #include "refs.h"
+#include "strbuf.h"
 
 static int notes_cache_match_validity(struct repository *r,
                                      const char *ref,
index c40107c3aa027218f0acd10f69a162049c88fca2..8799b522a55f31869dcc8cbfd7229cc8db65af4c 100644 (file)
@@ -1,21 +1,25 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
 #include "commit.h"
 #include "gettext.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "repository.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "hex.h"
 #include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "dir.h"
 #include "notes.h"
 #include "notes-merge.h"
 #include "strbuf.h"
+#include "trace.h"
 #include "notes-utils.h"
 #include "commit-reach.h"
-#include "wrapper.h"
 
 struct notes_merge_pair {
        struct object_id obj, base, local, remote;
index cb88171b7bb9e6def420a63e91487d1671992d1b..97c031c26ec7c7c2fdade8478fa039d470820bad 100644 (file)
@@ -6,6 +6,7 @@
 #include "refs.h"
 #include "notes-utils.h"
 #include "repository.h"
+#include "strbuf.h"
 
 void create_notes_commit(struct repository *r,
                         struct notes_tree *t,
@@ -93,7 +94,9 @@ static combine_notes_fn parse_combine_notes_fn(const char *v)
                return NULL;
 }
 
-static int notes_rewrite_config(const char *k, const char *v, void *cb)
+static int notes_rewrite_config(const char *k, const char *v,
+                               const struct config_context *ctx UNUSED,
+                               void *cb)
 {
        struct notes_rewrite_cfg *c = cb;
        if (starts_with(k, "notes.rewrite.") && !strcmp(k+14, c->cmd)) {
diff --git a/notes.c b/notes.c
index 45fb7f22d1df011396ec86e56f1f1bd3bd1645b9..1ef2a331ce9302e58cb2078e58b7b40a94972b3e 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
 #include "hex.h"
 #include "notes.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "tree.h"
 #include "utf8.h"
@@ -963,7 +964,7 @@ void string_list_add_refs_from_colon_sep(struct string_list *list,
        char *globs_copy = xstrdup(globs);
        int i;
 
-       string_list_split_in_place(&split, globs_copy, ':', -1);
+       string_list_split_in_place(&split, globs_copy, ":", -1);
        string_list_remove_empty_items(&split, 0);
 
        for (i = 0; i < split.nr; i++)
@@ -973,7 +974,9 @@ void string_list_add_refs_from_colon_sep(struct string_list *list,
        free(globs_copy);
 }
 
-static int notes_display_config(const char *k, const char *v, void *cb)
+static int notes_display_config(const char *k, const char *v,
+                               const struct config_context *ctx UNUSED,
+                               void *cb)
 {
        int *load_refs = cb;
 
@@ -1019,13 +1022,13 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
        t->root = (struct int_node *) xcalloc(1, sizeof(struct int_node));
        t->first_non_note = NULL;
        t->prev_non_note = NULL;
-       t->ref = xstrdup_or_null(notes_ref);
+       t->ref = xstrdup(notes_ref);
        t->update_ref = (flags & NOTES_INIT_WRITABLE) ? t->ref : NULL;
        t->combine_notes = combine_notes;
        t->initialized = 1;
        t->dirty = 0;
 
-       if (flags & NOTES_INIT_EMPTY || !notes_ref ||
+       if (flags & NOTES_INIT_EMPTY ||
            repo_get_oid_treeish(the_repository, notes_ref, &object_oid))
                return;
        if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, &object_oid))
diff --git a/notes.h b/notes.h
index c1682c39a97bf6d84940b64b353286dfb91282a3..064fd7143aad33424714de671f08238bdd463190 100644 (file)
--- a/notes.h
+++ b/notes.h
@@ -256,7 +256,17 @@ void free_notes(struct notes_tree *t);
 struct string_list;
 
 struct display_notes_opt {
+       /*
+        * Less than `0` is "unset", which means that the default notes
+        * are shown iff no other notes are given. Otherwise,
+        * treat it like a boolean.
+        */
        int use_default_notes;
+
+       /*
+        * A list of globs (in the same style as notes.displayRef) where
+        * notes should be loaded from.
+        */
        struct string_list extra_notes_refs;
 };
 
@@ -283,14 +293,7 @@ void disable_display_notes(struct display_notes_opt *opt, int *show_notes);
 /*
  * Load the notes machinery for displaying several notes trees.
  *
- * If 'opt' is not NULL, then it specifies additional settings for the
- * displaying:
- *
- * - suppress_default_notes indicates that the notes from
- *   core.notesRef and notes.displayRef should not be loaded.
- *
- * - extra_notes_refs may contain a list of globs (in the same style
- *   as notes.displayRef) where notes should be loaded from.
+ * 'opt' may be NULL.
  */
 void load_display_notes(struct display_notes_opt *opt);
 
index 76b22ca75cd2a3d65133ed49d285474f7e98d760..7dc0c4bfbba87d1a9f42e3274764f7e07cc74c52 100644 (file)
@@ -6,10 +6,10 @@
  * This handles basic git object files - packing, unpacking,
  * creation etc.
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
+#include "convert.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "mergesort.h"
 #include "quote.h"
 #include "packfile.h"
+#include "object-file.h"
 #include "object-store.h"
+#include "oidtree.h"
+#include "path.h"
 #include "promisor-remote.h"
 #include "setup.h"
 #include "submodule.h"
 #include "fsck.h"
-#include "wrapper.h"
 
 /* The maximum size for an object header. */
 #define MAX_HEADER_LEN 32
@@ -951,6 +953,12 @@ void prepare_alt_odb(struct repository *r)
        r->objects->loaded_alternates = 1;
 }
 
+int has_alt_odb(struct repository *r)
+{
+       prepare_alt_odb(r);
+       return !!r->objects->odb->next;
+}
+
 /* Returns 1 if we have successfully freshened the file, 0 otherwise. */
 static int freshen_file(const char *fn)
 {
@@ -2298,11 +2306,11 @@ int repo_has_object_file(struct repository *r,
  * report the minimal fsck error here, and rely on the caller to
  * give more context.
  */
-static int hash_format_check_report(struct fsck_options *opts,
-                                    const struct object_id *oid,
-                                    enum object_type object_type,
-                                    enum fsck_msg_type msg_type,
-                                    enum fsck_msg_id msg_id,
+static int hash_format_check_report(struct fsck_options *opts UNUSED,
+                                    const struct object_id *oid UNUSED,
+                                    enum object_type object_type UNUSED,
+                                    enum fsck_msg_type msg_type UNUSED,
+                                    enum fsck_msg_id msg_id UNUSED,
                                     const char *message)
 {
        error(_("object fails fsck: %s"), message);
diff --git a/object-file.h b/object-file.h
new file mode 100644 (file)
index 0000000..d641461
--- /dev/null
@@ -0,0 +1,131 @@
+#ifndef OBJECT_FILE_H
+#define OBJECT_FILE_H
+
+#include "git-zlib.h"
+#include "object.h"
+
+struct index_state;
+
+/*
+ * Set this to 0 to prevent oid_object_info_extended() from fetching missing
+ * blobs. This has a difference only if extensions.partialClone is set.
+ *
+ * Its default value is 1.
+ */
+extern int fetch_if_missing;
+
+#define HASH_WRITE_OBJECT 1
+#define HASH_FORMAT_CHECK 2
+#define HASH_RENORMALIZE  4
+#define HASH_SILENT 8
+int index_fd(struct index_state *istate, struct object_id *oid, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
+int index_path(struct index_state *istate, struct object_id *oid, const char *path, struct stat *st, unsigned flags);
+
+/*
+ * Create the directory containing the named path, using care to be
+ * somewhat safe against races. Return one of the scld_error values to
+ * indicate success/failure. On error, set errno to describe the
+ * problem.
+ *
+ * SCLD_VANISHED indicates that one of the ancestor directories of the
+ * path existed at one point during the function call and then
+ * suddenly vanished, probably because another process pruned the
+ * directory while we were working.  To be robust against this kind of
+ * race, callers might want to try invoking the function again when it
+ * returns SCLD_VANISHED.
+ *
+ * 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. 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,
+       SCLD_FAILED = -1,
+       SCLD_PERMS = -2,
+       SCLD_EXISTS = -3,
+       SCLD_VANISHED = -4
+};
+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);
+
+int mkdir_in_gitdir(const char *path);
+
+int git_open_cloexec(const char *name, int flags);
+#define git_open(name) git_open_cloexec(name, O_RDONLY)
+
+/**
+ * unpack_loose_header() initializes the data stream needed to unpack
+ * a loose object header.
+ *
+ * Returns:
+ *
+ * - ULHR_OK on success
+ * - ULHR_BAD on error
+ * - ULHR_TOO_LONG if the header was too long
+ *
+ * It will only parse up to MAX_HEADER_LEN bytes unless an optional
+ * "hdrbuf" argument is non-NULL. This is intended for use with
+ * OBJECT_INFO_ALLOW_UNKNOWN_TYPE to extract the bad type for (error)
+ * reporting. The full header will be extracted to "hdrbuf" for use
+ * with parse_loose_header(), ULHR_TOO_LONG will still be returned
+ * from this function to indicate that the header was too long.
+ */
+enum unpack_loose_header_result {
+       ULHR_OK,
+       ULHR_BAD,
+       ULHR_TOO_LONG,
+};
+enum unpack_loose_header_result unpack_loose_header(git_zstream *stream,
+                                                   unsigned char *map,
+                                                   unsigned long mapsize,
+                                                   void *buffer,
+                                                   unsigned long bufsiz,
+                                                   struct strbuf *hdrbuf);
+
+/**
+ * parse_loose_header() parses the starting "<type> <len>\0" of an
+ * object. If it doesn't follow that format -1 is returned. To check
+ * the validity of the <type> populate the "typep" in the "struct
+ * object_info". It will be OBJ_BAD if the object type is unknown. The
+ * parsed <len> can be retrieved via "oi->sizep", and from there
+ * passed to unpack_loose_rest().
+ */
+struct object_info;
+int parse_loose_header(const char *hdr, struct object_info *oi);
+
+/**
+ * With in-core object data in "buf", rehash it to make sure the
+ * object name actually matches "oid" to detect object corruption.
+ *
+ * A negative value indicates an error, usually that the OID is not
+ * what we expected, but it might also indicate another error.
+ */
+int check_object_signature(struct repository *r, const struct object_id *oid,
+                          void *map, unsigned long size,
+                          enum object_type type);
+
+/**
+ * A streaming version of check_object_signature().
+ * Try reading the object named with "oid" using
+ * the streaming interface and rehash it to do the same.
+ */
+int stream_object_signature(struct repository *r, const struct object_id *oid);
+
+int finalize_object_file(const char *tmpfile, const char *filename);
+
+/* Helper to check and "touch" a file */
+int check_and_freshen_file(const char *fn, int freshen);
+
+void *read_object_with_reference(struct repository *r,
+                                const struct object_id *oid,
+                                enum object_type required_type,
+                                unsigned long *size,
+                                struct object_id *oid_ret);
+
+#endif /* OBJECT_FILE_H */
index f1edc0035b0534e2d992c02d911bfff344a27fe8..0bfa29dbbfe9b489e454c03b419092294427425d 100644 (file)
@@ -1,4 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "object-name.h"
+#include "advice.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
 #include "remote.h"
 #include "dir.h"
 #include "oid-array.h"
+#include "oidtree.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "pretty.h"
+#include "object-store-ll.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "submodule.h"
@@ -764,6 +769,21 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
                find_abbrev_len_for_pack(p, mad);
 }
 
+void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
+                                  const struct object_id *oid, int abbrev_len)
+{
+       int r;
+       strbuf_grow(sb, GIT_MAX_HEXSZ + 1);
+       r = repo_find_unique_abbrev_r(repo, sb->buf + sb->len, oid, abbrev_len);
+       strbuf_setlen(sb, sb->len + r);
+}
+
+void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
+                             int abbrev_len)
+{
+       strbuf_repo_add_unique_abbrev(sb, the_repository, oid, abbrev_len);
+}
+
 int repo_find_unique_abbrev_r(struct repository *r, char *hex,
                              const struct object_id *oid, int len)
 {
diff --git a/object-name.h b/object-name.h
new file mode 100644 (file)
index 0000000..9ae5223
--- /dev/null
@@ -0,0 +1,130 @@
+#ifndef OBJECT_NAME_H
+#define OBJECT_NAME_H
+
+#include "object.h"
+#include "strbuf.h"
+
+struct object_id;
+struct repository;
+
+struct object_context {
+       unsigned short mode;
+       /*
+        * symlink_path is only used by get_tree_entry_follow_symlinks,
+        * and only for symlinks that point outside the repository.
+        */
+       struct strbuf symlink_path;
+       /*
+        * If GET_OID_RECORD_PATH is set, this will record path (if any)
+        * found when resolving the name. The caller is responsible for
+        * releasing the memory.
+        */
+       char *path;
+};
+
+/*
+ * Return an abbreviated sha1 unique within this repository's object database.
+ * The result will be at least `len` characters long, and will be NUL
+ * terminated.
+ *
+ * The non-`_r` version returns a static buffer which remains valid until 4
+ * more calls to repo_find_unique_abbrev are made.
+ *
+ * The `_r` variant writes to a buffer supplied by the caller, which must be at
+ * least `GIT_MAX_HEXSZ + 1` bytes. The return value is the number of bytes
+ * written (excluding the NUL terminator).
+ *
+ * Note that while this version avoids the static buffer, it is not fully
+ * reentrant, as it calls into other non-reentrant git code.
+ */
+const char *repo_find_unique_abbrev(struct repository *r, const struct object_id *oid, int len);
+int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
+
+/**
+ * Add the abbreviation, as generated by repo_find_unique_abbrev(), of `sha1` to
+ * the strbuf `sb`.
+ */
+void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
+                                  const struct object_id *oid, int abbrev_len);
+void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
+                             int abbrev_len);
+
+int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
+__attribute__((format (printf, 2, 3)))
+int get_oidf(struct object_id *oid, const char *fmt, ...);
+int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_tree(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_treeish(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_blob(struct repository *r, const char *str, struct object_id *oid);
+int repo_get_oid_mb(struct repository *r, const char *str, struct object_id *oid);
+void maybe_die_on_misspelt_object_name(struct repository *repo,
+                                      const char *name,
+                                      const char *prefix);
+enum get_oid_result get_oid_with_context(struct repository *repo, const char *str,
+                                        unsigned flags, struct object_id *oid,
+                                        struct object_context *oc);
+
+
+typedef int each_abbrev_fn(const struct object_id *oid, void *);
+int repo_for_each_abbrev(struct repository *r, const char *prefix, each_abbrev_fn, void *);
+
+int set_disambiguate_hint_config(const char *var, const char *value);
+
+/*
+ * This reads short-hand syntax that not only evaluates to a commit
+ * object name, but also can act as if the end user spelled the name
+ * of the branch from the command line.
+ *
+ * - "@{-N}" finds the name of the Nth previous branch we were on, and
+ *   places the name of the branch in the given buf and returns the
+ *   number of characters parsed if successful.
+ *
+ * - "<branch>@{upstream}" finds the name of the other ref that
+ *   <branch> is configured to merge with (missing <branch> defaults
+ *   to the current branch), and places the name of the branch in the
+ *   given buf and returns the number of characters parsed if
+ *   successful.
+ *
+ * If the input is not of the accepted format, it returns a negative
+ * number to signal an error.
+ *
+ * If the input was ok but there are not N branch switches in the
+ * reflog, it returns 0.
+ */
+#define INTERPRET_BRANCH_LOCAL (1<<0)
+#define INTERPRET_BRANCH_REMOTE (1<<1)
+#define INTERPRET_BRANCH_HEAD (1<<2)
+struct interpret_branch_name_options {
+       /*
+        * If "allowed" is non-zero, it is a treated as a bitfield of allowable
+        * expansions: local branches ("refs/heads/"), remote branches
+        * ("refs/remotes/"), or "HEAD". If no "allowed" bits are set, any expansion is
+        * allowed, even ones to refs outside of those namespaces.
+        */
+       unsigned allowed;
+
+       /*
+        * If ^{upstream} or ^{push} (or equivalent) is requested, and the
+        * branch in question does not have such a reference, return -1 instead
+        * of die()-ing.
+        */
+       unsigned nonfatal_dangling_mark : 1;
+};
+int repo_interpret_branch_name(struct repository *r,
+                              const char *str, int len,
+                              struct strbuf *buf,
+                              const struct interpret_branch_name_options *options);
+
+struct object *repo_peel_to_type(struct repository *r,
+                                const char *name, int namelen,
+                                struct object *o, enum object_type);
+
+/* Convert to/from hex/sha1 representation */
+#define MINIMUM_ABBREV minimum_abbrev
+#define DEFAULT_ABBREV default_abbrev
+
+/* used when the code does not know or care what the default abbrev is */
+#define FALLBACK_DEFAULT_ABBREV 7
+
+#endif /* OBJECT_NAME_H */
diff --git a/object-store-ll.h b/object-store-ll.h
new file mode 100644 (file)
index 0000000..26a3895
--- /dev/null
@@ -0,0 +1,533 @@
+#ifndef OBJECT_STORE_LL_H
+#define OBJECT_STORE_LL_H
+
+#include "hashmap.h"
+#include "object.h"
+#include "list.h"
+#include "thread-utils.h"
+#include "oidset.h"
+
+struct oidmap;
+struct oidtree;
+struct strbuf;
+
+struct object_directory {
+       struct object_directory *next;
+
+       /*
+        * Used to store the results of readdir(3) calls when we are OK
+        * sacrificing accuracy due to races for speed. That includes
+        * object existence with OBJECT_INFO_QUICK, as well as
+        * our search for unique abbreviated hashes. Don't use it for tasks
+        * requiring greater accuracy!
+        *
+        * Be sure to call odb_load_loose_cache() before using.
+        */
+       uint32_t loose_objects_subdir_seen[8]; /* 256 bits */
+       struct oidtree *loose_objects_cache;
+
+       /*
+        * This is a temporary object store created by the tmp_objdir
+        * facility. Disable ref updates since the objects in the store
+        * might be discarded on rollback.
+        */
+       int disable_ref_updates;
+
+       /*
+        * This object store is ephemeral, so there is no need to fsync.
+        */
+       int will_destroy;
+
+       /*
+        * Path to the alternative object store. If this is a relative path,
+        * it is relative to the current working directory.
+        */
+       char *path;
+};
+
+struct input_stream {
+       const void *(*read)(struct input_stream *, unsigned long *len);
+       void *data;
+       int is_finished;
+};
+
+void prepare_alt_odb(struct repository *r);
+int has_alt_odb(struct repository *r);
+char *compute_alternate_path(const char *path, struct strbuf *err);
+struct object_directory *find_odb(struct repository *r, const char *obj_dir);
+typedef int alt_odb_fn(struct object_directory *, void *);
+int foreach_alt_odb(alt_odb_fn, void*);
+typedef void alternate_ref_fn(const struct object_id *oid, void *);
+void for_each_alternate_ref(alternate_ref_fn, void *);
+
+/*
+ * Add the directory to the on-disk alternates file; the new entry will also
+ * take effect in the current process.
+ */
+void add_to_alternates_file(const char *dir);
+
+/*
+ * Add the directory to the in-memory list of alternates (along with any
+ * recursive alternates it points to), but do not modify the on-disk alternates
+ * file.
+ */
+void add_to_alternates_memory(const char *dir);
+
+/*
+ * Replace the current writable object directory with the specified temporary
+ * object directory; returns the former primary object directory.
+ */
+struct object_directory *set_temporary_primary_odb(const char *dir, int will_destroy);
+
+/*
+ * Restore a previous ODB replaced by set_temporary_main_odb.
+ */
+void restore_primary_odb(struct object_directory *restore_odb, const char *old_path);
+
+/*
+ * Populate and return the loose object cache array corresponding to the
+ * given object ID.
+ */
+struct oidtree *odb_loose_cache(struct object_directory *odb,
+                                 const struct object_id *oid);
+
+/* Empty the loose object cache for the specified object directory. */
+void odb_clear_loose_cache(struct object_directory *odb);
+
+/* Clear and free the specified object directory */
+void free_object_directory(struct object_directory *odb);
+
+struct packed_git {
+       struct hashmap_entry packmap_ent;
+       struct packed_git *next;
+       struct list_head mru;
+       struct pack_window *windows;
+       off_t pack_size;
+       const void *index_data;
+       size_t index_size;
+       uint32_t num_objects;
+       size_t crc_offset;
+       struct oidset bad_objects;
+       int index_version;
+       time_t mtime;
+       int pack_fd;
+       int index;              /* for builtin/pack-objects.c */
+       unsigned pack_local:1,
+                pack_keep:1,
+                pack_keep_in_core:1,
+                freshened:1,
+                do_not_close:1,
+                pack_promisor:1,
+                multi_pack_index:1,
+                is_cruft:1;
+       unsigned char hash[GIT_MAX_RAWSZ];
+       struct revindex_entry *revindex;
+       const uint32_t *revindex_data;
+       const uint32_t *revindex_map;
+       size_t revindex_size;
+       /*
+        * mtimes_map points at the beginning of the memory mapped region of
+        * this pack's corresponding .mtimes file, and mtimes_size is the size
+        * of that .mtimes file
+        */
+       const uint32_t *mtimes_map;
+       size_t mtimes_size;
+       /* something like ".git/objects/pack/xxxxx.pack" */
+       char pack_name[FLEX_ARRAY]; /* more */
+};
+
+struct multi_pack_index;
+
+static inline int pack_map_entry_cmp(const void *cmp_data UNUSED,
+                                    const struct hashmap_entry *entry,
+                                    const struct hashmap_entry *entry2,
+                                    const void *keydata)
+{
+       const char *key = keydata;
+       const struct packed_git *pg1, *pg2;
+
+       pg1 = container_of(entry, const struct packed_git, packmap_ent);
+       pg2 = container_of(entry2, const struct packed_git, packmap_ent);
+
+       return strcmp(pg1->pack_name, key ? key : pg2->pack_name);
+}
+
+struct raw_object_store {
+       /*
+        * Set of all object directories; the main directory is first (and
+        * cannot be NULL after initialization). Subsequent directories are
+        * alternates.
+        */
+       struct object_directory *odb;
+       struct object_directory **odb_tail;
+       struct kh_odb_path_map *odb_by_path;
+
+       int loaded_alternates;
+
+       /*
+        * A list of alternate object directories loaded from the environment;
+        * this should not generally need to be accessed directly, but will
+        * populate the "odb" list when prepare_alt_odb() is run.
+        */
+       char *alternate_db;
+
+       /*
+        * Objects that should be substituted by other objects
+        * (see git-replace(1)).
+        */
+       struct oidmap *replace_map;
+       unsigned replace_map_initialized : 1;
+       pthread_mutex_t replace_mutex; /* protect object replace functions */
+
+       struct commit_graph *commit_graph;
+       unsigned commit_graph_attempted : 1; /* if loading has been attempted */
+
+       /*
+        * private data
+        *
+        * should only be accessed directly by packfile.c and midx.c
+        */
+       struct multi_pack_index *multi_pack_index;
+
+       /*
+        * private data
+        *
+        * should only be accessed directly by packfile.c
+        */
+
+       struct packed_git *packed_git;
+       /* A most-recently-used ordered version of the packed_git list. */
+       struct list_head packed_git_mru;
+
+       struct {
+               struct packed_git **packs;
+               unsigned flags;
+       } kept_pack_cache;
+
+       /*
+        * A map of packfiles to packed_git structs for tracking which
+        * packs have been loaded already.
+        */
+       struct hashmap pack_map;
+
+       /*
+        * A fast, rough count of the number of objects in the repository.
+        * These two fields are not meant for direct access. Use
+        * repo_approximate_object_count() instead.
+        */
+       unsigned long approximate_object_count;
+       unsigned approximate_object_count_valid : 1;
+
+       /*
+        * Whether packed_git has already been populated with this repository's
+        * packs.
+        */
+       unsigned packed_git_initialized : 1;
+};
+
+struct raw_object_store *raw_object_store_new(void);
+void raw_object_store_clear(struct raw_object_store *o);
+
+/*
+ * Put in `buf` the name of the file in the local object database that
+ * would be used to store a loose object with the specified oid.
+ */
+const char *loose_object_path(struct repository *r, struct strbuf *buf,
+                             const struct object_id *oid);
+
+void *map_loose_object(struct repository *r, const struct object_id *oid,
+                      unsigned long *size);
+
+void *repo_read_object_file(struct repository *r,
+                           const struct object_id *oid,
+                           enum object_type *type,
+                           unsigned long *size);
+
+/* Read and unpack an object file into memory, write memory to an object file */
+int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);
+
+void hash_object_file(const struct git_hash_algo *algo, const void *buf,
+                     unsigned long len, enum object_type type,
+                     struct object_id *oid);
+
+int write_object_file_flags(const void *buf, unsigned long len,
+                           enum object_type type, struct object_id *oid,
+                           unsigned flags);
+static inline int write_object_file(const void *buf, unsigned long len,
+                                   enum object_type type, struct object_id *oid)
+{
+       return write_object_file_flags(buf, len, type, oid, 0);
+}
+
+int write_object_file_literally(const void *buf, unsigned long len,
+                               const char *type, struct object_id *oid,
+                               unsigned flags);
+int stream_loose_object(struct input_stream *in_stream, size_t len,
+                       struct object_id *oid);
+
+/*
+ * Add an object file to the in-memory object store, without writing it
+ * to disk.
+ *
+ * Callers are responsible for calling write_object_file to record the
+ * object in persistent storage before writing any other new objects
+ * that reference it.
+ */
+int pretend_object_file(void *, unsigned long, enum object_type,
+                       struct object_id *oid);
+
+int force_object_loose(const struct object_id *oid, time_t mtime);
+
+struct object_info {
+       /* Request */
+       enum object_type *typep;
+       unsigned long *sizep;
+       off_t *disk_sizep;
+       struct object_id *delta_base_oid;
+       struct strbuf *type_name;
+       void **contentp;
+
+       /* Response */
+       enum {
+               OI_CACHED,
+               OI_LOOSE,
+               OI_PACKED,
+               OI_DBCACHED
+       } whence;
+       union {
+               /*
+                * struct {
+                *      ... Nothing to expose in this case
+                * } cached;
+                * struct {
+                *      ... Nothing to expose in this case
+                * } loose;
+                */
+               struct {
+                       struct packed_git *pack;
+                       off_t offset;
+                       unsigned int is_delta;
+               } packed;
+       } u;
+};
+
+/*
+ * Initializer for a "struct object_info" that wants no items. You may
+ * also memset() the memory to all-zeroes.
+ */
+#define OBJECT_INFO_INIT { 0 }
+
+/* Invoke lookup_replace_object() on the given hash */
+#define OBJECT_INFO_LOOKUP_REPLACE 1
+/* Allow reading from a loose object file of unknown/bogus type */
+#define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2
+/* Do not retry packed storage after checking packed and loose storage */
+#define OBJECT_INFO_QUICK 8
+/*
+ * Do not attempt to fetch the object if missing (even if fetch_is_missing is
+ * nonzero).
+ */
+#define OBJECT_INFO_SKIP_FETCH_OBJECT 16
+/*
+ * This is meant for bulk prefetching of missing blobs in a partial
+ * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
+ */
+#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
+
+/* Die if object corruption (not just an object being missing) was detected. */
+#define OBJECT_INFO_DIE_IF_CORRUPT 32
+
+int oid_object_info_extended(struct repository *r,
+                            const struct object_id *,
+                            struct object_info *, unsigned flags);
+
+/*
+ * Open the loose object at path, check its hash, and return the contents,
+ * use the "oi" argument to assert things about the object, or e.g. populate its
+ * type, and size. If the object is a blob, then "contents" may return NULL,
+ * to allow streaming of large blobs.
+ *
+ * Returns 0 on success, negative on error (details may be written to stderr).
+ */
+int read_loose_object(const char *path,
+                     const struct object_id *expected_oid,
+                     struct object_id *real_oid,
+                     void **contents,
+                     struct object_info *oi);
+
+/* Retry packed storage after checking packed and loose storage */
+#define HAS_OBJECT_RECHECK_PACKED 1
+
+/*
+ * Returns 1 if the object exists. This function will not lazily fetch objects
+ * in a partial clone.
+ */
+int has_object(struct repository *r, const struct object_id *oid,
+              unsigned flags);
+
+/*
+ * These macros and functions are deprecated. If checking existence for an
+ * object that is likely to be missing and/or whose absence is relatively
+ * inconsequential (or is consequential but the caller is prepared to handle
+ * it), use has_object(), which has better defaults (no lazy fetch in a partial
+ * clone and no rechecking of packed storage). In the unlikely event that a
+ * caller needs to assert existence of an object that it fully expects to
+ * exist, and wants to trigger a lazy fetch in a partial clone, use
+ * oid_object_info_extended() with a NULL struct object_info.
+ *
+ * These functions can be removed once all callers have migrated to
+ * has_object() and/or oid_object_info_extended().
+ */
+int repo_has_object_file(struct repository *r, const struct object_id *oid);
+int repo_has_object_file_with_flags(struct repository *r,
+                                   const struct object_id *oid, int flags);
+
+/*
+ * Return true iff an alternate object database has a loose object
+ * with the specified name.  This function does not respect replace
+ * references.
+ */
+int has_loose_object_nonlocal(const struct object_id *);
+
+int has_loose_object(const struct object_id *);
+
+/**
+ * format_object_header() is a thin wrapper around s xsnprintf() that
+ * writes the initial "<type> <obj-len>" part of the loose object
+ * header. It returns the size that snprintf() returns + 1.
+ */
+int format_object_header(char *str, size_t size, enum object_type type,
+                        size_t objsize);
+
+void assert_oid_type(const struct object_id *oid, enum object_type expect);
+
+/*
+ * Enabling the object read lock allows multiple threads to safely call the
+ * following functions in parallel: repo_read_object_file(),
+ * read_object_with_reference(), oid_object_info() and oid_object_info_extended().
+ *
+ * obj_read_lock() and obj_read_unlock() may also be used to protect other
+ * section which cannot execute in parallel with object reading. Since the used
+ * lock is a recursive mutex, these sections can even contain calls to object
+ * reading functions. However, beware that in these cases zlib inflation won't
+ * be performed in parallel, losing performance.
+ *
+ * TODO: oid_object_info_extended()'s call stack has a recursive behavior. If
+ * any of its callees end up calling it, this recursive call won't benefit from
+ * parallel inflation.
+ */
+void enable_obj_read_lock(void);
+void disable_obj_read_lock(void);
+
+extern int obj_read_use_lock;
+extern pthread_mutex_t obj_read_mutex;
+
+static inline void obj_read_lock(void)
+{
+       if(obj_read_use_lock)
+               pthread_mutex_lock(&obj_read_mutex);
+}
+
+static inline void obj_read_unlock(void)
+{
+       if(obj_read_use_lock)
+               pthread_mutex_unlock(&obj_read_mutex);
+}
+
+/*
+ * Iterate over the files in the loose-object parts of the object
+ * directory "path", triggering the following callbacks:
+ *
+ *  - loose_object is called for each loose object we find.
+ *
+ *  - loose_cruft is called for any files that do not appear to be
+ *    loose objects. Note that we only look in the loose object
+ *    directories "objects/[0-9a-f]{2}/", so we will not report
+ *    "objects/foobar" as cruft.
+ *
+ *  - loose_subdir is called for each top-level hashed subdirectory
+ *    of the object directory (e.g., "$OBJDIR/f0"). It is called
+ *    after the objects in the directory are processed.
+ *
+ * Any callback that is NULL will be ignored. Callbacks returning non-zero
+ * will end the iteration.
+ *
+ * In the "buf" variant, "path" is a strbuf which will also be used as a
+ * scratch buffer, but restored to its original contents before
+ * the function returns.
+ */
+typedef int each_loose_object_fn(const struct object_id *oid,
+                                const char *path,
+                                void *data);
+typedef int each_loose_cruft_fn(const char *basename,
+                               const char *path,
+                               void *data);
+typedef int each_loose_subdir_fn(unsigned int nr,
+                                const char *path,
+                                void *data);
+int for_each_file_in_obj_subdir(unsigned int subdir_nr,
+                               struct strbuf *path,
+                               each_loose_object_fn obj_cb,
+                               each_loose_cruft_fn cruft_cb,
+                               each_loose_subdir_fn subdir_cb,
+                               void *data);
+int for_each_loose_file_in_objdir(const char *path,
+                                 each_loose_object_fn obj_cb,
+                                 each_loose_cruft_fn cruft_cb,
+                                 each_loose_subdir_fn subdir_cb,
+                                 void *data);
+int for_each_loose_file_in_objdir_buf(struct strbuf *path,
+                                     each_loose_object_fn obj_cb,
+                                     each_loose_cruft_fn cruft_cb,
+                                     each_loose_subdir_fn subdir_cb,
+                                     void *data);
+
+/* Flags for for_each_*_object() below. */
+enum for_each_object_flags {
+       /* Iterate only over local objects, not alternates. */
+       FOR_EACH_OBJECT_LOCAL_ONLY = (1<<0),
+
+       /* Only iterate over packs obtained from the promisor remote. */
+       FOR_EACH_OBJECT_PROMISOR_ONLY = (1<<1),
+
+       /*
+        * Visit objects within a pack in packfile order rather than .idx order
+        */
+       FOR_EACH_OBJECT_PACK_ORDER = (1<<2),
+
+       /* Only iterate over packs that are not marked as kept in-core. */
+       FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS = (1<<3),
+
+       /* Only iterate over packs that do not have .keep files. */
+       FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS = (1<<4),
+};
+
+/*
+ * Iterate over all accessible loose objects without respect to
+ * reachability. By default, this includes both local and alternate objects.
+ * The order in which objects are visited is unspecified.
+ *
+ * Any flags specific to packs are ignored.
+ */
+int for_each_loose_object(each_loose_object_fn, void *,
+                         enum for_each_object_flags flags);
+
+/*
+ * Iterate over all accessible packed objects without respect to reachability.
+ * By default, this includes both local and alternate packs.
+ *
+ * Note that some objects may appear twice if they are found in multiple packs.
+ * Each pack is visited in an unspecified order. By default, objects within a
+ * pack are visited in pack-idx order (i.e., sorted by oid).
+ */
+typedef int each_packed_object_fn(const struct object_id *oid,
+                                 struct packed_git *pack,
+                                 uint32_t pos,
+                                 void *data);
+int for_each_object_in_pack(struct packed_git *p,
+                           each_packed_object_fn, void *data,
+                           enum for_each_object_flags flags);
+int for_each_packed_object(each_packed_object_fn, void *,
+                          enum for_each_object_flags flags);
+
+#endif /* OBJECT_STORE_LL_H */
index f9d225783ae6c1730e7e947c81b39f86ebb3c85b..1b3e3d7d0145be18b523ea836aaac3e84c06af4e 100644 (file)
 #ifndef OBJECT_STORE_H
 #define OBJECT_STORE_H
 
-#include "object.h"
-#include "oidmap.h"
-#include "list.h"
-#include "oid-array.h"
-#include "strbuf.h"
-#include "thread-utils.h"
 #include "khash.h"
 #include "dir.h"
-#include "oidtree.h"
-#include "oidset.h"
-
-struct object_directory {
-       struct object_directory *next;
-
-       /*
-        * Used to store the results of readdir(3) calls when we are OK
-        * sacrificing accuracy due to races for speed. That includes
-        * object existence with OBJECT_INFO_QUICK, as well as
-        * our search for unique abbreviated hashes. Don't use it for tasks
-        * requiring greater accuracy!
-        *
-        * Be sure to call odb_load_loose_cache() before using.
-        */
-       uint32_t loose_objects_subdir_seen[8]; /* 256 bits */
-       struct oidtree *loose_objects_cache;
-
-       /*
-        * This is a temporary object store created by the tmp_objdir
-        * facility. Disable ref updates since the objects in the store
-        * might be discarded on rollback.
-        */
-       int disable_ref_updates;
-
-       /*
-        * This object store is ephemeral, so there is no need to fsync.
-        */
-       int will_destroy;
-
-       /*
-        * Path to the alternative object store. If this is a relative path,
-        * it is relative to the current working directory.
-        */
-       char *path;
-};
-
-struct input_stream {
-       const void *(*read)(struct input_stream *, unsigned long *len);
-       void *data;
-       int is_finished;
-};
+#include "object-store-ll.h"
 
 KHASH_INIT(odb_path_map, const char * /* key: odb_path */,
        struct object_directory *, 1, fspathhash, fspatheq)
 
-void prepare_alt_odb(struct repository *r);
-char *compute_alternate_path(const char *path, struct strbuf *err);
-struct object_directory *find_odb(struct repository *r, const char *obj_dir);
-typedef int alt_odb_fn(struct object_directory *, void *);
-int foreach_alt_odb(alt_odb_fn, void*);
-typedef void alternate_ref_fn(const struct object_id *oid, void *);
-void for_each_alternate_ref(alternate_ref_fn, void *);
-
-/*
- * Add the directory to the on-disk alternates file; the new entry will also
- * take effect in the current process.
- */
-void add_to_alternates_file(const char *dir);
-
-/*
- * Add the directory to the in-memory list of alternates (along with any
- * recursive alternates it points to), but do not modify the on-disk alternates
- * file.
- */
-void add_to_alternates_memory(const char *dir);
-
-/*
- * Replace the current writable object directory with the specified temporary
- * object directory; returns the former primary object directory.
- */
-struct object_directory *set_temporary_primary_odb(const char *dir, int will_destroy);
-
-/*
- * Restore a previous ODB replaced by set_temporary_main_odb.
- */
-void restore_primary_odb(struct object_directory *restore_odb, const char *old_path);
-
-/*
- * Populate and return the loose object cache array corresponding to the
- * given object ID.
- */
-struct oidtree *odb_loose_cache(struct object_directory *odb,
-                                 const struct object_id *oid);
-
-/* Empty the loose object cache for the specified object directory. */
-void odb_clear_loose_cache(struct object_directory *odb);
-
-/* Clear and free the specified object directory */
-void free_object_directory(struct object_directory *odb);
-
-struct packed_git {
-       struct hashmap_entry packmap_ent;
-       struct packed_git *next;
-       struct list_head mru;
-       struct pack_window *windows;
-       off_t pack_size;
-       const void *index_data;
-       size_t index_size;
-       uint32_t num_objects;
-       uint32_t crc_offset;
-       struct oidset bad_objects;
-       int index_version;
-       time_t mtime;
-       int pack_fd;
-       int index;              /* for builtin/pack-objects.c */
-       unsigned pack_local:1,
-                pack_keep:1,
-                pack_keep_in_core:1,
-                freshened:1,
-                do_not_close:1,
-                pack_promisor:1,
-                multi_pack_index:1,
-                is_cruft:1;
-       unsigned char hash[GIT_MAX_RAWSZ];
-       struct revindex_entry *revindex;
-       const uint32_t *revindex_data;
-       const uint32_t *revindex_map;
-       size_t revindex_size;
-       /*
-        * mtimes_map points at the beginning of the memory mapped region of
-        * this pack's corresponding .mtimes file, and mtimes_size is the size
-        * of that .mtimes file
-        */
-       const uint32_t *mtimes_map;
-       size_t mtimes_size;
-       /* something like ".git/objects/pack/xxxxx.pack" */
-       char pack_name[FLEX_ARRAY]; /* more */
-};
-
-struct multi_pack_index;
-
-static inline int pack_map_entry_cmp(const void *cmp_data UNUSED,
-                                    const struct hashmap_entry *entry,
-                                    const struct hashmap_entry *entry2,
-                                    const void *keydata)
-{
-       const char *key = keydata;
-       const struct packed_git *pg1, *pg2;
-
-       pg1 = container_of(entry, const struct packed_git, packmap_ent);
-       pg2 = container_of(entry2, const struct packed_git, packmap_ent);
-
-       return strcmp(pg1->pack_name, key ? key : pg2->pack_name);
-}
-
-struct raw_object_store {
-       /*
-        * Set of all object directories; the main directory is first (and
-        * cannot be NULL after initialization). Subsequent directories are
-        * alternates.
-        */
-       struct object_directory *odb;
-       struct object_directory **odb_tail;
-       kh_odb_path_map_t *odb_by_path;
-
-       int loaded_alternates;
-
-       /*
-        * A list of alternate object directories loaded from the environment;
-        * this should not generally need to be accessed directly, but will
-        * populate the "odb" list when prepare_alt_odb() is run.
-        */
-       char *alternate_db;
-
-       /*
-        * Objects that should be substituted by other objects
-        * (see git-replace(1)).
-        */
-       struct oidmap *replace_map;
-       unsigned replace_map_initialized : 1;
-       pthread_mutex_t replace_mutex; /* protect object replace functions */
-
-       struct commit_graph *commit_graph;
-       unsigned commit_graph_attempted : 1; /* if loading has been attempted */
-
-       /*
-        * private data
-        *
-        * should only be accessed directly by packfile.c and midx.c
-        */
-       struct multi_pack_index *multi_pack_index;
-
-       /*
-        * private data
-        *
-        * should only be accessed directly by packfile.c
-        */
-
-       struct packed_git *packed_git;
-       /* A most-recently-used ordered version of the packed_git list. */
-       struct list_head packed_git_mru;
-
-       struct {
-               struct packed_git **packs;
-               unsigned flags;
-       } kept_pack_cache;
-
-       /*
-        * A map of packfiles to packed_git structs for tracking which
-        * packs have been loaded already.
-        */
-       struct hashmap pack_map;
-
-       /*
-        * A fast, rough count of the number of objects in the repository.
-        * These two fields are not meant for direct access. Use
-        * repo_approximate_object_count() instead.
-        */
-       unsigned long approximate_object_count;
-       unsigned approximate_object_count_valid : 1;
-
-       /*
-        * Whether packed_git has already been populated with this repository's
-        * packs.
-        */
-       unsigned packed_git_initialized : 1;
-};
-
-struct raw_object_store *raw_object_store_new(void);
-void raw_object_store_clear(struct raw_object_store *o);
-
-/*
- * Put in `buf` the name of the file in the local object database that
- * would be used to store a loose object with the specified oid.
- */
-const char *loose_object_path(struct repository *r, struct strbuf *buf,
-                             const struct object_id *oid);
-
-void *map_loose_object(struct repository *r, const struct object_id *oid,
-                      unsigned long *size);
-
-void *repo_read_object_file(struct repository *r,
-                           const struct object_id *oid,
-                           enum object_type *type,
-                           unsigned long *size);
-
-/* Read and unpack an object file into memory, write memory to an object file */
-int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);
-
-void hash_object_file(const struct git_hash_algo *algo, const void *buf,
-                     unsigned long len, enum object_type type,
-                     struct object_id *oid);
-
-int write_object_file_flags(const void *buf, unsigned long len,
-                           enum object_type type, struct object_id *oid,
-                           unsigned flags);
-static inline int write_object_file(const void *buf, unsigned long len,
-                                   enum object_type type, struct object_id *oid)
-{
-       return write_object_file_flags(buf, len, type, oid, 0);
-}
-
-int write_object_file_literally(const void *buf, unsigned long len,
-                               const char *type, struct object_id *oid,
-                               unsigned flags);
-int stream_loose_object(struct input_stream *in_stream, size_t len,
-                       struct object_id *oid);
-
-/*
- * Add an object file to the in-memory object store, without writing it
- * to disk.
- *
- * Callers are responsible for calling write_object_file to record the
- * object in persistent storage before writing any other new objects
- * that reference it.
- */
-int pretend_object_file(void *, unsigned long, enum object_type,
-                       struct object_id *oid);
-
-int force_object_loose(const struct object_id *oid, time_t mtime);
-
-struct object_info {
-       /* Request */
-       enum object_type *typep;
-       unsigned long *sizep;
-       off_t *disk_sizep;
-       struct object_id *delta_base_oid;
-       struct strbuf *type_name;
-       void **contentp;
-
-       /* Response */
-       enum {
-               OI_CACHED,
-               OI_LOOSE,
-               OI_PACKED,
-               OI_DBCACHED
-       } whence;
-       union {
-               /*
-                * struct {
-                *      ... Nothing to expose in this case
-                * } cached;
-                * struct {
-                *      ... Nothing to expose in this case
-                * } loose;
-                */
-               struct {
-                       struct packed_git *pack;
-                       off_t offset;
-                       unsigned int is_delta;
-               } packed;
-       } u;
-};
-
-/*
- * Initializer for a "struct object_info" that wants no items. You may
- * also memset() the memory to all-zeroes.
- */
-#define OBJECT_INFO_INIT { 0 }
-
-/* Invoke lookup_replace_object() on the given hash */
-#define OBJECT_INFO_LOOKUP_REPLACE 1
-/* Allow reading from a loose object file of unknown/bogus type */
-#define OBJECT_INFO_ALLOW_UNKNOWN_TYPE 2
-/* Do not retry packed storage after checking packed and loose storage */
-#define OBJECT_INFO_QUICK 8
-/*
- * Do not attempt to fetch the object if missing (even if fetch_is_missing is
- * nonzero).
- */
-#define OBJECT_INFO_SKIP_FETCH_OBJECT 16
-/*
- * This is meant for bulk prefetching of missing blobs in a partial
- * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
- */
-#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
-
-/* Die if object corruption (not just an object being missing) was detected. */
-#define OBJECT_INFO_DIE_IF_CORRUPT 32
-
-int oid_object_info_extended(struct repository *r,
-                            const struct object_id *,
-                            struct object_info *, unsigned flags);
-
-/*
- * Open the loose object at path, check its hash, and return the contents,
- * use the "oi" argument to assert things about the object, or e.g. populate its
- * type, and size. If the object is a blob, then "contents" may return NULL,
- * to allow streaming of large blobs.
- *
- * Returns 0 on success, negative on error (details may be written to stderr).
- */
-int read_loose_object(const char *path,
-                     const struct object_id *expected_oid,
-                     struct object_id *real_oid,
-                     void **contents,
-                     struct object_info *oi);
-
-/* Retry packed storage after checking packed and loose storage */
-#define HAS_OBJECT_RECHECK_PACKED 1
-
-/*
- * Returns 1 if the object exists. This function will not lazily fetch objects
- * in a partial clone.
- */
-int has_object(struct repository *r, const struct object_id *oid,
-              unsigned flags);
-
-/*
- * These macros and functions are deprecated. If checking existence for an
- * object that is likely to be missing and/or whose absence is relatively
- * inconsequential (or is consequential but the caller is prepared to handle
- * it), use has_object(), which has better defaults (no lazy fetch in a partial
- * clone and no rechecking of packed storage). In the unlikely event that a
- * caller needs to assert existence of an object that it fully expects to
- * exist, and wants to trigger a lazy fetch in a partial clone, use
- * oid_object_info_extended() with a NULL struct object_info.
- *
- * These functions can be removed once all callers have migrated to
- * has_object() and/or oid_object_info_extended().
- */
-int repo_has_object_file(struct repository *r, const struct object_id *oid);
-int repo_has_object_file_with_flags(struct repository *r,
-                                   const struct object_id *oid, int flags);
-
-/*
- * Return true iff an alternate object database has a loose object
- * with the specified name.  This function does not respect replace
- * references.
- */
-int has_loose_object_nonlocal(const struct object_id *);
-
-int has_loose_object(const struct object_id *);
-
-/**
- * format_object_header() is a thin wrapper around s xsnprintf() that
- * writes the initial "<type> <obj-len>" part of the loose object
- * header. It returns the size that snprintf() returns + 1.
- */
-int format_object_header(char *str, size_t size, enum object_type type,
-                        size_t objsize);
-
-void assert_oid_type(const struct object_id *oid, enum object_type expect);
-
-/*
- * Enabling the object read lock allows multiple threads to safely call the
- * following functions in parallel: repo_read_object_file(),
- * read_object_with_reference(), oid_object_info() and oid_object_info_extended().
- *
- * obj_read_lock() and obj_read_unlock() may also be used to protect other
- * section which cannot execute in parallel with object reading. Since the used
- * lock is a recursive mutex, these sections can even contain calls to object
- * reading functions. However, beware that in these cases zlib inflation won't
- * be performed in parallel, losing performance.
- *
- * TODO: oid_object_info_extended()'s call stack has a recursive behavior. If
- * any of its callees end up calling it, this recursive call won't benefit from
- * parallel inflation.
- */
-void enable_obj_read_lock(void);
-void disable_obj_read_lock(void);
-
-extern int obj_read_use_lock;
-extern pthread_mutex_t obj_read_mutex;
-
-static inline void obj_read_lock(void)
-{
-       if(obj_read_use_lock)
-               pthread_mutex_lock(&obj_read_mutex);
-}
-
-static inline void obj_read_unlock(void)
-{
-       if(obj_read_use_lock)
-               pthread_mutex_unlock(&obj_read_mutex);
-}
-
-/*
- * Iterate over the files in the loose-object parts of the object
- * directory "path", triggering the following callbacks:
- *
- *  - loose_object is called for each loose object we find.
- *
- *  - loose_cruft is called for any files that do not appear to be
- *    loose objects. Note that we only look in the loose object
- *    directories "objects/[0-9a-f]{2}/", so we will not report
- *    "objects/foobar" as cruft.
- *
- *  - loose_subdir is called for each top-level hashed subdirectory
- *    of the object directory (e.g., "$OBJDIR/f0"). It is called
- *    after the objects in the directory are processed.
- *
- * Any callback that is NULL will be ignored. Callbacks returning non-zero
- * will end the iteration.
- *
- * In the "buf" variant, "path" is a strbuf which will also be used as a
- * scratch buffer, but restored to its original contents before
- * the function returns.
- */
-typedef int each_loose_object_fn(const struct object_id *oid,
-                                const char *path,
-                                void *data);
-typedef int each_loose_cruft_fn(const char *basename,
-                               const char *path,
-                               void *data);
-typedef int each_loose_subdir_fn(unsigned int nr,
-                                const char *path,
-                                void *data);
-int for_each_file_in_obj_subdir(unsigned int subdir_nr,
-                               struct strbuf *path,
-                               each_loose_object_fn obj_cb,
-                               each_loose_cruft_fn cruft_cb,
-                               each_loose_subdir_fn subdir_cb,
-                               void *data);
-int for_each_loose_file_in_objdir(const char *path,
-                                 each_loose_object_fn obj_cb,
-                                 each_loose_cruft_fn cruft_cb,
-                                 each_loose_subdir_fn subdir_cb,
-                                 void *data);
-int for_each_loose_file_in_objdir_buf(struct strbuf *path,
-                                     each_loose_object_fn obj_cb,
-                                     each_loose_cruft_fn cruft_cb,
-                                     each_loose_subdir_fn subdir_cb,
-                                     void *data);
-
-/* Flags for for_each_*_object() below. */
-enum for_each_object_flags {
-       /* Iterate only over local objects, not alternates. */
-       FOR_EACH_OBJECT_LOCAL_ONLY = (1<<0),
-
-       /* Only iterate over packs obtained from the promisor remote. */
-       FOR_EACH_OBJECT_PROMISOR_ONLY = (1<<1),
-
-       /*
-        * Visit objects within a pack in packfile order rather than .idx order
-        */
-       FOR_EACH_OBJECT_PACK_ORDER = (1<<2),
-
-       /* Only iterate over packs that are not marked as kept in-core. */
-       FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS = (1<<3),
-
-       /* Only iterate over packs that do not have .keep files. */
-       FOR_EACH_OBJECT_SKIP_ON_DISK_KEPT_PACKS = (1<<4),
-};
-
-/*
- * Iterate over all accessible loose objects without respect to
- * reachability. By default, this includes both local and alternate objects.
- * The order in which objects are visited is unspecified.
- *
- * Any flags specific to packs are ignored.
- */
-int for_each_loose_object(each_loose_object_fn, void *,
-                         enum for_each_object_flags flags);
-
-/*
- * Iterate over all accessible packed objects without respect to reachability.
- * By default, this includes both local and alternate packs.
- *
- * Note that some objects may appear twice if they are found in multiple packs.
- * Each pack is visited in an unspecified order. By default, objects within a
- * pack are visited in pack-idx order (i.e., sorted by oid).
- */
-typedef int each_packed_object_fn(const struct object_id *oid,
-                                 struct packed_git *pack,
-                                 uint32_t pos,
-                                 void *data);
-int for_each_object_in_pack(struct packed_git *p,
-                           each_packed_object_fn, void *data,
-                           enum for_each_object_flags flags);
-int for_each_packed_object(each_packed_object_fn, void *,
-                          enum for_each_object_flags flags);
-
 #endif /* OBJECT_STORE_H */
index 45c9721b8c81929a13854d46d0354374370fd02f..2c61e4c86217e633d2e28acd0b3ae654584ede7d 100644 (file)
--- a/object.c
+++ b/object.c
@@ -1,10 +1,12 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
 #include "object.h"
 #include "replace-object.h"
+#include "object-file.h"
 #include "object-store.h"
 #include "blob.h"
+#include "statinfo.h"
 #include "tree.h"
 #include "commit.h"
 #include "tag.h"
@@ -355,6 +357,12 @@ void object_list_free(struct object_list **list)
  */
 static char object_array_slopbuf[1];
 
+void object_array_init(struct object_array *array)
+{
+       struct object_array blank = OBJECT_ARRAY_INIT;
+       memcpy(array, &blank, sizeof(*array));
+}
+
 void add_object_array_with_path(struct object *obj, const char *name,
                                struct object_array *array,
                                unsigned mode, const char *path)
index fc45b158da095d750d9dc55b93282aabe997e7f1..114d45954d082229ed747dee16f2510387145771 100644 (file)
--- a/object.h
+++ b/object.h
@@ -1,9 +1,10 @@
 #ifndef OBJECT_H
 #define OBJECT_H
 
-#include "hash.h"
+#include "hash-ll.h"
 
 struct buffer_slab;
+struct repository;
 
 struct parsed_object_pool {
        struct object **obj_hash;
@@ -57,6 +58,8 @@ struct object_array {
 
 #define OBJECT_ARRAY_INIT { 0 }
 
+void object_array_init(struct object_array *array);
+
 /*
  * object flag allocation:
  * revision.h:               0---------10         15             23------27
@@ -101,6 +104,50 @@ enum object_type {
        OBJ_MAX
 };
 
+/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */
+#define S_IFINVALID     0030000
+
+/*
+ * A "directory link" is a link to another git directory.
+ *
+ * The value 0160000 is not normally a valid mode, and
+ * also just happens to be S_IFDIR + S_IFLNK
+ */
+#define S_IFGITLINK    0160000
+#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
+
+#define S_ISSPARSEDIR(m) ((m) == S_IFDIR)
+
+static inline enum object_type object_type(unsigned int mode)
+{
+       return S_ISDIR(mode) ? OBJ_TREE :
+               S_ISGITLINK(mode) ? OBJ_COMMIT :
+               OBJ_BLOB;
+}
+
+#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
+static inline unsigned int create_ce_mode(unsigned int mode)
+{
+       if (S_ISLNK(mode))
+               return S_IFLNK;
+       if (S_ISSPARSEDIR(mode))
+               return S_IFDIR;
+       if (S_ISDIR(mode) || S_ISGITLINK(mode))
+               return S_IFGITLINK;
+       return S_IFREG | ce_permissions(mode);
+}
+
+static inline unsigned int canon_mode(unsigned int mode)
+{
+       if (S_ISREG(mode))
+               return S_IFREG | ce_permissions(mode);
+       if (S_ISLNK(mode))
+               return S_IFLNK;
+       if (S_ISDIR(mode))
+               return S_IFDIR;
+       return S_IFGITLINK;
+}
+
 /*
  * The object type is stored in 3 bits.
  */
index e8228c777b1619d6bd1baaac0e24f14124d3e4d3..8e4717746c3183bd47c3c746c747efd83c61168c 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "oid-array.h"
 #include "hash-lookup.h"
 
index 8c1a139c974d360afcd9b23608484af134d77c9f..8b1bc4dec9496e3b49ba064cc0936925625e5c79 100644 (file)
--- a/oidmap.c
+++ b/oidmap.c
@@ -1,4 +1,5 @@
 #include "git-compat-util.h"
+#include "hash.h"
 #include "oidmap.h"
 
 static int oidmap_neq(const void *hashmap_cmp_fn_data UNUSED,
index c1642927fa614764312b0ebccd05a77d12a07388..05c673eb7c1163d912dd7e54466ae9931be5426b 100644 (file)
--- a/oidmap.h
+++ b/oidmap.h
@@ -1,6 +1,7 @@
 #ifndef OIDMAP_H
 #define OIDMAP_H
 
+#include "hash-ll.h"
 #include "hashmap.h"
 
 /*
index 7d57b7b19e364706f037ccb44388e00e901b1583..daef175dc71d6c7d55fc89ef1e286334afbe00b7 100644 (file)
--- a/oidtree.c
+++ b/oidtree.c
@@ -4,7 +4,6 @@
  */
 #include "git-compat-util.h"
 #include "oidtree.h"
-#include "alloc.h"
 #include "hash.h"
 
 struct oidtree_iter_data {
index 77898f510a12272ae2302805896eaf9eecb5ce7d..55c83513fdd5f3823a3b3a430ce814094deed5ba 100644 (file)
--- a/oidtree.h
+++ b/oidtree.h
@@ -2,7 +2,7 @@
 #define OIDTREE_H
 
 #include "cbtree.h"
-#include "hash.h"
+#include "hash-ll.h"
 #include "mem-pool.h"
 
 struct oidtree {
index 609a343ee3ea41e6c4f18f0d07a104922dc952f2..3e190214d1487e4bd1f04315698e0f041402648e 100644 (file)
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
index 7f5f489beb026545593613857a9d987b42ea34c2..f6757c3cbf2019b7cf41b3d82e0861138c92c075 100644 (file)
@@ -1,9 +1,8 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "tag.h"
 #include "diff.h"
 #include "pack-bitmap.h"
 #include "hash-lookup.h"
 #include "pack-objects.h"
+#include "path.h"
 #include "commit-reach.h"
 #include "prio-queue.h"
 #include "trace2.h"
+#include "tree.h"
+#include "tree-walk.h"
 
 struct bitmapped_commit {
        struct commit *commit;
index b2e7d06d604ece888ea3ca0d7139f189d8134d2f..6afc03d1e4c39e53c1c48deb51c16d65667979e8 100644 (file)
@@ -1,5 +1,4 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "commit.h"
 #include "gettext.h"
 #include "hex.h"
@@ -15,7 +14,9 @@
 #include "pack-objects.h"
 #include "packfile.h"
 #include "repository.h"
-#include "object-store.h"
+#include "trace2.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "list-objects-filter-options.h"
 #include "midx.h"
 #include "config.h"
@@ -379,15 +380,17 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
                goto cleanup;
        }
 
-       if (load_midx_revindex(bitmap_git->midx) < 0) {
+       if (load_midx_revindex(bitmap_git->midx)) {
                warning(_("multi-pack bitmap is missing required reverse index"));
                goto cleanup;
        }
 
        for (i = 0; i < bitmap_git->midx->num_packs; i++) {
-               if (prepare_midx_pack(the_repository, bitmap_git->midx, i))
-                       die(_("could not open pack %s"),
-                           bitmap_git->midx->pack_names[i]);
+               if (prepare_midx_pack(the_repository, bitmap_git->midx, i)) {
+                       warning(_("could not open pack %s"),
+                               bitmap_git->midx->pack_names[i]);
+                       goto cleanup;
+               }
        }
 
        preferred = bitmap_git->midx->packs[midx_preferred_pack(bitmap_git)];
@@ -463,7 +466,7 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git
        return 0;
 }
 
-static int load_reverse_index(struct bitmap_index *bitmap_git)
+static int load_reverse_index(struct repository *r, struct bitmap_index *bitmap_git)
 {
        if (bitmap_is_midx(bitmap_git)) {
                uint32_t i;
@@ -477,23 +480,23 @@ static int load_reverse_index(struct bitmap_index *bitmap_git)
                 * since we will need to make use of them in pack-objects.
                 */
                for (i = 0; i < bitmap_git->midx->num_packs; i++) {
-                       ret = load_pack_revindex(bitmap_git->midx->packs[i]);
+                       ret = load_pack_revindex(r, bitmap_git->midx->packs[i]);
                        if (ret)
                                return ret;
                }
                return 0;
        }
-       return load_pack_revindex(bitmap_git->pack);
+       return load_pack_revindex(r, bitmap_git->pack);
 }
 
-static int load_bitmap(struct bitmap_index *bitmap_git)
+static int load_bitmap(struct repository *r, struct bitmap_index *bitmap_git)
 {
        assert(bitmap_git->map);
 
        bitmap_git->bitmaps = kh_init_oid_map();
        bitmap_git->ext_index.positions = kh_init_oid_pos();
 
-       if (load_reverse_index(bitmap_git))
+       if (load_reverse_index(r, bitmap_git))
                goto failed;
 
        if (!(bitmap_git->commits = read_bitmap_1(bitmap_git)) ||
@@ -580,7 +583,7 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
 {
        struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git));
 
-       if (!open_bitmap(r, bitmap_git) && !load_bitmap(bitmap_git))
+       if (!open_bitmap(r, bitmap_git) && !load_bitmap(r, bitmap_git))
                return bitmap_git;
 
        free_bitmap_index(bitmap_git);
@@ -589,9 +592,10 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
 
 struct bitmap_index *prepare_midx_bitmap_git(struct multi_pack_index *midx)
 {
+       struct repository *r = the_repository;
        struct bitmap_index *bitmap_git = xcalloc(1, sizeof(*bitmap_git));
 
-       if (!open_midx_bitmap_1(bitmap_git, midx) && !load_bitmap(bitmap_git))
+       if (!open_midx_bitmap_1(bitmap_git, midx) && !load_bitmap(r, bitmap_git))
                return bitmap_git;
 
        free_bitmap_index(bitmap_git);
@@ -1040,6 +1044,160 @@ static int add_commit_to_bitmap(struct bitmap_index *bitmap_git,
        return 1;
 }
 
+static struct bitmap *fill_in_bitmap(struct bitmap_index *bitmap_git,
+                                    struct rev_info *revs,
+                                    struct bitmap *base,
+                                    struct bitmap *seen)
+{
+       struct include_data incdata;
+       struct bitmap_show_data show_data;
+
+       if (!base)
+               base = bitmap_new();
+
+       incdata.bitmap_git = bitmap_git;
+       incdata.base = base;
+       incdata.seen = seen;
+
+       revs->include_check = should_include;
+       revs->include_check_obj = should_include_obj;
+       revs->include_check_data = &incdata;
+
+       if (prepare_revision_walk(revs))
+               die(_("revision walk setup failed"));
+
+       show_data.bitmap_git = bitmap_git;
+       show_data.base = base;
+
+       traverse_commit_list(revs, show_commit, show_object, &show_data);
+
+       revs->include_check = NULL;
+       revs->include_check_obj = NULL;
+       revs->include_check_data = NULL;
+
+       return base;
+}
+
+struct bitmap_boundary_cb {
+       struct bitmap_index *bitmap_git;
+       struct bitmap *base;
+
+       struct object_array boundary;
+};
+
+static void show_boundary_commit(struct commit *commit, void *_data)
+{
+       struct bitmap_boundary_cb *data = _data;
+
+       if (commit->object.flags & BOUNDARY)
+               add_object_array(&commit->object, "", &data->boundary);
+
+       if (commit->object.flags & UNINTERESTING) {
+               if (bitmap_walk_contains(data->bitmap_git, data->base,
+                                        &commit->object.oid))
+                       return;
+
+               add_commit_to_bitmap(data->bitmap_git, &data->base, commit);
+       }
+}
+
+static void show_boundary_object(struct object *object,
+                                const char *name, void *data)
+{
+       BUG("should not be called");
+}
+
+static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
+                                           struct rev_info *revs,
+                                           struct object_list *roots)
+{
+       struct bitmap_boundary_cb cb;
+       struct object_list *root;
+       unsigned int i;
+       unsigned int tmp_blobs, tmp_trees, tmp_tags;
+       int any_missing = 0;
+
+       cb.bitmap_git = bitmap_git;
+       cb.base = bitmap_new();
+       object_array_init(&cb.boundary);
+
+       revs->ignore_missing_links = 1;
+
+       /*
+        * OR in any existing reachability bitmaps among `roots` into
+        * `cb.base`.
+        */
+       for (root = roots; root; root = root->next) {
+               struct object *object = root->item;
+               if (object->type != OBJ_COMMIT ||
+                   bitmap_walk_contains(bitmap_git, cb.base, &object->oid))
+                       continue;
+
+               if (add_commit_to_bitmap(bitmap_git, &cb.base,
+                                        (struct commit *)object))
+                       continue;
+
+               any_missing = 1;
+       }
+
+       if (!any_missing)
+               goto cleanup;
+
+       tmp_blobs = revs->blob_objects;
+       tmp_trees = revs->tree_objects;
+       tmp_tags = revs->blob_objects;
+       revs->blob_objects = 0;
+       revs->tree_objects = 0;
+       revs->tag_objects = 0;
+
+       /*
+        * We didn't have complete coverage of the roots. First setup a
+        * revision walk to (a) OR in any bitmaps that are UNINTERESTING
+        * between the tips and boundary, and (b) record the boundary.
+        */
+       trace2_region_enter("pack-bitmap", "boundary-prepare", the_repository);
+       if (prepare_revision_walk(revs))
+               die("revision walk setup failed");
+       trace2_region_leave("pack-bitmap", "boundary-prepare", the_repository);
+
+       trace2_region_enter("pack-bitmap", "boundary-traverse", the_repository);
+       revs->boundary = 1;
+       traverse_commit_list_filtered(revs,
+                                     show_boundary_commit,
+                                     show_boundary_object,
+                                     &cb, NULL);
+       revs->boundary = 0;
+       trace2_region_leave("pack-bitmap", "boundary-traverse", the_repository);
+
+       revs->blob_objects = tmp_blobs;
+       revs->tree_objects = tmp_trees;
+       revs->tag_objects = tmp_tags;
+
+       reset_revision_walk();
+       clear_object_flags(UNINTERESTING);
+
+       /*
+        * Then add the boundary commit(s) as fill-in traversal tips.
+        */
+       trace2_region_enter("pack-bitmap", "boundary-fill-in", the_repository);
+       for (i = 0; i < cb.boundary.nr; i++) {
+               struct object *obj = cb.boundary.objects[i].item;
+               if (bitmap_walk_contains(bitmap_git, cb.base, &obj->oid))
+                       obj->flags |= SEEN;
+               else
+                       add_pending_object(revs, obj, "");
+       }
+       if (revs->pending.nr)
+               cb.base = fill_in_bitmap(bitmap_git, revs, cb.base, NULL);
+       trace2_region_leave("pack-bitmap", "boundary-fill-in", the_repository);
+
+cleanup:
+       object_array_clear(&cb.boundary);
+       revs->ignore_missing_links = 0;
+
+       return cb.base;
+}
+
 static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
                                   struct rev_info *revs,
                                   struct object_list *roots,
@@ -1106,33 +1264,19 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
        }
 
        if (needs_walk) {
-               struct include_data incdata;
-               struct bitmap_show_data show_data;
-
-               if (!base)
-                       base = bitmap_new();
-
-               incdata.bitmap_git = bitmap_git;
-               incdata.base = base;
-               incdata.seen = seen;
-
-               revs->include_check = should_include;
-               revs->include_check_obj = should_include_obj;
-               revs->include_check_data = &incdata;
-
-               if (prepare_revision_walk(revs))
-                       die(_("revision walk setup failed"));
-
-               show_data.bitmap_git = bitmap_git;
-               show_data.base = base;
-
-               traverse_commit_list(revs,
-                                    show_commit, show_object,
-                                    &show_data);
-
-               revs->include_check = NULL;
-               revs->include_check_obj = NULL;
-               revs->include_check_data = NULL;
+               /*
+                * This fill-in traversal may walk over some objects
+                * again, since we have already traversed in order to
+                * find the boundary.
+                *
+                * But this extra walk should be extremely cheap, since
+                * all commit objects are loaded into memory, and
+                * because we skip walking to parents that are
+                * UNINTERESTING, since it will be marked in the haves
+                * bitmap already (or it has an on-disk bitmap, since
+                * OR-ing it in covers all of its ancestors).
+                */
+               base = fill_in_bitmap(bitmap_git, revs, base, seen);
        }
 
        return base;
@@ -1149,7 +1293,7 @@ static void show_extended_objects(struct bitmap_index *bitmap_git,
        for (i = 0; i < eindex->count; ++i) {
                struct object *obj;
 
-               if (!bitmap_get(objects, bitmap_num_objects(bitmap_git) + i))
+               if (!bitmap_get(objects, st_add(bitmap_num_objects(bitmap_git), i)))
                        continue;
 
                obj = eindex->objects[i];
@@ -1328,7 +1472,7 @@ static void filter_bitmap_exclude_type(struct bitmap_index *bitmap_git,
         * them individually.
         */
        for (i = 0; i < eindex->count; i++) {
-               uint32_t pos = i + bitmap_num_objects(bitmap_git);
+               size_t pos = st_add(i, bitmap_num_objects(bitmap_git));
                if (eindex->objects[i]->type == type &&
                    bitmap_get(to_filter, pos) &&
                    !bitmap_get(tips, pos))
@@ -1419,7 +1563,7 @@ static void filter_bitmap_blob_limit(struct bitmap_index *bitmap_git,
        }
 
        for (i = 0; i < eindex->count; i++) {
-               uint32_t pos = i + bitmap_num_objects(bitmap_git);
+               size_t pos = st_add(i, bitmap_num_objects(bitmap_git));
                if (eindex->objects[i]->type == OBJ_BLOB &&
                    bitmap_get(to_filter, pos) &&
                    !bitmap_get(tips, pos) &&
@@ -1525,6 +1669,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
                                         int filter_provided_objects)
 {
        unsigned int i;
+       int use_boundary_traversal;
 
        struct object_list *wants = NULL;
        struct object_list *haves = NULL;
@@ -1575,13 +1720,21 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
                        object_list_insert(object, &wants);
        }
 
-       /*
-        * if we have a HAVES list, but none of those haves is contained
-        * in the packfile that has a bitmap, we don't have anything to
-        * optimize here
-        */
-       if (haves && !in_bitmapped_pack(bitmap_git, haves))
-               goto cleanup;
+       use_boundary_traversal = git_env_bool(GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL, -1);
+       if (use_boundary_traversal < 0) {
+               prepare_repo_settings(revs->repo);
+               use_boundary_traversal = revs->repo->settings.pack_use_bitmap_boundary_traversal;
+       }
+
+       if (!use_boundary_traversal) {
+               /*
+                * if we have a HAVES list, but none of those haves is contained
+                * in the packfile that has a bitmap, we don't have anything to
+                * optimize here
+                */
+               if (haves && !in_bitmapped_pack(bitmap_git, haves))
+                       goto cleanup;
+       }
 
        /* if we don't want anything, we're done here */
        if (!wants)
@@ -1592,21 +1745,35 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
         * from disk. this is the point of no return; after this the rev_list
         * becomes invalidated and we must perform the revwalk through bitmaps
         */
-       if (load_bitmap(bitmap_git) < 0)
+       if (load_bitmap(revs->repo, bitmap_git) < 0)
                goto cleanup;
 
-       object_array_clear(&revs->pending);
+       if (!use_boundary_traversal)
+               object_array_clear(&revs->pending);
 
        if (haves) {
-               revs->ignore_missing_links = 1;
-               haves_bitmap = find_objects(bitmap_git, revs, haves, NULL);
-               reset_revision_walk();
-               revs->ignore_missing_links = 0;
+               if (use_boundary_traversal) {
+                       trace2_region_enter("pack-bitmap", "haves/boundary", the_repository);
+                       haves_bitmap = find_boundary_objects(bitmap_git, revs, haves);
+                       trace2_region_leave("pack-bitmap", "haves/boundary", the_repository);
+               } else {
+                       trace2_region_enter("pack-bitmap", "haves/classic", the_repository);
+                       revs->ignore_missing_links = 1;
+                       haves_bitmap = find_objects(bitmap_git, revs, haves, NULL);
+                       reset_revision_walk();
+                       revs->ignore_missing_links = 0;
+                       trace2_region_leave("pack-bitmap", "haves/classic", the_repository);
+               }
 
                if (!haves_bitmap)
                        BUG("failed to perform bitmap walk");
        }
 
+       if (use_boundary_traversal) {
+               object_array_clear(&revs->pending);
+               reset_revision_walk();
+       }
+
        wants_bitmap = find_objects(bitmap_git, revs, wants, haves_bitmap);
 
        if (!wants_bitmap)
@@ -1742,6 +1909,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
                                       uint32_t *entries,
                                       struct bitmap **reuse_out)
 {
+       struct repository *r = the_repository;
        struct packed_git *pack;
        struct bitmap *result = bitmap_git->result;
        struct bitmap *reuse;
@@ -1752,7 +1920,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
 
        assert(result);
 
-       load_reverse_index(bitmap_git);
+       load_reverse_index(r, bitmap_git);
 
        if (bitmap_is_midx(bitmap_git))
                pack = bitmap_git->midx->packs[midx_preferred_pack(bitmap_git)];
@@ -1869,7 +2037,8 @@ static uint32_t count_object_type(struct bitmap_index *bitmap_git,
 
        for (i = 0; i < eindex->count; ++i) {
                if (eindex->objects[i]->type == type &&
-                       bitmap_get(objects, bitmap_num_objects(bitmap_git) + i))
+                   bitmap_get(objects,
+                              st_add(bitmap_num_objects(bitmap_git), i)))
                        count++;
        }
 
@@ -2132,12 +2301,13 @@ int rebuild_bitmap(const uint32_t *reposition,
 uint32_t *create_bitmap_mapping(struct bitmap_index *bitmap_git,
                                struct packing_data *mapping)
 {
+       struct repository *r = the_repository;
        uint32_t i, num_objects;
        uint32_t *reposition;
 
        if (!bitmap_is_midx(bitmap_git))
-               load_reverse_index(bitmap_git);
-       else if (load_midx_revindex(bitmap_git->midx) < 0)
+               load_reverse_index(r, bitmap_git);
+       else if (load_midx_revindex(bitmap_git->midx))
                BUG("rebuild_existing_bitmaps: missing required rev-cache "
                    "extension");
 
@@ -2282,7 +2452,8 @@ static off_t get_disk_usage_for_extended(struct bitmap_index *bitmap_git)
        for (i = 0; i < eindex->count; i++) {
                struct object *obj = eindex->objects[i];
 
-               if (!bitmap_get(result, bitmap_num_objects(bitmap_git) + i))
+               if (!bitmap_get(result,
+                               st_add(bitmap_num_objects(bitmap_git), i)))
                        continue;
 
                if (oid_object_info_extended(the_repository, &obj->oid, &oi, 0) < 0)
@@ -2341,3 +2512,48 @@ int bitmap_is_preferred_refname(struct repository *r, const char *refname)
 
        return 0;
 }
+
+static int verify_bitmap_file(const char *name)
+{
+       struct stat st;
+       unsigned char *data;
+       int fd = git_open(name);
+       int res = 0;
+
+       /* It is OK to not have the file. */
+       if (fd < 0 || fstat(fd, &st)) {
+               if (fd >= 0)
+                       close(fd);
+               return 0;
+       }
+
+       data = xmmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+       close(fd);
+       if (!hashfile_checksum_valid(data, st.st_size))
+               res = error(_("bitmap file '%s' has invalid checksum"),
+                           name);
+
+       munmap(data, st.st_size);
+       return res;
+}
+
+int verify_bitmap_files(struct repository *r)
+{
+       int res = 0;
+
+       for (struct multi_pack_index *m = get_multi_pack_index(r);
+            m; m = m->next) {
+               char *midx_bitmap_name = midx_bitmap_filename(m);
+               res |= verify_bitmap_file(midx_bitmap_name);
+               free(midx_bitmap_name);
+       }
+
+       for (struct packed_git *p = get_all_packs(r);
+            p; p = p->next) {
+               char *pack_bitmap_name = pack_bitmap_filename(p);
+               res |= verify_bitmap_file(pack_bitmap_name);
+               free(pack_bitmap_name);
+       }
+
+       return res;
+}
index f0180b5276b15d6567eda9984637333811fa851b..5273a6a019708c8295be8e4fa5ca11db342f3a40 100644 (file)
@@ -62,6 +62,10 @@ void traverse_bitmap_commit_list(struct bitmap_index *,
 void test_bitmap_walk(struct rev_info *revs);
 int test_bitmap_commits(struct repository *r);
 int test_bitmap_hashes(struct repository *r);
+
+#define GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL \
+       "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL"
+
 struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
                                         int filter_provided_objects);
 uint32_t midx_preferred_pack(struct bitmap_index *bitmap_git);
@@ -111,4 +115,6 @@ int bitmap_is_midx(struct bitmap_index *bitmap_git);
 const struct string_list *bitmap_preferred_tips(struct repository *r);
 int bitmap_is_preferred_refname(struct repository *r, const char *refname);
 
+int verify_bitmap_files(struct repository *r);
+
 #endif
index 6974e40a95826e39b3f102d1653b391c9e87cde5..977f619618e0a9b97044f0b07e5617d3b3e1839b 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "hex.h"
 #include "repository.h"
@@ -6,7 +6,8 @@
 #include "pack-revindex.h"
 #include "progress.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 
 struct idx_entry {
        off_t                offset;
index afed63219060ecb57cc1fdb285bfe0b90eac725c..cdf30b8d2b0e809db7ee7e219b39863fad702bd4 100644 (file)
@@ -1,8 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "pack-mtimes.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "packfile.h"
+#include "strbuf.h"
 
 static char *pack_mtimes_filename(struct packed_git *p)
 {
index ccab09fe654391ef8da95c4f4ecf0bf55d5f3df7..1b8052bececc1f9b0a2ef53f04d70334c1b57314 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "object.h"
 #include "pack.h"
 #include "pack-objects.h"
index 579476687c4f7123c7861cde595a1ce94f87ae1f..0d78db40cb2f11fcbc4b3c2bbb2d23624ef3f22e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PACK_OBJECTS_H
 #define PACK_OBJECTS_H
 
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "thread-utils.h"
 #include "pack.h"
 
index 03c7e81f9da61602f22185d20bcb5121ba7fc97b..7fffcad9125610cb05a5823b03b86d3e28eeabdb 100644 (file)
@@ -1,10 +1,14 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "pack-revindex.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "packfile.h"
+#include "strbuf.h"
+#include "trace2.h"
 #include "config.h"
 #include "midx.h"
+#include "csum-file.h"
 
 struct revindex_entry {
        off_t offset;
@@ -205,10 +209,14 @@ static int load_revindex_from_disk(char *revindex_name,
        size_t revindex_size;
        struct revindex_header *hdr;
 
+       if (git_env_bool(GIT_TEST_REV_INDEX_DIE_ON_DISK, 0))
+               die("dying as requested by '%s'", GIT_TEST_REV_INDEX_DIE_ON_DISK);
+
        fd = git_open(revindex_name);
 
        if (fd < 0) {
-               ret = -1;
+               /* "No file" means return 1. */
+               ret = 1;
                goto cleanup;
        }
        if (fstat(fd, &st)) {
@@ -260,7 +268,7 @@ cleanup:
        return ret;
 }
 
-static int load_pack_revindex_from_disk(struct packed_git *p)
+int load_pack_revindex_from_disk(struct packed_git *p)
 {
        char *revindex_name;
        int ret;
@@ -283,18 +291,58 @@ cleanup:
        return ret;
 }
 
-int load_pack_revindex(struct packed_git *p)
+int load_pack_revindex(struct repository *r, struct packed_git *p)
 {
        if (p->revindex || p->revindex_data)
                return 0;
 
-       if (!load_pack_revindex_from_disk(p))
+       prepare_repo_settings(r);
+
+       if (r->settings.pack_read_reverse_index &&
+           !load_pack_revindex_from_disk(p))
                return 0;
        else if (!create_pack_revindex_in_memory(p))
                return 0;
        return -1;
 }
 
+/*
+ * verify_pack_revindex verifies that the on-disk rev-index for the given
+ * pack-file is the same that would be created if written from scratch.
+ *
+ * A negative number is returned on error.
+ */
+int verify_pack_revindex(struct packed_git *p)
+{
+       int res = 0;
+
+       /* Do not bother checking if not initialized. */
+       if (!p->revindex_map || !p->revindex_data)
+               return res;
+
+       if (!hashfile_checksum_valid((const unsigned char *)p->revindex_map, p->revindex_size)) {
+               error(_("invalid checksum"));
+               res = -1;
+       }
+
+       /* This may fail due to a broken .idx. */
+       if (create_pack_revindex_in_memory(p))
+               return res;
+
+       for (size_t i = 0; i < p->num_objects; i++) {
+               uint32_t nr = p->revindex[i].nr;
+               uint32_t rev_val = get_be32(p->revindex_data + i);
+
+               if (nr != rev_val) {
+                       error(_("invalid rev-index position at %"PRIu64": %"PRIu32" != %"PRIu32""),
+                             (uint64_t)i, nr, rev_val);
+                       res = -1;
+               }
+       }
+
+       return res;
+}
+
 int load_midx_revindex(struct multi_pack_index *m)
 {
        struct strbuf revindex_name = STRBUF_INIT;
@@ -356,7 +404,7 @@ int offset_to_pack_pos(struct packed_git *p, off_t ofs, uint32_t *pos)
 {
        unsigned lo, hi;
 
-       if (load_pack_revindex(p) < 0)
+       if (load_pack_revindex(the_repository, p) < 0)
                return -1;
 
        lo = 0;
index 4974e75eb4d0e9d002fc70a87e5bb4526e1e49f7..6dd47efea10ec69a3438f0a804a71bf13cd91c37 100644 (file)
 #define RIDX_SIGNATURE 0x52494458 /* "RIDX" */
 #define RIDX_VERSION 1
 
-#define GIT_TEST_WRITE_REV_INDEX "GIT_TEST_WRITE_REV_INDEX"
+#define GIT_TEST_NO_WRITE_REV_INDEX "GIT_TEST_NO_WRITE_REV_INDEX"
 #define GIT_TEST_REV_INDEX_DIE_IN_MEMORY "GIT_TEST_REV_INDEX_DIE_IN_MEMORY"
+#define GIT_TEST_REV_INDEX_DIE_ON_DISK "GIT_TEST_REV_INDEX_DIE_ON_DISK"
 
 struct packed_git;
 struct multi_pack_index;
+struct repository;
 
 /*
  * load_pack_revindex populates the revindex's internal data-structures for the
@@ -47,7 +49,23 @@ struct multi_pack_index;
  * If a '.rev' file is present it is mmap'd, and pointers are assigned into it
  * (instead of using the in-memory variant).
  */
-int load_pack_revindex(struct packed_git *p);
+int load_pack_revindex(struct repository *r, struct packed_git *p);
+
+/*
+ * Specifically load a pack revindex from disk.
+ *
+ * Returns 0 on success, 1 on "no .rev file", and -1 when there is an
+ * error parsing the .rev file.
+ */
+int load_pack_revindex_from_disk(struct packed_git *p);
+
+/*
+ * verify_pack_revindex verifies that the on-disk rev-index for the given
+ * pack-file is the same that would be created if written from scratch.
+ *
+ * A negative number is returned on error.
+ */
+int verify_pack_revindex(struct packed_git *p);
 
 /*
  * load_midx_revindex loads the '.rev' file corresponding to the given
index f1714054951e158ca920a4a17a831914962f557e..b19ddf15b284868acd7ad9123aed8fba10d08d30 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
@@ -9,6 +9,9 @@
 #include "pack-mtimes.h"
 #include "oidmap.h"
 #include "pack-objects.h"
+#include "pack-revindex.h"
+#include "path.h"
+#include "strbuf.h"
 
 void reset_pack_idx_option(struct pack_idx_option *opts)
 {
@@ -312,13 +315,13 @@ static void write_mtimes_trailer(struct hashfile *f, const unsigned char *hash)
        hashwrite(f, hash, the_hash_algo->rawsz);
 }
 
-static const char *write_mtimes_file(struct packing_data *to_pack,
-                                    struct pack_idx_entry **objects,
-                                    uint32_t nr_objects,
-                                    const unsigned char *hash)
+static char *write_mtimes_file(struct packing_data *to_pack,
+                              struct pack_idx_entry **objects,
+                              uint32_t nr_objects,
+                              const unsigned char *hash)
 {
        struct strbuf tmp_file = STRBUF_INIT;
-       const char *mtimes_name;
+       char *mtimes_name;
        struct hashfile *f;
        int fd;
 
@@ -544,7 +547,7 @@ void stage_tmp_packfiles(struct strbuf *name_buffer,
                         char **idx_tmp_name)
 {
        const char *rev_tmp_name = NULL;
-       const char *mtimes_tmp_name = NULL;
+       char *mtimes_tmp_name = NULL;
 
        if (adjust_shared_perm(pack_tmp_name))
                die_errno("unable to make temporary pack file readable");
@@ -568,6 +571,9 @@ void stage_tmp_packfiles(struct strbuf *name_buffer,
                rename_tmp_packfile(name_buffer, rev_tmp_name, "rev");
        if (mtimes_tmp_name)
                rename_tmp_packfile(name_buffer, mtimes_tmp_name, "mtimes");
+
+       free((char *)rev_tmp_name);
+       free(mtimes_tmp_name);
 }
 
 void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_sought)
index b120405ccc8a6bf591ddd7e8b9410f2305a88306..9cc0a2e37a83dd38c2fe1b26d34cfb5fea983bc7 100644 (file)
@@ -1,5 +1,4 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "commit.h"
 #include "object.h"
 #include "tag.h"
+#include "trace.h"
 #include "tree-walk.h"
 #include "tree.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "midx.h"
 #include "commit-graph.h"
+#include "pack-revindex.h"
 #include "promisor-remote.h"
-#include "wrapper.h"
 
 char *odb_pack_name(struct strbuf *buf,
                    const unsigned char *hash,
@@ -183,7 +184,7 @@ int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
                     */
                    (sizeof(off_t) <= 4))
                        return error("pack too large for current definition of off_t in %s", path);
-               p->crc_offset = 8 + 4 * 256 + nr * hashsz;
+               p->crc_offset = st_add(8 + 4 * 256, st_mult(nr, hashsz));
        }
 
        p->index_version = version;
@@ -378,7 +379,7 @@ void close_object_store(struct raw_object_store *o)
 
 void unlink_pack_path(const char *pack_name, int force_delete)
 {
-       static const char *exts[] = {".pack", ".idx", ".rev", ".keep", ".bitmap", ".promisor", ".mtimes"};
+       static const char *exts[] = {".idx", ".pack", ".rev", ".keep", ".bitmap", ".promisor", ".mtimes"};
        int i;
        struct strbuf buf = STRBUF_INIT;
        size_t plen;
@@ -750,7 +751,7 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
        p->pack_local = local;
        p->mtime = st.st_mtime;
        if (path_len < the_hash_algo->hexsz ||
-           get_sha1_hex(path + path_len - the_hash_algo->hexsz, p->hash))
+           get_hash_hex(path + path_len - the_hash_algo->hexsz, p->hash))
                hashclr(p->hash);
        return p;
 }
@@ -1917,10 +1918,10 @@ int nth_packed_object_id(struct object_id *oid,
                return -1;
        index += 4 * 256;
        if (p->index_version == 1) {
-               oidread(oid, index + (hashsz + 4) * n + 4);
+               oidread(oid, index + st_add(st_mult(hashsz + 4, n), 4));
        } else {
                index += 8;
-               oidread(oid, index + hashsz * n);
+               oidread(oid, index + st_mult(hashsz, n));
        }
        return 0;
 }
@@ -1945,14 +1946,15 @@ 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) * (size_t)n)));
+               return ntohl(*((uint32_t *)(index + st_mult(hashsz + 4, n))));
        } else {
                uint32_t off;
-               index += 8 + (size_t)p->num_objects * (hashsz + 4);
-               off = ntohl(*((uint32_t *)(index + 4 * n)));
+               index += st_add(8, st_mult(p->num_objects, hashsz + 4));
+               off = ntohl(*((uint32_t *)(index + st_mult(4, n))));
                if (!(off & 0x80000000))
                        return off;
-               index += (size_t)p->num_objects * 4 + (off & 0x7fffffff) * 8;
+               index += st_add(st_mult(p->num_objects, 4),
+                               st_mult(off & 0x7fffffff, 8));
                check_pack_index_ptr(p, index);
                return get_be64(index);
        }
@@ -2151,7 +2153,7 @@ int for_each_object_in_pack(struct packed_git *p,
        int r = 0;
 
        if (flags & FOR_EACH_OBJECT_PACK_ORDER) {
-               if (load_pack_revindex(p))
+               if (load_pack_revindex(the_repository, p))
                        return -1;
        }
 
index 665603b696a1e852ea9b0de0de7268540fe2870d..c3692308b8dc866b2b99b2ed9b983db4d6d1352b 100644 (file)
@@ -6,10 +6,22 @@
 
 /* in object-store.h */
 struct packed_git;
-struct pack_entry;
-struct pack_window;
 struct object_info;
 
+struct pack_window {
+       struct pack_window *next;
+       unsigned char *base;
+       off_t offset;
+       size_t len;
+       unsigned int last_used;
+       unsigned int inuse_cnt;
+};
+
+struct pack_entry {
+       off_t offset;
+       struct packed_git *p;
+};
+
 /*
  * Generate the filename to be used for a pack file with checksum "sha1" and
  * extension "ext". The result is written into the strbuf "buf", overwriting
diff --git a/pager.c b/pager.c
index b66bbff2785cb6ed032edb4f0d9cd68f6a841c36..b8822a9381e49487ecb9bf37f1a42f1414eb8ff3 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1,9 +1,13 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
+#include "editor.h"
+#include "pager.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "alias.h"
 
+int pager_use_color = 1;
+
 #ifndef DEFAULT_PAGER
 #define DEFAULT_PAGER "less"
 #endif
@@ -39,6 +43,7 @@ static void wait_for_pager_signal(int signo)
 }
 
 static int core_pager_config(const char *var, const char *value,
+                            const struct config_context *ctx UNUSED,
                             void *data UNUSED)
 {
        if (!strcmp(var, "core.pager"))
@@ -224,7 +229,9 @@ struct pager_command_config_data {
        char *value;
 };
 
-static int pager_command_config(const char *var, const char *value, void *vdata)
+static int pager_command_config(const char *var, const char *value,
+                               const struct config_context *ctx UNUSED,
+                               void *vdata)
 {
        struct pager_command_config_data *data = vdata;
        const char *cmd;
diff --git a/pager.h b/pager.h
new file mode 100644 (file)
index 0000000..b774330
--- /dev/null
+++ b/pager.h
@@ -0,0 +1,17 @@
+#ifndef PAGER_H
+#define PAGER_H
+
+struct child_process;
+
+const char *git_pager(int stdout_is_tty);
+void setup_pager(void);
+int pager_in_use(void);
+int term_columns(void);
+void term_clear_line(void);
+int decimal_width(uintmax_t);
+int check_pager_config(const char *cmd);
+void prepare_pager_args(struct child_process *, const char *pager);
+
+extern int pager_use_color;
+
+#endif /* PAGER_H */
index 50fd7fe31ef91e21a5204693f1509ae8d5d55589..b5a714c7111bda0d179077ef1614bbe5ce1570b5 100644 (file)
@@ -1,18 +1,19 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "entry.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "parallel-checkout.h"
 #include "pkt-line.h"
 #include "progress.h"
+#include "read-cache-ll.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "streaming.h"
+#include "symlinks.h"
 #include "thread-utils.h"
 #include "trace2.h"
-#include "wrapper.h"
 
 struct pc_worker {
        struct child_process cp;
index 10f2f75e83893a3599616f2ee593ac27fe14fd48..a24521dee0fca3de6284a9c59cd3bd8cefdb4942 100644 (file)
@@ -1,11 +1,12 @@
 #include "git-compat-util.h"
 #include "parse-options.h"
 #include "branch.h"
-#include "cache.h"
 #include "commit.h"
 #include "color.h"
+#include "date.h"
 #include "environment.h"
 #include "gettext.h"
+#include "object-name.h"
 #include "string-list.h"
 #include "strvec.h"
 #include "oid-array.h"
index b6803647d0eb84c6e4cdbbb3c053b8c082c0829c..60224cf8d03fb1764ad26da422f7158898b631ea 100644 (file)
@@ -5,6 +5,7 @@
 #include "commit.h"
 #include "color.h"
 #include "gettext.h"
+#include "strbuf.h"
 #include "utf8.h"
 
 static int disallow_abbreviated_options;
@@ -479,6 +480,9 @@ static void parse_options_check(const struct option *opts)
                     opts->long_name))
                        optbug(opts, "uses feature "
                               "not supported for dashless options");
+               if (opts->type == OPTION_SET_INT && !opts->defval &&
+                   opts->long_name && !(opts->flags & PARSE_OPT_NONEG))
+                       optbug(opts, "OPTION_SET_INT 0 should not be negatable");
                switch (opts->type) {
                case OPTION_COUNTUP:
                case OPTION_BIT:
@@ -1108,6 +1112,7 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
        for (; opts->type != OPTION_END; opts++) {
                size_t pos;
                int pad;
+               const char *cp, *np;
 
                if (opts->type == OPTION_SUBCOMMAND)
                        continue;
@@ -1144,7 +1149,9 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
                    !(opts->flags & PARSE_OPT_NOARG))
                        pos += usage_argh(opts, outfile);
 
-               if (pos <= USAGE_OPTS_WIDTH)
+               if (pos == USAGE_OPTS_WIDTH + 1)
+                       pad = -1;
+               else if (pos <= USAGE_OPTS_WIDTH)
                        pad = USAGE_OPTS_WIDTH - pos;
                else {
                        fputc('\n', outfile);
@@ -1156,7 +1163,16 @@ static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t
                                   (const char *)opts->value);
                        continue;
                }
-               fprintf(outfile, "%*s%s\n", pad + USAGE_GAP, "", _(opts->help));
+
+               for (cp = _(opts->help); *cp; cp = np) {
+                       np = strchrnul(cp, '\n');
+                       fprintf(outfile,
+                               "%*s%.*s\n", pad + USAGE_GAP, "",
+                               (int)(np - cp), cp);
+                       if (*np)
+                               np++;
+                       pad = USAGE_OPTS_WIDTH;
+               }
        }
        fputc('\n', outfile);
 
index 8e48efe524882a6dcd4c854de6fcdbe0ef76acda..57a7fe9d91a1690e59e05838897a8d474aca5de1 100644 (file)
@@ -581,4 +581,10 @@ int parse_opt_tracking_mode(const struct option *, const char *, int);
 #define OPT_PATHSPEC_FILE_NUL(v)  OPT_BOOL(0, "pathspec-file-nul", v, N_("with --pathspec-from-file, pathspec elements are separated with NUL character"))
 #define OPT_AUTOSTASH(v) OPT_BOOL(0, "autostash", v, N_("automatically stash/stash pop before and after"))
 
+#define OPT_IPVERSION(v) \
+       OPT_SET_INT_F('4', "ipv4", (v), N_("use IPv4 addresses only"), \
+               TRANSPORT_FAMILY_IPV4, PARSE_OPT_NONEG), \
+       OPT_SET_INT_F('6', "ipv6", (v), N_("use IPv6 addresses only"), \
+               TRANSPORT_FAMILY_IPV6, PARSE_OPT_NONEG)
+
 #endif
index 19af7bee9840e4fd945b21a10364bcd5c1fb546f..c3e1a0dd216c80c92c47f0e2a98d74a57c422742 100644 (file)
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "diff.h"
 #include "commit.h"
+#include "hash.h"
 #include "hash-lookup.h"
 #include "hex.h"
 #include "patch-ids.h"
diff --git a/path.c b/path.c
index dff215ac69339dce01cabd9a0f6d01b0e8bcec2f..67e2690efef897b406d46eab6202b52fc65a55d0 100644 (file)
--- a/path.c
+++ b/path.c
@@ -15,7 +15,7 @@
 #include "submodule-config.h"
 #include "path.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "lockfile.h"
 #include "exec-cmd.h"
 
@@ -1212,6 +1212,26 @@ int normalize_path_copy(char *dst, const char *src)
        return normalize_path_copy_len(dst, src, NULL);
 }
 
+int strbuf_normalize_path(struct strbuf *src)
+{
+       struct strbuf dst = STRBUF_INIT;
+
+       strbuf_grow(&dst, src->len);
+       if (normalize_path_copy(dst.buf, src->buf) < 0) {
+               strbuf_release(&dst);
+               return -1;
+       }
+
+       /*
+        * normalize_path does not tell us the new length, so we have to
+        * compute it by looking for the new NUL it placed
+        */
+       strbuf_setlen(&dst, strlen(dst.buf));
+       strbuf_swap(src, &dst);
+       strbuf_release(&dst);
+       return 0;
+}
+
 /*
  * path = Canonical absolute path
  * prefixes = string_list containing normalized, absolute paths without
diff --git a/path.h b/path.h
index 60e83a49a98507a276efccf6e355a2e375ac64ea..639372edd9ee36127e3b89084f89ee59d12ff60f 100644 (file)
--- a/path.h
+++ b/path.h
@@ -191,6 +191,11 @@ const char *remove_leading_path(const char *in, const char *prefix);
 const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);
 int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
 int normalize_path_copy(char *dst, const char *src);
+/**
+ * Normalize in-place the path contained in the strbuf. If an error occurs,
+ * the contents of "sb" are left untouched, and -1 is returned.
+ */
+int strbuf_normalize_path(struct strbuf *src);
 int longest_ancestor_length(const char *path, struct string_list *prefixes);
 char *strip_path_suffix(const char *path, const char *suffix);
 int daemon_avoid_alias(const char *path);
index 6972d515f0c7dbb93292361720603d9a80bfa44e..3a3a5724c44bcb7b53d10ddce6f0f9f9f397512b 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
 #include "dir.h"
@@ -6,9 +6,13 @@
 #include "gettext.h"
 #include "pathspec.h"
 #include "attr.h"
+#include "read-cache.h"
+#include "repository.h"
 #include "setup.h"
 #include "strvec.h"
+#include "symlinks.h"
 #include "quote.h"
+#include "wildmatch.h"
 
 /*
  * Finds which of the given pathspecs match items in the index.
@@ -529,24 +533,29 @@ static int pathspec_item_cmp(const void *a_, const void *b_)
        return strcmp(a->match, b->match);
 }
 
-static void NORETURN unsupported_magic(const char *pattern,
-                                      unsigned magic)
+void pathspec_magic_names(unsigned magic, struct strbuf *out)
 {
-       struct strbuf sb = STRBUF_INIT;
        int i;
        for (i = 0; i < ARRAY_SIZE(pathspec_magic); i++) {
                const struct pathspec_magic *m = pathspec_magic + i;
                if (!(magic & m->bit))
                        continue;
-               if (sb.len)
-                       strbuf_addstr(&sb, ", ");
+               if (out->len)
+                       strbuf_addstr(out, ", ");
 
                if (m->mnemonic)
-                       strbuf_addf(&sb, _("'%s' (mnemonic: '%c')"),
+                       strbuf_addf(out, _("'%s' (mnemonic: '%c')"),
                                    m->name, m->mnemonic);
                else
-                       strbuf_addf(&sb, "'%s'", m->name);
+                       strbuf_addf(out, "'%s'", m->name);
        }
+}
+
+static void NORETURN unsupported_magic(const char *pattern,
+                                      unsigned magic)
+{
+       struct strbuf sb = STRBUF_INIT;
+       pathspec_magic_names(magic, &sb);
        /*
         * We may want to substitute "this command" with a command
         * name. E.g. when "git add -p" or "git add -i" dies when running
@@ -734,7 +743,7 @@ int match_pathspec_attrs(struct index_state *istate,
        if (name[namelen])
                name = to_free = xmemdupz(name, namelen);
 
-       git_check_attr(istate, NULL, name, item->attr_check);
+       git_check_attr(istate, name, item->attr_check);
 
        free(to_free);
 
index a5b38e0907a9b8c498d643653d445ed7cd71fe02..fec4399bbc940823c76f689808ee77e8804624bb 100644 (file)
@@ -130,6 +130,14 @@ void parse_pathspec_file(struct pathspec *pathspec,
 void copy_pathspec(struct pathspec *dst, const struct pathspec *src);
 void clear_pathspec(struct pathspec *);
 
+/*
+ * Add a human-readable string to "out" representing the PATHSPEC_* flags set
+ * in "magic". The result is suitable for error messages, but not for
+ * parsing as pathspec magic itself (you get 'icase' with quotes, not
+ * :(icase)).
+ */
+void pathspec_magic_names(unsigned magic, struct strbuf *out);
+
 static inline int ps_strncmp(const struct pathspec_item *item,
                             const char *s1, const char *s2, size_t n)
 {
index 36ae0fea4a3c6ba06899d6248fb2c2a7578b378d..af83a19f4df5537da9f1c7a87ea29cb2f5903ea2 100644 (file)
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "copy.h"
 #include "pkt-line.h"
 #include "gettext.h"
 #include "hex.h"
 #include "run-command.h"
-#include "wrapper.h"
+#include "trace.h"
 #include "write-or-die.h"
 
 char packet_buffer[LARGE_PACKET_MAX];
@@ -371,10 +372,14 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size,
        return ret;
 }
 
-int packet_length(const char lenbuf_hex[4])
+int packet_length(const char lenbuf_hex[4], size_t size)
 {
-       int val = hex2chr(lenbuf_hex);
-       return (val < 0) ? val : (val << 8) | hex2chr(lenbuf_hex + 2);
+       if (size < 4)
+               BUG("buffer too small");
+       return  hexval(lenbuf_hex[0]) << 12 |
+               hexval(lenbuf_hex[1]) <<  8 |
+               hexval(lenbuf_hex[2]) <<  4 |
+               hexval(lenbuf_hex[3]);
 }
 
 static char *find_packfile_uri_path(const char *buffer)
@@ -417,7 +422,7 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,
                return PACKET_READ_EOF;
        }
 
-       len = packet_length(linelen);
+       len = packet_length(linelen, sizeof(linelen));
 
        if (len < 0) {
                if (options & PACKET_READ_GENTLE_ON_READ_ERROR)
index 8e9846f3151eece6ebd782d946645c61a6382eb1..954eec87197d3e0c50812879d47e0afbb008baa3 100644 (file)
@@ -94,7 +94,7 @@ int packet_read(int fd, char *buffer, unsigned size, int options);
  * If lenbuf_hex contains non-hex characters, return -1. Otherwise, return the
  * numeric value of the length header.
  */
-int packet_length(const char lenbuf_hex[4]);
+int packet_length(const char lenbuf_hex[4], size_t size);
 
 /*
  * Read a packetized line into a buffer like the 'packet_read()' function but
@@ -246,4 +246,6 @@ void packet_writer_error(struct packet_writer *writer, const char *fmt, ...);
 void packet_writer_delim(struct packet_writer *writer);
 void packet_writer_flush(struct packet_writer *writer);
 
+void packet_trace_identity(const char *prog);
+
 #endif
index 5a63397655a271bf5051f53058db864439020b3d..87df7c6962e2b340d3e78ab8135038186dafb560 100644 (file)
--- a/po/TEAMS
+++ b/po/TEAMS
@@ -51,7 +51,7 @@ Repository:   https://github.com/Arusekk/git-po
 Leader:                Arusekk <arek_koz@o2.pl>
 
 Language:      pt_PT (Portuguese - Portugal)
-Repository:    https://codeberg.org/git-pt/Git-PO-pt_PT/
+Repository:    https://gitlab.com/alexandre1985/git-pt/
 Leader:                Daniel Santos <dacs.git@brilhante.top>
 
 Language:      ru (Russian)
@@ -67,16 +67,22 @@ Language:   tr (Turkish)
 Repository:    https://github.com/bitigchi/git-po/
 Leader:                Emir SARI <bitigchi@me.com>
 
+Language:      uk (Ukrainian)
+Repository:    https://github.com/arkid15r/git-ukrainian-l10n/
+Leader:                Arkadii Yakovets <ark@cho.red>
+Members:       Kateryna Golovanova <kate@kgthreads.com>
+
 Language:      vi (Vietnamese)
 Repository:    https://github.com/vnwildman/git/
 Leader:                Trần Ngọc Quân <vnwildman AT gmail.com>
 Members:       Nguyễn Thái Ngọc Duy <pclouds AT gmail.com>
 
 Language:      zh_CN (Simplified Chinese)
-Repository:    https://github.com/fangyi-zhou/git-po/
-Leader:                Fangyi Zhou <me AT fangyi.io>
+Repository:    https://github.com/dyrone/git/
+Leader:                Teng Long <dyroneteng AT gmail.com>
 Members:       Ray Chen <oldsharp AT gmail.com>
                依云 <lilydjwg AT gmail.com>
+               Fangyi Zhou <me AT fangyi.io>
                Jiang Xin <worldhello.net AT gmail.com>
 
 Language:      zh_TW (Traditional Chinese)
index daec1326c06dd1597266c67d01b61b85312f54be..61214c4b1c5eb2a658503a0be9dfaaf23568597c 100644 (file)
--- a/po/bg.po
+++ b/po/bg.po
 # gitattributes file файл с атрибути на git
 # advertised обявен за наличен
 # superproject свръхпроект
-#
+# rev-index обратен индекс (reverse index)
+# dererging branches раздалечили се клони
 # ------------------------
 # „$var“ - може да не сработва за shell има gettext и eval_gettext - проверка - намират се лесно по „$
 # ------------------------
 # for i in `sort -u FILES`; do cnt=`grep $i FILES | wc -l`; echo $cnt $i ;done | sort -n
 msgid ""
 msgstr ""
-"Project-Id-Version: git 2.40\n"
+"Project-Id-Version: git 2.41\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-01 01:20+0000\n"
-"PO-Revision-Date: 2023-03-02 08:54+0200\n"
+"POT-Creation-Date: 2023-05-19 19:48+0200\n"
+"PO-Revision-Date: 2023-05-19 20:57+0300\n"
 "Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
 "Language-Team: Bulgarian <dict@fsa-bg.org>\n"
 "Language: bg\n"
@@ -890,6 +891,23 @@ msgstr "Промѐните трябва да се подадат преди с
 msgid "Exiting because of unfinished merge."
 msgstr "Изход от програмата заради незавършено сливане."
 
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Раздалечили се клони не може да се превъртят.  Ползвайте:\n"
+"\n"
+"  git merge --no-ff\n"
+"\n"
+"или:\n"
+"\n"
+"  git rebase\n"
+
 msgid "Not possible to fast-forward, aborting."
 msgstr "Не може да се извърши превъртане, преустановяване на действието."
 
@@ -1353,6 +1371,10 @@ msgstr "съкращаване на името на файла с отхвърл
 msgid "cannot open %s"
 msgstr "„%s“ не може да бъде отворен"
 
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "„%s“ не може да се изтрие"
+
 #, c-format
 msgid "Hunk #%d applied cleanly."
 msgstr "%d-то парче бе успешно приложено."
@@ -1546,6 +1568,10 @@ msgstr "git archive --remote ХРАНИЛИЩЕ [--exec КОМАНДА] --list"
 msgid "cannot read '%s'"
 msgstr "файлът „%s“ не може да бъде прочетен"
 
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "пътят „%s“ съвпада с файлове извън текущата директория"
+
 #, c-format
 msgid "pathspec '%s' did not match any files"
 msgstr "пътят „%s“ не съвпада с никой файл"
@@ -1562,9 +1588,6 @@ msgstr "неправилно име на обект: „%s“"
 msgid "not a tree object: %s"
 msgstr "не е обект-дърво: %s"
 
-msgid "current working directory is untracked"
-msgstr "текущата работна директория не е следена"
-
 #, c-format
 msgid "File not found: %s"
 msgstr "Файлът „%s“ липсва"
@@ -1691,6 +1714,11 @@ msgstr "прескачане на прекалено големия файл з
 msgid "ignoring overly large gitattributes blob '%s'"
 msgstr "прескачане на прекалено големия обект-BLOB за атрибути на git: „%s“"
 
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr ""
+"неправилна стойност за опцията „--attr-source“ или променливата "
+"„GIT_ATTR_SOURCE“"
+
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
 msgstr "Неправилно цитирано съдържание във файла „%s“: %s"
@@ -1796,9 +1824,6 @@ msgstr[1] "Двоично търсене: остават %d версии сле
 msgid "--contents and --reverse do not blend well."
 msgstr "опциите „--contents“ и „--reverse“ са несъвместими"
 
-msgid "cannot use --contents with final commit object name"
-msgstr "опцията „--contents“ е несъвместима с име на обект от крайно подаване"
-
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr ""
 "Едновременното задаване на опциите „--reverse“ и „--first-parent“ изисква "
@@ -1985,10 +2010,6 @@ msgstr "подмодул „%s“: клонът „%s“ не може да се
 msgid "'%s' is already checked out at '%s'"
 msgstr "„%s“ вече е изтеглен в „%s“"
 
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "Указателят „HEAD“ на работното дърво „%s“ не е обновен"
-
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [ОПЦИЯ…] [--] ПЪТ…"
 
@@ -3080,6 +3101,14 @@ msgstr "Не може да изтриете клона „%s“, който е 
 msgid "remote-tracking branch '%s' not found."
 msgstr "следящият клон „%s“ не може да бъде открит."
 
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"клонът „%s“ не може да бъде открит.\n"
+"Пробвахте ли опцията „--remote“?"
+
 #, c-format
 msgid "branch '%s' not found."
 msgstr "клонът „%s“ не може да бъде открит."
@@ -3110,6 +3139,10 @@ msgstr "Клонът „%s“ се пребазира върху „%s“"
 msgid "Branch %s is being bisected at %s"
 msgstr "Търси се двоично в клона „%s“ при „%s“"
 
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "Указателят „HEAD“ на работното дърво „%s“ не е обновен"
+
 #, c-format
 msgid "Invalid branch name: '%s'"
 msgstr "Неправилно име на клон: „%s“"
@@ -3213,6 +3246,9 @@ msgstr ""
 msgid "move/rename a branch, even if target exists"
 msgstr "преместване/преименуване на клон, дори ако има вече клон с такова име"
 
+msgid "do not output a newline after empty formatted refs"
+msgstr "без извеждане на нов ред след празен форматиран указател"
+
 msgid "copy a branch and its reflog"
 msgstr "копиране на клон и принадлежащия му журнал на указателите"
 
@@ -3436,12 +3472,10 @@ msgid "Created new report at '%s'.\n"
 msgstr "Новият доклад е създаден в „%s“.\n"
 
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress ]\n"
 "                  [--version=ВЕРСИЯ] ФАЙЛ ОПЦИЯ_ЗА_git-rev-list…"
 
 msgid "git bundle verify [-q | --quiet] <file>"
@@ -3462,12 +3496,11 @@ msgstr "без извеждане на напредъка"
 msgid "show progress meter"
 msgstr "извеждане на напредъка"
 
-msgid "show progress meter during object writing phase"
-msgstr "извеждане Ð½Ð° Ð½Ð°Ð¿Ñ\80едÑ\8aка Ð²Ñ\8aв Ñ\84азаÑ\82а Ð½Ð° Ð·Ð°Ð¿Ð°Ð·Ð²Ð°Ð½Ðµ Ð½Ð° Ð¾Ð±ÐµÐºÑ\82иÑ\82е"
+msgid "historical; same as --progress"
+msgstr "изоÑ\81Ñ\82авена Ð¾Ð¿Ñ\86иÑ\8f, Ñ\81Ñ\8aÑ\89оÑ\82о ÐºÐ°Ñ\82о â\80\9e--progressâ\80\9c"
 
-msgid "similar to --all-progress when progress meter is shown"
-msgstr ""
-"същото действие като опцията „--all-progress“ при извеждането на напредъка"
+msgid "historical; does nothing"
+msgstr "изоставена опция, нищо не прави"
 
 msgid "specify bundle format version"
 msgstr "версия на пратката"
@@ -4498,6 +4531,10 @@ msgstr "не може да бъде получена информация чре
 msgid "%s exists and is not a directory"
 msgstr "„%s“ съществува и не е директория"
 
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "„%s“ е символна връзка, не може да се клонира с опцията „--local“"
+
 #, c-format
 msgid "failed to start iterator over '%s'"
 msgstr "неуспешно итериране по „%s“"
@@ -6071,118 +6108,13 @@ msgstr "git fetch --all [ОПЦИЯ…]"
 msgid "fetch.parallel cannot be negative"
 msgstr "опцията „fetch.parallel“ трябва да е неотрицателна"
 
-msgid "fetch from all remotes"
-msgstr "доставяне от всички отдалечени хранилища"
-
-msgid "set upstream for git pull/fetch"
-msgstr "задаване на клон за следене за издърпване/доставяне"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "добавяне към „.git/FETCH_HEAD“ вместо замяна"
-
-msgid "use atomic transaction to update references"
-msgstr "изискване на атомарни операции за обновяване на указателите"
-
-msgid "path to upload pack on remote end"
-msgstr "отдалечен път, където да се качи пакетът"
-
-msgid "force overwrite of local reference"
-msgstr "принудително презаписване на локален указател"
-
-msgid "fetch from multiple remotes"
-msgstr "доставяне от множество отдалечени хранилища"
-
-msgid "fetch all tags and associated objects"
-msgstr "доставяне на всички етикети и принадлежащи обекти"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "без доставянето на всички етикети „--no-tags“"
-
-msgid "number of submodules fetched in parallel"
-msgstr "брой подмодули доставени паралелно"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"промяна на указателя, така че и той, както останалите, да бъде в „refs/"
-"prefetch/“"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "окастряне на клоните следящи вече несъществуващи отдалечени клони"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"окастряне на локалните етикети, които вече не съществуват в отдалеченото "
-"хранилище и презаписване на променените"
-
-msgid "on-demand"
-msgstr "ПРИ НУЖДА"
-
-msgid "control recursive fetching of submodules"
-msgstr "управление на рекурсивното доставяне на подмодулите"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "запазване на доставените указатели във файла „FETCH_HEAD“"
-
-msgid "keep downloaded pack"
-msgstr "запазване на изтеглените пакети с обекти"
-
-msgid "allow updating of HEAD ref"
-msgstr "позволяване на обновяването на указателя „HEAD“"
-
-msgid "deepen history of shallow clone"
-msgstr "задълбочаване на историята на плитко хранилище"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "задълбочаване на историята на плитко хранилище до определено време"
-
-msgid "convert to a complete repository"
-msgstr "превръщане в пълно хранилище"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "повторно доставяне без договаряне на общите подавания"
-
-msgid "prepend this to submodule path output"
-msgstr "добавяне на това пред пътя на подмодула"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"стандартно рекурсивно изтегляне на подмодулите (файловете с настройки са с "
-"приоритет)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "приемане на указатели, които обновяват „.git/shallow“"
-
-msgid "refmap"
-msgstr "КАРТА_С_УКАЗАТЕЛИ"
-
-msgid "specify fetch refmap"
-msgstr "указване на КАРТАта_С_УКАЗАТЕЛИ за доставяне"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "докладване, че всички обекти може са достижими при започване от този"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"без доставяне на пакетни файлове, вместо това да се извеждат предшественици "
-"на договорните върхове"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "изпълняване на „maintenance --auto“ след доставяне"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "проверка за принудителни обновявания на всички клони"
-
-msgid "write the commit-graph after fetching"
-msgstr "запазване на гра̀фа с подаванията след доставяне"
-
-msgid "accept refspecs from stdin"
-msgstr "четене на указателите от стандартния вход"
-
 msgid "couldn't find remote ref HEAD"
 msgstr "указателят „HEAD“ в отдалеченото хранилище не може да бъде открит"
 
+#, c-format
+msgid "From %.*s\n"
+msgstr "От %.*s\n"
+
 #, c-format
 msgid "object %s not found"
 msgstr "обектът „%s“ липсва"
@@ -6258,10 +6190,6 @@ msgid "rejected %s because shallow roots are not allowed to be updated"
 msgstr ""
 "отхвърляне на „%s“, защото плитките върхове не може да бъдат обновявани"
 
-#, c-format
-msgid "From %.*s\n"
-msgstr "От %.*s\n"
-
 #, c-format
 msgid ""
 "some local refs could not be updated; try running\n"
@@ -6355,6 +6283,115 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "трябва да укажете име на етикет"
 
+msgid "fetch from all remotes"
+msgstr "доставяне от всички отдалечени хранилища"
+
+msgid "set upstream for git pull/fetch"
+msgstr "задаване на клон за следене за издърпване/доставяне"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "добавяне към „.git/FETCH_HEAD“ вместо замяна"
+
+msgid "use atomic transaction to update references"
+msgstr "изискване на атомарни операции за обновяване на указателите"
+
+msgid "path to upload pack on remote end"
+msgstr "отдалечен път, където да се качи пакетът"
+
+msgid "force overwrite of local reference"
+msgstr "принудително презаписване на локален указател"
+
+msgid "fetch from multiple remotes"
+msgstr "доставяне от множество отдалечени хранилища"
+
+msgid "fetch all tags and associated objects"
+msgstr "доставяне на всички етикети и принадлежащи обекти"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "без доставянето на всички етикети „--no-tags“"
+
+msgid "number of submodules fetched in parallel"
+msgstr "брой подмодули доставени паралелно"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"промяна на указателя, така че и той, както останалите, да бъде в „refs/"
+"prefetch/“"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "окастряне на клоните следящи вече несъществуващи отдалечени клони"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"окастряне на локалните етикети, които вече не съществуват в отдалеченото "
+"хранилище и презаписване на променените"
+
+msgid "on-demand"
+msgstr "ПРИ НУЖДА"
+
+msgid "control recursive fetching of submodules"
+msgstr "управление на рекурсивното доставяне на подмодулите"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "запазване на доставените указатели във файла „FETCH_HEAD“"
+
+msgid "keep downloaded pack"
+msgstr "запазване на изтеглените пакети с обекти"
+
+msgid "allow updating of HEAD ref"
+msgstr "позволяване на обновяването на указателя „HEAD“"
+
+msgid "deepen history of shallow clone"
+msgstr "задълбочаване на историята на плитко хранилище"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "задълбочаване на историята на плитко хранилище до определено време"
+
+msgid "convert to a complete repository"
+msgstr "превръщане в пълно хранилище"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "повторно доставяне без договаряне на общите подавания"
+
+msgid "prepend this to submodule path output"
+msgstr "добавяне на това пред пътя на подмодула"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"стандартно рекурсивно изтегляне на подмодулите (файловете с настройки са с "
+"приоритет)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "приемане на указатели, които обновяват „.git/shallow“"
+
+msgid "refmap"
+msgstr "КАРТА_С_УКАЗАТЕЛИ"
+
+msgid "specify fetch refmap"
+msgstr "указване на КАРТАта_С_УКАЗАТЕЛИ за доставяне"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "докладване, че всички обекти може са достижими при започване от този"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"без доставяне на пакетни файлове, вместо това да се извеждат предшественици "
+"на договорните върхове"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "изпълняване на „maintenance --auto“ след доставяне"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "проверка за принудителни обновявания на всички клони"
+
+msgid "write the commit-graph after fetching"
+msgstr "запазване на гра̀фа с подаванията след доставяне"
+
+msgid "accept refspecs from stdin"
+msgstr "четене на указателите от стандартния вход"
+
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr ""
 "Опцията „--negotiate-only“ изисква една или повече опции „--negotiation-"
@@ -6473,6 +6510,12 @@ msgstr "извеждане само на указателите, които съ
 msgid "print only refs which don't contain the commit"
 msgstr "извеждане само на указателите, които не съдържат това ПОДАВАНЕ"
 
+msgid "read reference patterns from stdin"
+msgstr "изчитане на шаблоните за указатели от стандартния вход"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "непознат аргумент към опцията „--stdin“"
+
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=НАСТРОЙКА [--] АРГУМЕНТ…"
 
@@ -6485,6 +6528,10 @@ msgstr "настройка, която съдържа списък с пътищ
 msgid "missing --config=<config>"
 msgstr "липсва --config=НАСТРОЙКА"
 
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "получена е неправилена настройка „--config=%s“"
+
 msgid "unknown"
 msgstr "непознат"
 
@@ -6631,19 +6678,28 @@ msgstr "%s: несвързаният връх „HEAD“ не сочи към н
 msgid "notice: %s points to an unborn branch (%s)"
 msgstr "предупреждение: „%s“ сочи към все още несъществуващ клон (%s)"
 
-msgid "Checking cache tree"
-msgstr "Проверка на кеша на обектите-дървета"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Проверка на кеша на обектите-дървета на „%s“"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "„%s“: неправилен указател за SHA1 в кеша на обектите-дървета"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "„%s“: неправилен указател за SHA1 в кеша на обектите-дървета на „%s“"
 
 msgid "non-tree in cache-tree"
 msgstr "в кеша на обектите-дървета има нещо, което не е дърво"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "„%s“: неправилен указател за отмяна на разрешените подавания"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "„%s“: неправилен указател за отмяна на разрешените подавания на „%s“"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "обратният индекс на пакета „%s“ не може да бъде зареден"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "неправилен обратен индекс за пакета „%s“"
 
 msgid ""
 "git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
@@ -9584,6 +9640,13 @@ msgstr "неподдържана версия на индекса „%s“"
 msgid "bad index version '%s'"
 msgstr "неправилна версия на индекса „%s“"
 
+msgid "show progress meter during object writing phase"
+msgstr "извеждане на напредъка във фазата на запазване на обектите"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr ""
+"същото действие като опцията „--all-progress“ при извеждането на напредъка"
+
 msgid "<version>[,<offset>]"
 msgstr "ВЕРСИЯ[,ОТМЕСТВАНЕ]"
 
@@ -9788,6 +9851,9 @@ msgstr ""
 "ни известите с е-писмо до пощенския списък:\n"
 "<git@vger.kernel.org>.\n"
 
+msgid "refusing to run without --i-still-use-this"
+msgstr "трябва да добавите и опцията „--i-still-use-this“"
+
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
 
@@ -9962,8 +10028,8 @@ msgstr "Обновяване на все още несъздаден клон с
 msgid "pull with rebase"
 msgstr "издърпване с пребазиране"
 
-msgid "please commit or stash them."
-msgstr "трябва да подадете или скатаете промѐните."
+msgid "Please commit or stash them."
+msgstr "Промѐните трябва или да се подадат, или да се скатаят."
 
 #, c-format
 msgid ""
@@ -10001,7 +10067,7 @@ msgstr "Не може да превъртите към повече от еди
 
 msgid "Need to specify how to reconcile divergent branches."
 msgstr ""
-"ТÑ\80Ñ\8fбва Ð´Ð° Ñ\83кажеÑ\82е ÐºÐ°Ðº Ð´Ð° Ñ\81е Ñ\80еÑ\88аваÑ\82 Ñ\80азликиÑ\82е Ð¿Ñ\80и Ñ\80азминаване на клоните."
+"ТÑ\80Ñ\8fбва Ð´Ð° Ñ\83кажеÑ\82е ÐºÐ°Ðº Ð´Ð° Ñ\81е Ñ\80еÑ\88аваÑ\82 Ñ\80азликиÑ\82е Ð¿Ñ\80и Ñ\80аздалеÑ\87аване на клоните."
 
 msgid "cannot rebase with locally recorded submodule modifications"
 msgstr ""
@@ -10210,8 +10276,8 @@ msgstr "Неправилна стойност за „%s“"
 msgid "repository"
 msgstr "хранилище"
 
-msgid "push all refs"
-msgstr "изтласкване на всички указатели"
+msgid "push all branches"
+msgstr "изтласкване на всички клони"
 
 msgid "mirror all refs"
 msgstr "огледално копие на всички указатели"
@@ -10219,8 +10285,10 @@ msgstr "огледално копие на всички указатели"
 msgid "delete refs"
 msgstr "изтриване на указателите"
 
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "изтласкване на етикетите (несъвместимо с опциите „--all“ и „--mirror“)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"изтласкване на етикетите (несъвместимо с опциите „--all“, „--branches“ и „--"
+"mirror“)"
 
 msgid "force updates"
 msgstr "принудително обновяване"
@@ -10484,6 +10552,10 @@ msgstr ""
 "\n"
 "В резултат те не може да се пребазират."
 
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Неправилен режим за „--rebase-merges“: %s"
+
 #, c-format
 msgid "could not switch to %s"
 msgstr "не може да се премине към „%s“"
@@ -10499,6 +10571,15 @@ msgstr ""
 "неправилна стойност „%s“: вариантите са „drop“ (прескачане), "
 "„keep“ (запазване) и „ask“ (питане)"
 
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"ползването на „--rebase-merges“ с празен низ за аргумент е остаряло и в "
+"бъдеще ще спре да работи. Ползвайте опцията „--rebase-merges“ без аргумент, "
+"за да постигнете същия резултат."
+
 #, c-format
 msgid ""
 "%s\n"
@@ -10728,21 +10809,24 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "опцията „C“ очаква число за аргумент"
 
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Неизвестна стратегия: „%s“"
-
 msgid "--strategy requires --merge or --interactive"
 msgstr ""
 "опцията „--strategy“ изисква някоя от опциите „--merge“ или „--interactive“"
 
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
 msgstr ""
-"опциите за прилагане са несъвместими с „rebase.autosquash“.  Пробвайте да "
+"опциите за прилагане са несъвместими с „rebase.autoSquash“.  Пробвайте да "
 "добавите опцията „--no-autosquash“"
 
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"опциите за прилагане са несъвместими с „rebase.rebaseMerges“.  Пробвайте да "
+"добавите опцията „--no-rebase-merges“"
+
 msgid ""
 "apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
 "update-refs"
@@ -10789,9 +10873,6 @@ msgstr "„%s“: изисква се точно една база за преб
 msgid "Does not point to a valid commit '%s'"
 msgstr "Указателят „%s“ не сочи към подаване"
 
-msgid "Please commit or stash them."
-msgstr "Промѐните трябва или да се подадат, или да се скатаят."
-
 msgid "HEAD is up to date."
 msgstr "Указателят „HEAD“ е напълно актуален."
 
@@ -11476,9 +11557,9 @@ msgstr ""
 msgid "approxidate"
 msgstr "евристична дата"
 
-msgid "with -C, expire objects older than this"
+msgid "with --cruft, expire objects older than this"
 msgstr ""
-"с опцията „-C“: обявяване на обектите по-стари от това ВРЕМЕ за остарели"
+"с опцията „--cruft“: обявяване на обектите по-стари от това ВРЕМЕ за остарели"
 
 msgid "remove redundant packs, and run git-prune-packed"
 msgstr ""
@@ -12158,6 +12239,9 @@ msgstr ""
 msgid "remote name"
 msgstr "име на отдалечено хранилище"
 
+msgid "push all refs"
+msgstr "изтласкване на всички указатели"
+
 msgid "use stateless RPC protocol"
 msgstr "използване на протокол без запазване на състоянието за RPC"
 
@@ -12364,9 +12448,11 @@ msgstr ""
 "локалното хранилище"
 
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) ОПЦИЯ…"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) ОПЦИЯ…"
 
 msgid "this worktree is not sparse"
 msgstr "това работно дърво не е частично"
@@ -12492,6 +12578,24 @@ msgstr ""
 msgid "error while refreshing working directory"
 msgstr "грешка при обновяване на работната директория"
 
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks] [--[no-]cone] [--rules-"
+"file ФАЙЛ]"
+
+msgid "terminate input and output files by a NUL character"
+msgstr "разделяне на входните и изходните файлове с нулевия знак „NUL“"
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"когато е придружено с „--rules-file“ шаблоните се третират като шаблони в "
+"пътеводен режим"
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "ползване на шаблоните във ФАЙЛа вместо текущите."
+
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [ОПЦИЯ_ЗА_ЖУРНАЛ…]"
 
@@ -15421,8 +15525,8 @@ msgstr "дължината на съкращаване е извън диапа
 msgid "bad zlib compression level %d"
 msgstr "неправилно ниво на компресиране: %d"
 
-msgid "core.commentChar should only be one character"
-msgstr "настройката „core.commentChar“ трябва да е само един знак"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "настройката „core.commentChar“ трябва да е само един знак от ASCII"
 
 #, c-format
 msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -15539,6 +15643,10 @@ msgstr "„%s“ не може да се зададе да е „%s“"
 msgid "invalid section name: %s"
 msgstr "неправилно име на раздел: %s"
 
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "ред %2$<PRIuMAX> в „%1$s“ е прекалено дълъг"
+
 #, c-format
 msgid "missing value for '%s'"
 msgstr "липсва стойност за „%s“"
@@ -16235,6 +16343,9 @@ msgstr "добавяне на допълнителен префикс за вс
 msgid "do not show any source or destination prefix"
 msgstr "без префикс за източника и целта"
 
+msgid "use default prefixes a/ and b/"
+msgstr "ползване на стандартните префикси „a/“ и „b/“"
+
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr ""
 "извеждане на контекст между последователните парчета с разлики от указания "
@@ -16541,6 +16652,14 @@ msgstr "директорията на git не може да се мигрира
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "Подсказка: чака се редакторът ви да затвори файла …%c"
 
+#, c-format
+msgid "could not write to '%s'"
+msgstr "в „%s“ не може да се пише"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "„%s“ не може да се редактира"
+
 msgid "Filtering content"
 msgstr "Филтриране на съдържанието"
 
@@ -16845,6 +16964,10 @@ msgstr "опцията „-c“ изисква низ за настройка\n"
 msgid "no config key given for --config-env\n"
 msgstr "опцията „--config-env“ изисква ключ\n"
 
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "опцията „--attr-source“ изисква източник на атрибути\n"
+
 #, c-format
 msgid "unknown option: %s\n"
 msgstr "непозната опция: „%s“\n"
@@ -18587,6 +18710,10 @@ msgstr "„%s“ липсва в пакет „%s“ при отместване
 msgid "unable to get disk usage of '%s'"
 msgstr "използваното място за съхранение на „%s“ не може да бъде получено"
 
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "неправилна сума за проверка за файла с битови маски „%s“"
+
 #, c-format
 msgid "mtimes file %s is too small"
 msgstr "файлът с времето на промяна (mtime) „%s“ е твърде малък"
@@ -18633,6 +18760,14 @@ msgstr ""
 "идентификатор на контролна сума %2$<PRIu32> на файла с обратен индекс „%1$s“ "
 "не се поддържа"
 
+msgid "invalid checksum"
+msgstr "неправилна сума за проверка"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr ""
+"неправилна позиция в обратния индекс при %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
 msgid "cannot both write and verify reverse index"
 msgstr "обратният индекс не може едновременно да се записва и да се проверява"
 
@@ -19378,6 +19513,10 @@ msgstr "непознат аргумент за „%%(%s)“: %s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "очаква се положителна широчина с лексемата „%%(align)“"
 
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "очакван формат: %%(ahead-behind:ПОДАВАНЕ)"
+
 #, c-format
 msgid "malformed field name: %.*s"
 msgstr "неправилно име на обект: „%.*s“"
@@ -19929,10 +20068,10 @@ msgid_plural ""
 "Your branch and '%s' have diverged,\n"
 "and have %d and %d different commits each, respectively.\n"
 msgstr[0] ""
-"Текущият клон се е отделил от „%s“,\n"
+"Текущият клон се е раздалечил от „%s“,\n"
 "двата имат съответно по %d и %d несъвпадащи подавания.\n"
 msgstr[1] ""
-"Текущият клон се е отделил от „%s“,\n"
+"Текущият клон се е раздалечил от „%s“,\n"
 "двата имат съответно по %d и %d несъвпадащи подавания.\n"
 
 msgid "  (use \"git pull\" to merge the remote branch into yours)\n"
@@ -20011,10 +20150,6 @@ msgstr "конфликтът в „%s“ не може да се обнови"
 msgid "no remembered resolution for '%s'"
 msgstr "липсва запазена корекция на конфликт при „%s“"
 
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "„%s“ не може да се изтрие"
-
 #, c-format
 msgid "Updated preimage for '%s'"
 msgstr "Предварителният вариант на „%s“ е обновен"
@@ -20383,10 +20518,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "„%s“ не може да се заключи"
 
-#, c-format
-msgid "could not write to '%s'"
-msgstr "в „%s“ не може да се пише"
-
 #, c-format
 msgid "could not write eol to '%s'"
 msgstr "краят на ред не може да се запише в „%s“"
@@ -20757,9 +20888,6 @@ msgstr ""
 "директорията за определянето на последователността „%s“ не може да бъде "
 "създадена"
 
-msgid "could not lock HEAD"
-msgstr "указателят „HEAD“ не може да се заключи"
-
 msgid "no cherry-pick or revert in progress"
 msgstr ""
 "в момента не се извършва отбиране на подавания или пребазиране на клона"
@@ -20862,13 +20990,13 @@ msgstr ""
 "    git rebase --continue\n"
 "\n"
 
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "и променѝ индекса и/или работното дърво\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "и променѝ индекса и/или работното дърво.\n"
 
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
@@ -21324,10 +21452,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u байт/сек."
 msgstr[1] "%u байта/сек."
 
-#, c-format
-msgid "could not edit '%s'"
-msgstr "„%s“ не може да се редактира"
-
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
 msgstr "игнориране на подозрително име на подмодул: „%s“"
@@ -23085,13 +23209,17 @@ msgid "(%s) Could not execute '%s'"
 msgstr "(%s) Не може да бъде се изпълни „%s“"
 
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Ð\94обавÑ\8fне Ð½Ð° â\80\9e%s: %sâ\80\9c Ð¾Ñ\82: â\80\9e%sâ\80\9c\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Ð\9dепÑ\80авилен Ð¸Ð·Ñ\85од Ð¾Ñ\82: â\80\9e%sâ\80\9c."
 
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) програмният канал не може да се затвори за изпълнението на „%s“"
 
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Добавяне на „%s: %s“ от: „%s“\n"
+
 msgid "cannot send message as 7bit"
 msgstr "съобщението не може да се изпрати чрез 7 битови знаци"
 
index c6d2dd6ecc6138ded82d147b52dd549272830f52..4b164f29912fe926ec260d1008c6f6820980c9da 100644 (file)
--- a/po/ca.po
+++ b/po/ca.po
@@ -68,8 +68,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Git\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-01 01:20+0000\n"
-"PO-Revision-Date: 2023-03-01 19:00-0600\n"
+"POT-Creation-Date: 2023-05-20 14:03+0200\n"
+"PO-Revision-Date: 2023-05-26 19:00-0600\n"
 "Last-Translator: Jordi Mas i Hernàndez <jmas@softcatala.org>\n"
 "Language-Team: Catalan\n"
 "Language: ca\n"
@@ -584,7 +584,6 @@ msgstr "«git apply --cached» ha fallat"
 #. Consider translating (saying "no" discards!) as
 #. (saying "n" for "no" discards!) if the translation
 #. of the word "no" does not start with n.
-#.
 msgid ""
 "Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
 msgstr ""
@@ -723,6 +722,23 @@ msgstr "Cometeu els vostres canvis abans de fusionar."
 msgid "Exiting because of unfinished merge."
 msgstr "S'està sortint a causa d'una fusió no terminada."
 
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Les branques divergents no es poden avançar ràpidament, cal que feu:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"o:\n"
+"\n"
+"\tgit rebase\n"
+
 msgid "Not possible to fast-forward, aborting."
 msgstr "No és possible avançar ràpidament, s'està avortant."
 
@@ -1173,6 +1189,10 @@ msgstr "s'està truncant el nom del fitxer .rej a %.*s.rej"
 msgid "cannot open %s"
 msgstr "no es pot obrir %s"
 
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "no es pot fer «unlink» de «%s»"
+
 #, c-format
 msgid "Hunk #%d applied cleanly."
 msgstr "El tros #%d s'ha aplicat netament."
@@ -1364,6 +1384,11 @@ msgstr "git archive --remote <repositori> [--exec <ordre>] --list"
 msgid "cannot read '%s'"
 msgstr "no es pot llegir «%s»"
 
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+"l'específicació de camí «%s» coincideix amb fitxers fora del directori actual"
+
 #, c-format
 msgid "pathspec '%s' did not match any files"
 msgstr "l'especificació de camí «%s» no ha coincidit amb cap fitxer"
@@ -1380,9 +1405,6 @@ msgstr "no és un nom d'objecte vàlid: %s"
 msgid "not a tree object: %s"
 msgstr "no és un objecte d'arbre: %s"
 
-msgid "current working directory is untracked"
-msgstr "no se segueix el directori de treball actual"
-
 #, c-format
 msgid "File not found: %s"
 msgstr "Fitxer no trobat: %s"
@@ -1503,11 +1525,14 @@ msgstr "no es pot fer fstat gitattributes al fitxer «%s»"
 
 #, c-format
 msgid "ignoring overly large gitattributes file '%s'"
-msgstr "s'ignorarà el fitxer «%s» gitattributes per massa gran"
+msgstr "s'ignorarà el fitxer «%s» gitattributes per ser massa gran"
 
 #, c-format
 msgid "ignoring overly large gitattributes blob '%s'"
-msgstr "s'ignorarà la blob «%s» gitattributes per massa gran"
+msgstr "s'ignorarà el blob «%s» gitattributes per ser massa gran"
+
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "--attr-source incorrecte o GIT_ATTR_SOURCE"
 
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
@@ -1605,7 +1630,6 @@ msgstr[1] "(aproximadament %d passos)"
 
 #. TRANSLATORS: the last %s will be replaced with "(roughly %d
 #. steps)" translation.
-#.
 #, c-format
 msgid "Bisecting: %d revision left to test after this %s\n"
 msgid_plural "Bisecting: %d revisions left to test after this %s\n"
@@ -1615,9 +1639,6 @@ msgstr[1] "Bisecant: manquen %d revisions a provar després d'aquesta %s\n"
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents i --reverse no funcionen bé juntes."
 
-msgid "cannot use --contents with final commit object name"
-msgstr "no es pot usar --contents amb el nom d'objecte de la comissió final"
-
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr ""
 "--reverse i --first-parent junts requereixen una última comissió especificada"
@@ -1694,20 +1715,17 @@ msgstr "no s'està seguint: informació ambigua per a la referència «%s»"
 #. TRANSLATORS: This is a line listing a remote with duplicate
 #. refspecs in the advice message below. For RTL languages you'll
 #. probably want to swap the "%s" and leading "  " space around.
-#.
 #. #-#-#-#-#  object-name.c.po  #-#-#-#-#
 #. TRANSLATORS: This is line item of ambiguous object output
 #. from describe_ambiguous_object() above. For RTL languages
 #. you'll probably want to swap the "%s" and leading " " space
 #. around.
-#.
 #, c-format
 msgid "  %s\n"
 msgstr "  %s\n"
 
 #. TRANSLATORS: The second argument is a \n-delimited list of
 #. duplicate refspecs, composed above.
-#.
 #, c-format
 msgid ""
 "There are multiple remotes whose fetch refspecs map to the remote\n"
@@ -1802,10 +1820,6 @@ msgstr "submòdul «%s»: no es pot crear la branca: «%s»"
 msgid "'%s' is already checked out at '%s'"
 msgstr "«%s» ja s'ha agafat a «%s»"
 
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD de l'arbre de treball %s no està actualitzat"
-
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<opcions>] [--] <especificació-de-camí>..."
 
@@ -2125,7 +2139,6 @@ msgstr "El cos de la comissió és:"
 #. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]
 #. in your translation. The program will only accept English
 #. input at this point.
-#.
 #, c-format
 msgid "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: "
 msgstr ""
@@ -2474,7 +2487,6 @@ msgstr "bisecant amb només una comissió %s"
 #. TRANSLATORS: Make sure to include [Y] and [n] in your
 #. translation. The program will only accept English input
 #. at this point.
-#.
 msgid "Are you sure [Y/n]? "
 msgstr "N'esteu segur [Y/n]? "
 
@@ -2552,7 +2564,6 @@ msgstr "Cal començar per «git bisect start»\n"
 #. TRANSLATORS: Make sure to include [Y] and [n] in your
 #. translation. The program will only accept English input
 #. at this point.
-#.
 msgid "Do you want me to do it for you [Y/n]? "
 msgstr "Voleu que ho faci per vostè [Y/n]? "
 
@@ -2709,7 +2720,7 @@ msgid "show raw timestamp (Default: off)"
 msgstr "mostra la marca de temps en cru (per defecte: desactivat)"
 
 msgid "show long commit SHA1 (Default: off)"
-msgstr "mostra l'SHA1 de comissió llarg (per defecte: desactivat)"
+msgstr "mostra l'SHA1 de la comissió en format llarg (per defecte: desactivat)"
 
 msgid "suppress author name and timestamp (Default: off)"
 msgstr "omet el nom d'autor i la marca de temps (per defecte: desactivat)"
@@ -2773,7 +2784,6 @@ msgstr ""
 #. among various forms of relative timestamps, but
 #. your language may need more or fewer display
 #. columns.
-#.
 msgid "4 years, 11 months ago"
 msgstr "fa 4 anys i 11 mesos"
 
@@ -2858,6 +2868,14 @@ msgstr "No es pot suprimir la branca «%s» agafada a «%s»"
 msgid "remote-tracking branch '%s' not found."
 msgstr "no s'ha trobat la branca amb seguiment remot «%s»."
 
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"no s'ha trobat la branca «%s».\n"
+"Us heu oblidat de --remote?"
+
 #, c-format
 msgid "branch '%s' not found."
 msgstr "no s'ha trobat la branca «%s»."
@@ -2888,6 +2906,10 @@ msgstr "S'està fent «rebase» en la branca %s a %s"
 msgid "Branch %s is being bisected at %s"
 msgstr "La branca %s s'està bisecant a %s"
 
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD de l'arbre de treball %s no està actualitzat"
+
 #, c-format
 msgid "Invalid branch name: '%s'"
 msgstr "Nom de branca no vàlid: «%s»"
@@ -2992,6 +3014,9 @@ msgstr "mou/canvia de nom una branca i el seu registre de referència"
 msgid "move/rename a branch, even if target exists"
 msgstr "mou/canvia de nom una branca, encara que el destí existeixi"
 
+msgid "do not output a newline after empty formatted refs"
+msgstr "no emetis cap línia nova després de refs amb format buit"
+
 msgid "copy a branch and its reflog"
 msgstr "copia una branca i el seu registre de referència"
 
@@ -3210,12 +3235,10 @@ msgid "Created new report at '%s'.\n"
 msgstr "S'ha creat un nou informe a «%s».\n"
 
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<versió>] <fitxer> <git-rev-list-args>"
 
 msgid "git bundle verify [-q | --quiet] <file>"
@@ -3236,11 +3259,11 @@ msgstr "no mostris l'indicador de progrés"
 msgid "show progress meter"
 msgstr "mostra l'indicador de progrés"
 
-msgid "show progress meter during object writing phase"
-msgstr "mostra l'indicador de progrés durant la fase d'escriptura d'objectes"
+msgid "historical; same as --progress"
+msgstr "històric; el mateix que --progress"
 
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "similar a --all-progress quan l'indicador de progrés es mostra"
+msgid "historical; does nothing"
+msgstr "històric; no fa res"
 
 msgid "specify bundle format version"
 msgstr "especifica la versió del format del farcell"
@@ -4249,13 +4272,17 @@ msgstr "s'ha produït un error en fer stat a «%s»"
 msgid "%s exists and is not a directory"
 msgstr "%s existeix i no és directori"
 
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "«%s» és un enllaç simbòlic, es rebutja clonar amb --local"
+
 #, c-format
 msgid "failed to start iterator over '%s'"
 msgstr "no s'ha pogut iniciar l'iterador sobre «%s»"
 
 #, c-format
 msgid "symlink '%s' exists, refusing to clone with --local"
-msgstr "l'enllaç simbòlic «%s» existeix, es nega a clonar amb --local"
+msgstr "l'enllaç simbòlic «%s» existeix, es rebutja a clonar amb --local"
 
 #, c-format
 msgid "failed to unlink '%s'"
@@ -4979,7 +5006,6 @@ msgstr "reusa el missatge de la comissió especificada"
 
 #. TRANSLATORS: Leave "[(amend|reword):]" as-is,
 #. and only translate <commit>.
-#.
 msgid "[(amend|reword):]commit"
 msgstr "[(amend|reword):]commit"
 
@@ -5263,7 +5289,7 @@ msgid "writing to stdin is not supported"
 msgstr "no s'admet escriure a stdin"
 
 msgid "writing config blobs is not supported"
-msgstr "no s'ha admet l'escriptura de blobs de configuració"
+msgstr "no s'admet l'escriptura de blobs de configuració"
 
 #, c-format
 msgid ""
@@ -5778,119 +5804,13 @@ msgstr "git fetch --all [<opcions>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel no pot ser negatiu"
 
-msgid "fetch from all remotes"
-msgstr "obtén de tots els remots"
-
-msgid "set upstream for git pull/fetch"
-msgstr "estableix la font per a git pull/fetch"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "annexa a .git/FETCH_HEAD en lloc de sobreescriure'l"
-
-msgid "use atomic transaction to update references"
-msgstr "usa una transacció atòmica per a actualitzar les referències"
-
-msgid "path to upload pack on remote end"
-msgstr "camí al qual pujar el paquet al costat remot"
-
-msgid "force overwrite of local reference"
-msgstr "força la sobreescriptura de la referència local"
-
-msgid "fetch from multiple remotes"
-msgstr "obtén de múltiples remots"
-
-msgid "fetch all tags and associated objects"
-msgstr "obtén totes les etiquetes i tots els objectes associats"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "no obtinguis les etiquetes (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "nombre de submòduls obtinguts en paral·lel"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifica l'especificació de referència per a col·locar totes les referències "
-"dins de refs/prefetch/"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "poda les branques amb seguiment remot que ja no estiguin en el remot"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"poda les etiquetes locals que ja no existeixen al remot i adjunta les "
-"etiquetes que han canviat"
-
-msgid "on-demand"
-msgstr "sota demanda"
-
-msgid "control recursive fetching of submodules"
-msgstr "controla l'obtenció recursiva de submòduls"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "escriu les referències obtingudes al fitxer FETCH_HEAD"
-
-msgid "keep downloaded pack"
-msgstr "retén el paquet baixat"
-
-msgid "allow updating of HEAD ref"
-msgstr "permet l'actualització de la referència HEAD"
-
-msgid "deepen history of shallow clone"
-msgstr "aprofundeix la història d'un clon superficial"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "aprofundeix la història d'un clon superficial basat en una data"
-
-msgid "convert to a complete repository"
-msgstr "converteix en un repositori complet"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "tornar a obtenir sense negociar comissions comunes"
-
-msgid "prepend this to submodule path output"
-msgstr "anteposa això a la sortida de camí del submòdul"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"per defecte per a l'obtenció recursiva de submòduls (prioritat més baixa que "
-"els fitxers de configuració)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "accepta les referències que actualitzin .git/shallow"
-
-msgid "refmap"
-msgstr "mapa de referències"
-
-msgid "specify fetch refmap"
-msgstr "específica l'obtenció del mapa de referències"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "informa que només hi ha objectes abastables des d'aquest objecte"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"no obtinguis un fitxer de paquet; en canvi, mostra els avantpassats dels "
-"consells de negociació"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "executa «maintenance --auto» després d'obtenir"
-
-msgid "check for forced-updates on all updated branches"
-msgstr ""
-"comprova si hi ha actualitzacions forçades a totes les branques actualitzades"
-
-msgid "write the commit-graph after fetching"
-msgstr "escriu el graf de comissions després de recollir"
-
-msgid "accept refspecs from stdin"
-msgstr "llegeix les especificacions de referència des de stdin"
-
 msgid "couldn't find remote ref HEAD"
 msgstr "no s'ha pogut trobar la referència HEAD remota"
 
+#, c-format
+msgid "From %.*s\n"
+msgstr "De %.*s\n"
+
 #, c-format
 msgid "object %s not found"
 msgstr "objecte %s no trobat"
@@ -5963,10 +5883,6 @@ msgid "rejected %s because shallow roots are not allowed to be updated"
 msgstr ""
 "s'ha rebutjat %s perquè no es permeten actualitzar les arrels superficials"
 
-#, c-format
-msgid "From %.*s\n"
-msgstr "De %.*s\n"
-
 #, c-format
 msgid ""
 "some local refs could not be updated; try running\n"
@@ -6060,6 +5976,116 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "necessiteu especificar un nom d'etiqueta"
 
+msgid "fetch from all remotes"
+msgstr "obtén de tots els remots"
+
+msgid "set upstream for git pull/fetch"
+msgstr "estableix la font per a git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "annexa a .git/FETCH_HEAD en lloc de sobreescriure'l"
+
+msgid "use atomic transaction to update references"
+msgstr "usa una transacció atòmica per a actualitzar les referències"
+
+msgid "path to upload pack on remote end"
+msgstr "camí al qual pujar el paquet al costat remot"
+
+msgid "force overwrite of local reference"
+msgstr "força la sobreescriptura de la referència local"
+
+msgid "fetch from multiple remotes"
+msgstr "obtén de múltiples remots"
+
+msgid "fetch all tags and associated objects"
+msgstr "obtén totes les etiquetes i tots els objectes associats"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "no obtinguis les etiquetes (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "nombre de submòduls obtinguts en paral·lel"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifica l'especificació de referència per a col·locar totes les referències "
+"dins de refs/prefetch/"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "poda les branques amb seguiment remot que ja no estiguin en el remot"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"poda les etiquetes locals que ja no existeixen al remot i adjunta les "
+"etiquetes que han canviat"
+
+msgid "on-demand"
+msgstr "sota demanda"
+
+msgid "control recursive fetching of submodules"
+msgstr "controla l'obtenció recursiva de submòduls"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "escriu les referències obtingudes al fitxer FETCH_HEAD"
+
+msgid "keep downloaded pack"
+msgstr "retén el paquet baixat"
+
+msgid "allow updating of HEAD ref"
+msgstr "permet l'actualització de la referència HEAD"
+
+msgid "deepen history of shallow clone"
+msgstr "aprofundeix la història d'un clon superficial"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "aprofundeix la història d'un clon superficial basat en una data"
+
+msgid "convert to a complete repository"
+msgstr "converteix en un repositori complet"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "tornar a obtenir sense negociar comissions comunes"
+
+msgid "prepend this to submodule path output"
+msgstr "anteposa això a la sortida de camí del submòdul"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"per defecte per a l'obtenció recursiva de submòduls (prioritat més baixa que "
+"els fitxers de configuració)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "accepta les referències que actualitzin .git/shallow"
+
+msgid "refmap"
+msgstr "mapa de referències"
+
+msgid "specify fetch refmap"
+msgstr "específica l'obtenció del mapa de referències"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "informa que només hi ha objectes abastables des d'aquest objecte"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"no obtinguis un fitxer de paquet; en canvi, mostra els avantpassats dels "
+"consells de negociació"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "executa «maintenance --auto» després d'obtenir"
+
+msgid "check for forced-updates on all updated branches"
+msgstr ""
+"comprova si hi ha actualitzacions forçades a totes les branques actualitzades"
+
+msgid "write the commit-graph after fetching"
+msgstr "escriu el graf de comissions després de recollir"
+
+msgid "accept refspecs from stdin"
+msgstr "llegeix les especificacions de referència des de stdin"
+
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only necessita un o més --negotiation-tip=*"
 
@@ -6176,6 +6202,12 @@ msgstr "imprimeix només les referències que continguin la comissió"
 msgid "print only refs which don't contain the commit"
 msgstr "imprimeix només les referències que no continguin la comissió"
 
+msgid "read reference patterns from stdin"
+msgstr "llegeix els patrons de referència de l'entrada estàndard"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "s'han proporcionat arguments desconeguts amb --stdin"
+
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<config> [--] <arguments>"
 
@@ -6188,6 +6220,10 @@ msgstr "clau de configuració emmagatzemant una llista de camins de repositori"
 msgid "missing --config=<config>"
 msgstr "falta --config=<config>"
 
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "s'ha obtingut una configuració incorrecta --config=%s"
+
 msgid "unknown"
 msgstr "desconegut"
 
@@ -6334,19 +6370,28 @@ msgstr "%s: la HEAD separada no apunta a res"
 msgid "notice: %s points to an unborn branch (%s)"
 msgstr "avís: %s apunta a una branca no nascuda (%s)"
 
-msgid "Checking cache tree"
-msgstr "S'està comprovant l'arbre de la memòria cau"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "S'està comprovant l'arbre de la memòria cau %s"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: apuntador sha1 no vàlid a l'arbre de la memòria cau"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: punter sha1 no vàlid a l'arbre de la memòria cau %s"
 
 msgid "non-tree in cache-tree"
 msgstr "un no arbre en l'arbre de la memòria cau"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s: el punter sha1 no és vàlid a «resolve-undo»"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: punter sha1 no vàlid a «resolve-undo» de %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "no s'ha pogut carregar l'índex de reversió per al paquet «%s»"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "rev-index no vàlid per al paquet «%s»"
 
 msgid ""
 "git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
@@ -6768,7 +6813,6 @@ msgstr "s'ha especificat un nombre de fils no vàlid (%d) per a %s"
 #. TRANSLATORS: %s is the configuration
 #. variable for tweaking threads, currently
 #. grep.threads
-#.
 #, c-format
 msgid "no threads support, ignoring %s"
 msgstr "no s'admeten fils, s'ignorarà %s"
@@ -8851,7 +8895,6 @@ msgstr "s'ha produït un error en copiar les notes de «%s» a «%s»"
 
 #. TRANSLATORS: the first %s will be replaced by a git
 #. notes command: 'add', 'merge', 'remove', etc.
-#.
 #, c-format
 msgid "refusing to %s notes in %s (outside of refs/notes/)"
 msgstr "s'està refusant %s les notes en %s (fora de refs/notes/)"
@@ -9236,6 +9279,12 @@ msgstr "versió d'índex no compatible %s"
 msgid "bad index version '%s'"
 msgstr "versió d'índex incorrecta «%s»"
 
+msgid "show progress meter during object writing phase"
+msgstr "mostra l'indicador de progrés durant la fase d'escriptura d'objectes"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "similar a --all-progress quan l'indicador de progrés es mostra"
+
 msgid "<version>[,<offset>]"
 msgstr "<versió>[,<desplaçament>]"
 
@@ -9435,6 +9484,9 @@ msgstr ""
 "i feu-nos saber que encara l'useu enviant un correu electrònic\n"
 "a <git@vger.kernel.org>.  Gràcies.\n"
 
+msgid "refusing to run without --i-still-use-this"
+msgstr "es rebutja a executar sense --i-still-use-this"
+
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
 
@@ -9609,8 +9661,8 @@ msgstr ""
 msgid "pull with rebase"
 msgstr "baixar fent «rebase»"
 
-msgid "please commit or stash them."
-msgstr "cometeu-los o emmagatzemeu-los."
+msgid "Please commit or stash them."
+msgstr "Cometeu-los o emmagatzemeu-los."
 
 #, c-format
 msgid ""
@@ -9854,7 +9906,7 @@ msgstr "valor no vàlid per a «%s»"
 msgid "repository"
 msgstr "repositori"
 
-msgid "push all refs"
+msgid "push all branches"
 msgstr "puja totes les referències"
 
 msgid "mirror all refs"
@@ -9863,8 +9915,8 @@ msgstr "reflecteix totes les referències"
 msgid "delete refs"
 msgstr "suprimeix les referències"
 
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "puja les etiquetes (no es pot usar amb --all o --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "puja les etiquetes (no es pot usar amb --all, --branches o --mirror)"
 
 msgid "force updates"
 msgstr "força les actualitzacions"
@@ -10129,6 +10181,10 @@ msgstr ""
 "\n"
 "Com a resultat, git no pot fer un «rebase» d'elles."
 
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Mode de fusió de rebase desconegut: %s"
+
 #, c-format
 msgid "could not switch to %s"
 msgstr "no s'ha pogut commutar a %s"
@@ -10143,6 +10199,15 @@ msgid ""
 msgstr ""
 "tipus buit no reconegut «%s»; els valors vàlids són «drop», «keep» i «ask»."
 
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges amb un argument de cadena buit està obsolet i deixarà de "
+"funcionar en una versió futura del Git. Utilitzeu --rebase-merges sense un "
+"argument, que fa el mateix."
+
 #, c-format
 msgid ""
 "%s\n"
@@ -10357,20 +10422,23 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "«switch» «c» espera un valor numèric"
 
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Mode desconegut: %s"
-
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy requereix --merge o --interactive"
 
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
 msgstr ""
-"les opcions «apply» són incompatibles amb rebase.autosquash. Considereu "
+"les opcions «apply» són incompatibles amb rebase.autoSquash. Considereu "
 "afegir-hi --no-autosquash"
 
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"les opcions «apply» són incompatibles amb rebase.rebaseMerges. Considereu "
+"afegir-hi --no-rebase-merges"
+
 msgid ""
 "apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
 "update-refs"
@@ -10415,9 +10483,6 @@ msgstr "«%s»: necessita exactament una base de fusió"
 msgid "Does not point to a valid commit '%s'"
 msgstr "No apunta a una comissió vàlida «%s»"
 
-msgid "Please commit or stash them."
-msgstr "Cometeu-los o emmagatzemeu-los."
-
 msgid "HEAD is up to date."
 msgstr "HEAD està al dia."
 
@@ -10884,7 +10949,6 @@ msgstr "(sense URL)"
 #. TRANSLATORS: the colon ':' should align
 #. with the one in " Fetch URL: %s"
 #. translation.
-#.
 #, c-format
 msgid "  Push  URL: %s"
 msgstr "  URL de pujada: %s"
@@ -11091,8 +11155,8 @@ msgstr ""
 msgid "approxidate"
 msgstr "data aproximada"
 
-msgid "with -C, expire objects older than this"
-msgstr "amb -C, venç els objectes més antics que aquest"
+msgid "with --cruft, expire objects older than this"
+msgstr "amb --cruft, vencen els objectes més antics que aquest"
 
 msgid "remove redundant packs, and run git-prune-packed"
 msgstr "elimina els paquets redundants, i executeu git-prune-packed"
@@ -11764,6 +11828,9 @@ msgstr ""
 msgid "remote name"
 msgstr "nom del remot"
 
+msgid "push all refs"
+msgstr "puja totes les referències"
+
 msgid "use stateless RPC protocol"
 msgstr "usa el protocol RPC sense estat"
 
@@ -11968,9 +12035,11 @@ msgid "show refs from stdin that aren't in local repository"
 msgstr "mostra les referències de stdin que no siguin en el repositori local"
 
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<opcions>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<opcions>]"
 
 msgid "this worktree is not sparse"
 msgstr "aquest arbre de treball no és dispers"
@@ -12094,6 +12163,24 @@ msgstr ""
 msgid "error while refreshing working directory"
 msgstr "s'ha produït un error en actualitzar el directori de treball"
 
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <fitxer>]"
+
+msgid "terminate input and output files by a NUL character"
+msgstr "acaba els fitxers d'entrada i de sortida amb un caràcter NUL"
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"quan s'utilitza amb --rules-file, interpreta els patrons com a patrons del "
+"mode con"
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "utilitza patrons en <file> en lloc dels actuals."
+
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<log-options>]"
 
@@ -14994,8 +15081,8 @@ msgstr "la longitud d'«abbrev» està fora de rang: %d"
 msgid "bad zlib compression level %d"
 msgstr "nivell de compressió de zlib incorrecte %d"
 
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar només hauria de ser un caràcter"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar només hauria de ser un caràcter ASCII"
 
 #, c-format
 msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -15107,6 +15194,11 @@ msgstr "no s'ha pogut establir «%s» a «%s»"
 msgid "invalid section name: %s"
 msgstr "nom de secció no vàlida: %s"
 
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"es rebutja treballar amb una línia massa llarga a «%s» a la línia %<PRIuMAX>"
+
 #, c-format
 msgid "missing value for '%s'"
 msgstr "falta el valor per «%s»"
@@ -15790,6 +15882,9 @@ msgstr "afegir un prefix addicional per a cada línia de sortida"
 msgid "do not show any source or destination prefix"
 msgstr "no mostris cap prefix d'origen o destí"
 
+msgid "use default prefixes a/ and b/"
+msgstr "utilitza els prefixos per defecte a/ i b/"
+
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr ""
 "mostra el context entre trossos de diferència fins al nombre especificat de "
@@ -16101,6 +16196,14 @@ msgstr "no s'ha pogut migrar el directori de «%s» a «%s»"
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "consell: s'està esperant que el vostre editor tanqui el fitxer...%c"
 
+#, c-format
+msgid "could not write to '%s'"
+msgstr "no s'ha pogut escriure a «%s»"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "no s'ha pogut editar «%s»"
+
 msgid "Filtering content"
 msgstr "S'està filtrant el contingut"
 
@@ -16268,14 +16371,12 @@ msgstr "s'ha produït un error en processar els acks: %d"
 
 #. TRANSLATORS: The parameter will be 'ready', a protocol
 #. keyword.
-#.
 #, c-format
 msgid "expected packfile to be sent after '%s'"
 msgstr "s'esperava que el fitxer de paquet s'enviés després de «%s»"
 
 #. TRANSLATORS: The parameter will be 'ready', a protocol
 #. keyword.
-#.
 #, c-format
 msgid "expected no other sections to be sent after no '%s'"
 msgstr "no s'esperava que cap altra secció s'enviés després de «%s»"
@@ -16398,6 +16499,10 @@ msgstr "-c espera una cadena de configuració\n"
 msgid "no config key given for --config-env\n"
 msgstr "no s'ha indicat cap clau de configuració per a --config-env\n"
 
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "no s'ha donat d'atribut font per a --attr-source\n"
+
 #, c-format
 msgid "unknown option: %s\n"
 msgstr "opció desconeguda: %s\n"
@@ -17089,7 +17194,6 @@ msgstr ""
 #. name, and the second argument is the abbreviated id of the
 #. commit that needs to be merged.  For example:
 #.  - go to submodule (mysubmodule), and either merge commit abc1234"
-#.
 #, c-format
 msgid ""
 " - go to submodule (%s), and either merge commit %s\n"
@@ -17124,7 +17228,6 @@ msgstr ""
 
 #. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
 #. base, and 2-3) the trees for the two trees we're merging.
-#.
 #, c-format
 msgid "collecting merge info failed for trees %s, %s, %s"
 msgstr ""
@@ -17598,7 +17701,6 @@ msgstr "S'està refusant reescriure les notes en %s (fora de refs/notes/)"
 #. TRANSLATORS: The first %s is the name of
 #. the environment variable, the second %s is
 #. its value.
-#.
 #, c-format
 msgid "Bad %s value: '%s'"
 msgstr "Valor erroni de %s: «%s»"
@@ -17768,7 +17870,7 @@ msgid "object fails fsck: %s"
 msgstr "l'objecte ha fallat fsck: %s"
 
 msgid "refusing to create malformed object"
-msgstr "es nega a crear un objecte mal format"
+msgstr "es rebutja crear un objecte mal format"
 
 #, c-format
 msgid "read error while indexing %s"
@@ -17817,7 +17919,6 @@ msgstr "no s'han pogut desempaquetar els continguts de %s"
 #. TRANSLATORS: This is a line of ambiguous object
 #. output shown when we cannot look up or parse the
 #. object in question. E.g. "deadbeef [bad object]".
-#.
 #, c-format
 msgid "%s [bad object]"
 msgstr "%s [objecte incorrecte]"
@@ -17826,7 +17927,6 @@ msgstr "%s [objecte incorrecte]"
 #. object output. E.g.:
 #. *
 #.    "deadbeef commit 2021-01-01 - Some Commit Message"
-#.
 #, c-format
 msgid "%s commit %s - %s"
 msgstr "%s comissió %s - %s"
@@ -17841,7 +17941,6 @@ msgstr "%s comissió %s - %s"
 #. *
 #. The third argument is the "tag" string
 #. from object.c.
-#.
 #, c-format
 msgid "%s tag %s - %s"
 msgstr "%s etiqueta %s - %s"
@@ -17851,21 +17950,18 @@ msgstr "%s etiqueta %s - %s"
 #. the tag itself. E.g.:
 #. *
 #.    "deadbeef [bad tag, could not parse it]"
-#.
 #, c-format
 msgid "%s [bad tag, could not parse it]"
 msgstr "%s [etiqueta malmesa, no s'ha pogut analitzar]"
 
 #. TRANSLATORS: This is a line of ambiguous <type>
 #. object output. E.g. "deadbeef tree".
-#.
 #, c-format
 msgid "%s tree"
 msgstr "arbre %s"
 
 #. TRANSLATORS: This is a line of ambiguous <type>
 #. object output. E.g. "deadbeef blob".
-#.
 #, c-format
 msgid "%s blob"
 msgstr "blob %s"
@@ -17877,7 +17973,6 @@ msgstr "l'id d'objecte curt %s és ambigu"
 #. TRANSLATORS: The argument is the list of ambiguous
 #. objects composed in show_ambiguous_object(). See
 #. its "TRANSLATORS" comments for details.
-#.
 #, c-format
 msgid ""
 "The candidates are:\n"
@@ -18109,6 +18204,10 @@ msgstr "no s'ha pogut trobar «%s» al paquet «%s» al desplaçament %<PRIuMAX>
 msgid "unable to get disk usage of '%s'"
 msgstr "no s'ha pogut obtenir l'ús del disc de «%s»"
 
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "el fitxer de mapa de bits «%s» té una suma de verificació no vàlida"
+
 #, c-format
 msgid "mtimes file %s is too small"
 msgstr "el fitxer mtimes %s és massa petit"
@@ -18149,6 +18248,14 @@ msgstr "el fitxer d'índex invers %s té la versió %<PRIu32> no admesa"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "el fitxer d'índex invers %s té un ID de resum %<PRIu32> no admès"
 
+msgid "invalid checksum"
+msgstr "suma de verificació no vàlida"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr ""
+"posició no vàlida de l'índex de reversió a %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
 msgid "cannot both write and verify reverse index"
 msgstr "no es pot escriure i verificar l'índex invers"
 
@@ -18257,7 +18364,6 @@ msgstr "ús: %s"
 
 #. TRANSLATORS: the colon here should align with the
 #. one in "usage: %s" translation.
-#.
 #, c-format
 msgid "   or: %s"
 msgstr "   o: %s"
@@ -18280,7 +18386,6 @@ msgstr "   o: %s"
 #. function. The "%s" is a line in the (hopefully already
 #. translated) N_() usage string, which contained embedded
 #. newlines before we split it up.
-#.
 #, c-format
 msgid "%*s%s"
 msgstr "%*s%s"
@@ -18878,6 +18983,10 @@ msgstr "argument %%(%s) desconegut: %s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "amplada positiva esperada amb l'àtom %%(align)"
 
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "format esperat: %%(ahead-behind:<committish>)"
+
 #, c-format
 msgid "malformed field name: %.*s"
 msgstr "nom de camp mal format: %.*s"
@@ -19262,7 +19371,6 @@ msgstr ""
 #. TRANSLATORS: "matches '%s'%" is the <dst> part of "git push
 #. <remote> <src>:<dst>" push, and "being pushed ('%s')" is
 #. the <src>.
-#.
 #, c-format
 msgid ""
 "The destination you provided is not a full refname (i.e.,\n"
@@ -19512,10 +19620,6 @@ msgstr "ha fallat en actualitzar l'estat en conflicte a «%s»"
 msgid "no remembered resolution for '%s'"
 msgstr "no hi ha cap resolució recordada per a «%s»"
 
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "no es pot fer «unlink» de «%s»"
-
 #, c-format
 msgid "Updated preimage for '%s'"
 msgstr "Imatge prèvia actualitzada per a «%s»"
@@ -19854,10 +19958,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "no s'ha pogut bloquejar «%s»"
 
-#, c-format
-msgid "could not write to '%s'"
-msgstr "no s'ha pogut escriure a «%s»"
-
 #, c-format
 msgid "could not write eol to '%s'"
 msgstr "no s'ha pogut escriure el terminador de línia a «%s»"
@@ -19875,7 +19975,6 @@ msgstr "cometeu els vostres canvis o feu un «stash» per a procedir."
 
 #. TRANSLATORS: %s will be "revert", "cherry-pick" or
 #. "rebase".
-#.
 #, c-format
 msgid "%s: Unable to write new index file"
 msgstr "%s: No s'ha pogut escriure un fitxer d'índex nou"
@@ -20221,9 +20320,6 @@ msgstr "intenteu «git cherry-pick (--continue | %s--abort | --quit)»"
 msgid "could not create sequencer directory '%s'"
 msgstr "no s'ha pogut crear el directori de seqüenciador «%s»"
 
-msgid "could not lock HEAD"
-msgstr "no s'ha pogut bloquejar HEAD"
-
 msgid "no cherry-pick or revert in progress"
 msgstr "ni hi ha cap «cherry pick» ni cap reversió en curs"
 
@@ -20318,13 +20414,13 @@ msgstr ""
 " git rebase --continue\n"
 "\n"
 
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "i ha fet canvis a l'índex i/o l'arbre de treball\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "i ha fet canvis a l'índex i/o a l'arbre de treball.\n"
 
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
@@ -20334,7 +20430,8 @@ msgstr ""
 "però ha deixat canvis a l'índex i/o l'arbre de treball\n"
 "Cometeu o feu «stash» dels vostres canvis, i llavors executeu\n"
 "\n"
-" git rebase --continue\n"
+"  git rebase --continue\n"
+"\n"
 
 #, c-format
 msgid "illegal label name: '%.*s'"
@@ -20771,10 +20868,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u byte/s"
 msgstr[1] "%u bytes/s"
 
-#, c-format
-msgid "could not edit '%s'"
-msgstr "no s'ha pogut editar «%s»"
-
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
 msgstr "s'està ignorant el nom de submòdul sospitós %s"
@@ -22512,13 +22605,17 @@ msgid "(%s) Could not execute '%s'"
 msgstr "(%s) no s'ha pogut executar «%s»"
 
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) S'està afegint %s: %s des de: «%s»\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Sortida mal formada de «%s»"
 
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) s'ha produït un error en tancar el conducte «%s»"
 
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) S'està afegint %s: %s des de: «%s»\n"
+
 msgid "cannot send message as 7bit"
 msgstr "no es pot enviar el missatge en 7 bits"
 
@@ -22555,367 +22652,3 @@ msgstr "S'està ometent %s amb el sufix de còpia de seguretat «%s».\n"
 #, perl-format
 msgid "Do you really want to send %s? [y|N]: "
 msgstr "Esteu segur que voleu enviar %s? [y|N]: "
-
-#~ msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-#~ msgstr "git bisect--helper --bisect-state (bad|new) [<rev>]"
-
-#~ msgid "won't bisect on cg-seek'ed tree"
-#~ msgstr "no es bisecarà en un arbre en el qual s'ha fet cg-seek"
-
-#~ msgid "--bisect-terms requires 0 or 1 argument"
-#~ msgstr "--bisect-terms requereix 0 o 1 argument"
-
-#~ msgid "--bisect-next requires 0 arguments"
-#~ msgstr "--bisect-next no requereix cap argument"
-
-#~ msgid "--bisect-log requires 0 arguments"
-#~ msgstr "--bisect-log no requereix cap argument"
-
-#~ msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-#~ msgstr "git env--helper --type=[bool|ulong] <opcions> <env-var>"
-
-#~ msgid "default for git_env_*(...) to fall back on"
-#~ msgstr "valor per defecte per a git_env_*(...) en cas d'absència"
-
-#~ msgid "be quiet only use git_env_*() value as exit code"
-#~ msgstr "silenciós només utilitza el valor git_env_*() com a codi de sortida"
-
-#, c-format
-#~ msgid ""
-#~ "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-#~ msgstr ""
-#~ "l'opció «--default» espera un valor booleà amb «--type=bool», no «%s»"
-
-#, c-format
-#~ msgid ""
-#~ "option `--default' expects an unsigned long value with `--type=ulong`, "
-#~ "not `%s`"
-#~ msgstr ""
-#~ "l'opció «--default» espera un valor llarg sense signe amb «--type=ulong», "
-#~ "no «%s»"
-
-#, c-format
-#~ msgid "%s doesn't support --super-prefix"
-#~ msgstr "%s no admet --super-prefix"
-
-#, c-format
-#~ msgid "no prefix given for --super-prefix\n"
-#~ msgstr "no s'ha especificat cap prefix per a --super-prefix\n"
-
-#, c-format
-#~ msgid "failed to read object %s"
-#~ msgstr "s'ha produït un error en llegir l'objecte %s"
-
-#~ msgid "file write error"
-#~ msgstr "s'ha produït un error en escriure al fitxer"
-
-#~ msgid "corrupt commit"
-#~ msgstr "comissió corrupta"
-
-#~ msgid "corrupt tag"
-#~ msgstr "etiqueta corrupta"
-
-#, c-format
-#~ msgid "%%(objecttype) does not take arguments"
-#~ msgstr "%%(objecttype) no accepta arguments"
-
-#, c-format
-#~ msgid "%%(deltabase) does not take arguments"
-#~ msgstr "%%(deltabase) no accepta arguments"
-
-#, c-format
-#~ msgid "%%(body) does not take arguments"
-#~ msgstr "%%(body) no accepta arguments"
-
-#, c-format
-#~ msgid "unrecognized email option: %s"
-#~ msgstr "opció del correu electrònic no reconeguda: «%s»"
-
-#, c-format
-#~ msgid ""
-#~ "It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-#~ "may speed it up, but you have to be careful not to forget to add\n"
-#~ "new files yourself (see 'git help status')."
-#~ msgstr ""
-#~ "S'ha trigat %.2f segons enumerar els fitxers no seguits.\n"
-#~ "«status -uno» pot accelerar-ho, però heu d'anar amb compte de no\n"
-#~ "oblidar-vos d'afegir fitxers nous vosaltres mateixos (vegeu\n"
-#~ "«git help status»)."
-
-#, perl-format
-#~ msgid "%12s %12s %s"
-#~ msgstr "%12s %12s %s"
-
-#, perl-format
-#~ msgid "touched %d path\n"
-#~ msgid_plural "touched %d paths\n"
-#~ msgstr[0] "modificat %d camí\n"
-#~ msgstr[1] "modificat %d camins\n"
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for staging."
-#~ msgstr ""
-#~ "Si el pedaç s'aplica correctament, el tros editat es marcarà "
-#~ "immediatament\n"
-#~ "per «staging»."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for stashing."
-#~ msgstr ""
-#~ "Si el pedaç s'aplica correctament, el tros editat es marcarà "
-#~ "immediatament\n"
-#~ "per «stashing»."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for unstaging."
-#~ msgstr ""
-#~ "Si el pedaç s'aplica correctament, el tros editat es marcarà "
-#~ "immediatament\n"
-#~ "per «unstaging»."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for applying."
-#~ msgstr ""
-#~ "Si el pedaç s'aplica correctament, el tros editat es marcarà "
-#~ "immediatament\n"
-#~ "per a aplicar-se."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for discarding."
-#~ msgstr ""
-#~ "Si el pedaç s'aplica correctament, el tros editat es marcarà "
-#~ "immediatament\n"
-#~ "per a descartar-se."
-
-#, perl-format
-#~ msgid "failed to open hunk edit file for writing: %s"
-#~ msgstr "s'ha produït un error en escriure al fitxer d'edició del tros: %s"
-
-#, perl-format
-#~ msgid ""
-#~ "---\n"
-#~ "To remove '%s' lines, make them ' ' lines (context).\n"
-#~ "To remove '%s' lines, delete them.\n"
-#~ "Lines starting with %s will be removed.\n"
-#~ msgstr ""
-#~ "---\n"
-#~ "Per a eliminar les línies «%s», convertiu-les en línies ' ' (context).\n"
-#~ "Per a eliminar les línies «%s», suprimiu-les.\n"
-#~ "Les línies que comencin per %s s'eliminaran.\n"
-
-#, perl-format
-#~ msgid "failed to open hunk edit file for reading: %s"
-#~ msgstr "s'ha produït un error en llegir al fitxer d'edició del tros: %s"
-
-#~ msgid ""
-#~ "y - stage this hunk\n"
-#~ "n - do not stage this hunk\n"
-#~ "q - quit; do not stage this hunk or any of the remaining ones\n"
-#~ "a - stage this hunk and all later hunks in the file\n"
-#~ "d - do not stage this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - fes «stage» d'aquest tros\n"
-#~ "n - no facis «stage» d'aquest tros\n"
-#~ "q - surt; no facis «stage» d'aquest tros o de cap altre restant\n"
-#~ "a - fes «stage» d'aquest tros i tota la resta de trossos del fitxer\n"
-#~ "d - no facis «stage» d'aquest tros o de cap altre restant del fitxer"
-
-#~ msgid ""
-#~ "y - stash this hunk\n"
-#~ "n - do not stash this hunk\n"
-#~ "q - quit; do not stash this hunk or any of the remaining ones\n"
-#~ "a - stash this hunk and all later hunks in the file\n"
-#~ "d - do not stash this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - fes «stash» d'aquest tros\n"
-#~ "n - no facis «stash» d'aquest tros\n"
-#~ "q - surt; no facis «stash» d'aquest tros o de cap altre restant\n"
-#~ "a - fes «stash» d'aquest tros i tota la resta de trossos del fitxer\n"
-#~ "d - no facis «stash» d'aquest tros o de cap altre restant del fitxer"
-
-#~ msgid ""
-#~ "y - unstage this hunk\n"
-#~ "n - do not unstage this hunk\n"
-#~ "q - quit; do not unstage this hunk or any of the remaining ones\n"
-#~ "a - unstage this hunk and all later hunks in the file\n"
-#~ "d - do not unstage this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - fes «unstage» d'aquest tros\n"
-#~ "n - no facis «unstage» d'aquest tros\n"
-#~ "q - surt; no facis «unstage» d'aquest tros o de cap altre restant\n"
-#~ "a - fes «unstage» d'aquest tros i tota la resta de trossos del fitxer\n"
-#~ "d - no facis «unstage» d'aquest tros o de cap altre restant del fitxer"
-
-#~ msgid ""
-#~ "y - apply this hunk to index\n"
-#~ "n - do not apply this hunk to index\n"
-#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
-#~ "a - apply this hunk and all later hunks in the file\n"
-#~ "d - do not apply this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - aplica aquest tros a l'índex\n"
-#~ "n - no apliquis aquest tros a l'índex\n"
-#~ "q - surt; no apliquis aquest tros ni cap dels pendents\n"
-#~ "a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
-#~ "d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-#~ msgid ""
-#~ "y - discard this hunk from worktree\n"
-#~ "n - do not discard this hunk from worktree\n"
-#~ "q - quit; do not discard this hunk or any of the remaining ones\n"
-#~ "a - discard this hunk and all later hunks in the file\n"
-#~ "d - do not discard this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - descarta aquest tros de l'arbre de treball\n"
-#~ "n - no descartis aquest tros des de l'arbre de treball\n"
-#~ "q - surt; no descartis aquest tros ni cap dels pendents\n"
-#~ "a - descarta aquest tros i tots els trossos posteriors en el fitxer\n"
-#~ "d - no descartis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-#~ msgid ""
-#~ "y - discard this hunk from index and worktree\n"
-#~ "n - do not discard this hunk from index and worktree\n"
-#~ "q - quit; do not discard this hunk or any of the remaining ones\n"
-#~ "a - discard this hunk and all later hunks in the file\n"
-#~ "d - do not discard this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - descarta aquest tros de l'índex i de l'arbre de treball\n"
-#~ "n - no descartis aquest tros des de l'índex i de l'arbre de treball\n"
-#~ "q - surt; no descartis aquest tros ni cap dels pendents\n"
-#~ "a - descarta aquest tros i tots els trossos posteriors en el fitxer\n"
-#~ "d - no descartis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-#~ msgid ""
-#~ "y - apply this hunk to index and worktree\n"
-#~ "n - do not apply this hunk to index and worktree\n"
-#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
-#~ "a - apply this hunk and all later hunks in the file\n"
-#~ "d - do not apply this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - aplica aquest tros a l'índex i l'arbre de treball\n"
-#~ "n - no apliquis aquest tros des de l'índex i de l'arbre de treball\n"
-#~ "q - surt; no apliquis aquest tros ni cap dels pendents\n"
-#~ "a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
-#~ "d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-#~ msgid ""
-#~ "y - apply this hunk to worktree\n"
-#~ "n - do not apply this hunk to worktree\n"
-#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
-#~ "a - apply this hunk and all later hunks in the file\n"
-#~ "d - do not apply this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - aplica aquest tros a l'arbre de treball\n"
-#~ "n - no apliquis aquest tros a l'arbre de treball\n"
-#~ "q - surt; no apliquis aquest tros ni cap dels pendents\n"
-#~ "a - aplica aquest tros i tots els trossos posteriors en el fitxer\n"
-#~ "d - no apliquis aquest tros ni cap dels trossos posteriors en el fitxer"
-
-#~ msgid ""
-#~ "g - select a hunk to go to\n"
-#~ "/ - search for a hunk matching the given regex\n"
-#~ "j - leave this hunk undecided, see next undecided hunk\n"
-#~ "J - leave this hunk undecided, see next hunk\n"
-#~ "k - leave this hunk undecided, see previous undecided hunk\n"
-#~ "K - leave this hunk undecided, see previous hunk\n"
-#~ "s - split the current hunk into smaller hunks\n"
-#~ "e - manually edit the current hunk\n"
-#~ "? - print help\n"
-#~ msgstr ""
-#~ "g - selecciona el tros on voleu anar\n"
-#~ "/ - cerca un tros que coincideixi amb l'expressió regular donada\n"
-#~ "j - deixa aquest tros sense decidir, veure el tros sense decidir següent\n"
-#~ "J - deixa aquest tros sense decidir, veure el tros següent\n"
-#~ "k - deixa aquest tros sense decidir, veure el tros sense decidir "
-#~ "anterior\n"
-#~ "K - deixa aquest tros sense decidir, veure el tros anterior\n"
-#~ "s - divideix el tros actual en trossos més petits\n"
-#~ "e - edita manualment el tros actual\n"
-#~ "? - mostra l'ajuda\n"
-
-#~ msgid "The selected hunks do not apply to the index!\n"
-#~ msgstr "Els trossos seleccionats no apliquen a l'índex\n"
-
-#, perl-format
-#~ msgid "ignoring unmerged: %s\n"
-#~ msgstr "s'està ignorant %s no fusionat\n"
-
-#~ msgid "No other hunks to goto\n"
-#~ msgstr "No hi ha altres trossos on anar-hi\n"
-
-#, perl-format
-#~ msgid "Invalid number: '%s'\n"
-#~ msgstr "Número no vàlid: «%s»\n"
-
-#, perl-format
-#~ msgid "Sorry, only %d hunk available.\n"
-#~ msgid_plural "Sorry, only %d hunks available.\n"
-#~ msgstr[0] "Només %d tros disponible.\n"
-#~ msgstr[1] "Només %d trossos disponibles.\n"
-
-#~ msgid "No other hunks to search\n"
-#~ msgstr "No hi ha cap altre tros a cercar\n"
-
-#, perl-format
-#~ msgid "Malformed search regexp %s: %s\n"
-#~ msgstr "Expressió regular de cerca mal formada %s: %s\n"
-
-#~ msgid "No hunk matches the given pattern\n"
-#~ msgstr "No hi ha trossos que coincideixin amb el patró donat\n"
-
-#~ msgid "No previous hunk\n"
-#~ msgstr "Sense tros previ\n"
-
-#~ msgid "No next hunk\n"
-#~ msgstr "No hi ha tros següent\n"
-
-#~ msgid "Sorry, cannot split this hunk\n"
-#~ msgstr "No es pot dividir aquest tros\n"
-
-#, perl-format
-#~ msgid "Split into %d hunk.\n"
-#~ msgid_plural "Split into %d hunks.\n"
-#~ msgstr[0] "Divideix en %d tros.\n"
-#~ msgstr[1] "Divideix en %d trossos.\n"
-
-#~ msgid "Sorry, cannot edit this hunk\n"
-#~ msgstr "No es pot editar aquest tros\n"
-
-#~ msgid ""
-#~ "status        - show paths with changes\n"
-#~ "update        - add working tree state to the staged set of changes\n"
-#~ "revert        - revert staged set of changes back to the HEAD version\n"
-#~ "patch         - pick hunks and update selectively\n"
-#~ "diff          - view diff between HEAD and index\n"
-#~ "add untracked - add contents of untracked files to the staged set of "
-#~ "changes\n"
-#~ msgstr ""
-#~ "status        - mostra els camins amb canvis\n"
-#~ "update        - afegeix l'estat de l'arbre de treball al conjunt de "
-#~ "canvis «staged»\n"
-#~ "revert        - reverteix el conjunt de canvis de «staged» a la versió "
-#~ "HEAD\n"
-#~ "patch         - selecciona trossos i actualitza'ls selectivament\n"
-#~ "diff          - mostra la diferència entre HEAD i l'índex\n"
-#~ "add untracked - afegeix el contingut dels fitxers no seguits al conjunt "
-#~ "de canvis «staged»\n"
-
-#~ msgid "missing --"
-#~ msgstr "manca --"
-
-#, perl-format
-#~ msgid "unknown --patch mode: %s"
-#~ msgstr "desconegut --patch mode: %s"
-
-#, perl-format
-#~ msgid "invalid argument %s, expecting --"
-#~ msgstr "argument %s no vàlid, s'esperava --"
-
-#, c-format
-#~ msgid "unable to normalize object directory: %s"
-#~ msgstr "no s'ha pogut normalitzar el directori de l'objecte: %s"
index 7559a8c64e4eb799110aa7142a35656c30cdb2b6..2ef0dc7a7265dfd2b40d00626e6d9086f6c79197 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Git\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-03 17:13+0100\n"
-"PO-Revision-Date: 2023-03-03 13:46+0100\n"
+"POT-Creation-Date: 2023-05-22 17:14+0200\n"
+"PO-Revision-Date: 2023-05-22 17:16+0200\n"
 "Last-Translator: Ralf Thielow <ralf.thielow@gmail.com>\n"
 "Language-Team: German\n"
 "Language: de\n"
@@ -17,7 +17,7 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n!=1);\n"
-"X-Generator: Poedit 3.2.2\n"
+"X-Generator: Poedit 3.3.1\n"
 
 #, c-format
 msgid "Huh (%s)?"
@@ -688,6 +688,24 @@ msgstr "Bitte committen Sie Ihre Änderungen, bevor Sie mergen."
 msgid "Exiting because of unfinished merge."
 msgstr "Beende wegen nicht abgeschlossenem Merge."
 
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Abweichende Branches können nicht vorgespult werden, benutzen Sie "
+"stattdessen:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"oder:\n"
+"\n"
+"\tgit rebase\n"
+
 msgid "Not possible to fast-forward, aborting."
 msgstr "Vorspulen nicht möglich, breche ab."
 
@@ -1143,6 +1161,10 @@ msgstr "Verkürze Name von .rej Datei zu %.*s.rej"
 msgid "cannot open %s"
 msgstr "kann '%s' nicht öffnen"
 
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "Kann '%s' nicht löschen."
+
 #, c-format
 msgid "Hunk #%d applied cleanly."
 msgstr "Patch-Bereich #%d sauber angewendet."
@@ -1340,6 +1362,11 @@ msgstr "git archive --remote <Repository> [--exec <Programm>] --list"
 msgid "cannot read '%s'"
 msgstr "kann '%s' nicht lesen"
 
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+"Pfadspezifikation '%s' findet Dateien außerhalb des aktuellen Verzeichnisses"
+
 #, c-format
 msgid "pathspec '%s' did not match any files"
 msgstr "Pfadspezifikation '%s' stimmt mit keinen Dateien überein"
@@ -1356,9 +1383,6 @@ msgstr "Kein gültiger Objektname: %s"
 msgid "not a tree object: %s"
 msgstr "Kein Tree-Objekt: %s"
 
-msgid "current working directory is untracked"
-msgstr "aktuelles Arbeitsverzeichnis ist unversioniert"
-
 #, c-format
 msgid "File not found: %s"
 msgstr "Datei nicht gefunden: %s"
@@ -1485,6 +1509,9 @@ msgstr "ignoriere übermäßig große gitattributes-Datei '%s'"
 msgid "ignoring overly large gitattributes blob '%s'"
 msgstr "ignoriere übermäßig großen gitattribute-Blob '%s'"
 
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "ungültiges --attr-source oder GIT_ATTR_SOURCE"
+
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
 msgstr "Ungültiger Inhalt bzgl. Anführungszeichen in Datei '%s': %s"
@@ -1591,10 +1618,6 @@ msgstr[1] "Binäre Suche: danach noch %d Commits zum Testen übrig %s\n"
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents und --reverse funktionieren gemeinsam nicht."
 
-msgid "cannot use --contents with final commit object name"
-msgstr ""
-"kann --contents nicht mit endgültigem Namen des Commit-Objektes benutzen"
-
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr ""
 "--reverse und --first-parent zusammen erfordern die Angabe eines "
@@ -1782,10 +1805,6 @@ msgstr "Submodul '%s': kann Branch nicht erzeugen: '%s'"
 msgid "'%s' is already checked out at '%s'"
 msgstr "'%s' ist bereits in '%s' ausgecheckt"
 
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD des Arbeitsverzeichnisses %s ist nicht aktualisiert"
-
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<Optionen>] [--] <Pfadspezifikation>..."
 
@@ -2848,6 +2867,14 @@ msgstr "Kann Branch '%s' nicht entfernen, ausgecheckt in '%s'."
 msgid "remote-tracking branch '%s' not found."
 msgstr "Remote-Tracking-Branch '%s' nicht gefunden"
 
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"Branch '%s' nicht gefunden.\n"
+"Haben Sie --remote vergessen?"
+
 #, c-format
 msgid "branch '%s' not found."
 msgstr "Branch '%s' nicht gefunden."
@@ -2878,6 +2905,10 @@ msgstr "Branch %s wird auf %s umgesetzt"
 msgid "Branch %s is being bisected at %s"
 msgstr "Binäre Suche von Branch %s zu %s im Gange"
 
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD des Arbeitsverzeichnisses %s ist nicht aktualisiert"
+
 #, c-format
 msgid "Invalid branch name: '%s'"
 msgstr "Ungültiger Branchname: '%s'"
@@ -2983,6 +3014,9 @@ msgid "move/rename a branch, even if target exists"
 msgstr ""
 "einen Branch verschieben/umbenennen, auch wenn das Ziel bereits existiert"
 
+msgid "do not output a newline after empty formatted refs"
+msgstr "keinen Zeilenumbruch nach leer formatierten Referenzen ausgeben"
+
 msgid "copy a branch and its reflog"
 msgstr "einen Branch und dessen Reflog kopieren"
 
@@ -3212,12 +3246,10 @@ msgid "Created new report at '%s'.\n"
 msgstr "Neuer Bericht unter '%s' erstellt.\n"
 
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<Version>] <Datei> <git-rev-list-Argumente>"
 
 msgid "git bundle verify [-q | --quiet] <file>"
@@ -3238,11 +3270,11 @@ msgstr "keine Fortschrittsanzeige anzeigen"
 msgid "show progress meter"
 msgstr "Fortschrittsanzeige anzeigen"
 
-msgid "show progress meter during object writing phase"
-msgstr "Forschrittsanzeige während des Schreibens von Objekten anzeigen"
+msgid "historical; same as --progress"
+msgstr "historisch; dasselbe wie --progress"
 
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "ähnlich zu --all-progress wenn Fortschrittsanzeige darstellt wird"
+msgid "historical; does nothing"
+msgstr "historisch; kein Effekt"
 
 msgid "specify bundle format version"
 msgstr "Version des Paket-Formats angeben"
@@ -4274,6 +4306,11 @@ msgstr "Konnte '%s' nicht lesen"
 msgid "%s exists and is not a directory"
 msgstr "%s existiert und ist kein Verzeichnis"
 
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr ""
+"'%s' ist eine symbolische Verknüpfung, verweigere das Klonen mit --local"
+
 #, c-format
 msgid "failed to start iterator over '%s'"
 msgstr "Fehler beim Starten der Iteration über '%s'"
@@ -5828,126 +5865,13 @@ msgstr "git fetch --all [<Optionen>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel kann nicht negativ sein"
 
-msgid "fetch from all remotes"
-msgstr "fordert von allen Remote-Repositories an"
-
-msgid "set upstream for git pull/fetch"
-msgstr "Upstream für \"git pull/fetch\" setzen"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "an .git/FETCH_HEAD anhängen statt zu überschreiben"
-
-msgid "use atomic transaction to update references"
-msgstr "atomare Transaktionen nutzen, um Referenzen zu aktualisieren"
-
-msgid "path to upload pack on remote end"
-msgstr "Pfad des Programms zum Hochladen von Paketen auf der Gegenseite"
-
-msgid "force overwrite of local reference"
-msgstr "das Überschreiben einer lokalen Referenz erzwingen"
-
-msgid "fetch from multiple remotes"
-msgstr "von mehreren Remote-Repositories anfordern"
-
-msgid "fetch all tags and associated objects"
-msgstr "alle Tags und verbundene Objekte anfordern"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "nicht alle Tags anfordern (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "Anzahl der parallel anzufordernden Submodule"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"Refspec verändern, damit alle Referenzen unter refs/prefetch/ platziert "
-"werden"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr ""
-"Remote-Tracking-Branches entfernen, die sich nicht mehr im Remote-Repository "
-"befinden"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"lokale Tags entfernen, die sich nicht mehr im Remote-Repository befinden, "
-"und geänderte Tags aktualisieren"
-
-msgid "on-demand"
-msgstr "bei-Bedarf"
-
-msgid "control recursive fetching of submodules"
-msgstr "rekursive Anforderungen von Submodulen kontrollieren"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "schreibe angeforderte Referenzen in die FETCH_HEAD-Datei"
-
-msgid "keep downloaded pack"
-msgstr "heruntergeladenes Paket behalten"
-
-msgid "allow updating of HEAD ref"
-msgstr "Aktualisierung der \"HEAD\"-Referenz erlauben"
-
-msgid "deepen history of shallow clone"
-msgstr ""
-"die Historie eines Klons mit unvollständiger Historie (shallow) vertiefen"
-
-msgid "deepen history of shallow repository based on time"
-msgstr ""
-"die Historie eines Klons mit unvollständiger Historie (shallow) auf "
-"Zeitbasis\n"
-"vertiefen"
-
-msgid "convert to a complete repository"
-msgstr "zu einem vollständigen Repository konvertieren"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "erneutes Abrufen ohne Aushandeln gemeinsamer Commits"
-
-msgid "prepend this to submodule path output"
-msgstr "dies an die Ausgabe der Submodul-Pfade voranstellen"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"Standard für die rekursive Anforderung von Submodulen (geringere Priorität\n"
-"als Konfigurationsdateien)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "Referenzen, die .git/shallow aktualisieren, akzeptieren"
-
-msgid "refmap"
-msgstr "Refmap"
-
-msgid "specify fetch refmap"
-msgstr "Refmap für 'fetch' angeben"
-
-msgid "report that we have only objects reachable from this object"
-msgstr ""
-"ausgeben, dass wir nur Objekte haben, die von diesem Objekt aus erreichbar "
-"sind"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"keine Packdatei anfordern; stattdessen die Vorgänger der Verhandlungstipps "
-"anzeigen"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "führe 'maintenance --auto' nach \"fetch\" aus"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "Prüfe auf erzwungene Aktualisierungen in allen aktualisierten Branches"
-
-msgid "write the commit-graph after fetching"
-msgstr "Schreibe den Commit-Graph nach \"fetch\""
-
-msgid "accept refspecs from stdin"
-msgstr "akzeptiere Refspecs von der Standard-Eingabe"
-
 msgid "couldn't find remote ref HEAD"
 msgstr "konnte Remote-Referenz von HEAD nicht finden"
 
+#, c-format
+msgid "From %.*s\n"
+msgstr "Von %.*s\n"
+
 #, c-format
 msgid "object %s not found"
 msgstr "Objekt %s nicht gefunden"
@@ -6021,10 +5945,6 @@ msgstr ""
 "%s zurückgewiesen, da Root-Commits von Repositories mit unvollständiger\n"
 "Historie (shallow) nicht aktualisiert werden dürfen."
 
-#, c-format
-msgid "From %.*s\n"
-msgstr "Von %.*s\n"
-
 #, c-format
 msgid ""
 "some local refs could not be updated; try running\n"
@@ -6117,6 +6037,123 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "Sie müssen den Namen des Tags angeben"
 
+msgid "fetch from all remotes"
+msgstr "fordert von allen Remote-Repositories an"
+
+msgid "set upstream for git pull/fetch"
+msgstr "Upstream für \"git pull/fetch\" setzen"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "an .git/FETCH_HEAD anhängen statt zu überschreiben"
+
+msgid "use atomic transaction to update references"
+msgstr "atomare Transaktionen nutzen, um Referenzen zu aktualisieren"
+
+msgid "path to upload pack on remote end"
+msgstr "Pfad des Programms zum Hochladen von Paketen auf der Gegenseite"
+
+msgid "force overwrite of local reference"
+msgstr "das Überschreiben einer lokalen Referenz erzwingen"
+
+msgid "fetch from multiple remotes"
+msgstr "von mehreren Remote-Repositories anfordern"
+
+msgid "fetch all tags and associated objects"
+msgstr "alle Tags und verbundene Objekte anfordern"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "nicht alle Tags anfordern (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "Anzahl der parallel anzufordernden Submodule"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"Refspec verändern, damit alle Referenzen unter refs/prefetch/ platziert "
+"werden"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr ""
+"Remote-Tracking-Branches entfernen, die sich nicht mehr im Remote-Repository "
+"befinden"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"lokale Tags entfernen, die sich nicht mehr im Remote-Repository befinden, "
+"und geänderte Tags aktualisieren"
+
+msgid "on-demand"
+msgstr "bei-Bedarf"
+
+msgid "control recursive fetching of submodules"
+msgstr "rekursive Anforderungen von Submodulen kontrollieren"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "schreibe angeforderte Referenzen in die FETCH_HEAD-Datei"
+
+msgid "keep downloaded pack"
+msgstr "heruntergeladenes Paket behalten"
+
+msgid "allow updating of HEAD ref"
+msgstr "Aktualisierung der \"HEAD\"-Referenz erlauben"
+
+msgid "deepen history of shallow clone"
+msgstr ""
+"die Historie eines Klons mit unvollständiger Historie (shallow) vertiefen"
+
+msgid "deepen history of shallow repository based on time"
+msgstr ""
+"die Historie eines Klons mit unvollständiger Historie (shallow) auf "
+"Zeitbasis\n"
+"vertiefen"
+
+msgid "convert to a complete repository"
+msgstr "zu einem vollständigen Repository konvertieren"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "erneutes Abrufen ohne Aushandeln gemeinsamer Commits"
+
+msgid "prepend this to submodule path output"
+msgstr "dies an die Ausgabe der Submodul-Pfade voranstellen"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"Standard für die rekursive Anforderung von Submodulen (geringere Priorität\n"
+"als Konfigurationsdateien)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "Referenzen, die .git/shallow aktualisieren, akzeptieren"
+
+msgid "refmap"
+msgstr "Refmap"
+
+msgid "specify fetch refmap"
+msgstr "Refmap für 'fetch' angeben"
+
+msgid "report that we have only objects reachable from this object"
+msgstr ""
+"ausgeben, dass wir nur Objekte haben, die von diesem Objekt aus erreichbar "
+"sind"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"keine Packdatei anfordern; stattdessen die Vorgänger der Verhandlungstipps "
+"anzeigen"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "führe 'maintenance --auto' nach \"fetch\" aus"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "Prüfe auf erzwungene Aktualisierungen in allen aktualisierten Branches"
+
+msgid "write the commit-graph after fetching"
+msgstr "Schreibe den Commit-Graph nach \"fetch\""
+
+msgid "accept refspecs from stdin"
+msgstr "akzeptiere Refspecs von der Standard-Eingabe"
+
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only benötigt einen oder mehrere --negotiation-tip=*"
 
@@ -6239,6 +6276,12 @@ msgstr "nur Referenzen ausgeben, die diesen Commit enthalten"
 msgid "print only refs which don't contain the commit"
 msgstr "nur Referenzen ausgeben, die diesen Commit nicht enthalten"
 
+msgid "read reference patterns from stdin"
+msgstr "Referenzmuster von Standard-Eingabe lesen"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "unbekannte Argumente mit --stdin geliefert"
+
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<Konfiguration> [--] <Argumente>"
 
@@ -6251,6 +6294,10 @@ msgstr "Konfigurationsschlüssel für eine Liste von Repository-Pfaden"
 msgid "missing --config=<config>"
 msgstr "Option --config=<Konfiguration> fehlt"
 
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "ungültige Konfiguration --config=%s"
+
 msgid "unknown"
 msgstr "unbekannt"
 
@@ -6397,19 +6444,28 @@ msgstr "%s: losgelöster HEAD zeigt auf nichts"
 msgid "notice: %s points to an unborn branch (%s)"
 msgstr "Notiz: %s zeigt auf einen ungeborenen Branch (%s)"
 
-msgid "Checking cache tree"
-msgstr "Prüfe Cache-Verzeichnis"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Prüfe Cache-Verzeichnis von %s"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: Ungültiger SHA1-Zeiger in Cache-Verzeichnis"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: ungültiger SHA1-Zeiger im Cache-Verzeichnis von %s"
 
 msgid "non-tree in cache-tree"
 msgstr "non-tree in Cache-Verzeichnis"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s: Ungültiger sha1-Zeiger in resolve-undo"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: ungültiger SHA1-Zeiger in resolve-undo von %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "rev-Index für Pack-Datei '%s' kann nicht geladen werden"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "ungültiger Rev-Index für Pack-Datei '%s'"
 
 msgid ""
 "git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
@@ -9326,6 +9382,12 @@ msgstr "nicht unterstützte Index-Version %s"
 msgid "bad index version '%s'"
 msgstr "ungültige Index-Version '%s'"
 
+msgid "show progress meter during object writing phase"
+msgstr "Forschrittsanzeige während des Schreibens von Objekten anzeigen"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "ähnlich zu --all-progress wenn Fortschrittsanzeige darstellt wird"
+
 msgid "<version>[,<offset>]"
 msgstr "<Version>[,<Offset>]"
 
@@ -9530,6 +9592,9 @@ msgstr ""
 "Sie es immer noch verwenden, indem Sie eine E-Mail an\n"
 "<git@vger.kernel.org> senden. Danke.\n"
 
+msgid "refusing to run without --i-still-use-this"
+msgstr "Ausführung ohne --i-still-use-this verweigert"
+
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
 
@@ -9712,7 +9777,7 @@ msgstr ""
 msgid "pull with rebase"
 msgstr "Pull mit Rebase"
 
-msgid "please commit or stash them."
+msgid "Please commit or stash them."
 msgstr "Bitte committen Sie die Änderungen oder benutzen Sie \"stash\"."
 
 #, c-format
@@ -9962,8 +10027,8 @@ msgstr "ungültiger Wert für '%s'"
 msgid "repository"
 msgstr "Repository"
 
-msgid "push all refs"
-msgstr "alle Referenzen versenden"
+msgid "push all branches"
+msgstr "alle Branches versenden"
 
 msgid "mirror all refs"
 msgstr "alle Referenzen spiegeln"
@@ -9971,8 +10036,10 @@ msgstr "alle Referenzen spiegeln"
 msgid "delete refs"
 msgstr "Referenzen löschen"
 
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "Tags versenden (kann nicht mit --all oder --mirror verwendet werden)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"Tags versenden (kann nicht mit --all, --branches oder --mirror verwendet "
+"werden)"
 
 msgid "force updates"
 msgstr "Aktualisierung erzwingen"
@@ -10241,6 +10308,10 @@ msgstr ""
 "Infolge dessen kann Git auf diesen Revisionen Rebase nicht\n"
 "ausführen."
 
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Unbekannter rebase-merges Modus: %s"
+
 #, c-format
 msgid "could not switch to %s"
 msgstr "Konnte nicht zu %s wechseln."
@@ -10258,6 +10329,15 @@ msgstr ""
 "nicht erkannter leerer Typ '%s'; gültige Werte sind \"drop\", \"keep\", und "
 "\"ask\"."
 
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges mit einem leeren String-Argument ist veraltet und wird in "
+"einer zukünftigen Version von Git nicht mehr funktionieren. Verwenden Sie "
+"stattdessen --rebase-merges ohne ein Argument, was dasselbe bewirkt."
+
 #, c-format
 msgid ""
 "%s\n"
@@ -10483,20 +10563,23 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "Schalter `C' erwartet einen numerischen Wert."
 
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Unbekannter Modus: %s"
-
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy erfordert --merge oder --interactive"
 
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
 msgstr ""
-"apply-Optionen sind mit rebase.autosquash nicht kompatibel. Erwägen Sie das "
+"apply-Optionen sind mit rebase.autoSquash nicht kompatibel. Erwägen Sie das "
 "Hinzufügen von --no-autosquash"
 
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"apply-Optionen sind nicht kompatibel mit rebase.rebaseMerges. Erwägen Sie "
+"das Hinzufügen von --no-rebase-merges"
+
 msgid ""
 "apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
 "update-refs"
@@ -10541,9 +10624,6 @@ msgstr "'%s': benötige genau eine Merge-Basis"
 msgid "Does not point to a valid commit '%s'"
 msgstr "'%s' zeigt auf keinen gültigen Commit."
 
-msgid "Please commit or stash them."
-msgstr "Bitte committen Sie die Änderungen oder benutzen Sie \"stash\"."
-
 msgid "HEAD is up to date."
 msgstr "HEAD ist aktuell."
 
@@ -11221,8 +11301,8 @@ msgstr "genau wie -a, unerreichbare überflüssige Objekte separat packen"
 msgid "approxidate"
 msgstr "Datumsangabe"
 
-msgid "with -C, expire objects older than this"
-msgstr "mit -C, Objekte älter als angegeben verfallen lassen"
+msgid "with --cruft, expire objects older than this"
+msgstr "mit --cruft, Objekte verfallen lassen, die älter sind als das"
 
 msgid "remove redundant packs, and run git-prune-packed"
 msgstr "redundante Pakete entfernen und \"git-prune-packed\" ausführen"
@@ -11902,6 +11982,9 @@ msgstr ""
 msgid "remote name"
 msgstr "Name des Remote-Repositories"
 
+msgid "push all refs"
+msgstr "alle Referenzen versenden"
+
 msgid "use stateless RPC protocol"
 msgstr "zustandsloses RPC-Protokoll verwenden"
 
@@ -12107,10 +12190,11 @@ msgstr ""
 "Repository befinden"
 
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable"
-"[<Optionen>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<Optionen>]"
 
 msgid "this worktree is not sparse"
 msgstr "dieses Arbeitsverzeichnis ist nicht partiell"
@@ -12241,6 +12325,24 @@ msgstr ""
 msgid "error while refreshing working directory"
 msgstr "Fehler während der Aktualisierung des Arbeitsverzeichnisses."
 
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <Datei>]"
+
+msgid "terminate input and output files by a NUL character"
+msgstr "Eingabe- und Ausgabedateien durch ein NUL-Zeichen abschließen"
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"bei Verwendung mit --rules-file werden die Muster als Cone-Modus Muster "
+"interpretiert"
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "Muster aus <Datei> anstelle der aktuellen Muster verwenden"
+
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<log-Optionen>]"
 
@@ -15181,8 +15283,8 @@ msgstr "Länge für Abkürzung von Commit-IDs außerhalb des Bereichs: %d"
 msgid "bad zlib compression level %d"
 msgstr "ungültiger zlib Komprimierungsgrad %d"
 
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar sollte nur ein Zeichen sein"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar sollte nur ein ASCII-Zeichen sein"
 
 #, c-format
 msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -15299,6 +15401,11 @@ msgstr "Konnte '%s' nicht zu '%s' setzen."
 msgid "invalid section name: %s"
 msgstr "Ungültiger Sektionsname: %s"
 
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"Ausführung mit übermäßig langer Zeile in '%s' bei Zeile %<PRIuMAX> verweigert"
+
 #, c-format
 msgid "missing value for '%s'"
 msgstr "Fehlender Wert für '%s'"
@@ -15980,6 +16087,9 @@ msgstr "einen zusätzlichen Präfix bei jeder Ausgabezeile voranstellen"
 msgid "do not show any source or destination prefix"
 msgstr "keine Quell- oder Ziel-Präfixe anzeigen"
 
+msgid "use default prefixes a/ and b/"
+msgstr "Standardpräfixe a/ und b/ verwenden"
+
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr ""
 "Kontext zwischen Unterschied-Blöcken bis zur angegebenen Anzahl von Zeilen "
@@ -16294,6 +16404,14 @@ msgstr "Konnte Git-Verzeichnis nicht von '%s' nach '%s' migrieren"
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "Hinweis: Warte auf das Schließen der Datei durch Ihren Editor...%c"
 
+#, c-format
+msgid "could not write to '%s'"
+msgstr "Konnte nicht nach '%s' schreiben."
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "Konnte '%s' nicht editieren."
+
 msgid "Filtering content"
 msgstr "Filtere Inhalt"
 
@@ -16590,6 +16708,10 @@ msgstr "-c erwartet einen Konfigurationsstring.\n"
 msgid "no config key given for --config-env\n"
 msgstr "kein Konfigurationsschlüssel für --config-env angegeben\n"
 
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "keine Attributquelle für --attr-source angegeben\n"
+
 #, c-format
 msgid "unknown option: %s\n"
 msgstr "Unbekannte Option: %s\n"
@@ -18303,6 +18425,10 @@ msgstr "konnte '%s' in Paket '%s' bei Offset %<PRIuMAX> nicht finden"
 msgid "unable to get disk usage of '%s'"
 msgstr "Festplattennutzung von '%s' kann nicht abgerufen werden"
 
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "Bitmap-Datei '%s' hat eine ungültige Prüfsumme"
+
 #, c-format
 msgid "mtimes file %s is too small"
 msgstr "mtimes-Datei %s ist zu klein"
@@ -18343,6 +18469,13 @@ msgstr "Reverse-Index-Datei %s hat nicht unterstützte Version %<PRIu32>"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "Reverse-Index-Datei %s hat nicht unterstützte Hash-ID %<PRIu32>"
 
+msgid "invalid checksum"
+msgstr "ungültige Prüfsumme"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "ungültige rev-index Position bei %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
 msgid "cannot both write and verify reverse index"
 msgstr ""
 "Reverse-Index kann nicht gleichzeitig geschrieben und verifiziert werden"
@@ -19071,6 +19204,10 @@ msgstr "nicht erkanntes %%(%s) Argument: %s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "Positive Breitenangabe für %%(align) erwartet"
 
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "erwartetes Format: %%(ahead-behind:<Commit>)"
+
 #, c-format
 msgid "malformed field name: %.*s"
 msgstr "Fehlerhafter Feldname: %.*s"
@@ -19710,10 +19847,6 @@ msgstr "Fehler beim Aktualisieren des Konflikt-Status in '%s'."
 msgid "no remembered resolution for '%s'"
 msgstr "Keine aufgezeichnete Konfliktauflösung für '%s'."
 
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "Kann '%s' nicht löschen."
-
 #, c-format
 msgid "Updated preimage for '%s'"
 msgstr "Preimage für '%s' aktualisiert."
@@ -20052,10 +20185,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "Konnte '%s' nicht sperren"
 
-#, c-format
-msgid "could not write to '%s'"
-msgstr "Konnte nicht nach '%s' schreiben."
-
 #, c-format
 msgid "could not write eol to '%s'"
 msgstr "Konnte EOL nicht nach '%s' schreiben."
@@ -20424,9 +20553,6 @@ msgstr "versuchen Sie \"git cherry-pick (--continue | %s--abort | --quit)\""
 msgid "could not create sequencer directory '%s'"
 msgstr "konnte \"sequencer\"-Verzeichnis '%s' nicht erstellen"
 
-msgid "could not lock HEAD"
-msgstr "konnte HEAD nicht sperren"
-
 msgid "no cherry-pick or revert in progress"
 msgstr "kein \"cherry-pick\" oder \"revert\" im Gange"
 
@@ -20523,20 +20649,20 @@ msgstr ""
 "\n"
 "ausführen.\n"
 
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "Der Index und/oder das Arbeitsverzeichnis wurde geändert.\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "und Änderungen am Index und/oder am Arbeitsverzeichnis vorgenommen.\n"
 
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
 msgstr ""
 "Ausführung erfolgreich: %s\n"
-"Aber Änderungen in Index oder Arbeitsverzeichnis verblieben.\n"
+"Aber es sind Änderungen im Index oder Arbeitsverzeichnis verblieben.\n"
 "Committen Sie Ihre Änderungen oder benutzen Sie \"stash\".\n"
 "Führen Sie dann aus:\n"
 "\n"
@@ -20981,10 +21107,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u Byte/s"
 msgstr[1] "%u Bytes/s"
 
-#, c-format
-msgid "could not edit '%s'"
-msgstr "Konnte '%s' nicht editieren."
-
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
 msgstr "Ignoriere verdächtigen Submodulnamen: %s"
@@ -22794,13 +22916,17 @@ msgid "(%s) Could not execute '%s'"
 msgstr "(%s) Konnte '%s' nicht ausführen"
 
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Füge %s: %s hinzu von: '%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Fehlerhafte Ausgabe von '%s'"
 
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) Fehler beim Schließen der Pipe nach '%s'"
 
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Füge %s: %s hinzu von: '%s'\n"
+
 msgid "cannot send message as 7bit"
 msgstr "kann Nachricht nicht als 7bit versenden"
 
@@ -22837,377 +22963,3 @@ msgstr "Lasse %s mit Backup-Suffix '%s' aus.\n"
 #, perl-format
 msgid "Do you really want to send %s? [y|N]: "
 msgstr "Wollen Sie %s wirklich versenden? [y|N]: "
-
-#~ msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-#~ msgstr "git bisect--helper --bisect-state (bad|new) [<Commit>]"
-
-#~ msgid "won't bisect on cg-seek'ed tree"
-#~ msgstr ""
-#~ "binäre Suche auf einem durch 'cg-seek' geändertem Verzeichnis nicht "
-#~ "möglich"
-
-#~ msgid "--bisect-terms requires 0 or 1 argument"
-#~ msgstr "--bisect-terms benötigt 0 oder 1 Argument"
-
-#~ msgid "--bisect-next requires 0 arguments"
-#~ msgstr "--bisect-next benötigt 0 Argumente"
-
-#~ msgid "--bisect-log requires 0 arguments"
-#~ msgstr "--bisect-log benötigt 0 Argumente"
-
-#~ msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-#~ msgstr "git env--helper --type=[bool|ulong] <Optionen> <Umgebungsvariable>"
-
-#~ msgid "default for git_env_*(...) to fall back on"
-#~ msgstr "Standard für git_env_*(...), um darauf zurückzugreifen"
-
-#~ msgid "be quiet only use git_env_*() value as exit code"
-#~ msgstr ""
-#~ "Ausgaben unterdrücken; nur git_env_*() Werte als Exit-Code verwenden"
-
-#, c-format
-#~ msgid ""
-#~ "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-#~ msgstr ""
-#~ "Option `--default' erwartet einen booleschen Wert bei `--type=bool`, "
-#~ "nicht `%s`"
-
-#, c-format
-#~ msgid ""
-#~ "option `--default' expects an unsigned long value with `--type=ulong`, "
-#~ "not `%s`"
-#~ msgstr ""
-#~ "Option `--default' erwartet einen vorzeichenlosen Long-Wert bei `--"
-#~ "type=ulong`, nicht `%s`"
-
-#, c-format
-#~ msgid "%s doesn't support --super-prefix"
-#~ msgstr "%s unterstützt kein --super-prefix"
-
-#, c-format
-#~ msgid "no prefix given for --super-prefix\n"
-#~ msgstr "Kein Präfix für --super-prefix angegeben.\n"
-
-#, c-format
-#~ msgid "failed to read object %s"
-#~ msgstr "Konnte Objekt %s nicht lesen."
-
-#~ msgid "file write error"
-#~ msgstr "Fehler beim Schreiben einer Datei."
-
-#~ msgid "corrupt commit"
-#~ msgstr "fehlerhafter Commit"
-
-#~ msgid "corrupt tag"
-#~ msgstr "fehlerhaftes Tag"
-
-#, c-format
-#~ msgid "%%(objecttype) does not take arguments"
-#~ msgstr "%%(objecttype) akzeptiert keine Argumente"
-
-#, c-format
-#~ msgid "%%(deltabase) does not take arguments"
-#~ msgstr "%%(deltabase) akzeptiert keine Argumente"
-
-#, c-format
-#~ msgid "%%(body) does not take arguments"
-#~ msgstr "%%(body) akzeptiert keine Argumente"
-
-#, c-format
-#~ msgid "unrecognized email option: %s"
-#~ msgstr "nicht erkannte E-Mail Option: %s"
-
-#, c-format
-#~ msgid ""
-#~ "It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-#~ "may speed it up, but you have to be careful not to forget to add\n"
-#~ "new files yourself (see 'git help status')."
-#~ msgstr ""
-#~ "Es dauerte %.2f Sekunden die unversionierten Dateien zu bestimmen.\n"
-#~ "'status -uno' könnte das beschleunigen, aber Sie müssen darauf achten,\n"
-#~ "neue Dateien selbstständig hinzuzufügen (siehe 'git help status')."
-
-#, perl-format
-#~ msgid "%12s %12s %s"
-#~ msgstr "%28s %25s %s"
-
-#, perl-format
-#~ msgid "touched %d path\n"
-#~ msgid_plural "touched %d paths\n"
-#~ msgstr[0] "%d Pfad angefasst\n"
-#~ msgstr[1] "%d Pfade angefasst\n"
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for staging."
-#~ msgstr ""
-#~ "Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-#~ "Patch-Block direkt zum Hinzufügen zur Staging-Area markiert."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for stashing."
-#~ msgstr ""
-#~ "Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-#~ "Patch-Block direkt zum Hinzufügen zum Stash markiert."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for unstaging."
-#~ msgstr ""
-#~ "Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-#~ "Patch-Block direkt zum Entfernen aus der Staging-Area markiert."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for applying."
-#~ msgstr ""
-#~ "Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-#~ "Patch-Block direkt zum Anwenden markiert."
-
-#~ msgid ""
-#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
-#~ "marked for discarding."
-#~ msgstr ""
-#~ "Wenn der Patch sauber angewendet werden kann, wird der bearbeitete\n"
-#~ "Patch-Block direkt zum Verwerfen markiert."
-
-#, perl-format
-#~ msgid "failed to open hunk edit file for writing: %s"
-#~ msgstr ""
-#~ "Fehler beim Öffnen von Editier-Datei eines Patch-Blocks zum Schreiben: %s"
-
-#, perl-format
-#~ msgid ""
-#~ "---\n"
-#~ "To remove '%s' lines, make them ' ' lines (context).\n"
-#~ "To remove '%s' lines, delete them.\n"
-#~ "Lines starting with %s will be removed.\n"
-#~ msgstr ""
-#~ "---\n"
-#~ "Um '%s' Zeilen zu entfernen, machen Sie aus diesen ' ' Zeilen (Kontext).\n"
-#~ "Um '%s' Zeilen zu entfernen, löschen Sie diese.\n"
-#~ "Zeilen, die mit %s beginnen, werden entfernt.\n"
-
-#, perl-format
-#~ msgid "failed to open hunk edit file for reading: %s"
-#~ msgstr ""
-#~ "Fehler beim Öffnen von Editier-Datei eines Patch-Blocks zum Lesen: %s"
-
-#~ msgid ""
-#~ "y - stage this hunk\n"
-#~ "n - do not stage this hunk\n"
-#~ "q - quit; do not stage this hunk or any of the remaining ones\n"
-#~ "a - stage this hunk and all later hunks in the file\n"
-#~ "d - do not stage this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block zum Commit vormerken\n"
-#~ "n - diesen Patch-Block nicht zum Commit vormerken\n"
-#~ "q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht zum Commit "
-#~ "vormerken\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke dieser Datei zum Commit "
-#~ "vormerken\n"
-#~ "d - diesen oder alle weiteren Patch-Blöcke in dieser Datei nicht zum "
-#~ "Commit vormerken"
-
-#~ msgid ""
-#~ "y - stash this hunk\n"
-#~ "n - do not stash this hunk\n"
-#~ "q - quit; do not stash this hunk or any of the remaining ones\n"
-#~ "a - stash this hunk and all later hunks in the file\n"
-#~ "d - do not stash this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block stashen\n"
-#~ "n - diesen Patch-Block nicht stashen\n"
-#~ "q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht stashen\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke dieser Datei stashen\n"
-#~ "d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht stashen"
-
-#~ msgid ""
-#~ "y - unstage this hunk\n"
-#~ "n - do not unstage this hunk\n"
-#~ "q - quit; do not unstage this hunk or any of the remaining ones\n"
-#~ "a - unstage this hunk and all later hunks in the file\n"
-#~ "d - do not unstage this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block unstashen\n"
-#~ "n - diesen Patch-Block nicht unstashen\n"
-#~ "q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht unstashen\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke dieser Datei unstashen\n"
-#~ "d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht unstashen"
-
-#~ msgid ""
-#~ "y - apply this hunk to index\n"
-#~ "n - do not apply this hunk to index\n"
-#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
-#~ "a - apply this hunk and all later hunks in the file\n"
-#~ "d - do not apply this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block auf den Index anwenden\n"
-#~ "n - diesen Patch-Block nicht auf den Index anwenden\n"
-#~ "q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht auf den "
-#~ "Index anwenden\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke dieser Datei auf den Index "
-#~ "anwenden\n"
-#~ "d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht auf den "
-#~ "Index anwenden"
-
-#~ msgid ""
-#~ "y - discard this hunk from worktree\n"
-#~ "n - do not discard this hunk from worktree\n"
-#~ "q - quit; do not discard this hunk or any of the remaining ones\n"
-#~ "a - discard this hunk and all later hunks in the file\n"
-#~ "d - do not discard this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block im Arbeitsverzeichnis verwerfen\n"
-#~ "n - diesen Patch-Block im Arbeitsverzeichnis nicht verwerfen\n"
-#~ "q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht im "
-#~ "Arbeitsverzeichnis verwerfen\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke dieser Datei im "
-#~ "Arbeitsverzeichnis verwerfen\n"
-#~ "d - diesen oder alle weiteren Patch-Blöcke dieser Datei nicht im "
-#~ "Arbeitsverzeichnis verwerfen"
-
-#~ msgid ""
-#~ "y - discard this hunk from index and worktree\n"
-#~ "n - do not discard this hunk from index and worktree\n"
-#~ "q - quit; do not discard this hunk or any of the remaining ones\n"
-#~ "a - discard this hunk and all later hunks in the file\n"
-#~ "d - do not discard this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block im Index und Arbeitsverzeichnis verwerfen\n"
-#~ "n - diesen Patch-Block nicht im Index und Arbeitsverzeichnis verwerfen\n"
-#~ "q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht im Index "
-#~ "und Arbeitsverzeichnis verwerfen\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke in der Datei verwerfen\n"
-#~ "d - diesen oder alle weiteren Patch-Blöcke in der Datei nicht verwerfen"
-
-#~ msgid ""
-#~ "y - apply this hunk to index and worktree\n"
-#~ "n - do not apply this hunk to index and worktree\n"
-#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
-#~ "a - apply this hunk and all later hunks in the file\n"
-#~ "d - do not apply this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block im Index und auf Arbeitsverzeichnis anwenden\n"
-#~ "n - diesen Patch-Block nicht im Index und auf Arbeitsverzeichnis "
-#~ "anwenden\n"
-#~ "q - Beenden; diesen oder alle verbleibenden Patch-Blöcke nicht anwenden\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke in der Datei anwenden\n"
-#~ "d - diesen oder alle weiteren Patch-Blöcke in der Datei nicht anwenden"
-
-#~ msgid ""
-#~ "y - apply this hunk to worktree\n"
-#~ "n - do not apply this hunk to worktree\n"
-#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
-#~ "a - apply this hunk and all later hunks in the file\n"
-#~ "d - do not apply this hunk or any of the later hunks in the file"
-#~ msgstr ""
-#~ "y - diesen Patch-Block auf das Arbeitsverzeichnis anwenden\n"
-#~ "n - diesen Patch-Block nicht auf das Arbeitsverzeichnis anwenden\n"
-#~ "q - Beenden; diesen und alle verbleibenden Patch-Blöcke nicht anwenden\n"
-#~ "a - diesen und alle weiteren Patch-Blöcke in der Datei anwenden\n"
-#~ "d - diesen und alle weiteren Patch-Blöcke in der Datei nicht anwenden"
-
-#~ msgid ""
-#~ "g - select a hunk to go to\n"
-#~ "/ - search for a hunk matching the given regex\n"
-#~ "j - leave this hunk undecided, see next undecided hunk\n"
-#~ "J - leave this hunk undecided, see next hunk\n"
-#~ "k - leave this hunk undecided, see previous undecided hunk\n"
-#~ "K - leave this hunk undecided, see previous hunk\n"
-#~ "s - split the current hunk into smaller hunks\n"
-#~ "e - manually edit the current hunk\n"
-#~ "? - print help\n"
-#~ msgstr ""
-#~ "g - Patch-Block zum Hinspringen auswählen\n"
-#~ "/ - nach Patch-Block suchen, der gegebenem regulärem Ausdruck entspricht\n"
-#~ "j - diesen Patch-Block unbestimmt lassen, nächsten unbestimmten Patch-"
-#~ "Block anzeigen\n"
-#~ "J - diesen Patch-Block unbestimmt lassen, nächsten Patch-Block anzeigen\n"
-#~ "k - diesen Patch-Block unbestimmt lassen, vorherigen unbestimmten Patch-"
-#~ "Block anzeigen\n"
-#~ "K - diesen Patch-Block unbestimmt lassen, vorherigen Patch-Block "
-#~ "anzeigen\n"
-#~ "s - aktuellen Patch-Block in kleinere Patch-Blöcke aufteilen\n"
-#~ "e - aktuellen Patch-Block manuell editieren\n"
-#~ "? - Hilfe anzeigen\n"
-
-#~ msgid "The selected hunks do not apply to the index!\n"
-#~ msgstr ""
-#~ "Die ausgewählten Patch-Blöcke können nicht auf den Index angewendet "
-#~ "werden!\n"
-
-#, perl-format
-#~ msgid "ignoring unmerged: %s\n"
-#~ msgstr "ignoriere nicht zusammengeführte Datei: %s\n"
-
-#~ msgid "No other hunks to goto\n"
-#~ msgstr "Keine anderen Patch-Blöcke verbleibend\n"
-
-#, perl-format
-#~ msgid "Invalid number: '%s'\n"
-#~ msgstr "Ungültige Nummer: '%s'\n"
-
-#, perl-format
-#~ msgid "Sorry, only %d hunk available.\n"
-#~ msgid_plural "Sorry, only %d hunks available.\n"
-#~ msgstr[0] "Entschuldigung, nur %d Patch-Block verfügbar.\n"
-#~ msgstr[1] "Entschuldigung, nur %d Patch-Blöcke verfügbar.\n"
-
-#~ msgid "No other hunks to search\n"
-#~ msgstr "Keine anderen Patch-Blöcke zum Durchsuchen\n"
-
-#, perl-format
-#~ msgid "Malformed search regexp %s: %s\n"
-#~ msgstr "Fehlerhafter regulärer Ausdruck für Suche %s: %s\n"
-
-#~ msgid "No hunk matches the given pattern\n"
-#~ msgstr "Kein Patch-Block entspricht dem angegebenen Muster\n"
-
-#~ msgid "No previous hunk\n"
-#~ msgstr "Kein vorheriger Patch-Block\n"
-
-#~ msgid "No next hunk\n"
-#~ msgstr "Kein folgender Patch-Block\n"
-
-#~ msgid "Sorry, cannot split this hunk\n"
-#~ msgstr "Entschuldigung, kann diesen Patch-Block nicht aufteilen.\n"
-
-#, perl-format
-#~ msgid "Split into %d hunk.\n"
-#~ msgid_plural "Split into %d hunks.\n"
-#~ msgstr[0] "In %d Patch-Block aufgeteilt.\n"
-#~ msgstr[1] "In %d Patch-Blöcke aufgeteilt.\n"
-
-#~ msgid "Sorry, cannot edit this hunk\n"
-#~ msgstr "Entschuldigung, kann diesen Patch-Block nicht bearbeiten.\n"
-
-#~ msgid ""
-#~ "status        - show paths with changes\n"
-#~ "update        - add working tree state to the staged set of changes\n"
-#~ "revert        - revert staged set of changes back to the HEAD version\n"
-#~ "patch         - pick hunks and update selectively\n"
-#~ "diff          - view diff between HEAD and index\n"
-#~ "add untracked - add contents of untracked files to the staged set of "
-#~ "changes\n"
-#~ msgstr ""
-#~ "status        - Pfade mit Änderungen anzeigen\n"
-#~ "update        - Zustand des Arbeitsverzeichnisses den zum Commit "
-#~ "vorgemerkten Änderungen hinzufügen\n"
-#~ "revert        - zum Commit vorgemerkte Änderungen auf HEAD Version "
-#~ "zurücksetzen\n"
-#~ "patch         - Patch-Blöcke auswählen und selektiv aktualisieren\n"
-#~ "diff          - Unterschiede zwischen HEAD und Index anzeigen\n"
-#~ "add untracked - Inhalte von unversionierten Dateien zum Commit vormerken\n"
-
-#~ msgid "missing --"
-#~ msgstr "-- fehlt"
-
-#, perl-format
-#~ msgid "unknown --patch mode: %s"
-#~ msgstr "Unbekannter --patch Modus: %s"
-
-#, perl-format
-#~ msgid "invalid argument %s, expecting --"
-#~ msgstr "ungültiges Argument %s, erwarte --"
index f032441614dfecc3848cea6f314588cb7bebd797..db6efc02508fc47815f485b99f1c7d1256cc396d 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -78,8 +78,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: git\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-01 01:20+0000\n"
-"PO-Revision-Date: 2023-03-02 18:44+0100\n"
+"POT-Creation-Date: 2023-05-20 12:25+0200\n"
+"PO-Revision-Date: 2023-05-18 18:50+0200\n"
 "Last-Translator: Cédric Malard <c.malard-git@valdun.net>\n"
 "Language-Team: Jean-Noël Avila <jn.avila@free.fr>\n"
 "Language: fr\n"
@@ -739,6 +739,24 @@ msgstr "Veuillez valider vos changements avant de fusionner."
 msgid "Exiting because of unfinished merge."
 msgstr "Abandon à cause d'une fusion non terminée."
 
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Des branches divergentes ne peuvent pas être gérées en avance rapide, vous "
+"devez soit :\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"ou :\n"
+"\n"
+"\tgit rebase\n"
+
 msgid "Not possible to fast-forward, aborting."
 msgstr "Pas possible d'avancer rapidement, abandon."
 
@@ -1199,6 +1217,10 @@ msgstr "troncature du nom de fichier .rej en %.*s.rej"
 msgid "cannot open %s"
 msgstr "impossible d'ouvrir %s"
 
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "impossible de délier '%s'"
+
 #, c-format
 msgid "Hunk #%d applied cleanly."
 msgstr "Section n°%d appliquée proprement."
@@ -1390,6 +1412,12 @@ msgstr "git archive --remote <dépôt> [--exec <commande>] --list"
 msgid "cannot read '%s'"
 msgstr "impossible de lire '%s'"
 
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+"le spécificateur de chemin '%s' correspond à des fichiers hors du répertoire "
+"actuel"
+
 #, c-format
 msgid "pathspec '%s' did not match any files"
 msgstr "le chemin '%s' ne correspond à aucun fichier"
@@ -1406,9 +1434,6 @@ msgstr "nom d'objet invalide : %s"
 msgid "not a tree object: %s"
 msgstr "objet arbre invalide : %s"
 
-msgid "current working directory is untracked"
-msgstr "l'arbre de travail actuel est non-suivi"
-
 #, c-format
 msgid "File not found: %s"
 msgstr "Fichier non trouvé : %s"
@@ -1535,6 +1560,9 @@ msgstr "fichier gitattributes trop gros ignoré '%s'"
 msgid "ignoring overly large gitattributes blob '%s'"
 msgstr "blob gitattributes trop gros ignoré '%s'"
 
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "mauvais --attr-source ou GIT_ATTR_SOURCE"
+
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
 msgstr "Contenu mal cité dans le fichier '%s' : %s"
@@ -1641,9 +1669,6 @@ msgstr[1] "Bissection : %d révisions à tester après ceci %s\n"
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents et --reverse ne font pas bon ménage."
 
-msgid "cannot use --contents with final commit object name"
-msgstr "on ne peut pas utiliser --contents avec un nom d'objet commit final"
-
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr ""
 "--reverse et --first-parent ensemble nécessitent la spécification d'un "
@@ -1827,10 +1852,6 @@ msgstr "sous-module '%s' : impossible de créer la branche '%s'"
 msgid "'%s' is already checked out at '%s'"
 msgstr "'%s' est déjà extrait dans '%s'"
 
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "la HEAD de la copie de travail %s n'est pas mise à jour"
-
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<options>] [--] <chemin>..."
 
@@ -2888,6 +2909,14 @@ msgstr "Impossible de supprimer la branche '%s' extraite dans '%s'"
 msgid "remote-tracking branch '%s' not found."
 msgstr "branche de suivi '%s' non trouvée."
 
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"branche '%s' non trouvée.\n"
+"Avez-vous oublié --remote ?"
+
 #, c-format
 msgid "branch '%s' not found."
 msgstr "branche '%s' non trouvée."
@@ -2918,6 +2947,10 @@ msgstr "La branche %s est en cours de rebasage sur %s"
 msgid "Branch %s is being bisected at %s"
 msgstr "La branche %s est en cours de bissection sur %s"
 
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "la HEAD de la copie de travail %s n'est pas mise à jour"
+
 #, c-format
 msgid "Invalid branch name: '%s'"
 msgstr "Nom de branche invalide : '%s'"
@@ -3022,6 +3055,9 @@ msgstr "déplacer/renommer une branche et son reflog"
 msgid "move/rename a branch, even if target exists"
 msgstr "déplacer/renommer une branche, même si la cible existe"
 
+msgid "do not output a newline after empty formatted refs"
+msgstr "ne pas générer de nouvelle ligne après des réfs formatées vides"
+
 msgid "copy a branch and its reflog"
 msgstr "copier une branche et son reflog"
 
@@ -3247,13 +3283,11 @@ msgid "Created new report at '%s'.\n"
 msgstr "Nouveau rapport créé à '%s'.\n"
 
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
-"                  [--version=<version>] <file> <args-de-git-rev-list>"
+"git bundle create [-q | --quiet | --progress]\n"
+"                  [--version=<version>] <fichier> <args-de-git-rev-list>"
 
 msgid "git bundle verify [-q | --quiet] <file>"
 msgstr "git bundle verify [-q | --quiet] <fichier>"
@@ -3273,11 +3307,11 @@ msgstr "ne pas afficher la barre de progression"
 msgid "show progress meter"
 msgstr "afficher la barre de progression"
 
-msgid "show progress meter during object writing phase"
-msgstr "afficher la barre de progression durant la phase d'écrite des objets"
+msgid "historical; same as --progress"
+msgstr "option historique ; identique à --progress"
 
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "similaire à --all-progress quand la barre de progression est affichée"
+msgid "historical; does nothing"
+msgstr "option historique ; ne fait rien"
 
 msgid "specify bundle format version"
 msgstr "spécifier la version du format de colis"
@@ -4300,6 +4334,10 @@ msgstr "échec du stat de '%s'"
 msgid "%s exists and is not a directory"
 msgstr "%s existe et n'est pas un répertoire"
 
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' est un lien symbolique, refus de cloner avec --local"
+
 #, c-format
 msgid "failed to start iterator over '%s'"
 msgstr "échec du démarrage un itérateur sur '%s'"
@@ -5841,122 +5879,13 @@ msgstr "git fetch --all [<options>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel ne peut pas être négatif"
 
-msgid "fetch from all remotes"
-msgstr "récupérer depuis tous les dépôts distants"
-
-msgid "set upstream for git pull/fetch"
-msgstr "définir la branche amont pour git pull/fetch"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "ajouter à .git/FETCH_HEAD au lieu de l'écraser"
-
-msgid "use atomic transaction to update references"
-msgstr "utiliser une transaction atomique pour mettre à jour les références"
-
-msgid "path to upload pack on remote end"
-msgstr "chemin vers lequel télécharger le paquet sur le poste distant"
-
-msgid "force overwrite of local reference"
-msgstr "forcer l'écrasement de la branche locale"
-
-msgid "fetch from multiple remotes"
-msgstr "récupérer depuis plusieurs dépôts distants"
-
-msgid "fetch all tags and associated objects"
-msgstr "récupérer toutes les étiquettes et leurs objets associés"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "ne pas récupérer toutes les étiquettes (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "nombre de sous-modules récupérés en parallèle"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifier le spécificateur de référence pour placer les références dans refs/"
-"prefetch/"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr ""
-"élaguer les branches de suivi distant si la branche n'existe plus dans le "
-"dépôt distant"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"élaguer les étiquettes locales qui ont disparu du dépôt distant et qui "
-"encombrent les étiquettes modifiées"
-
-msgid "on-demand"
-msgstr "à la demande"
-
-msgid "control recursive fetching of submodules"
-msgstr "contrôler la récupération récursive dans les sous-modules"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "écrire les références récupérées dans le fichier FETCH_HEAD"
-
-msgid "keep downloaded pack"
-msgstr "conserver le paquet téléchargé"
-
-msgid "allow updating of HEAD ref"
-msgstr "permettre la mise à jour de la référence HEAD"
-
-msgid "deepen history of shallow clone"
-msgstr "approfondir l'historique d'un clone superficiel"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "approfondir l'historique d'un clone superficiel en fonction d'une date"
-
-msgid "convert to a complete repository"
-msgstr "convertir en un dépôt complet"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "re-récupérer sans négocier les commits communs"
-
-msgid "prepend this to submodule path output"
-msgstr "préfixer ceci à la sortie du chemin du sous-module"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"par défaut pour la récupération récursive de sous-modules (priorité plus "
-"basse que les fichiers de config)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "accepter les références qui mettent à jour .git/shallow"
-
-msgid "refmap"
-msgstr "correspondance de référence"
-
-msgid "specify fetch refmap"
-msgstr "spécifier une correspondance de référence pour la récupération"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "rapporte que nous n'avons que des objets joignables depuis cet objet"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"ne pas récupérer le fichier paquet ; à la place, afficher les ancêtres des "
-"sommets de négociation"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "lancer 'maintenance --auto' après la récupération"
-
-msgid "check for forced-updates on all updated branches"
-msgstr ""
-"vérifier les mises à jour forcées (forced-updates) sur toutes les branches "
-"mises à jour"
-
-msgid "write the commit-graph after fetching"
-msgstr "écrire le graphe de commits après le rapatriement"
-
-msgid "accept refspecs from stdin"
-msgstr "lire les spécificateurs de référence depuis l'entrée standard"
-
 msgid "couldn't find remote ref HEAD"
 msgstr "impossible de trouver la référence HEAD distante"
 
+#, c-format
+msgid "From %.*s\n"
+msgstr "Depuis %.*s\n"
+
 #, c-format
 msgid "object %s not found"
 msgstr "objet %s non trouvé"
@@ -6028,10 +5957,6 @@ msgstr ""
 "%s rejeté parce que les  mises à jour de racines superficielles ne sont pas "
 "permises"
 
-#, c-format
-msgid "From %.*s\n"
-msgstr "Depuis %.*s\n"
-
 #, c-format
 msgid ""
 "some local refs could not be updated; try running\n"
@@ -6123,6 +6048,119 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "Vous devez spécifier un nom d'étiquette"
 
+msgid "fetch from all remotes"
+msgstr "récupérer depuis tous les dépôts distants"
+
+msgid "set upstream for git pull/fetch"
+msgstr "définir la branche amont pour git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "ajouter à .git/FETCH_HEAD au lieu de l'écraser"
+
+msgid "use atomic transaction to update references"
+msgstr "utiliser une transaction atomique pour mettre à jour les références"
+
+msgid "path to upload pack on remote end"
+msgstr "chemin vers lequel télécharger le paquet sur le poste distant"
+
+msgid "force overwrite of local reference"
+msgstr "forcer l'écrasement de la branche locale"
+
+msgid "fetch from multiple remotes"
+msgstr "récupérer depuis plusieurs dépôts distants"
+
+msgid "fetch all tags and associated objects"
+msgstr "récupérer toutes les étiquettes et leurs objets associés"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "ne pas récupérer toutes les étiquettes (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "nombre de sous-modules récupérés en parallèle"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifier le spécificateur de référence pour placer les références dans refs/"
+"prefetch/"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr ""
+"élaguer les branches de suivi distant si la branche n'existe plus dans le "
+"dépôt distant"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"élaguer les étiquettes locales qui ont disparu du dépôt distant et qui "
+"encombrent les étiquettes modifiées"
+
+msgid "on-demand"
+msgstr "à la demande"
+
+msgid "control recursive fetching of submodules"
+msgstr "contrôler la récupération récursive dans les sous-modules"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "écrire les références récupérées dans le fichier FETCH_HEAD"
+
+msgid "keep downloaded pack"
+msgstr "conserver le paquet téléchargé"
+
+msgid "allow updating of HEAD ref"
+msgstr "permettre la mise à jour de la référence HEAD"
+
+msgid "deepen history of shallow clone"
+msgstr "approfondir l'historique d'un clone superficiel"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "approfondir l'historique d'un clone superficiel en fonction d'une date"
+
+msgid "convert to a complete repository"
+msgstr "convertir en un dépôt complet"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "re-récupérer sans négocier les commits communs"
+
+msgid "prepend this to submodule path output"
+msgstr "préfixer ceci à la sortie du chemin du sous-module"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"par défaut pour la récupération récursive de sous-modules (priorité plus "
+"basse que les fichiers de config)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "accepter les références qui mettent à jour .git/shallow"
+
+msgid "refmap"
+msgstr "correspondance de référence"
+
+msgid "specify fetch refmap"
+msgstr "spécifier une correspondance de référence pour la récupération"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "rapporte que nous n'avons que des objets joignables depuis cet objet"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"ne pas récupérer le fichier paquet ; à la place, afficher les ancêtres des "
+"sommets de négociation"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "lancer 'maintenance --auto' après la récupération"
+
+msgid "check for forced-updates on all updated branches"
+msgstr ""
+"vérifier les mises à jour forcées (forced-updates) sur toutes les branches "
+"mises à jour"
+
+msgid "write the commit-graph after fetching"
+msgstr "écrire le graphe de commits après le rapatriement"
+
+msgid "accept refspecs from stdin"
+msgstr "lire les spécificateurs de référence depuis l'entrée standard"
+
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only nécessite au moins un --negotiation-tip=*"
 
@@ -6238,6 +6276,12 @@ msgstr "afficher seulement les références qui contiennent le commit"
 msgid "print only refs which don't contain the commit"
 msgstr "afficher seulement les références qui ne contiennent pas le commit"
 
+msgid "read reference patterns from stdin"
+msgstr "lire les motifs de références depuis l'entrée standard"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "arguments inconnus fournis avec l'option --stdin"
+
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<config> [--] <arguments>"
 
@@ -6250,6 +6294,10 @@ msgstr "clé de config qui stocke la liste des chemins de dépôts"
 msgid "missing --config=<config>"
 msgstr "--config=<config> manquant"
 
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "config incorrecte --config=%s"
+
 msgid "unknown"
 msgstr "inconnu"
 
@@ -6396,19 +6444,28 @@ msgstr "%s : la HEAD détachée ne pointe sur rien"
 msgid "notice: %s points to an unborn branch (%s)"
 msgstr "note : %s pointe sur une branche non-née (%s)"
 
-msgid "Checking cache tree"
-msgstr "Vérification de l'arbre cache"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Vérification de l'arbre cache de %s"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s : pointer sha1 invalide dans l'arbre de cache"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s : pointer sha1 invalide dans l'arbre de cache de %s"
 
 msgid "non-tree in cache-tree"
 msgstr "non-arbre dans l'arbre de cache"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s : pointeur sha1 invalide dans resolve-undo"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s : pointeur sha1 invalide dans resolve-undo de %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "impossible de charger le rev-index pour le paquet '%s'"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "rev-index invalide pour le paquet '%s'"
 
 msgid ""
 "git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
@@ -9321,6 +9378,12 @@ msgstr "version d'index non supportée %s"
 msgid "bad index version '%s'"
 msgstr "mauvaise version d'index '%s'"
 
+msgid "show progress meter during object writing phase"
+msgstr "afficher la barre de progression durant la phase d'écrite des objets"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "similaire à --all-progress quand la barre de progression est affichée"
+
 msgid "<version>[,<offset>]"
 msgstr "<version>[,<décalage>]"
 
@@ -9518,6 +9581,9 @@ msgstr ""
 "sur la ligne de commande pour nous avertir par\n"
 "un courriel à <git@vger.kernel.org>. Merci.\n"
 
+msgid "refusing to run without --i-still-use-this"
+msgstr "refus de lancer sans --i-still-use-this"
+
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
 
@@ -9694,8 +9760,8 @@ msgstr ""
 msgid "pull with rebase"
 msgstr "tirer avec un rebasage"
 
-msgid "please commit or stash them."
-msgstr "veuillez les valider ou les remiser."
+msgid "Please commit or stash them."
+msgstr "Veuillez les valider ou les remiser."
 
 #, c-format
 msgid ""
@@ -9946,8 +10012,8 @@ msgstr "valeur invalide pour '%s'"
 msgid "repository"
 msgstr "dépôt"
 
-msgid "push all refs"
-msgstr "pousser toutes les références"
+msgid "push all branches"
+msgstr "pousser toutes les branches"
 
 msgid "mirror all refs"
 msgstr "refléter toutes les références"
@@ -9955,9 +10021,10 @@ msgstr "refléter toutes les références"
 msgid "delete refs"
 msgstr "supprimer les références"
 
-msgid "push tags (can't be used with --all or --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
 msgstr ""
-"pousser les étiquettes (ne peut pas être utilisé avec --all ou --mirror)"
+"pousser les étiquettes (ne peut pas être utilisé avec --all, --branches ou --"
+"mirror)"
 
 msgid "force updates"
 msgstr "forcer les mises à jour"
@@ -10224,6 +10291,10 @@ msgstr ""
 "\n"
 "Résultat, git ne peut pas les rebaser."
 
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Mode de rebase-merges inconnu : %s"
+
 #, c-format
 msgid "could not switch to %s"
 msgstr "impossible de basculer vers %s"
@@ -10240,6 +10311,15 @@ msgstr ""
 "type vide non connu '%s' ; les valeurs valides sont \"drop\" (abandonner), "
 "\"keep\" (garder) et \"ask\" (demander)."
 
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges avec un argument chaîne vide est obsolète et cessera de "
+"fonctionner dans une version future de Git. Utilisez à la place --rebase-"
+"merges sans argument, qui a le même effet."
+
 #, c-format
 msgid ""
 "%s\n"
@@ -10460,20 +10540,23 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "l'option `C' attend un valeur numérique"
 
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Mode inconnu : %s"
-
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy requiert --merge ou --interactive"
 
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
 msgstr ""
-"les options d'application sont incompatibles avec rebase.autosquash. "
+"les options d'application sont incompatibles avec rebase.autoSquash. "
 "Considérez l'ajout de --no-autosquash"
 
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"les options d'application sont incompatibles avec rebase.rebaseMerges. "
+"Considérez l'ajout de --no-rebase-merges"
+
 msgid ""
 "apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
 "update-refs"
@@ -10518,9 +10601,6 @@ msgstr "'%s': exactement une base de fusion nécessaire"
 msgid "Does not point to a valid commit '%s'"
 msgstr "Ne pointe pas sur une validation valide : '%s'"
 
-msgid "Please commit or stash them."
-msgstr "Veuillez les valider ou les remiser."
-
 msgid "HEAD is up to date."
 msgstr "HEAD est à jour."
 
@@ -11197,8 +11277,8 @@ msgstr ""
 msgid "approxidate"
 msgstr "date approximative"
 
-msgid "with -C, expire objects older than this"
-msgstr "avec -C, faire expirer les objets plus vieux que celui-ci"
+msgid "with --cruft, expire objects older than this"
+msgstr "avec --cruft, faire expirer les objets plus vieux que celui-ci"
 
 msgid "remove redundant packs, and run git-prune-packed"
 msgstr "supprimer les paquets redondants et lancer git-prune-packed"
@@ -11871,6 +11951,9 @@ msgstr ""
 msgid "remote name"
 msgstr "nom distant"
 
+msgid "push all refs"
+msgstr "pousser toutes les références"
+
 msgid "use stateless RPC protocol"
 msgstr "utiliser un protocole RPC sans état"
 
@@ -12081,9 +12164,11 @@ msgstr ""
 "local"
 
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 
 msgid "this worktree is not sparse"
 msgstr "cet arbre de travail n'est pas clairsemé"
@@ -12213,6 +12298,24 @@ msgstr ""
 msgid "error while refreshing working directory"
 msgstr "erreur lors du rafraîchissement du répertoire de travail"
 
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <fichier>]"
+
+msgid "terminate input and output files by a NUL character"
+msgstr "terminer les fichiers en entrée et en sortie par un caractère NUL"
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"quand utilisé avec --rules-file, interpréter les motifs comme des motifs en "
+"mode cone"
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "utiliser les motifs dans <fichier> plutôt que les actuels."
+
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<options-de-log>]"
 
@@ -12419,7 +12522,7 @@ msgid "stash staged changes only"
 msgstr "remiser seulement les modifications indexées"
 
 msgid "stash in patch mode"
-msgstr "remiser une mode rustine"
+msgstr "remiser en mode rustine"
 
 msgid "quiet mode"
 msgstr "mode silencieux"
@@ -15146,8 +15249,8 @@ msgstr "longueur d'abbrev hors plage : %d"
 msgid "bad zlib compression level %d"
 msgstr "niveau de compression zlib incorrect %d"
 
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar ne devrait être qu'un unique caractère"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar ne devrait être qu'un unique caractère ASCII"
 
 #, c-format
 msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -15261,6 +15364,12 @@ msgstr "impossible de régler '%s' à '%s'"
 msgid "invalid section name: %s"
 msgstr "nom de section invalide : %s"
 
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"refus de travailler avec des lignes trop longues dans '%s' à la ligne "
+"%<PRIuMAX>"
+
 #, c-format
 msgid "missing value for '%s'"
 msgstr "valeur manquante pour '%s'"
@@ -15950,6 +16059,9 @@ msgstr "préfixer toutes les lignes en sortie avec la chaîne indiquée"
 msgid "do not show any source or destination prefix"
 msgstr "n'afficher aucun préfixe, ni de source, ni de destination"
 
+msgid "use default prefixes a/ and b/"
+msgstr "utiliser les préfixes par défaut a/ et b/"
+
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr ""
 "afficher le contexte entre les sections à concurrence du nombre de ligne "
@@ -16271,6 +16383,14 @@ msgstr ""
 "suggestion : en attente de la fermeture du fichier par votre éditeur de "
 "texte…%c"
 
+#, c-format
+msgid "could not write to '%s'"
+msgstr "impossible d'écrire dans '%s'"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "impossible d'éditer '%s'"
+
 msgid "Filtering content"
 msgstr "Filtrage du contenu"
 
@@ -16569,6 +16689,10 @@ msgstr "-c requiert une chaîne de configuration\n"
 msgid "no config key given for --config-env\n"
 msgstr "aucune clé de configuration fournie pour --config-env\n"
 
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "aucune source d'attribut fournie pour --attr-source\n"
+
 #, c-format
 msgid "unknown option: %s\n"
 msgstr "option inconnue : %s\n"
@@ -18264,6 +18388,10 @@ msgstr "impossible de trouver '%s' dans le paquet '%s' à l'offset %<PRIuMAX>"
 msgid "unable to get disk usage of '%s'"
 msgstr "impossible de récupérer l'utilisation du disque de '%s'"
 
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "le fichier bitmap '%s' a une somme de contrôle invalide"
+
 #, c-format
 msgid "mtimes file %s is too small"
 msgstr "le fichier de mtimes %s est trop petit"
@@ -18304,6 +18432,13 @@ msgstr "le fichier d'index inverse %s a une version non gérée %<PRIu32>"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "le fichier d'index inverse %s a un id d'empreinte non géré %<PRIu32>"
 
+msgid "invalid checksum"
+msgstr "somme de contrôle invalide"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "position de rev-index invalide à %<PRIu64> : %<PRIu32> != %<PRIu32>"
+
 msgid "cannot both write and verify reverse index"
 msgstr "impossible de lire et vérifier à la fois l'index inverse"
 
@@ -19037,6 +19172,10 @@ msgstr "argument %%(%s) non reconnu : %s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "valeur positive attendue avec l'atome %%(align)"
 
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "format attendu : %%(ahead-behind:<commit-esque>)"
+
 #, c-format
 msgid "malformed field name: %.*s"
 msgstr "nom de champ malformé %.*s"
@@ -19671,10 +19810,6 @@ msgstr "échec de la mise à jour de l'état en conflit dans '%s'"
 msgid "no remembered resolution for '%s'"
 msgstr "aucune résolution enregistrée pour '%s'"
 
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "impossible de délier '%s'"
-
 #, c-format
 msgid "Updated preimage for '%s'"
 msgstr "Pré-image mise à jour pour '%s'"
@@ -20013,10 +20148,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "impossible de verrouiller '%s'"
 
-#, c-format
-msgid "could not write to '%s'"
-msgstr "impossible d'écrire dans '%s'"
-
 #, c-format
 msgid "could not write eol to '%s'"
 msgstr "impossible d'écrire la fin de ligne dans '%s'"
@@ -20382,9 +20513,6 @@ msgstr "essayez \"git cherry-pick (--continue | %s--abort | --quit)\""
 msgid "could not create sequencer directory '%s'"
 msgstr "impossible de créer le répertoire de séquenceur '%s'"
 
-msgid "could not lock HEAD"
-msgstr "impossible de verrouiller HEAD"
-
 msgid "no cherry-pick or revert in progress"
 msgstr "aucun picorage ou retour en cours"
 
@@ -20480,20 +20608,20 @@ msgstr ""
 "git rebase --continue\n"
 "\n"
 
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "et a mis à jour l'index ou l'arbre de travail\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "et a mis à jour l'index ou l'arbre de travail.\n"
 
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
 msgstr ""
 "l'exécution a réussi : %s\n"
-"mais a laissé des modifications dans l'index ou la copie de travail\n"
+"mais a laissé des modifications dans l'index ou la copie de travail.\n"
 "Validez ou remisez vos modification, puis lancez\n"
 "\n"
 "  git rebase --continue\n"
@@ -20936,10 +21064,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u octet/s"
 msgstr[1] "%u octets/s"
 
-#, c-format
-msgid "could not edit '%s'"
-msgstr "impossible d'éditer '%s'"
-
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
 msgstr "nom de sous-module suspicieux %s ignoré"
@@ -22698,13 +22822,17 @@ msgid "(%s) Could not execute '%s'"
 msgstr "(%s) Impossible d'exécuter '%s'"
 
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Ajout de %s : %s depuis : '%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Sortie malformée depuis '%s'"
 
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) échec de la fermeture du pipe vers '%s'"
 
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Ajout de %s : %s depuis : '%s'\n"
+
 msgid "cannot send message as 7bit"
 msgstr "impossible d'envoyer un message comme 7bit"
 
@@ -22741,3 +22869,19 @@ msgstr "%s sauté avec un suffix de sauvegarde '%s'.\n"
 #, perl-format
 msgid "Do you really want to send %s? [y|N]: "
 msgstr "Souhaitez-vous réellement envoyer %s ?[y|N] : "
+
+#~ msgid "current working directory is untracked"
+#~ msgstr "l'arbre de travail actuel est non-suivi"
+
+#~ msgid "cannot use --contents with final commit object name"
+#~ msgstr "on ne peut pas utiliser --contents avec un nom d'objet commit final"
+
+#~ msgid "please commit or stash them."
+#~ msgstr "veuillez les valider ou les remiser."
+
+#, c-format
+#~ msgid "Unknown mode: %s"
+#~ msgstr "Mode inconnu : %s"
+
+#~ msgid "could not lock HEAD"
+#~ msgstr "impossible de verrouiller HEAD"
index e468b6d9b82445b1eaea1dfe238d8920c0f9d5b0..ccd38422c752e45022d2fda60c4231f13f98d845 100644 (file)
--- a/po/id.po
+++ b/po/id.po
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Git\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-02 15:18+0700\n"
-"PO-Revision-Date: 2023-03-02 17:52+0700\n"
+"POT-Creation-Date: 2023-05-19 19:57+0000\n"
+"PO-Revision-Date: 2023-05-22 15:24+0700\n"
 "Last-Translator: Bagas Sanjaya <bagasdotme@gmail.com>\n"
 "Language-Team: Indonesian\n"
 "Language: id\n"
@@ -792,6 +792,25 @@ msgstr "Mohon komit perubahan Anda sebelum menggabungkan."
 msgid "Exiting because of unfinished merge."
 msgstr "Keluar karena penggabungan belum selesai."
 
+#: advice.c
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Cabang yang menyebar tidak dapat dimajucepatkan, Anda perlu salah satu "
+"dari:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"atau:\n"
+"\n"
+"\tgit rebase\n"
+
 #: advice.c
 msgid "Not possible to fast-forward, aborting."
 msgstr "Tidak mungkin untuk maju cepat, batalkan."
@@ -1339,6 +1358,11 @@ msgstr "memotong nama berkas .rej ke %.*s.rej"
 msgid "cannot open %s"
 msgstr "tidak dapat membuka %s"
 
+#: apply.c rerere.c
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "tidak dapat batal taut '%s'"
+
 #: apply.c
 #, c-format
 msgid "Hunk #%d applied cleanly."
@@ -1579,6 +1603,11 @@ msgstr "git archive --remote <repo> [--exec <perintah>] --list"
 msgid "cannot read '%s'"
 msgstr "tidak dapat membaca '%s'"
 
+#: archive.c
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "spek jalur '%s' mencocoki berkas di luar direktori saat ini"
+
 #: archive.c builtin/add.c builtin/rm.c
 #, c-format
 msgid "pathspec '%s' did not match any files"
@@ -1599,10 +1628,6 @@ msgstr "bukan nama objek valid: %s"
 msgid "not a tree object: %s"
 msgstr "bukan objek pohon: %s"
 
-#: archive.c
-msgid "current working directory is untracked"
-msgstr "direktori kerja saat ini tak terlacak"
-
 #: archive.c
 #, c-format
 msgid "File not found: %s"
@@ -1771,6 +1796,10 @@ msgstr "mengabaikan berkas gitattributes yang terlalu besar '%s'"
 msgid "ignoring overly large gitattributes blob '%s'"
 msgstr "mengabaikan blob gitattributes '%s' yang terlalu besar"
 
+#: attr.c
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "--attr-source atau GIT_ATTR_SOURCE jelek"
+
 #: bisect.c
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
@@ -1894,18 +1923,14 @@ msgstr[1] "Membagi dua: %d revisi tersisa untuk diuji setelah ini %s\n"
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents dan --reverse tidak dapat dipadu dengan baik."
 
-#: blame.c
-msgid "cannot use --contents with final commit object name"
-msgstr "tidak dapat menggunakan --contents dengan nama objek komit final"
-
 #: blame.c
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr ""
 "--reverse dan --first-parent bersama-sama butuh komit terbaru yang disebutkan"
 
 #: blame.c builtin/commit.c builtin/log.c builtin/merge.c
-#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c ref-filter.c
-#: remote.c sequencer.c submodule.c
+#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c remote.c
+#: sequencer.c submodule.c
 msgid "revision walk setup failed"
 msgstr "persiapan jalan revisi gagal"
 
@@ -2111,11 +2136,6 @@ msgstr "submodul '%s': tidak dapat membuat cabang '%s'"
 msgid "'%s' is already checked out at '%s'"
 msgstr "'%s' sudah di-checkout pada '%s'"
 
-#: branch.c
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD dari pohon kerja %s tidak diperbarui"
-
 #: builtin/add.c
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<opsi>] [--] <pathspec>..."
@@ -2386,7 +2406,7 @@ msgstr "fseek gagal"
 msgid "could not open '%s' for reading"
 msgstr "tidak dapat membuka '%s' untuk dibaca"
 
-#: builtin/am.c builtin/rebase.c sequencer.c strbuf.c wrapper.c
+#: builtin/am.c builtin/rebase.c editor.c sequencer.c wrapper.c
 #, c-format
 msgid "could not open '%s' for writing"
 msgstr "tidak dapat membuka '%s' untuk ditulis"
@@ -3429,6 +3449,15 @@ msgstr "Tidak dapat menghapus cabang '%s' yang ter-checkout pada '%s'"
 msgid "remote-tracking branch '%s' not found."
 msgstr "cabang pelacak remote '%s' tidak ditemukan."
 
+#: builtin/branch.c
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"cabang '%s' tidak ditemukan.\n"
+"Mungkin anda lupa menambahkan --remote?"
+
 #: builtin/branch.c
 #, c-format
 msgid "branch '%s' not found."
@@ -3467,6 +3496,11 @@ msgstr "Cabang %s sedang didasarkan ulang pada %s"
 msgid "Branch %s is being bisected at %s"
 msgstr "Cabang %s sedang dibagi dua pada %s"
 
+#: builtin/branch.c
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD dari pohon kerja %s tidak diperbarui"
+
 #: builtin/branch.c
 #, c-format
 msgid "Invalid branch name: '%s'"
@@ -3596,6 +3630,10 @@ msgstr "pindah/ganti nama cabang dan reflog-nya"
 msgid "move/rename a branch, even if target exists"
 msgstr "pindah/ganti nama cabang, walaupun target ada"
 
+#: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
+msgid "do not output a newline after empty formatted refs"
+msgstr "jangan keluarkan baris baru setelah referensi terformat kosong"
+
 #: builtin/branch.c
 msgid "copy a branch and its reflog"
 msgstr "salin cabang dan reflog-nya"
@@ -3872,12 +3910,10 @@ msgstr "Laporan baru dibuat pada '%s'.\n"
 
 #: builtin/bundle.c
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [-all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<versi>] <berkas> <argumen git-rev-list>"
 
 #: builtin/bundle.c
@@ -3904,13 +3940,13 @@ msgstr "jangan perlihatkan meteran perkembangan"
 msgid "show progress meter"
 msgstr "perlihatkan meteran perkembangan"
 
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "show progress meter during object writing phase"
-msgstr "perlihatkan meteran perkembangan saat fase penulisan objek"
+#: builtin/bundle.c
+msgid "historical; same as --progress"
+msgstr "opsi bersejarah; sama dengan --progress"
 
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "sama seperti --all-progress ketika meteran perkembangan diperlihatkan"
+#: builtin/bundle.c
+msgid "historical; does nothing"
+msgstr "opsi bersejarah: tidak apa-apa"
 
 #: builtin/bundle.c
 msgid "specify bundle format version"
@@ -5179,6 +5215,11 @@ msgstr "gagal men-stat '%s'"
 msgid "%s exists and is not a directory"
 msgstr "%s ada dan bukan direktori"
 
+#: builtin/clone.c
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' tautan simbolik, menolak mengkloning dengan --local"
+
 #: builtin/clone.c
 #, c-format
 msgid "failed to start iterator over '%s'"
@@ -5983,7 +6024,7 @@ msgstr "hitung nilai didepan/dibelakang penuh"
 msgid "version"
 msgstr "versi"
 
-#: builtin/commit.c builtin/push.c builtin/worktree.c
+#: builtin/commit.c builtin/fetch.c builtin/push.c builtin/worktree.c
 msgid "machine-readable output"
 msgstr "keluaran yang dapat dibaca mesin"
 
@@ -7078,150 +7119,15 @@ msgstr "git fetch --all [<opsi>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel tidak dapat bernilai negatif"
 
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch from all remotes"
-msgstr "ambil dari semua remote"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "set upstream for git pull/fetch"
-msgstr "setel hulu untuk git pull/fetch"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "tambah ke .git/FETCH_HEAD daripada timpa"
-
-#: builtin/fetch.c
-msgid "use atomic transaction to update references"
-msgstr "gunakan transaksi atomik untuk memperbarui referensi"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "path to upload pack on remote end"
-msgstr "jalur ke paket unggah pada sisi remote"
-
-#: builtin/fetch.c
-msgid "force overwrite of local reference"
-msgstr "paksa timpa referensi lokal"
-
-#: builtin/fetch.c
-msgid "fetch from multiple remotes"
-msgstr "ambil dari banyak remote"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch all tags and associated objects"
-msgstr "ambil semua tag dan objek yang bersesuaian"
-
-#: builtin/fetch.c
-msgid "do not fetch all tags (--no-tags)"
-msgstr "jangan ambil semua tag (--no-tags)"
-
-#: builtin/fetch.c
-msgid "number of submodules fetched in parallel"
-msgstr "jumlah submodul yang diambil secara bersamaan"
-
-#: builtin/fetch.c
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifikasi spek referensi untuk tempatkan semua referensi di dalam refs/"
-"prefetch/"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "buang cabang pelacak remote yang tidak ada pada remote"
-
-#: builtin/fetch.c
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr "buang tag lokal yang tidak ada pada remote dan klob tag yang berubah"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "on-demand"
-msgstr "sesuai permintaan"
-
-#: builtin/fetch.c
-msgid "control recursive fetching of submodules"
-msgstr "kontrol pengambilan submodul rekursif"
-
-#: builtin/fetch.c
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "tulis referensi yang diambil ke berkas FETCH_HEAD"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "keep downloaded pack"
-msgstr "simpan paket yang diunduh"
-
-#: builtin/fetch.c
-msgid "allow updating of HEAD ref"
-msgstr "bolehkan perbarui referensi HEAD"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone"
-msgstr "perdalam riwayat klon dangkal"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow repository based on time"
-msgstr "perdalam riwayat repositori dangkal berdasarkan waktu"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "convert to a complete repository"
-msgstr "ubah ke repositori penuh"
-
-#: builtin/fetch.c
-msgid "re-fetch without negotiating common commits"
-msgstr "ambil ulang tanpa menegosiasikan komit yang sama"
-
-#: builtin/fetch.c
-msgid "prepend this to submodule path output"
-msgstr "tambahkan ini ke jalur keluaran submodul"
-
-#: builtin/fetch.c
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"default untuk ambil submodul secara rekursif (prioritas lebih rendah "
-"dariberkas konfigurasi)"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "accept refs that update .git/shallow"
-msgstr "terima referensi yang memperbarui .git/shallow"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "refmap"
-msgstr "peta referensi"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "specify fetch refmap"
-msgstr "sebutkan ambil peta referensi"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "report that we have only objects reachable from this object"
-msgstr ""
-"laporkan bahwa kami hanya punya object yang bisa dicapai dari objek ini"
-
-#: builtin/fetch.c
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"jangan ambil berkas pak; sebagai gantinya cetak leluhur dari ujung negosiasi"
-
-#: builtin/fetch.c
-msgid "run 'maintenance --auto' after fetching"
-msgstr "lakukan 'maintenance --auto' setelah pengambilan"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "check for forced-updates on all updated branches"
-msgstr "periksa pembaruan terpaksa pada semua cabang"
-
-#: builtin/fetch.c
-msgid "write the commit-graph after fetching"
-msgstr "tulis grafik komit setelah pengambilan"
-
-#: builtin/fetch.c
-msgid "accept refspecs from stdin"
-msgstr "terima spek referensi dari masukan standar"
-
 #: builtin/fetch.c
 msgid "couldn't find remote ref HEAD"
 msgstr "tidak dapat menemukan referensi remote HEAD"
 
+#: builtin/fetch.c
+#, c-format
+msgid "From %.*s\n"
+msgstr "Dari %.*s\n"
+
 #: builtin/fetch.c
 #, c-format
 msgid "object %s not found"
@@ -7311,11 +7217,6 @@ msgstr "%s tidak mengirim semua objek yang diperlukan\n"
 msgid "rejected %s because shallow roots are not allowed to be updated"
 msgstr "tolak %s karena akar dangkal tidak diperkenankan untuk diperbarui"
 
-#: builtin/fetch.c
-#, c-format
-msgid "From %.*s\n"
-msgstr "Dari %.*s\n"
-
 #: builtin/fetch.c
 #, c-format
 msgid ""
@@ -7428,6 +7329,146 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "Anda perlu sebutkan sebuah nama tag"
 
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch from all remotes"
+msgstr "ambil dari semua remote"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "set upstream for git pull/fetch"
+msgstr "setel hulu untuk git pull/fetch"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "tambah ke .git/FETCH_HEAD daripada timpa"
+
+#: builtin/fetch.c
+msgid "use atomic transaction to update references"
+msgstr "gunakan transaksi atomik untuk memperbarui referensi"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "path to upload pack on remote end"
+msgstr "jalur ke paket unggah pada sisi remote"
+
+#: builtin/fetch.c
+msgid "force overwrite of local reference"
+msgstr "paksa timpa referensi lokal"
+
+#: builtin/fetch.c
+msgid "fetch from multiple remotes"
+msgstr "ambil dari banyak remote"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch all tags and associated objects"
+msgstr "ambil semua tag dan objek yang bersesuaian"
+
+#: builtin/fetch.c
+msgid "do not fetch all tags (--no-tags)"
+msgstr "jangan ambil semua tag (--no-tags)"
+
+#: builtin/fetch.c
+msgid "number of submodules fetched in parallel"
+msgstr "jumlah submodul yang diambil secara bersamaan"
+
+#: builtin/fetch.c
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifikasi spek referensi untuk tempatkan semua referensi di dalam refs/"
+"prefetch/"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "buang cabang pelacak remote yang tidak ada pada remote"
+
+#: builtin/fetch.c
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr "buang tag lokal yang tidak ada pada remote dan klob tag yang berubah"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "on-demand"
+msgstr "sesuai permintaan"
+
+#: builtin/fetch.c
+msgid "control recursive fetching of submodules"
+msgstr "kontrol pengambilan submodul rekursif"
+
+#: builtin/fetch.c
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "tulis referensi yang diambil ke berkas FETCH_HEAD"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "keep downloaded pack"
+msgstr "simpan paket yang diunduh"
+
+#: builtin/fetch.c
+msgid "allow updating of HEAD ref"
+msgstr "bolehkan perbarui referensi HEAD"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow clone"
+msgstr "perdalam riwayat klon dangkal"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow repository based on time"
+msgstr "perdalam riwayat repositori dangkal berdasarkan waktu"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "convert to a complete repository"
+msgstr "ubah ke repositori penuh"
+
+#: builtin/fetch.c
+msgid "re-fetch without negotiating common commits"
+msgstr "ambil ulang tanpa menegosiasikan komit yang sama"
+
+#: builtin/fetch.c
+msgid "prepend this to submodule path output"
+msgstr "tambahkan ini ke jalur keluaran submodul"
+
+#: builtin/fetch.c
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"default untuk ambil submodul secara rekursif (prioritas lebih rendah "
+"dariberkas konfigurasi)"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "accept refs that update .git/shallow"
+msgstr "terima referensi yang memperbarui .git/shallow"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "refmap"
+msgstr "peta referensi"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "specify fetch refmap"
+msgstr "sebutkan ambil peta referensi"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "report that we have only objects reachable from this object"
+msgstr ""
+"laporkan bahwa kami hanya punya object yang bisa dicapai dari objek ini"
+
+#: builtin/fetch.c
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"jangan ambil berkas pak; sebagai gantinya cetak leluhur dari ujung negosiasi"
+
+#: builtin/fetch.c
+msgid "run 'maintenance --auto' after fetching"
+msgstr "lakukan 'maintenance --auto' setelah pengambilan"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "check for forced-updates on all updated branches"
+msgstr "periksa pembaruan terpaksa pada semua cabang"
+
+#: builtin/fetch.c
+msgid "write the commit-graph after fetching"
+msgstr "tulis grafik komit setelah pengambilan"
+
+#: builtin/fetch.c
+msgid "accept refspecs from stdin"
+msgstr "terima spek referensi dari masukan standar"
+
 #: builtin/fetch.c
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only perlu satu atau lebih --negotiation-tip=*"
@@ -7576,6 +7617,14 @@ msgstr "hanya cetak referensi yang berisi komit"
 msgid "print only refs which don't contain the commit"
 msgstr "hanya cetak referensi yang tidak berisi komit"
 
+#: builtin/for-each-ref.c
+msgid "read reference patterns from stdin"
+msgstr "baca pola referensi dari masukan standar"
+
+#: builtin/for-each-ref.c
+msgid "unknown arguments supplied with --stdin"
+msgstr "argumen tidak dikenal diberikan dengan --stdin"
+
 #: builtin/for-each-repo.c
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<konfigurasi> [--] <argumen perintah>"
@@ -7592,6 +7641,11 @@ msgstr "kunci konfigurasi yang menampung daftar jalur repositori"
 msgid "missing --config=<config>"
 msgstr "kehilangan --config=<config>"
 
+#: builtin/for-each-repo.c
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "dapat konfigurasi jelek --config=%s"
+
 #: builtin/fsck.c
 msgid "unknown"
 msgstr "tidak dikenal"
@@ -7777,13 +7831,14 @@ msgid "notice: %s points to an unborn branch (%s)"
 msgstr "catatan: %s menunjuk ke cabang yang belum lahir (%s)"
 
 #: builtin/fsck.c
-msgid "Checking cache tree"
-msgstr "Memeriksa pohon tembolok"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Memeriksa pohon tembolok %s"
 
 #: builtin/fsck.c
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: penunjuk sha1 tidak valid pada pohon tembolok"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: penunjuk sha1 tidak valid pada pohon tembolok %s"
 
 #: builtin/fsck.c
 msgid "non-tree in cache-tree"
@@ -7791,8 +7846,18 @@ msgstr "bukan pohon pada pohon tembolok"
 
 #: builtin/fsck.c
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s: penunjuk sha1 tidak valid di resolve-undo"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: penunjuk sha1 tidak valid di resolve-undo %s"
+
+#: builtin/fsck.c
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "tidak dapat memuat indeks balik untuk pak '%s'"
+
+#: builtin/fsck.c
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "indeks balik tidak valid untuk pak '%s'"
 
 #: builtin/fsck.c
 msgid ""
@@ -10422,7 +10487,7 @@ msgstr "Tidak ada cabang pelacak remote untuk %s dari %s"
 msgid "Bad value '%s' in environment '%s'"
 msgstr "Nilai jelek '%s' dalam lingkungan '%s'"
 
-#: builtin/merge.c read-cache.c strbuf.c wrapper.c
+#: builtin/merge.c editor.c read-cache.c wrapper.c
 #, c-format
 msgid "could not close '%s'"
 msgstr "tidak dapat menutup '%s'"
@@ -11278,7 +11343,7 @@ msgstr "gagal menulis indeks bitmap"
 msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
 msgstr "%<PRIu32> objek ditulish ketika mengharapkan %<PRIu32>"
 
-#: builtin/pack-objects.c
+#: builtin/pack-objects.c builtin/repack.c
 msgid "disabling bitmap writing, as some objects are not being packed"
 msgstr "menonaktifkan penulisan bitmap, saat beberapa objek tidak sedang dipak"
 
@@ -11446,6 +11511,14 @@ msgstr "versi indeks tidak didukung %s"
 msgid "bad index version '%s'"
 msgstr "versi indeks jelek '%s'"
 
+#: builtin/pack-objects.c
+msgid "show progress meter during object writing phase"
+msgstr "perlihatkan meteran perkembangan saat fase penulisan objek"
+
+#: builtin/pack-objects.c
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "sama seperti --all-progress ketika meteran perkembangan diperlihatkan"
+
 #: builtin/pack-objects.c
 msgid "<version>[,<offset>]"
 msgstr "<versi>[,<offset>]"
@@ -11693,6 +11766,10 @@ msgstr ""
 "Anda masih menggunakannya dengan mengirimkan surel ke\n"
 "<git@vger.kernel.org>. Terima kasih.\n"
 
+#: builtin/pack-redundant.c
+msgid "refusing to run without --i-still-use-this"
+msgstr "menolak menjalankan tanpa --i-still-use-this"
+
 #: builtin/pack-refs.c
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
@@ -11909,9 +11986,9 @@ msgstr ""
 msgid "pull with rebase"
 msgstr "tarik dengan pendasaran ulang"
 
-#: builtin/pull.c
-msgid "please commit or stash them."
-msgstr "mohon komit atau stase."
+#: builtin/pull.c builtin/rebase.c
+msgid "Please commit or stash them."
+msgstr "Mohon komit atau stase."
 
 #: builtin/pull.c
 #, c-format
@@ -12174,9 +12251,9 @@ msgstr "nilai tidak valid untuk '%s'"
 msgid "repository"
 msgstr "repositori"
 
-#: builtin/push.c builtin/send-pack.c
-msgid "push all refs"
-msgstr "dorong semua referensi"
+#: builtin/push.c
+msgid "push all branches"
+msgstr "dorong semua cabang"
 
 #: builtin/push.c builtin/send-pack.c
 msgid "mirror all refs"
@@ -12187,8 +12264,10 @@ msgid "delete refs"
 msgstr "hapus referensi"
 
 #: builtin/push.c
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "dorong tag (tidak dapat digunakan dengan --all atau --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"dorong tag (tidak dapat digunakan bersamaan dengan --all, --branches, atau --"
+"mirror)"
 
 #: builtin/push.c builtin/send-pack.c
 msgid "force updates"
@@ -12518,6 +12597,11 @@ msgstr ""
 "\n"
 "Hasilnya git tidak dapat mendasarkan ulang."
 
+#: builtin/rebase.c
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Mode rebase-merges tidak dikenal: %s"
+
 #: builtin/rebase.c
 #, c-format
 msgid "could not switch to %s"
@@ -12536,6 +12620,16 @@ msgstr ""
 "tipe kosong tak dikenali '%s'; nilai yang valid adalah \"drop\", \"keep\", "
 "dan \"ask\"."
 
+#: builtin/rebase.c
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges dengan argumen untai kosong usang dan akan berhenti bekerja "
+"pada versi Git berikutnya. Sebagai gantinya, gunakan --rebase-merges tanpa "
+"argumen, yang melakukan hal yang sama."
+
 #: builtin/rebase.c
 #, c-format
 msgid ""
@@ -12802,23 +12896,26 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "tombol `C' harap nilai numerik"
 
-#: builtin/rebase.c
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Mode tidak dikenal: %s"
-
 #: builtin/rebase.c
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy butuh --merge atau --interactive"
 
 #: builtin/rebase.c
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
 msgstr ""
-"opsi penerapan tidak kompatibel dengan rebase.autosquash. "
+"opsi penerapan tidak kompatibel dengan rebase.autoSquash. "
 "Pertimbangkanmenambahkan --no-autosquash"
 
+#: builtin/rebase.c
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"opsi penerapan tidak kompatibel dengan rebase.rebaseMerges. "
+"Pertimbangkanmenambahkan --no-rebase-merges"
+
 #: builtin/rebase.c
 msgid ""
 "apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
@@ -12874,10 +12971,6 @@ msgstr "'%s': butuh tepatnya satu dasar penggabungan"
 msgid "Does not point to a valid commit '%s'"
 msgstr "Tidak menunjuk pada komit yang valid '%s'"
 
-#: builtin/rebase.c
-msgid "Please commit or stash them."
-msgstr "Mohon komit atau stase."
-
 #: builtin/rebase.c
 msgid "HEAD is up to date."
 msgstr "HEAD terbaru."
@@ -13693,8 +13786,8 @@ msgid "approxidate"
 msgstr "tanggal aproksimasi"
 
 #: builtin/repack.c
-msgid "with -C, expire objects older than this"
-msgstr "dengan -C, jangan kadaluarsakan objek lebih lama dari ini"
+msgid "with --cruft, expire objects older than this"
+msgstr "dengan --cruft, kadaluarsakan objek yang lebih tua dari ini"
 
 #: builtin/repack.c
 msgid "remove redundant packs, and run git-prune-packed"
@@ -14538,6 +14631,10 @@ msgstr ""
 msgid "remote name"
 msgstr "nama remote"
 
+#: builtin/send-pack.c
+msgid "push all refs"
+msgstr "dorong semua referensi"
+
 #: builtin/send-pack.c
 msgid "use stateless RPC protocol"
 msgstr "gunakan protokol RPC nirkeadaan"
@@ -14798,9 +14895,11 @@ msgstr ""
 
 #: builtin/sparse-checkout.c
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<opsi>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<opsi>]"
 
 #: builtin/sparse-checkout.c
 msgid "this worktree is not sparse"
@@ -14951,6 +15050,27 @@ msgstr ""
 msgid "error while refreshing working directory"
 msgstr "kesalahan saat menyegarkan direktori kerja"
 
+#: builtin/sparse-checkout.c
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no]-cone] [--rules-"
+"file <file>]"
+
+#: builtin/sparse-checkout.c
+msgid "terminate input and output files by a NUL character"
+msgstr "akhiri berkas masukan dan keluaran oleh satu karakter NUL"
+
+#: builtin/sparse-checkout.c
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"ketika digunakan dengan --rules-file tafsirkan pola sebagai pola mode kerucut"
+
+#: builtin/sparse-checkout.c
+msgid "use patterns in <file> instead of the current ones."
+msgstr "gunakan pola di dalam <berkas> daripada yang saat ini."
+
 #: builtin/stash.c
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<opsi log>]"
@@ -18547,8 +18667,8 @@ msgid "bad zlib compression level %d"
 msgstr "level kompresi zlib jelek %d"
 
 #: config.c
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar harusnya hanya satu karakter"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar seharusnya hanya satu karakter ASCII"
 
 #: config.c
 #, c-format
@@ -18686,6 +18806,13 @@ msgstr "tidak dapat menyetel '%s' ke '%s'"
 msgid "invalid section name: %s"
 msgstr "nama bagian tidak valid: %s"
 
+#: config.c
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+"menolak bekerja dengan baris yang terlalu panjang di '%s' pada baris "
+"%<PRIuMAX>"
+
 #: config.c
 #, c-format
 msgid "missing value for '%s'"
@@ -19517,6 +19644,10 @@ msgstr "tambah depan prefiks tambahan pada setiap baris keluaran"
 msgid "do not show any source or destination prefix"
 msgstr "jangan perlihatkan prefiks sumber atau tujuan apapun"
 
+#: diff.c
+msgid "use default prefixes a/ and b/"
+msgstr "gunakan awalan asali a/ dan b/"
+
 #: diff.c
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr ""
@@ -19901,6 +20032,16 @@ msgstr "tidak dapat memigrasikan direktori git dari '%s' ke '%s'"
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "petunjuk: Menunggu penyunting Anda untuk menutup berkas...%c"
 
+#: editor.c sequencer.c wrapper.c
+#, c-format
+msgid "could not write to '%s'"
+msgstr "tidak dapat menulis ke '%s'"
+
+#: editor.c
+#, c-format
+msgid "could not edit '%s'"
+msgstr "tidak dapat menyunting '%s'"
+
 #: entry.c
 msgid "Filtering content"
 msgstr "Menyaring isi"
@@ -20271,6 +20412,11 @@ msgstr "-c mengharapkan sebuah untai konfigurasi\n"
 msgid "no config key given for --config-env\n"
 msgstr "tidak ada kunci konfigurasi yang diberikan untuk --config-env\n"
 
+#: git.c
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "tidak ada atribut yang diberikan untuk --attr-source\n"
+
 #: git.c
 #, c-format
 msgid "unknown option: %s\n"
@@ -22304,6 +22450,11 @@ msgstr "tidak dapat menemukan %s di dalam pak '%s' pada offset %<PRIuMAX>"
 msgid "unable to get disk usage of '%s'"
 msgstr "tidak dapat mendapatkan penggunaan disk dari '%s'"
 
+#: pack-bitmap.c
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "checksum berkas bitmap '%s' tidak valid"
+
 #: pack-mtimes.c
 #, c-format
 msgid "mtimes file %s is too small"
@@ -22354,6 +22505,15 @@ msgstr "berkas indeks balik %s punya versi tidak didukung %<PRIu32>"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "berkas indeks balik %s punya id hash tidak didukung %<PRIu32>"
 
+#: pack-revindex.c
+msgid "invalid checksum"
+msgstr "checksum tidak valid"
+
+#: pack-revindex.c
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "posisi indeks balik tidak valid pada %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
 #: pack-write.c
 msgid "cannot both write and verify reverse index"
 msgstr "tidak dapat kedua-duanya menulis dan memverifikasi indeks balik"
@@ -23228,6 +23388,11 @@ msgstr "argumen %%(%s) tidak dikenal: %s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "lebar positif diharapkan dengan atom %%(align)"
 
+#: ref-filter.c
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "format yang diharapkan: %%(ahead-behind:<mirip komit>)"
+
 #: ref-filter.c
 #, c-format
 msgid "malformed field name: %.*s"
@@ -23993,11 +24158,6 @@ msgstr "gagal memperbarui keadaan konflik di '%s'"
 msgid "no remembered resolution for '%s'"
 msgstr "tidak ada resolusi yang diingat untuk '%s'"
 
-#: rerere.c
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "tidak dapat batal taut '%s'"
-
 #: rerere.c
 #, c-format
 msgid "Updated preimage for '%s'"
@@ -24419,11 +24579,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "tidak dapat mengunci '%s'"
 
-#: sequencer.c strbuf.c wrapper.c
-#, c-format
-msgid "could not write to '%s'"
-msgstr "tidak dapat menulis ke '%s'"
-
 #: sequencer.c
 #, c-format
 msgid "could not write eol to '%s'"
@@ -24866,10 +25021,6 @@ msgstr "coba \"git cherry-pick (--continue | %s--abort | --quit)\""
 msgid "could not create sequencer directory '%s'"
 msgstr "tidak dapat membuat direktori pembaris '%s'"
 
-#: sequencer.c
-msgid "could not lock HEAD"
-msgstr "tidak dapat mengunci HEAD"
-
 #: sequencer.c
 msgid "no cherry-pick or revert in progress"
 msgstr "tidak ada pemetikan ceri atau pembalikkan yang sedang berjalan"
@@ -24986,21 +25137,21 @@ msgstr ""
 "\n"
 
 #: sequencer.c
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "dan buat perubahan ke indeks dan/atau pohon kerja\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "dan buat perubahan ke indeks dan/atau pohon kerja.\n"
 
 #: sequencer.c
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
 msgstr ""
 "eksekusi berhasil: %s\n"
-"tapi meninggalkan perubahan ke indeks dan/atau pohon kerja\n"
+"tapi meninggalkan perubahan ke indeks dan/atau pohon kerja.\n"
 "Komit atau stase perubahan Anda, lalu jalankan\n"
 "\n"
 "  git rebase --continue\n"
@@ -25528,11 +25679,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u bita/detik"
 msgstr[1] "%u bita/detik"
 
-#: strbuf.c
-#, c-format
-msgid "could not edit '%s'"
-msgstr "tidak dapat menyunting '%s'"
-
 #: submodule-config.c
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
@@ -27643,14 +27789,19 @@ msgstr "(%s) Tidak dapat menjalankan '%s'"
 
 #: git-send-email.perl
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Menambahkan %s: %s dari: '%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Baris masukan salah format: '%s'"
 
 #: git-send-email.perl
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) gagal menutup pipa ke '%s'"
 
+#: git-send-email.perl
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Menambahkan %s: %s dari: '%s'\n"
+
 #: git-send-email.perl
 msgid "cannot send message as 7bit"
 msgstr "tidak dapat mengirim pesan sebagai 7bit"
index 0ba8585b766d55944805a57753b00a077c6d566f..284da9061818dc28584d65df2520831953cbb0a0 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -5,10 +5,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: git 2.40.0\n"
+"Project-Id-Version: git 2.41.0\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-02 09:34+0100\n"
-"PO-Revision-Date: 2023-03-02 09:35+0100\n"
+"POT-Creation-Date: 2023-05-31 13:14+0100\n"
+"PO-Revision-Date: 2023-05-31 13:15+0100\n"
 "Last-Translator: Peter Krefting <peter@softwolves.pp.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
 "Language: sv\n"
@@ -665,6 +665,23 @@ msgstr "Checka in dina ändringar innan du utför sammanslagningen."
 msgid "Exiting because of unfinished merge."
 msgstr "Avslutar på grund av ofullbordad sammanslagning."
 
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Divergerande grenar kan inte snabbspolas, du måste antingen använda:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"eller:\n"
+"\n"
+"\tgit rebase\n"
+
 msgid "Not possible to fast-forward, aborting."
 msgstr "Kan inte snabbspola, avbryter."
 
@@ -1109,6 +1126,10 @@ msgstr "trunkerar .rej-filnamnet till %.*s.rej"
 msgid "cannot open %s"
 msgstr "kan inte öppna %s"
 
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "kan inte ta bort länken \"%s\""
+
 #, c-format
 msgid "Hunk #%d applied cleanly."
 msgstr "Stycke %d tillämpades rent."
@@ -1295,6 +1316,10 @@ msgstr "git archive --remote <arkiv> [--exec <kmd>] --list"
 msgid "cannot read '%s'"
 msgstr "kunde inte läsa \"%s\""
 
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "sökvägsangivelsen \"%s\" motsvarar filer utanför aktuell katalog"
+
 #, c-format
 msgid "pathspec '%s' did not match any files"
 msgstr "sökvägsangivelsen \"%s\" motsvarade inte några filer"
@@ -1311,9 +1336,6 @@ msgstr "objektnamnet är inte giltigt: %s"
 msgid "not a tree object: %s"
 msgstr "inte ett trädobjekt: %s"
 
-msgid "current working directory is untracked"
-msgstr "aktuell arbetskatalog är inte spårad"
-
 #, c-format
 msgid "File not found: %s"
 msgstr "Hittar inte filen: %s"
@@ -1440,6 +1462,9 @@ msgstr "ignorerar allt för stor gitattributes-fil \"%s\""
 msgid "ignoring overly large gitattributes blob '%s'"
 msgstr "ignorerar allt för stor gitattributes-objekt \"%s\""
 
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "felaktig --attr-source eller GIT_ATTR_SOURCE"
+
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
 msgstr "Felaktigt citerat innehåll i filen \"%s\": %s"
@@ -1546,9 +1571,6 @@ msgstr[1] "Bisect: %d revisioner kvar att testa efter denna %s\n"
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents och --reverse fungerar inte så bra tillsammans."
 
-msgid "cannot use --contents with final commit object name"
-msgstr "kan inte använda --contents med namn på slutgiltigt incheckningsobjekt"
-
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr ""
 "--reverse och --first-parent tillsammans kräver att du anger senaste "
@@ -1731,10 +1753,6 @@ msgstr "undermodulen \"%s\": kan inte skapa grenen \"%s\""
 msgid "'%s' is already checked out at '%s'"
 msgstr "\"%s\" är redan utcheckad på \"%s\""
 
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "HEAD i arbetskatalogen %s har inte uppdaterats"
-
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<flaggor>] [--] <sökväg>..."
 
@@ -2764,6 +2782,14 @@ msgstr "Kan inte ta bort grenen \"%s\" som är utcheckad på \"%s\""
 msgid "remote-tracking branch '%s' not found."
 msgstr "fjärrspårande grenen \"%s\" hittades inte."
 
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"grenen \"%s\" hittades inte.\n"
+"Glömde du --remote?"
+
 #, c-format
 msgid "branch '%s' not found."
 msgstr "grenen \"%s\" hittades inte."
@@ -2794,6 +2820,10 @@ msgstr "Grenen %s ombaseras på %s"
 msgid "Branch %s is being bisected at %s"
 msgstr "Grenen %s är i en \"bisect\" på %s"
 
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD i arbetskatalogen %s har inte uppdaterats"
+
 #, c-format
 msgid "Invalid branch name: '%s'"
 msgstr "Felaktigt namn på gren: \"%s\""
@@ -2894,6 +2924,9 @@ msgstr "flytta/ta bort en gren och dess reflogg"
 msgid "move/rename a branch, even if target exists"
 msgstr "flytta/ta bort en gren, även om målet finns"
 
+msgid "do not output a newline after empty formatted refs"
+msgstr "skriv inte ut ett nyradstecken efter tomma formaterade referenser"
+
 msgid "copy a branch and its reflog"
 msgstr "kopiera en gren och dess reflogg"
 
@@ -3115,12 +3148,10 @@ msgid "Created new report at '%s'.\n"
 msgstr "Skapade ny rapport på \"%s\"\n"
 
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <fil> <git-rev-list-flaggor>"
 
 msgid "git bundle verify [-q | --quiet] <file>"
@@ -3141,11 +3172,11 @@ msgstr "visa inte förloppsindikator"
 msgid "show progress meter"
 msgstr "visa förloppsindikator"
 
-msgid "show progress meter during object writing phase"
-msgstr "visa förloppsindikator under objektskrivningsfasen"
+msgid "historical; same as --progress"
+msgstr "historisk; samma som --progress"
 
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "som --all-progress när förloppsindikatorn visas"
+msgid "historical; does nothing"
+msgstr "historisk flagga; gör ingenting"
 
 msgid "specify bundle format version"
 msgstr "ange formatversion för bunten."
@@ -3171,7 +3202,7 @@ msgid "cannot read object %s '%s'"
 msgstr "kan inte läsa objektet %s: \"%s\""
 
 msgid "flush is only for --buffer mode"
-msgstr "flush är endast till för --buffer-läge"
+msgstr "flush är endast till för \"--buffer\"-läge"
 
 msgid "empty command in input"
 msgstr "tomt kommando i indata"
@@ -4147,6 +4178,10 @@ msgstr "misslyckades ta status på \"%s\""
 msgid "%s exists and is not a directory"
 msgstr "%s finns och är ingen katalog"
 
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "\"%s\" är en symbolisk länk, vägrar klona med --local"
+
 #, c-format
 msgid "failed to start iterator over '%s'"
 msgstr "misslyckades starta iterator över \"%s\""
@@ -5649,115 +5684,13 @@ msgstr "git fetch --all [<flaggor>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel kan inte vara negativt"
 
-msgid "fetch from all remotes"
-msgstr "hämta från alla fjärrar"
-
-msgid "set upstream for git pull/fetch"
-msgstr "ställ in uppström för git pull/fetch"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "lägg till i .git/FETCH_HEAD istället för att skriva över"
-
-msgid "use atomic transaction to update references"
-msgstr "använd atomiska transaktioner för att uppdatera referenser"
-
-msgid "path to upload pack on remote end"
-msgstr "sökväg till upload pack på fjärren"
-
-msgid "force overwrite of local reference"
-msgstr "tvinga överskrivning av lokal referens"
-
-msgid "fetch from multiple remotes"
-msgstr "hämta från flera fjärrar"
-
-msgid "fetch all tags and associated objects"
-msgstr "hämta alla taggar och associerade objekt"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "hämta inte alla taggar (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "antal undermoduler som hämtas parallellt"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"modifiera referensspecifikationen så att alla referenser hamnar i refs/"
-"prefetch/"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "rensa fjärrspårande grenar ej längre på fjärren"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"rensa lokala taggar inte längre på fjärren och skriv över ändrade taggar"
-
-msgid "on-demand"
-msgstr "on-demand"
-
-msgid "control recursive fetching of submodules"
-msgstr "styr rekursiv hämtning av undermoduler"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "skriv hämtade referenser till FETCH_HEAD-filen"
-
-msgid "keep downloaded pack"
-msgstr "behåll hämtade paket"
-
-msgid "allow updating of HEAD ref"
-msgstr "tillåt uppdatering av HEAD-referens"
-
-msgid "deepen history of shallow clone"
-msgstr "fördjupa historik för grund klon"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "fördjupa historik för grund klon baserad på tid"
-
-msgid "convert to a complete repository"
-msgstr "konvertera till komplett arkiv"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "hämta om utan att förhandla om gemensamma incheckningar"
-
-msgid "prepend this to submodule path output"
-msgstr "lägg till i början av undermodulens sökvägsutdata"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"standard för rekursiv hämtning av undermoduler (lägre prioritet än "
-"konfigurationsfiler)"
-
-msgid "accept refs that update .git/shallow"
-msgstr "tar emot referenser som uppdaterar .git/shallow"
-
-msgid "refmap"
-msgstr "referenskarta"
-
-msgid "specify fetch refmap"
-msgstr "ange referenskarta för \"fetch\""
-
-msgid "report that we have only objects reachable from this object"
-msgstr "rapportera att vi bara har objekt nåbara från detta objektet"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr "hämta inte paketfil; skriv istället förfäder till förhandlingstips"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "kör \"maintenance --auto\" efter hämtning"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "se efter tvingade uppdateringar i alla uppdaterade grenar"
-
-msgid "write the commit-graph after fetching"
-msgstr "skriv incheckingsgrafen efter hämtning"
-
-msgid "accept refspecs from stdin"
-msgstr "ta emot referenser från standard in"
-
 msgid "couldn't find remote ref HEAD"
 msgstr "kunde inte hitta fjärr-referensen HEAD"
 
+#, c-format
+msgid "From %.*s\n"
+msgstr "Från %.*s\n"
+
 #, c-format
 msgid "object %s not found"
 msgstr "objektet %s hittades inte"
@@ -5829,10 +5762,6 @@ msgstr "%s sände inte alla nödvändiga objekt\n"
 msgid "rejected %s because shallow roots are not allowed to be updated"
 msgstr "avvisade %s då grunda rötter inte tillåts uppdateras"
 
-#, c-format
-msgid "From %.*s\n"
-msgstr "Från %.*s\n"
-
 #, c-format
 msgid ""
 "some local refs could not be updated; try running\n"
@@ -5924,6 +5853,112 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "du måste ange namnet på en tagg"
 
+msgid "fetch from all remotes"
+msgstr "hämta från alla fjärrar"
+
+msgid "set upstream for git pull/fetch"
+msgstr "ställ in uppström för git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "lägg till i .git/FETCH_HEAD istället för att skriva över"
+
+msgid "use atomic transaction to update references"
+msgstr "använd atomiska transaktioner för att uppdatera referenser"
+
+msgid "path to upload pack on remote end"
+msgstr "sökväg till upload pack på fjärren"
+
+msgid "force overwrite of local reference"
+msgstr "tvinga överskrivning av lokal referens"
+
+msgid "fetch from multiple remotes"
+msgstr "hämta från flera fjärrar"
+
+msgid "fetch all tags and associated objects"
+msgstr "hämta alla taggar och associerade objekt"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "hämta inte alla taggar (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "antal undermoduler som hämtas parallellt"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"modifiera referensspecifikationen så att alla referenser hamnar i refs/"
+"prefetch/"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "rensa fjärrspårande grenar ej längre på fjärren"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"rensa lokala taggar inte längre på fjärren och skriv över ändrade taggar"
+
+msgid "on-demand"
+msgstr "on-demand"
+
+msgid "control recursive fetching of submodules"
+msgstr "styr rekursiv hämtning av undermoduler"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "skriv hämtade referenser till FETCH_HEAD-filen"
+
+msgid "keep downloaded pack"
+msgstr "behåll hämtade paket"
+
+msgid "allow updating of HEAD ref"
+msgstr "tillåt uppdatering av HEAD-referens"
+
+msgid "deepen history of shallow clone"
+msgstr "fördjupa historik för grund klon"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "fördjupa historik för grund klon baserad på tid"
+
+msgid "convert to a complete repository"
+msgstr "konvertera till komplett arkiv"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "hämta om utan att förhandla om gemensamma incheckningar"
+
+msgid "prepend this to submodule path output"
+msgstr "lägg till i början av undermodulens sökvägsutdata"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"standard för rekursiv hämtning av undermoduler (lägre prioritet än "
+"konfigurationsfiler)"
+
+msgid "accept refs that update .git/shallow"
+msgstr "tar emot referenser som uppdaterar .git/shallow"
+
+msgid "refmap"
+msgstr "referenskarta"
+
+msgid "specify fetch refmap"
+msgstr "ange referenskarta för \"fetch\""
+
+msgid "report that we have only objects reachable from this object"
+msgstr "rapportera att vi bara har objekt nåbara från detta objektet"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr "hämta inte paketfil; skriv istället förfäder till förhandlingstips"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "kör \"maintenance --auto\" efter hämtning"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "se efter tvingade uppdateringar i alla uppdaterade grenar"
+
+msgid "write the commit-graph after fetching"
+msgstr "skriv incheckingsgrafen efter hämtning"
+
+msgid "accept refspecs from stdin"
+msgstr "ta emot referenser från standard in"
+
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only behöver en eller flera --negotiation-tip=*"
 
@@ -6039,6 +6074,12 @@ msgstr "visa endast referenser som innehåller incheckningen"
 msgid "print only refs which don't contain the commit"
 msgstr "visa endast referenser som inte innehåller incheckningen"
 
+msgid "read reference patterns from stdin"
+msgstr "läs referensmönster från standard in"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "okända argument angavs tillsammans med --stdin"
+
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<konfig> [--] <argument>"
 
@@ -6051,6 +6092,10 @@ msgstr "konfigurationsnyckel som innehåller en lista över arkivsökvägar"
 msgid "missing --config=<config>"
 msgstr "saknar --config=<konfig>"
 
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "fick felaktig konfiguration --config=%s"
+
 msgid "unknown"
 msgstr "okänd"
 
@@ -6201,19 +6246,28 @@ msgstr "%s: frånkopplat HEAD pekar på ingenting"
 msgid "notice: %s points to an unborn branch (%s)"
 msgstr "obs: %s pekar på en ofödd gren (%s)"
 
-msgid "Checking cache tree"
-msgstr "Kontrollerar cacheträd"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Kontrollerar cacheträd för %s"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: ogiltig sha1-pekare i cacheträd"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: ogiltig sha1-pekare i cacheträd för %s"
 
 msgid "non-tree in cache-tree"
 msgstr "icke-träd i cacheträd"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s: ogiltig sha1-pekare i resolve-undo"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: ogiltig sha1-pekare i resolve-undo för %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "kunde inte läsa rev-index för paketfil \"%s\""
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "ogiltigt rev-index för paketet \"%s\""
 
 msgid ""
 "git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
@@ -9055,6 +9109,12 @@ msgstr "indexversionen %s stöds ej"
 msgid "bad index version '%s'"
 msgstr "felaktig indexversion \"%s\""
 
+msgid "show progress meter during object writing phase"
+msgstr "visa förloppsindikator under objektskrivningsfasen"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "som --all-progress när förloppsindikatorn visas"
+
 msgid "<version>[,<offset>]"
 msgstr "<version>[,<offset>]"
 
@@ -9243,6 +9303,9 @@ msgstr ""
 "oss att du fortfarande använder det på e-post till\n"
 "<git@vger.kernel.org>. Tack.\n"
 
+msgid "refusing to run without --i-still-use-this"
+msgstr "vägrar köra utan --i-still-use-this"
+
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
 
@@ -9413,8 +9476,8 @@ msgstr "Uppdaterar en ofödd gren med ändringar som lagts till i indexet."
 msgid "pull with rebase"
 msgstr "pull med ombasering"
 
-msgid "please commit or stash them."
-msgstr "checka in eller använd \"stash\" på dem."
+msgid "Please commit or stash them."
+msgstr "Checka in eller använd \"stash\" på dem."
 
 #, c-format
 msgid ""
@@ -9648,8 +9711,8 @@ msgstr "ogiltigt värde för \"%s\""
 msgid "repository"
 msgstr "arkiv"
 
-msgid "push all refs"
-msgstr "sänd alla referenser"
+msgid "push all branches"
+msgstr "sänd alla grenar"
 
 msgid "mirror all refs"
 msgstr "spegla alla referenser"
@@ -9657,8 +9720,9 @@ msgstr "spegla alla referenser"
 msgid "delete refs"
 msgstr "ta bort referenser"
 
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "sänd taggar (kan inte användas med --all eller --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr ""
+"sänd taggar (kan inte användas med --all eller --branches eller --mirror)"
 
 msgid "force updates"
 msgstr "tvinga uppdateringar"
@@ -9920,6 +9984,10 @@ msgstr ""
 "\n"
 "Därför kan inte git ombasera dessa."
 
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Okänd rebase-merges-läge: %s"
+
 #, c-format
 msgid "could not switch to %s"
 msgstr "kunde inte växla till %s"
@@ -9935,6 +10003,15 @@ msgid ""
 msgstr ""
 "okänd tom-typ \"%s\"; giltiga värden är \"drop\", \"keep\" och \"ask\"."
 
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"--rebase-merges med en tom sträng som argument avråds från och kommer sluta "
+"fungera i en framtida version av Git. Använd istället --rebase-merges utan "
+"argument, vilket har samma effekt."
+
 #, c-format
 msgid ""
 "%s\n"
@@ -10149,20 +10226,23 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "flaggan \"C\" förväntar ett numeriskt värde"
 
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Okänt läge: %s"
-
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy kräver --merge eller --interactive"
 
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
 msgstr ""
-"argument för \"apply\" är inkompatibla med rebase.autosquash. Överväg att "
+"argument för \"apply\" är inkompatibla med rebase.autoSquash. Överväg att "
 "lägga till --no-autosquash"
 
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"argument för \"apply\" är inkompatibla med rebase.rebaseMerges. Överväg att "
+"lägga till --no-rebase-merges"
+
 msgid ""
 "apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
 "update-refs"
@@ -10207,9 +10287,6 @@ msgstr "\"%s\": behöver precis en sammanslagningsbas"
 msgid "Does not point to a valid commit '%s'"
 msgstr "Pekar inte på en giltig incheckning: \"%s\""
 
-msgid "Please commit or stash them."
-msgstr "Checka in eller använd \"stash\" på dem."
-
 msgid "HEAD is up to date."
 msgstr "HEAD är à jour."
 
@@ -10863,8 +10940,8 @@ msgstr "samma som -a, packa onåbara onödiga objekt separat"
 msgid "approxidate"
 msgstr "cirkadatum"
 
-msgid "with -C, expire objects older than this"
-msgstr "med -C, låt tid gå ut för objekt äldre än detta"
+msgid "with --cruft, expire objects older than this"
+msgstr "med --cruft, låt tid gå ut för objekt äldre än detta"
 
 msgid "remove redundant packs, and run git-prune-packed"
 msgstr "ta bort överflödiga paket, och kör git-prune-packed"
@@ -11528,6 +11605,9 @@ msgstr ""
 msgid "remote name"
 msgstr "fjärrnamn"
 
+msgid "push all refs"
+msgstr "sänd alla referenser"
+
 msgid "use stateless RPC protocol"
 msgstr "använd tillståndslöst RPC-protokoll"
 
@@ -11728,9 +11808,11 @@ msgid "show refs from stdin that aren't in local repository"
 msgstr "visa referenser från standard in som inte finns i lokalt arkiv"
 
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) <flaggor>"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) <flaggor>"
 
 msgid "this worktree is not sparse"
 msgstr "arbetskatalogen är inte gren"
@@ -11853,6 +11935,22 @@ msgstr ""
 msgid "error while refreshing working directory"
 msgstr "fel vid uppdatering av arbetskatalog"
 
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks] [--[no-]cone] [--rules-"
+"file <fil>]"
+
+msgid "terminate input and output files by a NUL character"
+msgstr "avsluta in- och utdatafiler med NUL-tecken"
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr "om används med --rules-file tolka mönster som kon-lägemönster"
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "använd mönster i <fil> istället för de nuvarande."
+
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<\"log\"-flaggor>]"
 
@@ -14685,8 +14783,8 @@ msgstr "förkortningslängd utanför intervallet: %d"
 msgid "bad zlib compression level %d"
 msgstr "felaktigt zlib-komprimeringsgrad %d"
 
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar kan bara vara ett tecken"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar kan bara vara ett ASCII-tecken"
 
 #, c-format
 msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -14797,6 +14895,10 @@ msgstr "kunde inte ställa in \"%s\" till \"%s\""
 msgid "invalid section name: %s"
 msgstr "felaktigt namn på stycke: %s"
 
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "vägrar arbeta med för långa rader i \"%s\" på rad %<PRIuMAX>"
+
 #, c-format
 msgid "missing value for '%s'"
 msgstr "värde saknas för \"%s\""
@@ -15466,6 +15568,9 @@ msgstr "lägg till ytterligare prefix på alla rader i utdata"
 msgid "do not show any source or destination prefix"
 msgstr "visa inte käll- eller målprefix"
 
+msgid "use default prefixes a/ and b/"
+msgstr "använd standardprefixen a/ och b/"
+
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr "visa sammnhang mellan diff-stycken upp till angivet antal rader"
 
@@ -15759,6 +15864,14 @@ msgstr "kunde inte migrera git-katalog från \"%s\" till \"%s\""
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "tips: Väntar på att textredigeringsprogrammet ska stänga filen...%c"
 
+#, c-format
+msgid "could not write to '%s'"
+msgstr "kunde inte skriva till \"%s\""
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "kunde inte redigera \"%s\""
+
 msgid "Filtering content"
 msgstr "Filtrerar innehåll"
 
@@ -16056,6 +16169,10 @@ msgstr "-c förväntar en konfigurationssträng\n"
 msgid "no config key given for --config-env\n"
 msgstr "ingen konfigurationsnyckel angavs för --config-env\n"
 
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "ingen attributkälla angavs för --attr-source\n"
+
 #, c-format
 msgid "unknown option: %s\n"
 msgstr "okänd flagga: %s\n"
@@ -17715,6 +17832,10 @@ msgstr "kunde inte hitta \"%s\" i paketet \"%s\" på offset %<PRIuMAX>"
 msgid "unable to get disk usage of '%s'"
 msgstr "kan inte hämta diskanvändning för \"%s\""
 
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "bitkartefilen \"%s\" har ogiltig kontrollsumma"
+
 #, c-format
 msgid "mtimes file %s is too small"
 msgstr "mtimes-filen %s är för liten"
@@ -17755,6 +17876,13 @@ msgstr "reverse-index-filen %s har versionen %<PRIu32> som inte stöds"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "reverse-index-filen %s har hash-ID %<PRIu32> som inte stöds"
 
+msgid "invalid checksum"
+msgstr "ogiltig kontrollsumma"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "ogiltig rev-indexposition vid %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
 msgid "cannot both write and verify reverse index"
 msgstr "kan inte både skriva och bekräfta reverse-index"
 
@@ -18476,6 +18604,10 @@ msgstr "okänt %%(%s)-argument: %s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "positiv bredd förväntad med atomen %%(align)"
 
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "förväntat format: %%(ahead-behind:<incheckning-igt>)"
+
 #, c-format
 msgid "malformed field name: %.*s"
 msgstr "felformat fältnamn: %.*s"
@@ -19095,10 +19227,6 @@ msgstr "misslyckades uppdatera tillstånd för sammanslagningsproblem i \"%s\""
 msgid "no remembered resolution for '%s'"
 msgstr "inget sparat sammanslagningsresultat för \"%s\""
 
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "kan inte ta bort länken \"%s\""
-
 #, c-format
 msgid "Updated preimage for '%s'"
 msgstr "Uppdaterade förhandsbild för \"%s\""
@@ -19431,10 +19559,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "kunde inte låsa \"%s\""
 
-#, c-format
-msgid "could not write to '%s'"
-msgstr "kunde inte skriva till \"%s\""
-
 #, c-format
 msgid "could not write eol to '%s'"
 msgstr "kunde inte skriva radslut till \"%s\""
@@ -19795,9 +19919,6 @@ msgstr "testa \"git cherry-pick (--continue | %s--abort | --quit)\""
 msgid "could not create sequencer directory '%s'"
 msgstr "kunde inte skapa \"sequencer\"-katalogen \"%s\""
 
-msgid "could not lock HEAD"
-msgstr "kunde inte låsa HEAD"
-
 msgid "no cherry-pick or revert in progress"
 msgstr "ingen \"cherry-pick\" eller \"revert\" pågår"
 
@@ -19894,20 +20015,20 @@ msgstr ""
 "\tgit rebase --continue\n"
 "\n"
 
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "och gjorde ändringar till indexet och/eller arbetskatalogen\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "och gjorde ändringar till indexet och/eller arbetskatalogen.\n"
 
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
 msgstr ""
 "körningen lyckades: %s\n"
-"men lämnade kvar ändringar i indexet och/eller arbetskatalogen\n"
+"men lämnade kvar ändringar i indexet och/eller arbetskatalogen.\n"
 "Checka in eller utför \"stash\" på ändringarna och kör sedan\n"
 "\n"
 "\tgit rebase --continue\n"
@@ -20341,10 +20462,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u byte/s"
 msgstr[1] "%u bytes/s"
 
-#, c-format
-msgid "could not edit '%s'"
-msgstr "kunde inte redigera \"%s\""
-
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
 msgstr "ignorerar misstänkt undermodulnamn: %s"
@@ -22058,13 +22175,17 @@ msgid "(%s) Could not execute '%s'"
 msgstr "(%s) Kunde inte köra \"%s\""
 
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) Lägger till %s: %s från: \"%s\"\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Felformaterad utdata från \"%s\""
 
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) misslyckades stänga röret till \"%s\""
 
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Lägger till %s: %s från: \"%s\"\n"
+
 msgid "cannot send message as 7bit"
 msgstr "kan inte sända brev som sjubitars"
 
index a24a7ae9cb42a8bf1e98e7a6ae3bc5304cef5c10..d788dfe93e9273e1366e0cc8ad42f6c918a90ceb 100644 (file)
--- a/po/tr.po
+++ b/po/tr.po
@@ -92,8 +92,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Git Turkish Localization Project\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-03 11:32+0300\n"
-"PO-Revision-Date: 2023-03-03 11:40+0300\n"
+"POT-Creation-Date: 2023-05-20 12:55+0300\n"
+"PO-Revision-Date: 2023-05-20 14:00+0300\n"
 "Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
 "Language-Team: Turkish (https://github.com/bitigchi/git-po/)\n"
 "Language: tr\n"
@@ -741,6 +741,23 @@ msgstr "Birleştirme öncesinde değişikliklerinizi işleyin."
 msgid "Exiting because of unfinished merge."
 msgstr "Tamamlanmamış birleştirmeden dolayı çıkılıyor."
 
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Iraksak dallar ileri sarılamaz; şunlardan birini yapmanız gerekiyor:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"veya\n"
+"\n"
+"\tgit rebase\n"
+
 msgid "Not possible to fast-forward, aborting."
 msgstr "İleri sarma olanaklı değil, iptal ediliyor."
 
@@ -1182,6 +1199,10 @@ msgstr ".rej dosya adı %.*s.rej olarak kısaltılıyor"
 msgid "cannot open %s"
 msgstr "%s açılamıyor"
 
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "'%s' bağlantısı kesilemiyor"
+
 #, c-format
 msgid "Hunk #%d applied cleanly."
 msgstr "Parça #%d sorunsuzca uygulandı."
@@ -1365,9 +1386,13 @@ msgstr "git archive --remote <depo> [--exec <komut>] --list"
 msgid "cannot read '%s'"
 msgstr "'%s' okunamıyor"
 
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "yol belirteci '%s', geçerli dizinin dışındaki dosyalarla eşleşiyor"
+
 #, c-format
 msgid "pathspec '%s' did not match any files"
-msgstr "yol belirteci '%s' hiçbir dosya ile eşleşmedi"
+msgstr "yol belirteci '%s', hiçbir dosya ile eşleşmedi"
 
 #, c-format
 msgid "no such ref: %.*s"
@@ -1381,9 +1406,6 @@ msgstr "geçerli bir nesne adı değil: %s"
 msgid "not a tree object: %s"
 msgstr "bir ağaç nesnesi değil: %s"
 
-msgid "current working directory is untracked"
-msgstr "geçerli çalışma dizini izlenmiyor"
-
 #, c-format
 msgid "File not found: %s"
 msgstr "Dosya bulunamadı: %s"
@@ -1510,6 +1532,9 @@ msgstr "pek büyük gitattributes dosyası '%s' dosyası yok sayılıyor"
 msgid "ignoring overly large gitattributes blob '%s'"
 msgstr "pek büyük gitattributes ikili nesnesi '%s' yok sayılıyor"
 
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "hatalı --attr-source veya GIT_ATTR_SOURCE"
+
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
 msgstr "'%s' dosyasında hatalı tırnağa alınmış içerik: %s"
@@ -1615,9 +1640,6 @@ msgstr[1] "İkili arama: Şundan sonra sınanacak %d revizyon kaldı: %s\n"
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents ve --reverse birlikte pek iyi gitmiyor."
 
-msgid "cannot use --contents with final commit object name"
-msgstr "--contents son işleme nesnesi adı ile kullanılamıyor"
-
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr ""
 "--reverse ve --first-parent birlikte en son işlemenin belirtilmesini "
@@ -1800,10 +1822,6 @@ msgstr "'%s' altmodülü: '%s' dalı oluşturulamıyor"
 msgid "'%s' is already checked out at '%s'"
 msgstr "'%s' çıkışı '%s' konumunda halihazırda yapılmış"
 
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "%s çalışma ağacının HEAD'i güncellenmemiş"
-
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<seçenekler>] [--] <yol-blrtç>..."
 
@@ -2837,6 +2855,14 @@ msgstr "'%s' dalı silinemiyor, şurada çıkış yapılmış: '%s'"
 msgid "remote-tracking branch '%s' not found."
 msgstr "Uzak izleme dalı '%s' bulunamadı."
 
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"'%s' dalı bulunamadı.\n"
+"--remote yazmayı mı unuttunuz?"
+
 #, c-format
 msgid "branch '%s' not found."
 msgstr "'%s' dalı bulunamadı."
@@ -2867,6 +2893,10 @@ msgstr "%s dalı %s konumunda yeniden temellendiriliyor"
 msgid "Branch %s is being bisected at %s"
 msgstr "%s dalı %s konumunda ikili aranıyor"
 
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "%s çalışma ağacının HEAD'i güncellenmemiş"
+
 #, c-format
 msgid "Invalid branch name: '%s'"
 msgstr "Geçersiz dal adı: '%s'"
@@ -2967,6 +2997,9 @@ msgstr "bir dalı ve onun başvuru günlüğünü taşı/yeniden adlandır"
 msgid "move/rename a branch, even if target exists"
 msgstr "bir dalı taşı/yeniden adlandır, hedef var olsa bile"
 
+msgid "do not output a newline after empty formatted refs"
+msgstr "boş biçimli başvurulardan sonra bir yenisatır çıktılama"
+
 msgid "copy a branch and its reflog"
 msgstr "bir dalı ve onun başvuru günlüğünü kopyala"
 
@@ -3185,13 +3218,11 @@ msgid "Created new report at '%s'.\n"
 msgstr "Hata raporu '%s' dosyasına yazıldı.\n"
 
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
-"                  [--version=<sürüm>] <dosya> <git-rev-liste-argümanları>"
+"git bundle create [-q | --quiet | --progress]\n"
+"                  [--version=<sürüm>] <dosya> <git-rev-listesi-argümanları>"
 
 msgid "git bundle verify [-q | --quiet] <file>"
 msgstr "git bundle verify [-q | --quiet] <dosya>"
@@ -3211,11 +3242,11 @@ msgstr "ilerleme çubuğunu gösterme"
 msgid "show progress meter"
 msgstr "ilerleme çubuğunu göster"
 
-msgid "show progress meter during object writing phase"
-msgstr "ilerleme çubuğunu nesne yazımı aşaması sırasında göster"
+msgid "historical; same as --progress"
+msgstr "eski seçenek; --progress ile aynı"
 
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "ilerleme çubuğu gösterildiğinde --all-progress'e benzer"
+msgid "historical; does nothing"
+msgstr "eski seçenek; bir şey yapmaz"
 
 msgid "specify bundle format version"
 msgstr "demet biçim sürümünü belirt"
@@ -4220,6 +4251,10 @@ msgstr "'%s' dosyasının bilgileri alınamadı"
 msgid "%s exists and is not a directory"
 msgstr "%s var ve bir dizin değil"
 
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' bir sembolik bağlantı; --local ile klonlama reddediliyor"
+
 #, c-format
 msgid "failed to start iterator over '%s'"
 msgstr "yineleyici '%s' üzerinden çalıştırılamadı"
@@ -5733,118 +5768,13 @@ msgstr "git fetch --all [<seçenekler>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel negatif olamaz"
 
-msgid "fetch from all remotes"
-msgstr "tüm uzak konumlardan getir"
-
-msgid "set upstream for git pull/fetch"
-msgstr "git pull/fetch için üstkaynak ayarla"
-
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr ".git/FETCH_HEAD'in üzerine yazmak yerine ona iliştir"
-
-msgid "use atomic transaction to update references"
-msgstr "başvuruları güncellemek için atomsal işlem kullan"
-
-msgid "path to upload pack on remote end"
-msgstr "uzak uçtaki yükleme paketine olan yol"
-
-msgid "force overwrite of local reference"
-msgstr "yerel başvurunun üzerine zorla yaz"
-
-msgid "fetch from multiple remotes"
-msgstr "birden çok uzak konumdan getir"
-
-msgid "fetch all tags and associated objects"
-msgstr "tüm etiketleri ve ilişkilendirilen nesneleri getir"
-
-msgid "do not fetch all tags (--no-tags)"
-msgstr "tüm etiketleri getirme (--no-tags)"
-
-msgid "number of submodules fetched in parallel"
-msgstr "paralelde getirilen altmodüllerin sayısı"
-
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr ""
-"başvuru belirtecini tüm başvuruları refs/prefetch/'e yerleştirecek biçimde "
-"değiştir"
-
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "artık uzak konumda olmayan uzak izleme dallarını buda"
-
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr ""
-"artık uzak konumda olmayan yerel etiketleri buda ve değiştirilen etiketleri "
-"güncelle"
-
-msgid "on-demand"
-msgstr "istek üzerine"
-
-msgid "control recursive fetching of submodules"
-msgstr "altmodüllerin özyineli getirilmesini denetle"
-
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "getirilen başvuruları FETCH_HEAD dosyasına yaz"
-
-msgid "keep downloaded pack"
-msgstr "indirilen paketi tut"
-
-msgid "allow updating of HEAD ref"
-msgstr "HEAD başvurusunun güncellenmesine izin ver"
-
-msgid "deepen history of shallow clone"
-msgstr "sığ klonun geçmişini derinleştir"
-
-msgid "deepen history of shallow repository based on time"
-msgstr "zamana bağlı olarak sığ deponun geçmişini derinleştir"
-
-msgid "convert to a complete repository"
-msgstr "tam bir depoya dönüştür"
-
-msgid "re-fetch without negotiating common commits"
-msgstr "ortak işlemeleri pazarlık etmeden yeniden getir"
-
-msgid "prepend this to submodule path output"
-msgstr "bunu altmodül yol çıktısının başına ekle"
-
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr ""
-"altmodüllerin özyineli getirilmesi için öntanımlı (yapılandırma "
-"dosyalarından daha az önceliğe iye)"
-
-msgid "accept refs that update .git/shallow"
-msgstr ".git/shallow'u güncelleyen başvuruları kabul et"
-
-msgid "refmap"
-msgstr "ilgili başvuru"
-
-msgid "specify fetch refmap"
-msgstr "getirme ile ilgili başvuruları belirt"
-
-msgid "report that we have only objects reachable from this object"
-msgstr "yalnızca bu nesneden ulaşılabilir nesnelerimiz olduğunu bildir"
-
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr ""
-"bir paket dosyasını getirme; bunun yerine pazarlık ipuçlarının atalarını "
-"yazdır"
-
-msgid "run 'maintenance --auto' after fetching"
-msgstr "getirme sonrasında 'maintenance --auto' çalıştır"
-
-msgid "check for forced-updates on all updated branches"
-msgstr "tüm güncellenmiş dalları zorlanmış güncellemeler için denetle"
-
-msgid "write the commit-graph after fetching"
-msgstr "getirdikten sonra işleme grafiğini yaz"
-
-msgid "accept refspecs from stdin"
-msgstr "başvuru belirteçlerini stdin'den oku"
-
 msgid "couldn't find remote ref HEAD"
 msgstr "uzak HEAD başvurusu bulunamadı"
 
+#, c-format
+msgid "From %.*s\n"
+msgstr "Şu konumdan: %.*s\n"
+
 #, c-format
 msgid "object %s not found"
 msgstr "%s nesnesi bulunamadı"
@@ -5915,10 +5845,6 @@ msgstr "%s tüm gerekli nesneleri göndermedi\n"
 msgid "rejected %s because shallow roots are not allowed to be updated"
 msgstr "%s reddedildi; çünkü sığ köklerin güncellenmesine izin verilmiyor"
 
-#, c-format
-msgid "From %.*s\n"
-msgstr "Şu konumdan: %.*s\n"
-
 #, c-format
 msgid ""
 "some local refs could not be updated; try running\n"
@@ -6010,6 +5936,115 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "bir etiket adı belirtmeniz gerekiyor"
 
+msgid "fetch from all remotes"
+msgstr "tüm uzak konumlardan getir"
+
+msgid "set upstream for git pull/fetch"
+msgstr "git pull/fetch için üstkaynak ayarla"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr ".git/FETCH_HEAD'in üzerine yazmak yerine ona iliştir"
+
+msgid "use atomic transaction to update references"
+msgstr "başvuruları güncellemek için atomsal işlem kullan"
+
+msgid "path to upload pack on remote end"
+msgstr "uzak uçtaki yükleme paketine olan yol"
+
+msgid "force overwrite of local reference"
+msgstr "yerel başvurunun üzerine zorla yaz"
+
+msgid "fetch from multiple remotes"
+msgstr "birden çok uzak konumdan getir"
+
+msgid "fetch all tags and associated objects"
+msgstr "tüm etiketleri ve ilişkilendirilen nesneleri getir"
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr "tüm etiketleri getirme (--no-tags)"
+
+msgid "number of submodules fetched in parallel"
+msgstr "paralelde getirilen altmodüllerin sayısı"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+"başvuru belirtecini tüm başvuruları refs/prefetch/'e yerleştirecek biçimde "
+"değiştir"
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "artık uzak konumda olmayan uzak izleme dallarını buda"
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+"artık uzak konumda olmayan yerel etiketleri buda ve değiştirilen etiketleri "
+"güncelle"
+
+msgid "on-demand"
+msgstr "istek üzerine"
+
+msgid "control recursive fetching of submodules"
+msgstr "altmodüllerin özyineli getirilmesini denetle"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "getirilen başvuruları FETCH_HEAD dosyasına yaz"
+
+msgid "keep downloaded pack"
+msgstr "indirilen paketi tut"
+
+msgid "allow updating of HEAD ref"
+msgstr "HEAD başvurusunun güncellenmesine izin ver"
+
+msgid "deepen history of shallow clone"
+msgstr "sığ klonun geçmişini derinleştir"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "zamana bağlı olarak sığ deponun geçmişini derinleştir"
+
+msgid "convert to a complete repository"
+msgstr "tam bir depoya dönüştür"
+
+msgid "re-fetch without negotiating common commits"
+msgstr "ortak işlemeleri pazarlık etmeden yeniden getir"
+
+msgid "prepend this to submodule path output"
+msgstr "bunu altmodül yol çıktısının başına ekle"
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+"altmodüllerin özyineli getirilmesi için öntanımlı (yapılandırma "
+"dosyalarından daha az önceliğe iye)"
+
+msgid "accept refs that update .git/shallow"
+msgstr ".git/shallow'u güncelleyen başvuruları kabul et"
+
+msgid "refmap"
+msgstr "ilgili başvuru"
+
+msgid "specify fetch refmap"
+msgstr "getirme ile ilgili başvuruları belirt"
+
+msgid "report that we have only objects reachable from this object"
+msgstr "yalnızca bu nesneden ulaşılabilir nesnelerimiz olduğunu bildir"
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+"bir paket dosyasını getirme; bunun yerine pazarlık ipuçlarının atalarını "
+"yazdır"
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr "getirme sonrasında 'maintenance --auto' çalıştır"
+
+msgid "check for forced-updates on all updated branches"
+msgstr "tüm güncellenmiş dalları zorlanmış güncellemeler için denetle"
+
+msgid "write the commit-graph after fetching"
+msgstr "getirdikten sonra işleme grafiğini yaz"
+
+msgid "accept refspecs from stdin"
+msgstr "başvuru belirteçlerini stdin'den oku"
+
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only'e bir veya daha çok --negotiation-tip=* gerekiyor"
 
@@ -6125,6 +6160,12 @@ msgstr "yalnızca işlemeyi içeren başvuruları yazdır"
 msgid "print only refs which don't contain the commit"
 msgstr "yalnızca işlemeyi içermeyen başvuruları yazdır"
 
+msgid "read reference patterns from stdin"
+msgstr "başvuru dizgilerini stdin'den oku"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr "--stdin ile bilinmeyen argümanlar verilmiş"
+
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<yapılandırma> [--] <argümanlar>"
 
@@ -6137,6 +6178,10 @@ msgstr "bir depo yolları listesi tutan yapılandırma anahtarı"
 msgid "missing --config=<config>"
 msgstr "--config=<yapılandırma> eksik"
 
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "hatayı yapılandırma alındı, --config=%s"
+
 msgid "unknown"
 msgstr "bilinmeyen"
 
@@ -6283,19 +6328,28 @@ msgstr "%s: ayrık HEAD bir şeye işaret etmiyor"
 msgid "notice: %s points to an unborn branch (%s)"
 msgstr "Uyarı: %s henüz doğmamış bir dala işaret ediyor (%s)"
 
-msgid "Checking cache tree"
-msgstr "Önbellek ağacı denetleniyor"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "%s ögesinin önbellek ağacı denetleniyor"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s: cache-tree içinde geçersiz sha1 işaretçisi"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: %s ögesinin cache-tree'si içinde geçersiz sha1 işaretçisi"
 
 msgid "non-tree in cache-tree"
 msgstr "cache-tree içinde ağaç olmayan öge"
 
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s: resolve-undo içinde geçersiz sha1 işaretçisi"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: %s ögesinin resolve-undo'su içinde geçersiz sha1 işaretçisi"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "'%s' paketi için rev-index yüklenemiyor"
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "'%s' paketi için geçersiz rev-index"
 
 msgid ""
 "git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
@@ -9139,6 +9193,12 @@ msgstr "desteklenmeyen indeks sürümü %s"
 msgid "bad index version '%s'"
 msgstr "hatalı indeks sürümü '%s'"
 
+msgid "show progress meter during object writing phase"
+msgstr "ilerleme çubuğunu nesne yazımı aşaması sırasında göster"
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "ilerleme çubuğu gösterildiğinde --all-progress'e benzer"
+
 msgid "<version>[,<offset>]"
 msgstr "<sürüm>[,<ofset>]"
 
@@ -9329,6 +9389,9 @@ msgstr ""
 "<git@vger.kernel.org> adresine bir e-posta atarak\n"
 "bize haber verin. Sağ olun.\n"
 
+msgid "refusing to run without --i-still-use-this"
+msgstr "--i-still-use-this olmadan çalıştırma reddediliyor"
+
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
 
@@ -9499,7 +9562,7 @@ msgstr "İndekse eklenen değişikliklerle henüz doğmamış bir dal güncellen
 msgid "pull with rebase"
 msgstr "yeniden temellendirme ile çekim"
 
-msgid "please commit or stash them."
+msgid "Please commit or stash them."
 msgstr "Lütfen onları işleyin veya zulalayın."
 
 #, c-format
@@ -9735,8 +9798,8 @@ msgstr "'%s' için geçersiz değer"
 msgid "repository"
 msgstr "depo"
 
-msgid "push all refs"
-msgstr "tüm başvuruları it"
+msgid "push all branches"
+msgstr "tüm dalları it"
 
 msgid "mirror all refs"
 msgstr "tüm başvuruları yansıla"
@@ -9744,11 +9807,11 @@ msgstr "tüm başvuruları yansıla"
 msgid "delete refs"
 msgstr "başvuruları sil"
 
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "etiketleri it (--all veya --mirror ile kullanılamaz)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "etiketleri it (--all, --branches  veya --mirror ile kullanılamaz)"
 
 msgid "force updates"
-msgstr "zorla güncelle"
+msgstr "güncellemeleri zorla"
 
 msgid "<refname>:<expect>"
 msgstr "<bşvr-adı>:<bekle>"
@@ -10008,6 +10071,10 @@ msgstr ""
 "\n"
 "Bunun sonucu olarak git onları yeniden temellendiremiyor."
 
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "Bilinmeyen rebase-merges kipi: %s"
+
 #, c-format
 msgid "could not switch to %s"
 msgstr "şuraya geçilemedi: %s"
@@ -10022,6 +10089,15 @@ msgid ""
 msgstr ""
 "Tanımlanamayan boş tür '%s'; geçerli türler: \"drop\", \"keep\" ve \"ask\"."
 
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"bir boş dizi argümanıyla --rebase-merges yapmak artık kullanılmıyor ve "
+"Git'in ileriki bir sürümünde tümüyle kaldırılacak. Bunun yerine, aynı şeyi "
+"yapan argümansız bir --rebase-merges kullanın."
+
 #, c-format
 msgid ""
 "%s\n"
@@ -10243,18 +10319,21 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "'C' anahtarı sayısal bir değer bekliyor"
 
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "Bilinmeyen kip: %s"
-
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy, --merge veya --interactive gerektiriyor"
 
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
 msgstr ""
-"uygulama seçenekleri, rebase.autosquash ile uyumlu değil. --no-autosquash "
+"seçenekleri uygula, rebase.autoSquash ile uyumlu değil. --no-autosquash "
+"eklemeyi düşünün"
+
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+"seçenekleri uygula, rebase.rebaseMerges ile uyumlu değil. --no-rebase-merges "
 "eklemeyi düşünün"
 
 msgid ""
@@ -10301,9 +10380,6 @@ msgstr "'%s': tam olarak bir birleştirme temeli gerekiyor"
 msgid "Does not point to a valid commit '%s'"
 msgstr "'%s' geçerli bir işlemeye işaret etmiyor"
 
-msgid "Please commit or stash them."
-msgstr "Lütfen onları işleyin veya zulalayın."
-
 msgid "HEAD is up to date."
 msgstr "HEAD güncel."
 
@@ -10965,8 +11041,8 @@ msgstr "-a ile aynı, ulaşılamayan süprüntü nesneleri ayrı paketle"
 msgid "approxidate"
 msgstr "yaklaşık tarih"
 
-msgid "with -C, expire objects older than this"
-msgstr "-C ile, bundan daha eski nesneleri yürürlükten kaldır"
+msgid "with --cruft, expire objects older than this"
+msgstr "--cruft ile, bundan daha eski nesneleri yürürlükten kaldır"
 
 msgid "remove redundant packs, and run git-prune-packed"
 msgstr "gereksiz paketleri kaldır ve 'git-prune-packed' çalıştır"
@@ -11634,6 +11710,9 @@ msgstr ""
 msgid "remote name"
 msgstr "uzak konum adı"
 
+msgid "push all refs"
+msgstr "tüm başvuruları it"
+
 msgid "use stateless RPC protocol"
 msgstr "durumsuz RPC protokolünü kullan"
 
@@ -11834,9 +11913,11 @@ msgid "show refs from stdin that aren't in local repository"
 msgstr "stdin'den yerel bir depoda olmayan başvuruları göster"
 
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<sçnklr>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<seçenekler>]"
 
 msgid "this worktree is not sparse"
 msgstr "bu çalışma ağacı aralıklı değil"
@@ -11958,6 +12039,23 @@ msgstr ""
 msgid "error while refreshing working directory"
 msgstr "çalışma dizini yenilenirken hata"
 
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <dosya>]"
+
+msgid "terminate input and output files by a NUL character"
+msgstr "girdi ve çıktı dosyalarını bir NUL karakteri ile sonlandır"
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"--rules-file ile kullanıldığında dizgileri koni kipi dizgileri olarak yorumla"
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "geçerli dizgiler yerine <dosya> içindekileri kullan."
+
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<günlük-seçenekleri>]"
 
@@ -14778,8 +14876,8 @@ msgstr "kısaltma uzunluğu erim dışında: %d"
 msgid "bad zlib compression level %d"
 msgstr "hatalı zlib sıkıştırma düzeyi %d"
 
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar yalnızca bir karakter olmalı"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar yalnızca bir ASCII karakter olmalı"
 
 #, c-format
 msgid "ignoring unknown core.fsyncMethod value '%s'"
@@ -14889,6 +14987,10 @@ msgstr "'%s', '%s' olarak ayarlanamadı"
 msgid "invalid section name: %s"
 msgstr "geçersiz bölüm adı: %s"
 
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "'%s' içindeki haddinden uzun %<PRIuMAX>. satırla çalışma reddediliyor"
+
 #, c-format
 msgid "missing value for '%s'"
 msgstr "'%s' için değer eksik"
@@ -15559,6 +15661,9 @@ msgstr "çıktının her satırının başına ek bir önek ekle"
 msgid "do not show any source or destination prefix"
 msgstr "hiçbir kaynak ve hedef önekini gösterme"
 
+msgid "use default prefixes a/ and b/"
+msgstr "a/ ve b/ ögelerinin öntanımlı öneklerini kullan"
+
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr "diff parçaları arasındaki bağlamı belirtilen satır sayısı kadar göster"
 
@@ -15856,6 +15961,14 @@ msgstr "git dizini '%s' konumundan '%s' konumuna göç ettirilemedi"
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "İpucu: Düzenleyicinizin dosyayı kapatması bekleniyor...%c"
 
+#, c-format
+msgid "could not write to '%s'"
+msgstr "şuraya yazılamadı: '%s'"
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "'%s' düzenlenemedi"
+
 msgid "Filtering content"
 msgstr "İçerik süzülüyor"
 
@@ -16150,6 +16263,10 @@ msgstr "-c bir yapılandırma dizisi bekliyor\n"
 msgid "no config key given for --config-env\n"
 msgstr "--config-env için bir yapılandırma anahtarı verilmedi\n"
 
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "--attr-source için öznitelik kaynağı verilmedi\n"
+
 #, c-format
 msgid "unknown option: %s\n"
 msgstr "bilinmeyen seçenek: %s\n"
@@ -17822,6 +17939,10 @@ msgstr "öge bulunamadı: '%s'; '%s' paketinde, %<PRIuMAX> ofsetinde"
 msgid "unable to get disk usage of '%s'"
 msgstr "'%s' ögesinin disk kullanımı alınamadı"
 
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "biteşlem dosyası '%s', geçersiz sağlama toplamına iye"
+
 #, c-format
 msgid "mtimes file %s is too small"
 msgstr "mtimes dosyası %s pek küçük"
@@ -17862,6 +17983,13 @@ msgstr "%s reverse-index dosyasının sürümü %<PRIu32> desteklenmiyor"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "%s reverse-index dosyasının sağlama numarası %<PRIu32> desteklenmiyor"
 
+msgid "invalid checksum"
+msgstr "geçersiz sağlama toplamı"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "%<PRIu64> konumunda geçersiz rev-index konumu: %<PRIu32> != %<PRIu32>"
+
 msgid "cannot both write and verify reverse index"
 msgstr "ters indeks dosyası hem yazılıp hem doğrulanamıyor"
 
@@ -18572,6 +18700,10 @@ msgstr "tanımlanamayan %%(%s) argümanı: %s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "pozitif genişlik %%(align) ögeciği ile birlikte bekleniyordu"
 
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "beklenen biçim: %%(ahead-behind:<işlememsi>)"
+
 #, c-format
 msgid "malformed field name: %.*s"
 msgstr "hatalı oluşturulmuş alan adı: %.*s"
@@ -19193,10 +19325,6 @@ msgstr "'%s' içindeki çakışan durum güncellenemedi"
 msgid "no remembered resolution for '%s'"
 msgstr "'%s' için hatırlanan çözüm yok"
 
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "'%s' bağlantısı kesilemiyor"
-
 #, c-format
 msgid "Updated preimage for '%s'"
 msgstr "'%s' için öngörüntü güncellendi"
@@ -19530,10 +19658,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "'%s' kilitlenemedi"
 
-#, c-format
-msgid "could not write to '%s'"
-msgstr "şuraya yazılamadı: '%s'"
-
 #, c-format
 msgid "could not write eol to '%s'"
 msgstr "satır sonu şuraya yazılamadı: '%s'"
@@ -19894,9 +20018,6 @@ msgstr "\"git cherry-pick (--continue | %s--abort | --quit)\" deneyin"
 msgid "could not create sequencer directory '%s'"
 msgstr "ardıştırıcı dizini '%s' oluşturulamadı"
 
-msgid "could not lock HEAD"
-msgstr "HEAD kilitlenemedi"
-
 msgid "no cherry-pick or revert in progress"
 msgstr "süren bir seç-al veya geri al yok"
 
@@ -19991,20 +20112,20 @@ msgstr ""
 "\tgit rebase --continue\n"
 "\n"
 
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "ve indekse ve/veya çalışma ağacına değişiklikler yapıldı\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "ve indekse ve/veya çalışma ağacına değişiklikler yapıldı.\n"
 
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
 msgstr ""
-"Yürütme başarılı oldu: %s,\n"
-"ancak indeksinize ve/veya çalışma ağacınıza değişiklikler bıraktı\n"
+"Yürütme başarılı oldu: %s;\n"
+"ancak indeksinize ve/veya çalışma ağacınıza değişiklikler bıraktı.\n"
 "Değişikliklerinizi işleyin veya zulalayın, ardından şunu çalıştırın:\n"
 "\n"
 "\tgit rebase --continue\n"
@@ -20437,10 +20558,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u bayt/sn"
 msgstr[1] "%u bayt/sn"
 
-#, c-format
-msgid "could not edit '%s'"
-msgstr "'%s' düzenlenemedi"
-
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
 msgstr "kuşku doğuran altmodül yok sayılıyor: %s"
@@ -22147,12 +22264,16 @@ msgid "(%s) Could not execute '%s'"
 msgstr "(%s) '%s' yürütülemedi"
 
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) %s: %s, '%s' konumundan ekleniyor\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) '%s' ögesinden hatalı oluşturulmuş çıktı"
 
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
-msgstr "(%s) şuraya olan veri yolu kapatılamadı: '%s'"
+msgstr "(%s) şuraya olan veriyolu kapatılamadı: '%s'"
+
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) %s: %s, '%s' konumundan ekleniyor\n"
 
 msgid "cannot send message as 7bit"
 msgstr "ileti 7 bit olarak gönderilemiyor"
diff --git a/po/uk.po b/po/uk.po
new file mode 100644 (file)
index 0000000..11c57b9
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,21554 @@
+# Ukrainian translation for Git package.
+# Український переклад пакету Git.
+# Copyright (c) 2023 Arkadii Yakovets.
+# Copyright (c) 2023 Kateryna Golovanova.
+# This file is distributed under the same license as the Git package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Git v2.41\n"
+"Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
+"POT-Creation-Date: 2023-05-15 23:57+0000\n"
+"PO-Revision-Date: 2023-05-17 13:51-0700\n"
+"Last-Translator: Arkadii Yakovets <ark@cho.red>\n"
+"Language-Team: Ukrainian <https://github.com/arkid15r/git-ukrainian-l10n/>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
+"X-Generator: Poedit 3.3.1\n"
+
+#, c-format
+msgid "Huh (%s)?"
+msgstr "Га (%s)?"
+
+msgid "could not read index"
+msgstr "не вдалося прочитати індекс"
+
+msgid "binary"
+msgstr "бінарний"
+
+msgid "nothing"
+msgstr "нічого"
+
+msgid "unchanged"
+msgstr "без змін"
+
+msgid "Update"
+msgstr "Оновити"
+
+#, c-format
+msgid "could not stage '%s'"
+msgstr "не вдалося додати до індекса %s"
+
+msgid "could not write index"
+msgstr "не вдалося записати індекс"
+
+#, c-format
+msgid "updated %d path\n"
+msgid_plural "updated %d paths\n"
+msgstr[0] "оновлено %d шлях\n"
+msgstr[1] "оновлено %d шляхи\n"
+msgstr[2] "оновлено %d шляхів\n"
+
+#, c-format
+msgid "note: %s is untracked now.\n"
+msgstr "примітка: %s зараз не відстежується.\n"
+
+#, c-format
+msgid "make_cache_entry failed for path '%s'"
+msgstr "невдала спроба make_cache_entry для шляху '%s'"
+
+msgid "Revert"
+msgstr "Вивернути"
+
+msgid "Could not parse HEAD^{tree}"
+msgstr "Не вдалося розібрати HEAD^{tree}"
+
+#, c-format
+msgid "reverted %d path\n"
+msgid_plural "reverted %d paths\n"
+msgstr[0] "вивернуто %d шлях\n"
+msgstr[1] "вивернуто %d шляхи\n"
+msgstr[2] "вивернуто %d шляхів\n"
+
+#, c-format
+msgid "No untracked files.\n"
+msgstr "Невідстежуваних файлів немає\n"
+
+msgid "Add untracked"
+msgstr "Додати невідстежувані"
+
+#, c-format
+msgid "added %d path\n"
+msgid_plural "added %d paths\n"
+msgstr[0] "додано %d шлях\n"
+msgstr[1] "додано %d шляхи\n"
+msgstr[2] "додано %d шляхів\n"
+
+#, c-format
+msgid "ignoring unmerged: %s"
+msgstr "ігноруються незлиті записи: %s"
+
+#, c-format
+msgid "Only binary files changed.\n"
+msgstr "Змінилися лише бінарні файли.\n"
+
+#, c-format
+msgid "No changes.\n"
+msgstr "Нічого не змінено.\n"
+
+msgid "Patch update"
+msgstr "Оновлення патча"
+
+msgid "Review diff"
+msgstr "Переглянути різницю"
+
+msgid "show paths with changes"
+msgstr "показати шляхи зі змінами"
+
+msgid "add working tree state to the staged set of changes"
+msgstr "додати стан робочого дерева до індексу"
+
+msgid "revert staged set of changes back to the HEAD version"
+msgstr "вивернути зміни індексу до версії HEAD"
+
+msgid "pick hunks and update selectively"
+msgstr "вибирати шматки і оновлювати вибірково"
+
+msgid "view diff between HEAD and index"
+msgstr "переглянути різницю між HEAD та індексом"
+
+msgid "add contents of untracked files to the staged set of changes"
+msgstr "додати вміст невідстежуваних файлів до індексу"
+
+msgid "Prompt help:"
+msgstr "Інформація про опції:"
+
+msgid "select a single item"
+msgstr "вибрати один елемент"
+
+msgid "select a range of items"
+msgstr "вибрати діапазон елементів"
+
+msgid "select multiple ranges"
+msgstr "вибрати кілька діапазонів"
+
+msgid "select item based on unique prefix"
+msgstr "вибрати елемент за унікальним префіксом"
+
+msgid "unselect specified items"
+msgstr "зняти позначку із зазначених елементів"
+
+msgid "choose all items"
+msgstr "вибрати всі елементи"
+
+msgid "(empty) finish selecting"
+msgstr "(пусто) закінчити вибір"
+
+msgid "select a numbered item"
+msgstr "вибрати пронумерований елемент"
+
+msgid "(empty) select nothing"
+msgstr "(пусто) нічого не вибирати"
+
+msgid "*** Commands ***"
+msgstr "*** Команди ***"
+
+msgid "What now"
+msgstr "Що тепер"
+
+msgid "staged"
+msgstr "в індексі"
+
+msgid "unstaged"
+msgstr "поза індексом"
+
+msgid "path"
+msgstr "шлях"
+
+msgid "could not refresh index"
+msgstr "не вдалося оновити індекс"
+
+#, c-format
+msgid "Bye.\n"
+msgstr "До побачення.\n"
+
+#, c-format
+msgid "Stage mode change [y,n,q,a,d%s,?]? "
+msgstr "Індексувати зміну режиму [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stage deletion [y,n,q,a,d%s,?]? "
+msgstr "Індексувати видалення [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stage addition [y,n,q,a,d%s,?]? "
+msgstr "Індексувати додавання [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stage this hunk [y,n,q,a,d%s,?]? "
+msgstr "Індексувати цей шматок [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"staging."
+msgstr ""
+"Якщо патч буде застосовано без помилок, відредагований шматок буде одразу ж "
+"позначено для індексації."
+
+msgid ""
+"y - stage this hunk\n"
+"n - do not stage this hunk\n"
+"q - quit; do not stage this hunk or any of the remaining ones\n"
+"a - stage this hunk and all later hunks in the file\n"
+"d - do not stage this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - індексувати цей шматок\n"
+"n - не індексувати цей шматок\n"
+"q - вийти; не індексувати ні цей шматок, ні решту\n"
+"a - індексувати цей шматок і всі наступні шматки у файлі\n"
+"d - не індексувати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "Stash mode change [y,n,q,a,d%s,?]? "
+msgstr "Сховати зміну режиму [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stash deletion [y,n,q,a,d%s,?]? "
+msgstr "Сховати видалення [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stash addition [y,n,q,a,d%s,?]? "
+msgstr "Сховати додавання [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Stash this hunk [y,n,q,a,d%s,?]? "
+msgstr "Сховати цей шматок [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"stashing."
+msgstr ""
+"Якщо патч буде застосовано без помилок, відредагований шматок буде одразу ж "
+"позначено для схову."
+
+msgid ""
+"y - stash this hunk\n"
+"n - do not stash this hunk\n"
+"q - quit; do not stash this hunk or any of the remaining ones\n"
+"a - stash this hunk and all later hunks in the file\n"
+"d - do not stash this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - сховати цей шматок\n"
+"n - не ховати цей шматок\n"
+"q - вийти; не ховати ні цей шматок, ні решту\n"
+"a - сховати цей шматок і всі наступні шматки у файлі\n"
+"d - не ховати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "Unstage mode change [y,n,q,a,d%s,?]? "
+msgstr "Розіндексувати зміну режиму [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Unstage deletion [y,n,q,a,d%s,?]? "
+msgstr "Розіндексувати видалення [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Unstage addition [y,n,q,a,d%s,?]? "
+msgstr "Розіндексувати додавання [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
+msgstr "Розіндексувати цей шматок [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"unstaging."
+msgstr ""
+"Якщо патч буде застосовано без помилок, відредагований шматок буде одразу ж "
+"позначено для розіндексації."
+
+msgid ""
+"y - unstage this hunk\n"
+"n - do not unstage this hunk\n"
+"q - quit; do not unstage this hunk or any of the remaining ones\n"
+"a - unstage this hunk and all later hunks in the file\n"
+"d - do not unstage this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - розіндексувати цей шматок\n"
+"n - не розіндексовувати цей шматок\n"
+"q - вийти; не розіндексовувати ні цей шматок, ні решту\n"
+"a - розіндексувати цей шматок і всі наступні шматки у файлі\n"
+"d - не розіндексувати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
+msgstr "Застосувати зміну режиму до індексу [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
+msgstr "Застосувати видалення до індексу [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to index [y,n,q,a,d%s,?]? "
+msgstr "Застосувати додавання до індексу [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
+msgstr "Застосувати цей шматок до індексу [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"applying."
+msgstr ""
+"Якщо патч буде застосовано без помилок, відредагований шматок буде одразу ж "
+"позначено для застосування."
+
+msgid ""
+"y - apply this hunk to index\n"
+"n - do not apply this hunk to index\n"
+"q - quit; do not apply this hunk or any of the remaining ones\n"
+"a - apply this hunk and all later hunks in the file\n"
+"d - do not apply this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - застосувати цей шматок до індексу\n"
+"n - не застосовувати цей шматок до індексу\n"
+"q - вийти; не застосовувати ні цей шматок, ні решту\n"
+"a - застосувати цей шматок і всі наступні шматки у файлі\n"
+"d - не застосовувати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути зміну режиму з робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути видалення з робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути додавання з робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути цей шматок з робочого дерева [y,n,q,a,d%s,?]? "
+
+msgid ""
+"If the patch applies cleanly, the edited hunk will immediately be marked for "
+"discarding."
+msgstr ""
+"Якщо патч буде застосовано без помилок, відредагований шматок буде одразу ж "
+"позначено для відкидання."
+
+msgid ""
+"y - discard this hunk from worktree\n"
+"n - do not discard this hunk from worktree\n"
+"q - quit; do not discard this hunk or any of the remaining ones\n"
+"a - discard this hunk and all later hunks in the file\n"
+"d - do not discard this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - відкинути цей шматок з робочого дерева\n"
+"n - не відкидати цей шматок з робочого дерева\n"
+"q - вийти; не відкидати ні цей шматок, ні решту\n"
+"a - відкинути цей шматок і всі наступні шматки у файлі\n"
+"d - не відкидати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути зміну режиму з індексу та робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути видалення з індексу та робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути додавання з індексу та робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Відкинути цей шматок з індексу та робочого дерева [y,n,q,a,d%s,?]? "
+
+msgid ""
+"y - discard this hunk from index and worktree\n"
+"n - do not discard this hunk from index and worktree\n"
+"q - quit; do not discard this hunk or any of the remaining ones\n"
+"a - discard this hunk and all later hunks in the file\n"
+"d - do not discard this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - відкинути цей шматок з індексу та робочого дерева\n"
+"n - не відкидати цей шматок з індексу та робочого дерева\n"
+"q - вийти; не відкидати ні цей шматок, ні решту\n"
+"a - відкинути цей шматок і всі наступні шматки у файлі\n"
+"d - не відкидати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
+msgstr ""
+"Застосувати зміну режиму до індексу та робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Застосувати видалення до індексу та робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Застосувати додавання до індексу та робочого дерева [y,n,q,a,d%s,?] "
+
+#, c-format
+msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
+msgstr "Застосувати цей шматок до індексу та робочого дерева [y,n,q,a,d%s,?] "
+
+msgid ""
+"y - apply this hunk to index and worktree\n"
+"n - do not apply this hunk to index and worktree\n"
+"q - quit; do not apply this hunk or any of the remaining ones\n"
+"a - apply this hunk and all later hunks in the file\n"
+"d - do not apply this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - застосувати цей шматок до індексу та робочого дерева\n"
+"n - не застосовувати цей шматок до індексу та робочого дерева\n"
+"q - вийти; не застосовувати ні цей шматок, ні решту\n"
+"a - застосувати цей шматок і всі наступні шматки у файлі\n"
+"d - не застосовувати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
+msgstr "Застосувати зміну режиму до робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
+msgstr "Застосувати видалення до робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
+msgstr "Застосувати додавання до робочого дерева [y,n,q,a,d%s,?]? "
+
+#, c-format
+msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
+msgstr "Застосувати цей шматок до робочого дерева [y,n,q,a,d%s,?]? "
+
+msgid ""
+"y - apply this hunk to worktree\n"
+"n - do not apply this hunk to worktree\n"
+"q - quit; do not apply this hunk or any of the remaining ones\n"
+"a - apply this hunk and all later hunks in the file\n"
+"d - do not apply this hunk or any of the later hunks in the file\n"
+msgstr ""
+"y - застосувати цей шматок до робочого дерева\n"
+"n - не застосовувати цей шматок до робочого дерева\n"
+"q - вийти; не застосовувати ні цей шматок, ні решту\n"
+"a - застосувати цей шматок і всі наступні шматки у файлі\n"
+"d - не застосовувати цей шматок і всі наступні шматки у файлі\n"
+
+#, c-format
+msgid "could not parse hunk header '%.*s'"
+msgstr "не вдалося розібрати заголовок шматка \"%.*s\""
+
+msgid "could not parse diff"
+msgstr "не вдалося розібрати різницю"
+
+msgid "could not parse colored diff"
+msgstr "не вдалося розібрати кольоровану різницю"
+
+#, c-format
+msgid "failed to run '%s'"
+msgstr "не вдалося запустити \"%s\""
+
+msgid "mismatched output from interactive.diffFilter"
+msgstr "неспівпадіння виводу з interactive.diffFilter"
+
+msgid ""
+"Your filter must maintain a one-to-one correspondence\n"
+"between its input and output lines."
+msgstr ""
+"Ваш фільтр повинен підтримувати один до одного відповідність\n"
+"між його вхідними та вихідними рядками."
+
+#, c-format
+msgid ""
+"expected context line #%d in\n"
+"%.*s"
+msgstr ""
+"очікувався рядок контексту #%d в\n"
+"%.*s"
+
+#, c-format
+msgid ""
+"hunks do not overlap:\n"
+"%.*s\n"
+"\tdoes not end with:\n"
+"%.*s"
+msgstr ""
+"шматки не перетинаються:\n"
+"%.*s\n"
+"\tне закінчується на:\n"
+"%.*s"
+
+msgid "Manual hunk edit mode -- see bottom for a quick guide.\n"
+msgstr "Режим ручного редагування шматка -- див. короткий посібник внизу.\n"
+
+#, c-format
+msgid ""
+"---\n"
+"To remove '%c' lines, make them ' ' lines (context).\n"
+"To remove '%c' lines, delete them.\n"
+"Lines starting with %c will be removed.\n"
+msgstr ""
+"---\n"
+"Щоб видалити рядки \"%c\", зробіть їх рядками \" \" (контекст).\n"
+"Щоб видалити рядки \"%c\", вилучіть їх.\n"
+"Буде видалено рядки, що починаються з %c.\n"
+
+msgid ""
+"If it does not apply cleanly, you will be given an opportunity to\n"
+"edit again.  If all lines of the hunk are removed, then the edit is\n"
+"aborted and the hunk is left unchanged.\n"
+msgstr ""
+"Якщо шматок буде застосований з помилками, вам буде надана можливість\n"
+"відредагувати ще раз.  Якщо всі рядки шматка буде вилучено, то редагування "
+"буде\n"
+"перервано, і шматок залишиться без змін.\n"
+
+msgid "could not parse hunk header"
+msgstr "не вдалося розібрати заголовок шматка"
+
+msgid "'git apply --cached' failed"
+msgstr "\"git apply --cached\" завершився невдало"
+
+#. TRANSLATORS: do not translate [y/n]
+#. The program will only accept that input at this point.
+#. Consider translating (saying "no" discards!) as
+#. (saying "n" for "no" discards!) if the translation
+#. of the word "no" does not start with n.
+#.
+
+msgid ""
+"Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
+msgstr ""
+"Ваш відредагований шматок неможливо застосувати. Відредагувати ще раз "
+"(\"no\" - відкинути!) [y/n]? "
+
+msgid "The selected hunks do not apply to the index!"
+msgstr "Вибрані шматки неможливо застосувати до індексу!"
+
+msgid "Apply them to the worktree anyway? "
+msgstr "Все одно застосувати їх до робочого дерева? "
+
+msgid "Nothing was applied.\n"
+msgstr "Нічого не застосовано.\n"
+
+msgid ""
+"j - leave this hunk undecided, see next undecided hunk\n"
+"J - leave this hunk undecided, see next hunk\n"
+"k - leave this hunk undecided, see previous undecided hunk\n"
+"K - leave this hunk undecided, see previous hunk\n"
+"g - select a hunk to go to\n"
+"/ - search for a hunk matching the given regex\n"
+"s - split the current hunk into smaller hunks\n"
+"e - manually edit the current hunk\n"
+"? - print help\n"
+msgstr ""
+"j - залишити цей шматок невизначеним, перейти до наступного невизначеного "
+"шматка\n"
+"J - залишити цей шматок невизначеним, перейти до наступного шматка\n"
+"k - залишити цей шматок невизначеним, перейти до попереднього невизначеного "
+"шматка\n"
+"K - залишити цей шматок невизначеним, перейти до попереднього шматка\n"
+"g - вибрати шматок, до якого ви хочете перейти\n"
+"/ - шукати шматок, що відповідає заданому регвиру\n"
+"s - розбити поточний шматок на менші шматки\n"
+"e - редагувати поточний шматок вручну\n"
+"? - показати довідку\n"
+
+msgid "No previous hunk"
+msgstr "Немає попереднього шматка"
+
+msgid "No next hunk"
+msgstr "Немає наступного шматка"
+
+msgid "No other hunks to goto"
+msgstr "Немає інших шматків для переходу"
+
+msgid "go to which hunk (<ret> to see more)? "
+msgstr "до якого шматка перейти (<ret>, щоб побачити більше)? "
+
+msgid "go to which hunk? "
+msgstr "до якого шматка перейти? "
+
+#, c-format
+msgid "Invalid number: '%s'"
+msgstr "Неприпустиме число: \"%s\""
+
+#, c-format
+msgid "Sorry, only %d hunk available."
+msgid_plural "Sorry, only %d hunks available."
+msgstr[0] "Вибачте, доступний лише %d шматок."
+msgstr[1] "Вибачте, доступно лише %d шматки."
+msgstr[2] "Вибачте, доступно лише %d шматків."
+
+msgid "No other hunks to search"
+msgstr "Немає інших шматків для пошуку"
+
+msgid "search for regex? "
+msgstr "шукати регвир? "
+
+#, c-format
+msgid "Malformed search regexp %s: %s"
+msgstr "Невірно сформований регвир пошуку %s: %s"
+
+msgid "No hunk matches the given pattern"
+msgstr "Жоден шматок не відповідає заданому шаблону"
+
+msgid "Sorry, cannot split this hunk"
+msgstr "Вибачте, не можу розділити цей шматок"
+
+#, c-format
+msgid "Split into %d hunks."
+msgstr "Розділити на %d шматків."
+
+msgid "Sorry, cannot edit this hunk"
+msgstr "Вибачте, не можу редагувати цей шматок"
+
+msgid "'git apply' failed"
+msgstr "\"git apply\" завершився невдало"
+
+#, c-format
+msgid ""
+"\n"
+"Disable this message with \"git config advice.%s false\""
+msgstr ""
+"\n"
+"Вимкнути це повідомлення можна за допомогою \"git config advice.%s false\""
+
+#, c-format
+msgid "%shint: %.*s%s\n"
+msgstr "%sпідказка: %.*s%s\n"
+
+msgid "Cherry-picking is not possible because you have unmerged files."
+msgstr "Висмикування неможливе, оскільки у вас є не злиті файли."
+
+msgid "Committing is not possible because you have unmerged files."
+msgstr "Створення коміту неможливе, оскільки у вас є не злиті файли."
+
+msgid "Merging is not possible because you have unmerged files."
+msgstr "Злиття неможливе, оскільки у вас є не злиті файли."
+
+msgid "Pulling is not possible because you have unmerged files."
+msgstr "Отримання неможливе, оскільки у вас є не злиті файли."
+
+msgid "Reverting is not possible because you have unmerged files."
+msgstr "Вивертання неможливе, оскільки у вас є не злиті файли."
+
+#, c-format
+msgid "It is not possible to %s because you have unmerged files."
+msgstr "Неможливо виконати %s, оскільки у вас є не злиті файли."
+
+msgid ""
+"Fix them up in the work tree, and then use 'git add/rm <file>'\n"
+"as appropriate to mark resolution and make a commit."
+msgstr ""
+"Виправте їх у робочому дереві, а потім скористайтеся командою \"git add/rm "
+"<файл>\"\n"
+"щоб позначити розвʼязання і зробити коміт."
+
+msgid "Exiting because of an unresolved conflict."
+msgstr "Вихід через нерозв’язаний конфлікт."
+
+msgid "You have not concluded your merge (MERGE_HEAD exists)."
+msgstr "Ви не завершили злиття (існує MERGE_HEAD)."
+
+msgid "Please, commit your changes before merging."
+msgstr "Будь ласка, зробіть коміт ваших змін перед злиттям."
+
+msgid "Exiting because of unfinished merge."
+msgstr "Вихід через незавершене злиття."
+
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"Гілки, що розходяться, не можуть бути перемотані вперед, вам потрібно "
+"зробити:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"або\n"
+"\n"
+"\tgit rebase\n"
+
+msgid "Not possible to fast-forward, aborting."
+msgstr "Неможливо перемотати вперед, переривання."
+
+#, c-format
+msgid ""
+"The following paths and/or pathspecs matched paths that exist\n"
+"outside of your sparse-checkout definition, so will not be\n"
+"updated in the index:\n"
+msgstr ""
+"Наступні шляхи та/або визначники шляхів відповідають шляхам, які існують\n"
+"за межами визначення вашого часткового переходу, тому не будуть\n"
+"оновлені в індексі:\n"
+
+msgid ""
+"If you intend to update such entries, try one of the following:\n"
+"* Use the --sparse option.\n"
+"* Disable or modify the sparsity rules."
+msgstr ""
+"Якщо ви маєте намір оновити такі записи, спробуйте один із наведених нижче "
+"способів:\n"
+"* Використайте параметр --sparse.\n"
+"* Вимкніть або змініть правила частковості."
+
+#, c-format
+msgid ""
+"Note: switching to '%s'.\n"
+"\n"
+"You are in 'detached HEAD' state. You can look around, make experimental\n"
+"changes and commit them, and you can discard any commits you make in this\n"
+"state without impacting any branches by switching back to a branch.\n"
+"\n"
+"If you want to create a new branch to retain commits you create, you may\n"
+"do so (now or later) by using -c with the switch command. Example:\n"
+"\n"
+"  git switch -c <new-branch-name>\n"
+"\n"
+"Or undo this operation with:\n"
+"\n"
+"  git switch -\n"
+"\n"
+"Turn off this advice by setting config variable advice.detachedHead to "
+"false\n"
+"\n"
+msgstr ""
+"Примітка: перемикання на \"%s\".\n"
+"\n"
+"Ви перебуваєте в стані \"відʼєднаного HEAD\". Ви можете озирнутися довкола, "
+"внести експериментальні\n"
+"зміни і зробити коміт, також ви можете відкинути будь-які коміти, зроблені у "
+"цьому\n"
+"стані, не впливаючи на інші гілки, просто перейшовши до іншної гілки.\n"
+"\n"
+"Якщо ви хочете створити нову гілку для збереження зроблених вами комітів, ви "
+"можете\n"
+"використати (зараз або пізніше) -c з командою switch. Наприклад:\n"
+"\n"
+"  git switch -c <назва-нової-гілки\n"
+"\n"
+"Або скасувати цю операцію за допомогою:\n"
+"\n"
+"  git switch -\n"
+"\n"
+"Щоб вимкнути цю пораду, встановіть конфігураційний параметр advice."
+"detachedHead у false\n"
+
+#, c-format
+msgid ""
+"The following paths have been moved outside the\n"
+"sparse-checkout definition but are not sparse due to local\n"
+"modifications.\n"
+msgstr ""
+"Наступні шляхи, що було винесено за межі визначення часткового\n"
+"переходу, не є частковими через локальні\n"
+"зміни.\n"
+
+msgid ""
+"To correct the sparsity of these paths, do the following:\n"
+"* Use \"git add --sparse <paths>\" to update the index\n"
+"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"
+msgstr ""
+"Щоб виправити частковість цих шляхів, виконайте наступне:\n"
+"* Використайте \"git add --sparse <шляхи>\" для оновлення індексу\n"
+"* Використайте \"git sparse-checkout reapply\", щоб застосувати правила "
+"частковості"
+
+msgid "cmdline ends with \\"
+msgstr "cmdline завершується символом \\"
+
+msgid "unclosed quote"
+msgstr "незакриті лапки"
+
+msgid "too many arguments"
+msgstr "забагато аргументів"
+
+#, c-format
+msgid "unrecognized whitespace option '%s'"
+msgstr "нерозпізнана опція пробільних символів \"%s\""
+
+#, c-format
+msgid "unrecognized whitespace ignore option '%s'"
+msgstr "нерозпізнана опція ігнорування пробільних символів \"%s\""
+
+#, c-format
+msgid "options '%s' and '%s' cannot be used together"
+msgstr "опції '%s' і '%s' не можна використовувати разом"
+
+#, c-format
+msgid "'%s' outside a repository"
+msgstr "\"%s\" поза сховищем"
+
+#, c-format
+msgid "Cannot prepare timestamp regexp %s"
+msgstr "Неможливо підготувати регвир позначки часу %s"
+
+#, c-format
+msgid "regexec returned %d for input: %s"
+msgstr "regexec повернув %d для вводу: %s"
+
+#, c-format
+msgid "unable to find filename in patch at line %d"
+msgstr "не вдалося знайти ім’я файлу у латці в рядку %d"
+
+#, c-format
+msgid "git apply: bad git-diff - expected /dev/null, got %s on line %d"
+msgstr ""
+"git apply: невірний git-diff - очікувався /dev/null, отримано %s у рядку %d"
+
+#, c-format
+msgid "git apply: bad git-diff - inconsistent new filename on line %d"
+msgstr ""
+"git apply: невірний git-diff - невідповідне ім’я нового файлу у рядку %d"
+
+#, c-format
+msgid "git apply: bad git-diff - inconsistent old filename on line %d"
+msgstr ""
+"git apply: невірний git-diff - невідповідне ім’я старого файлу у рядку %d"
+
+#, c-format
+msgid "git apply: bad git-diff - expected /dev/null on line %d"
+msgstr "git apply: невірний git-diff - очікувався /dev/null у рядку %d"
+
+#, c-format
+msgid "invalid mode on line %d: %s"
+msgstr "недійсний режим у рядку %d: %s"
+
+#, c-format
+msgid "inconsistent header lines %d and %d"
+msgstr "невідповідні рядки заголовка %d та %d"
+
+#, c-format
+msgid ""
+"git diff header lacks filename information when removing %d leading pathname "
+"component (line %d)"
+msgid_plural ""
+"git diff header lacks filename information when removing %d leading pathname "
+"components (line %d)"
+msgstr[0] ""
+"у заголовку git diff відсутня інформація про назву файла при видаленні %d "
+"провідного компонента назви шляху (рядок %d)"
+msgstr[1] ""
+"у заголовку git diff відсутня інформація про назву файла при видаленні %d "
+"провідних компонентів назви шляху (рядок %d)"
+msgstr[2] ""
+"у заголовку git diff відсутня інформація про назву файла при видаленні %d "
+"провідних компонентів назви шляху (рядок %d)"
+
+#, c-format
+msgid "git diff header lacks filename information (line %d)"
+msgstr "у заголовку git diff відсутня інформація про назву файла (рядок %d)"
+
+#, c-format
+msgid "recount: unexpected line: %.*s"
+msgstr "recount: неочікуваний рядок: %.*s"
+
+#, c-format
+msgid "patch fragment without header at line %d: %.*s"
+msgstr "фрагмент латки без заголовка у рядку %d: %.*s"
+
+msgid "new file depends on old contents"
+msgstr "новий файл залежить від старого вмісту"
+
+msgid "deleted file still has contents"
+msgstr "видалений файл все ще має вміст"
+
+#, c-format
+msgid "corrupt patch at line %d"
+msgstr "пошкоджена латка у рядку %d"
+
+#, c-format
+msgid "new file %s depends on old contents"
+msgstr "новий файл %s залежить від старого вмісту"
+
+#, c-format
+msgid "deleted file %s still has contents"
+msgstr "видалений файл %s все ще має вміст"
+
+#, c-format
+msgid "** warning: file %s becomes empty but is not deleted"
+msgstr "** попередження: файл %s стане порожнім, але не буде видалений"
+
+#, c-format
+msgid "corrupt binary patch at line %d: %.*s"
+msgstr "пошкоджена бінарна латка у рядку %d: %.*s"
+
+#, c-format
+msgid "unrecognized binary patch at line %d"
+msgstr "нерозпізнана бінарна латка у рядку %d"
+
+#, c-format
+msgid "patch with only garbage at line %d"
+msgstr "латка, що містить лише непотріб у рядку %d"
+
+#, c-format
+msgid "unable to read symlink %s"
+msgstr "не вдалося прочитати символьне посилання %s"
+
+#, c-format
+msgid "unable to open or read %s"
+msgstr "не вдалося відкрити або прочитати %s"
+
+#, c-format
+msgid "invalid start of line: '%c'"
+msgstr "неприпустимий початок рядка: \"%c\""
+
+#, c-format
+msgid "Hunk #%d succeeded at %d (offset %d line)."
+msgid_plural "Hunk #%d succeeded at %d (offset %d lines)."
+msgstr[0] "Шматок #%d успішно застосовано на позиції %d (зміщення %d рядок)."
+msgstr[1] "Шматок #%d успішно застосовано на позиції %d (зміщення %d рядки)."
+msgstr[2] "Шматок #%d успішно застосовано на позиції %d (зміщення %d рядків)."
+
+#, c-format
+msgid "Context reduced to (%ld/%ld) to apply fragment at %d"
+msgstr ""
+"Контекст скорочено до (%ld/%ld), щоб застосувати фрагмент на позиції %d"
+
+#, c-format
+msgid ""
+"while searching for:\n"
+"%.*s"
+msgstr ""
+"поки йде пошук:\n"
+"%.*s"
+
+#, c-format
+msgid "missing binary patch data for '%s'"
+msgstr "відсутні дані бінарної латки для \"%s\""
+
+#, c-format
+msgid "cannot reverse-apply a binary patch without the reverse hunk to '%s'"
+msgstr ""
+"неможливо виконати reverse-apply бінарної латки без зворотнього шматка до "
+"\"%s\""
+
+#, c-format
+msgid "cannot apply binary patch to '%s' without full index line"
+msgstr ""
+"неможливо застосувати бінарну латку до \"%s\" без повного індексного рядка"
+
+#, c-format
+msgid ""
+"the patch applies to '%s' (%s), which does not match the current contents."
+msgstr ""
+"латка застосовується до \"%s\" (%s), який не збігається з поточним вмістом."
+
+#, c-format
+msgid "the patch applies to an empty '%s' but it is not empty"
+msgstr "латка застосовується до порожнього \"%s\", який не є порожнім"
+
+#, c-format
+msgid "the necessary postimage %s for '%s' cannot be read"
+msgstr "неможливо прочитати необхідний postimage %s для \"%s\""
+
+#, c-format
+msgid "binary patch does not apply to '%s'"
+msgstr "бінарна латка не застосовується до \"%s\""
+
+#, c-format
+msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)"
+msgstr ""
+"бінарна латка для \"%s\" призводить до некоректного результату (очікувалося "
+"%s, отримано %s)"
+
+#, c-format
+msgid "patch failed: %s:%ld"
+msgstr "латання не вдалося: %s:%ld"
+
+#, c-format
+msgid "cannot checkout %s"
+msgstr "неможливо переключити стан %s"
+
+#, c-format
+msgid "failed to read %s"
+msgstr "не вдалося прочитати %s"
+
+#, c-format
+msgid "reading from '%s' beyond a symbolic link"
+msgstr "читання з \"%s\" за символьним посиланням"
+
+#, c-format
+msgid "path %s has been renamed/deleted"
+msgstr "шлях %s перейменовано/видалено"
+
+#, c-format
+msgid "%s: does not exist in index"
+msgstr "%s: не існує в індексі"
+
+#, c-format
+msgid "%s: does not match index"
+msgstr "%s: не співпадає з індексом"
+
+msgid "repository lacks the necessary blob to perform 3-way merge."
+msgstr ""
+"у сховищі відсутній необхідний blob для виконання тристороннього злиття."
+
+#, c-format
+msgid "Performing three-way merge...\n"
+msgstr "Виконання тристороннього злиття...\n"
+
+#, c-format
+msgid "cannot read the current contents of '%s'"
+msgstr "неможливо прочитати поточний вміст \"%s\""
+
+#, c-format
+msgid "Failed to perform three-way merge...\n"
+msgstr "Не вдалося виконати тристороннє злиття...\n"
+
+#, c-format
+msgid "Applied patch to '%s' with conflicts.\n"
+msgstr "Латка до \"%s\" застосована з конфліктами.\n"
+
+#, c-format
+msgid "Applied patch to '%s' cleanly.\n"
+msgstr "Латка до \"%s\" застосована чисто.\n"
+
+#, c-format
+msgid "Falling back to direct application...\n"
+msgstr "Повернення до прямого застосування...\n"
+
+msgid "removal patch leaves file contents"
+msgstr "латка видалення залишає вміст файлу"
+
+#, c-format
+msgid "%s: wrong type"
+msgstr "%s: невірний тип"
+
+#, c-format
+msgid "%s has type %o, expected %o"
+msgstr "%s має тип %o, очікувався %o"
+
+#, c-format
+msgid "invalid path '%s'"
+msgstr "неприпустимий шлях \"%s\""
+
+#, c-format
+msgid "%s: already exists in index"
+msgstr "%s: вже існує в індексі"
+
+#, c-format
+msgid "%s: already exists in working directory"
+msgstr "%s: вже існує в робочій директорії"
+
+#, c-format
+msgid "new mode (%o) of %s does not match old mode (%o)"
+msgstr "новий режим (%o) для %s не відповідає старому режиму (%o)"
+
+#, c-format
+msgid "new mode (%o) of %s does not match old mode (%o) of %s"
+msgstr "новий режим (%o) для %s не відповідає старому режиму (%o) для %s"
+
+#, c-format
+msgid "affected file '%s' is beyond a symbolic link"
+msgstr "уражений файл \"%s\" знаходиться за межами символічного посилання"
+
+#, c-format
+msgid "%s: patch does not apply"
+msgstr "%s: латка не може бути застосована"
+
+#, c-format
+msgid "Checking patch %s..."
+msgstr "Перевірка латки %s..."
+
+#, c-format
+msgid "sha1 information is lacking or useless for submodule %s"
+msgstr "sha1 інформація відсутня або марна для підмодуля %s"
+
+#, c-format
+msgid "mode change for %s, which is not in current HEAD"
+msgstr "зміна режиму для %s, якого немає в поточному HEAD"
+
+#, c-format
+msgid "sha1 information is lacking or useless (%s)."
+msgstr "sha1 інформація відсутня або марна (%s)."
+
+#, c-format
+msgid "could not add %s to temporary index"
+msgstr "не вдалося додати %s до тимчасового індексу"
+
+#, c-format
+msgid "could not write temporary index to %s"
+msgstr "не вдалося записати тимчасовий індекс у %s"
+
+#, c-format
+msgid "unable to remove %s from index"
+msgstr "не вдалося видалити %s з індексу"
+
+#, c-format
+msgid "corrupt patch for submodule %s"
+msgstr "пошкоджена латка для підмодуля %s"
+
+#, c-format
+msgid "unable to stat newly created file '%s'"
+msgstr "не вдалося отримати інформацію про щойно створений файл \"%s\""
+
+#, c-format
+msgid "unable to create backing store for newly created file %s"
+msgstr "не вдалося створити підтримуюче сховище для щойно створеного файлу %s"
+
+#, c-format
+msgid "unable to add cache entry for %s"
+msgstr "не вдалося додати запис кешу для %s"
+
+#, c-format
+msgid "failed to write to '%s'"
+msgstr "не вдалося записати в \"%s\""
+
+#, c-format
+msgid "closing file '%s'"
+msgstr "закриття файлу \"%s\""
+
+#, c-format
+msgid "unable to write file '%s' mode %o"
+msgstr "не вдалося записати файл \"%s\" в режимі %o"
+
+#, c-format
+msgid "Applied patch %s cleanly."
+msgstr "Латка %s застосована чисто."
+
+msgid "internal error"
+msgstr "внутрішня помилка"
+
+#, c-format
+msgid "Applying patch %%s with %d reject..."
+msgid_plural "Applying patch %%s with %d rejects..."
+msgstr[0] "Застосування латки %%s з %d відкиданням..."
+msgstr[1] "Застосування латки %%s з %d відкиданнями..."
+msgstr[2] "Застосування латки %%s з %d відкиданнями..."
+
+#, c-format
+msgid "truncating .rej filename to %.*s.rej"
+msgstr "скорочення назви файлу .rej до %.*s.rej"
+
+#, c-format
+msgid "cannot open %s"
+msgstr "неможливо відкрити %s"
+
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "неможливо відʼєднати \"%s\""
+
+#, c-format
+msgid "Hunk #%d applied cleanly."
+msgstr "Шматок #%d застосовано чисто."
+
+#, c-format
+msgid "Rejected hunk #%d."
+msgstr "Шматок #%d відкинуто."
+
+#, c-format
+msgid "Skipped patch '%s'."
+msgstr "Пропущена латка \"%s\"."
+
+msgid "No valid patches in input (allow with \"--allow-empty\")"
+msgstr "Немає коректних латок на вході (дозволити через \"--allow-empty\")"
+
+msgid "unable to read index file"
+msgstr "не вдалося прочитати індексний файл"
+
+#, c-format
+msgid "can't open patch '%s': %s"
+msgstr "неможливо відкрити латку \"%s\": %s"
+
+#, c-format
+msgid "squelched %d whitespace error"
+msgid_plural "squelched %d whitespace errors"
+msgstr[0] "ігнорована %d помилка пробільних символів"
+msgstr[1] "ігноровані %d помилки пробільних символів"
+msgstr[2] "ігноровані %d помилок пробільних символів"
+
+#, c-format
+msgid "%d line adds whitespace errors."
+msgid_plural "%d lines add whitespace errors."
+msgstr[0] "%d рядок додає помилки пробільних символів."
+msgstr[1] "%d рядки додають помилки пробільних символів."
+msgstr[2] "%d рядків додають помилки пробільних символів."
+
+#, c-format
+msgid "%d line applied after fixing whitespace errors."
+msgid_plural "%d lines applied after fixing whitespace errors."
+msgstr[0] "%d рядок застосовано після виправлення помилок пробільних символів."
+msgstr[1] "%d рядки застосовано після виправлення помилок пробільних символів."
+msgstr[2] ""
+"%d рядків застосовано після виправлення помилок пробільних символів."
+
+msgid "Unable to write new index file"
+msgstr "Не вдалося записати новий файл індексу"
+
+msgid "don't apply changes matching the given path"
+msgstr "не застосовувати зміни, що відповідають вказаному шляху"
+
+msgid "apply changes matching the given path"
+msgstr "застосувати зміни, що відповідають вказаному шляху"
+
+msgid "num"
+msgstr "число"
+
+msgid "remove <num> leading slashes from traditional diff paths"
+msgstr "видалити <num> перших слешів з традиційних diff-шляхів"
+
+msgid "ignore additions made by the patch"
+msgstr "ігнорувати доповнення, зроблені латкою"
+
+msgid "instead of applying the patch, output diffstat for the input"
+msgstr "замість застосування латки вивести diffstat для вхідних даних"
+
+msgid "show number of added and deleted lines in decimal notation"
+msgstr "показати кількість доданих і видалених рядків у десятковій нотації"
+
+msgid "instead of applying the patch, output a summary for the input"
+msgstr "замість застосування латки вивести підсумок для вхідних даних"
+
+msgid "instead of applying the patch, see if the patch is applicable"
+msgstr "замість застосування латки перевірити можливість її застосування"
+
+msgid "make sure the patch is applicable to the current index"
+msgstr "переконатися, що латка може бути застосовна до поточного індексу"
+
+msgid "mark new files with `git add --intent-to-add`"
+msgstr "позначити нові файли командою \"git add --intent-to-add\""
+
+msgid "apply a patch without touching the working tree"
+msgstr "застосувати латку, не торкаючись робочого дерева"
+
+msgid "accept a patch that touches outside the working area"
+msgstr "прийняти латку, яка виходить за межі робочого простору"
+
+msgid "also apply the patch (use with --stat/--summary/--check)"
+msgstr "також застосувати патч (використовуйте з --stat/--summary/--check)"
+
+msgid "attempt three-way merge, fall back on normal patch if that fails"
+msgstr ""
+"спробувати тристороннє злиття, повернутися до звичайного латання, якщо це не "
+"вдасться"
+
+msgid "build a temporary index based on embedded index information"
+msgstr "створити тимчасовий індекс на основі вбудованої індексної інформації"
+
+msgid "paths are separated with NUL character"
+msgstr "шляхи відокремлюються символом NUL"
+
+msgid "ensure at least <n> lines of context match"
+msgstr "забезпечити збіг принаймні <n> рядків контексту"
+
+msgid "action"
+msgstr "дія"
+
+msgid "detect new or modified lines that have whitespace errors"
+msgstr "виявляти нові або змінені рядки з помилками пробільних символів"
+
+msgid "ignore changes in whitespace when finding context"
+msgstr "ігнорувати зміни пробільних символів при пошуку контексту"
+
+msgid "apply the patch in reverse"
+msgstr "застосувати латку у зворотному порядку"
+
+msgid "don't expect at least one line of context"
+msgstr "не очікувати на хоча б один рядок контексту"
+
+msgid "leave the rejected hunks in corresponding *.rej files"
+msgstr "залишити відкинуті шматки у відповідних *.rej файлах"
+
+msgid "allow overlapping hunks"
+msgstr "дозволити перекриття шматків"
+
+msgid "tolerate incorrectly detected missing new-line at the end of file"
+msgstr "дозволяти некоректно виявлену відсутність нового рядка в кінці файлу"
+
+msgid "do not trust the line counts in the hunk headers"
+msgstr "не довіряти кількості рядків у заголовках шматків"
+
+msgid "root"
+msgstr "корінь"
+
+msgid "prepend <root> to all filenames"
+msgstr "додати <корінь> до всіх назв файлів"
+
+msgid "don't return error for empty patches"
+msgstr "не повертати помилку для порожніх латок"
+
+#, c-format
+msgid "cannot stream blob %s"
+msgstr "неможливо транслювати blob %s"
+
+#, c-format
+msgid "unsupported file mode: 0%o (SHA1: %s)"
+msgstr "непідтримуваний режим файлу: 0%o (SHA1: %s)"
+
+#, c-format
+msgid "deflate error (%d)"
+msgstr "помилка пакування (%d)"
+
+#, c-format
+msgid "unable to start '%s' filter"
+msgstr "не вдалося запустити \"%s\" фільтр"
+
+msgid "unable to redirect descriptor"
+msgstr "не вдалося перенаправити дескриптор"
+
+#, c-format
+msgid "'%s' filter reported error"
+msgstr "Фільтр \"%s\" повідомив про помилку"
+
+#, c-format
+msgid "path is not valid UTF-8: %s"
+msgstr "шлях не є припустимим UTF-8: %s"
+
+#, c-format
+msgid "path too long (%d chars, SHA1: %s): %s"
+msgstr "шлях занадто довгий (%d символів, SHA1: %s): %s"
+
+#, c-format
+msgid "timestamp too large for this system: %<PRIuMAX>"
+msgstr "позначка часу занадто велика для цієї системи: %<PRIuMAX>"
+
+msgid "git archive [<options>] <tree-ish> [<path>...]"
+msgstr "git archive [<опції>] <деревоподібне джерело> [<шлях>...]"
+
+msgid ""
+"git archive --remote <repo> [--exec <cmd>] [<options>] <tree-ish> [<path>...]"
+msgstr ""
+"git archive --remote <сховище> [--exec <команда>] [<опції>] <деревоподібне "
+"джерело> [<шлях>...]"
+
+msgid "git archive --remote <repo> [--exec <cmd>] --list"
+msgstr "git archive --remote <сховище> [--exec <команда>] --list"
+
+#, c-format
+msgid "cannot read '%s'"
+msgstr "неможливо прочитати \"%s\""
+
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr ""
+
+#, c-format
+msgid "pathspec '%s' did not match any files"
+msgstr "визначник шляxу \"%s\" не відповідає жодному файлу"
+
+#, c-format
+msgid "no such ref: %.*s"
+msgstr "немає такого посилання: %.*s"
+
+#, c-format
+msgid "not a valid object name: %s"
+msgstr "невірне ім’я об’єкта: %s"
+
+#, c-format
+msgid "not a tree object: %s"
+msgstr "не є об’єктом дерева: %s"
+
+#, c-format
+msgid "File not found: %s"
+msgstr "Файл не знайдено: %s"
+
+#, c-format
+msgid "Not a regular file: %s"
+msgstr "Не звичайний файл: %s"
+
+#, c-format
+msgid "unclosed quote: '%s'"
+msgstr "незакриті лапки: \"%s\""
+
+#, c-format
+msgid "missing colon: '%s'"
+msgstr "відсутня двокрапка: \"%s\""
+
+#, c-format
+msgid "empty file name: '%s'"
+msgstr "порожня назва файлу: \"%s\""
+
+msgid "fmt"
+msgstr "fmt"
+
+msgid "archive format"
+msgstr "формат архіву"
+
+msgid "prefix"
+msgstr "префікс"
+
+msgid "prepend prefix to each pathname in the archive"
+msgstr "додати префікс до кожної назви шляху в архіві"
+
+msgid "file"
+msgstr "файл"
+
+msgid "add untracked file to archive"
+msgstr "додати невідстежуваний файл до архіву"
+
+msgid "path:content"
+msgstr "шлях:вміст"
+
+msgid "write the archive to this file"
+msgstr "записати архів до цього файлу"
+
+msgid "read .gitattributes in working directory"
+msgstr "прочитати .gitattributes робочої директорії"
+
+msgid "report archived files on stderr"
+msgstr "звітувати про заархівовані файли в stderr"
+
+msgid "time"
+msgstr "час"
+
+msgid "set modification time of archive entries"
+msgstr "встановити час модифікації архівних записів"
+
+msgid "set compression level"
+msgstr "встановити рівень компресії"
+
+msgid "list supported archive formats"
+msgstr "показати список підтримуваних форматів архівів"
+
+msgid "repo"
+msgstr "сховище"
+
+msgid "retrieve the archive from remote repository <repo>"
+msgstr "отримати архів з віддаленого <сховища>"
+
+msgid "command"
+msgstr "команда"
+
+msgid "path to the remote git-upload-archive command"
+msgstr "шлях до віддаленої команди git-upload-archive"
+
+msgid "Unexpected option --remote"
+msgstr "Неочікувана опція --remote"
+
+#, c-format
+msgid "the option '%s' requires '%s'"
+msgstr "опція \"%s\" вимагає \"%s\""
+
+msgid "Unexpected option --output"
+msgstr "Неочікувана опція --output"
+
+#, c-format
+msgid "Unknown archive format '%s'"
+msgstr "Невідомий формат архіву \"%s\""
+
+#, c-format
+msgid "Argument not supported for format '%s': -%d"
+msgstr "Аргумент не підтримується для формату \"%s\": -%d"
+
+#, c-format
+msgid "%.*s is not a valid attribute name"
+msgstr "%.*s не є припустимою назвою атрибута"
+
+msgid "unable to add additional attribute"
+msgstr "не вдалося додати додатковий атрибут"
+
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "ігнорування надто довгого рядка атрибутів %d"
+
+#, c-format
+msgid "%s not allowed: %s:%d"
+msgstr "%s не дозволено: %s:%d"
+
+msgid ""
+"Negative patterns are ignored in git attributes\n"
+"Use '\\!' for literal leading exclamation."
+msgstr ""
+"Негативні шаблони ігноруються в git атрибутах\n"
+"Використовуйте \"\\!\" для додання знака оклику."
+
+#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "неможливо виконати fstat для файла git атрибутів \"%s\""
+
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "ігнорування надто великого файлу gitattributes \"%s\""
+
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "ігнорування надто великих gitattributes blob \"%s\""
+
+#, c-format
+msgid "Badly quoted content in file '%s': %s"
+msgstr "Невірно процитований вміст у файлі \"%s\": %s"
+
+#, c-format
+msgid "We cannot bisect more!\n"
+msgstr "Неможливо бісектувати більше!\n"
+
+#, c-format
+msgid "Not a valid commit name %s"
+msgstr "Не є дійсною назвою коміта %s"
+
+#, c-format
+msgid ""
+"The merge base %s is bad.\n"
+"This means the bug has been fixed between %s and [%s].\n"
+msgstr ""
+"База злиття %s є невірною.\n"
+"Це означає, що помилку було виправлено між %s та [%s].\n"
+
+#, c-format
+msgid ""
+"The merge base %s is new.\n"
+"The property has changed between %s and [%s].\n"
+msgstr ""
+"База злиття %s є новою.\n"
+"Властивість змінилася між %s та [%s].\n"
+
+#, c-format
+msgid ""
+"The merge base %s is %s.\n"
+"This means the first '%s' commit is between %s and [%s].\n"
+msgstr ""
+"Базою злиття %s є %s.\n"
+"Це означає, що перший \"%s\" коміт знаходиться між %s і [%s].\n"
+
+#, c-format
+msgid ""
+"Some %s revs are not ancestors of the %s rev.\n"
+"git bisect cannot work properly in this case.\n"
+"Maybe you mistook %s and %s revs?\n"
+msgstr ""
+"Деякі %s revs не є предками %s rev.\n"
+"git bisect не може працювати належним чином в таких випадках.\n"
+"Можливо, ви переплутали %s і %s revs?\n"
+
+#, c-format
+msgid ""
+"the merge base between %s and [%s] must be skipped.\n"
+"So we cannot be sure the first %s commit is between %s and %s.\n"
+"We continue anyway."
+msgstr ""
+"базу злиття між %s і [%s] потрібно пропустити.\n"
+"Тому ми не можемо бути впевнені, що перший коміт %s знаходиться між %s і "
+"%s.\n"
+"Ми все одно продовжимо."
+
+#, c-format
+msgid "Bisecting: a merge base must be tested\n"
+msgstr "Бісекція: база злиття повинна бути протестована\n"
+
+#, c-format
+msgid "a %s revision is needed"
+msgstr "необхідна ревізія %s"
+
+#, c-format
+msgid "could not create file '%s'"
+msgstr "не вдалося створити файл \"%s\""
+
+#, c-format
+msgid "could not read file '%s'"
+msgstr "не вдалося прочитати файл \"%s\""
+
+msgid "reading bisect refs failed"
+msgstr "не вдалося прочитати бісекційні посилання"
+
+#, c-format
+msgid "%s was both %s and %s\n"
+msgstr "%s був одночасно і %s, і %s\n"
+
+#, c-format
+msgid ""
+"No testable commit found.\n"
+"Maybe you started with bad path arguments?\n"
+msgstr ""
+"Не знайдено коміт для тестування.\n"
+"Можливо, ви почали з неправильних аргументів шляху?\n"
+
+#, c-format
+msgid "(roughly %d step)"
+msgid_plural "(roughly %d steps)"
+msgstr[0] "(приблизно %d крок)"
+msgstr[1] "(приблизно %d кроки)"
+msgstr[2] "(приблизно %d кроків)"
+
+#. TRANSLATORS: the last %s will be replaced with "(roughly %d
+#. steps)" translation.
+#.
+
+#, c-format
+msgid "Bisecting: %d revision left to test after this %s\n"
+msgid_plural "Bisecting: %d revisions left to test after this %s\n"
+msgstr[0] "Бісекція: залишилося протестувати %d ревізію після цього %s\n"
+msgstr[1] "Бісекція: залишилося протестувати %d ревізії після цього %s\n"
+msgstr[2] "Бісекція: залишилося протестувати %d ревізій після цього %s\n"
+
+msgid "--contents and --reverse do not blend well."
+msgstr "--contents і --reverse поєднуються не дуже добре."
+
+msgid "--reverse and --first-parent together require specified latest commit"
+msgstr "--reverse і --first-parent разом вимагають вказівки останнього коміту"
+
+msgid "revision walk setup failed"
+msgstr "не вдалося налаштувати проходження по ревізіям"
+
+msgid ""
+"--reverse --first-parent together require range along first-parent chain"
+msgstr ""
+"--reverse --first-parent разом вимагають вказівки діапазона вздовж ланцюжка "
+"першого батька"
+
+#, c-format
+msgid "no such path %s in %s"
+msgstr "немає шляху %s в %s"
+
+#, c-format
+msgid "cannot read blob %s for path %s"
+msgstr "неможливо прочитати blob %s для шляху %s"
+
+msgid ""
+"cannot inherit upstream tracking configuration of multiple refs when "
+"rebasing is requested"
+msgstr ""
+"неможливо успадковувати першоджерельну конфігурацію відстежування декількох "
+"посилань при запиті перебазування"
+
+#, c-format
+msgid "not setting branch '%s' as its own upstream"
+msgstr "гілку \"%s\" не встановлено власним першоджерельним сховищем"
+
+#, c-format
+msgid "branch '%s' set up to track '%s' by rebasing."
+msgstr "гілку \"%s\" налаштовано на відстежування \"%s\" через перебазування."
+
+#, c-format
+msgid "branch '%s' set up to track '%s'."
+msgstr "гілку \"%s\" налаштовано на відстежуваня \"%s\"."
+
+#, c-format
+msgid "branch '%s' set up to track:"
+msgstr "гілку \"%s\" налаштовано на відстежування:"
+
+msgid "unable to write upstream branch configuration"
+msgstr "не вдалося записати конфігурацію гілки першоджерельного сховища"
+
+msgid ""
+"\n"
+"After fixing the error cause you may try to fix up\n"
+"the remote tracking information by invoking:"
+msgstr ""
+"\n"
+"Після усунення причини помилки ви можете спробувати виправити\n"
+"інформацію про віддалене відстежування здійснівши виклик:"
+
+#, c-format
+msgid "asked to inherit tracking from '%s', but no remote is set"
+msgstr ""
+"просили успадкувати відстежування з \"%s\", але віддалене призначення не "
+"встановлено"
+
+#, c-format
+msgid "asked to inherit tracking from '%s', but no merge configuration is set"
+msgstr ""
+"просили успадкувати відстежування з \"%s\", але конфігурацію злиття не задано"
+
+#, c-format
+msgid "not tracking: ambiguous information for ref '%s'"
+msgstr "не відстежується: неоднозначна інформація для посилання \"%s\""
+
+#. TRANSLATORS: This is a line listing a remote with duplicate
+#. refspecs in the advice message below. For RTL languages you'll
+#. probably want to swap the "%s" and leading "  " space around.
+#.
+#. TRANSLATORS: This is line item of ambiguous object output
+#. from describe_ambiguous_object() above. For RTL languages
+#. you'll probably want to swap the "%s" and leading " " space
+#. around.
+#.
+
+#, c-format
+msgid "  %s\n"
+msgstr "  %s\n"
+
+#. TRANSLATORS: The second argument is a \n-delimited list of
+#. duplicate refspecs, composed above.
+#.
+
+#, c-format
+msgid ""
+"There are multiple remotes whose fetch refspecs map to the remote\n"
+"tracking ref '%s':\n"
+"%s\n"
+"This is typically a configuration error.\n"
+"\n"
+"To support setting up tracking branches, ensure that\n"
+"different remotes' fetch refspecs map into different\n"
+"tracking namespaces."
+msgstr ""
+"Існує декілька віддалених призначень, визначники отримування посилань яких "
+"розвʼязуються у віддалено \n"
+"відстежуване посилання \"%s\":\n"
+"%s\n"
+"Зазвичай це помилка конфігурації.\n"
+"\n"
+"Щоб підтримувати налаштування гілок відстежування, переконайтеся, що\n"
+"визначники отримування посилань різних віддалених призначень розвʼязуються у "
+"різні\n"
+" простори імен відстежування."
+
+#, c-format
+msgid "'%s' is not a valid branch name"
+msgstr "\"%s\" не є допустимою назвою гілки"
+
+#, c-format
+msgid "a branch named '%s' already exists"
+msgstr "гілка з ім’ям \"%s\" вже існує"
+
+#, c-format
+msgid "cannot force update the branch '%s' checked out at '%s'"
+msgstr "неможливо примусово оновити гілку \"%s\", розташовану в \"%s\""
+
+#, c-format
+msgid "cannot set up tracking information; starting point '%s' is not a branch"
+msgstr ""
+"неможливо налаштувати інформацію про відстежування; початкова точка \"%s\" "
+"не є гілкою"
+
+#, c-format
+msgid "the requested upstream branch '%s' does not exist"
+msgstr "запитувана гілка \"%s\" не існує у першоджерельному сховищі"
+
+msgid ""
+"\n"
+"If you are planning on basing your work on an upstream\n"
+"branch that already exists at the remote, you may need to\n"
+"run \"git fetch\" to retrieve it.\n"
+"\n"
+"If you are planning to push out a new local branch that\n"
+"will track its remote counterpart, you may want to use\n"
+"\"git push -u\" to set the upstream config as you push."
+msgstr ""
+"\n"
+"Якщо ви плануєте базувати свою роботу на основі першоджерельної\n"
+"гілки, яка вже існує на віддаленому призначенні, вам може знадобитися\n"
+"запустити \"git fetch\", щоб отримати її.\n"
+"\n"
+"Якщо ви плануєте надіслати нову локальну гілку, яка\n"
+"буде відстежувати свою віддалену гілку, вам слід скористатися командою\n"
+"\"git push -u\", щоб встановити конфігурацію першоджерельного сховища під "
+"час надсилання."
+
+#, c-format
+msgid "not a valid object name: '%s'"
+msgstr "не є допустимим ім’ям об’єкта: \"%s\""
+
+#, c-format
+msgid "ambiguous object name: '%s'"
+msgstr "неоднозначне ім’я об’єкта: \"%s\""
+
+#, c-format
+msgid "not a valid branch point: '%s'"
+msgstr "не є допустимим ім’ям точки розгалуження: \"%s\""
+
+#, c-format
+msgid "submodule '%s': unable to find submodule"
+msgstr "підмодуль \"%s\": не вдалося знайти підмодуль"
+
+#, c-format
+msgid ""
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
+msgstr ""
+"Ви можете спробувати оновити підмодулі за допомогою \"git checkout --no-"
+"recurse-submodules %s && git submodule update --init\"."
+
+#, c-format
+msgid "submodule '%s': cannot create branch '%s'"
+msgstr "підмодуль \"%s\": неможливо створити гілку \"%s\""
+
+#, c-format
+msgid "'%s' is already checked out at '%s'"
+msgstr "\"%s\" вже існує в \"%s\""
+
+msgid "git add [<options>] [--] <pathspec>..."
+msgstr "git add [<опції>] [--] <визначник шляху>..."
+
+#, c-format
+msgid "cannot chmod %cx '%s'"
+msgstr "неможливо виконати chmod %cx \"%s\""
+
+#, c-format
+msgid "unexpected diff status %c"
+msgstr "неочікуваний статус diff %c"
+
+msgid "updating files failed"
+msgstr "не вдалося оновити файли"
+
+#, c-format
+msgid "remove '%s'\n"
+msgstr "видалити \"%s\"\n"
+
+msgid "Unstaged changes after refreshing the index:"
+msgstr "Неіндексовані зміни після оновлення індексу:"
+
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"параметр add.interactive.useBuiltin було видалено!\n"
+"Дивіться запис у \"git help config\" для більш детальної інформації."
+
+msgid "Could not read the index"
+msgstr "Не вдалося прочитати індекс"
+
+msgid "Could not write patch"
+msgstr "Не вдалося записати латку"
+
+msgid "editing patch failed"
+msgstr "не вдалося відредагувати латку"
+
+#, c-format
+msgid "Could not stat '%s'"
+msgstr "Не вдалося виконати stat \"%s\""
+
+msgid "Empty patch. Aborted."
+msgstr "Порожня латка. Перервано."
+
+#, c-format
+msgid "Could not apply '%s'"
+msgstr "Не вдалося застосувати \"%s\""
+
+msgid "The following paths are ignored by one of your .gitignore files:\n"
+msgstr "Наступні шляхи ігноруються одним з ваших .gitignore файлів:\n"
+
+msgid "dry run"
+msgstr "пробний запуск"
+
+msgid "be verbose"
+msgstr "розгорнутий вивід"
+
+msgid "interactive picking"
+msgstr "інтерактивний вибір"
+
+msgid "select hunks interactively"
+msgstr "обирати шматки інтерактивно"
+
+msgid "edit current diff and apply"
+msgstr "відредагувати поточну різницю і застосувати"
+
+msgid "allow adding otherwise ignored files"
+msgstr "дозволити додавання ігнорованих файлів"
+
+msgid "update tracked files"
+msgstr "оновити відстежувані файли"
+
+msgid "renormalize EOL of tracked files (implies -u)"
+msgstr "перенормувати EOL відстежуваних файлів (мається на увазі -u)"
+
+msgid "record only the fact that the path will be added later"
+msgstr "записати лише той факт, що шлях будe додано пізніше"
+
+msgid "add changes from all tracked and untracked files"
+msgstr "додати зміни з усіх відстежуваних і невідстежуваних файлів"
+
+msgid "ignore paths removed in the working tree (same as --no-all)"
+msgstr "ігнорувати шляхи, видалені у робочому дереві (те саме, що й --no-all)"
+
+msgid "don't add, only refresh the index"
+msgstr "не додавати, лише оновити індекс"
+
+msgid "just skip files which cannot be added because of errors"
+msgstr "просто пропустити файли, які не можуть бути додані через помилки"
+
+msgid "check if - even missing - files are ignored in dry run"
+msgstr ""
+"перевірити, чи ігноруються файли, навіть якщо вони відсутні, під час "
+"пробного запуску"
+
+msgid "allow updating entries outside of the sparse-checkout cone"
+msgstr "дозволити оновлення записів за межами конуса часткового переходу"
+
+msgid "override the executable bit of the listed files"
+msgstr "перевизначити біт виконання для зазначених файлів"
+
+msgid "warn when adding an embedded repository"
+msgstr "попереджувати при додаванні вбудованого сховища"
+
+#, c-format
+msgid ""
+"You've added another git repository inside your current repository.\n"
+"Clones of the outer repository will not contain the contents of\n"
+"the embedded repository and will not know how to obtain it.\n"
+"If you meant to add a submodule, use:\n"
+"\n"
+"\tgit submodule add <url> %s\n"
+"\n"
+"If you added this path by mistake, you can remove it from the\n"
+"index with:\n"
+"\n"
+"\tgit rm --cached %s\n"
+"\n"
+"See \"git help submodule\" for more information."
+msgstr ""
+"Ви додали ще одне git сховище всередині вашого поточного сховища.\n"
+"Клони зовнішнього сховища не міститимуть вмісту\n"
+"вбудованого сховища і не знатимуть, як його отримати.\n"
+"Якщо ви хочете додати підмодуль, скористайтеся командою\n"
+"\n"
+"\tgit submodule add <url> %s\n"
+"\n"
+"Якщо ви додали цей шлях помилково, ви можете видалити його з\n"
+"індексу за допомогою:\n"
+"\n"
+"\tgit rm --cached %s\n"
+"\n"
+"Докладніше дивіться у \"git help submodule\"."
+
+#, c-format
+msgid "adding embedded git repository: %s"
+msgstr "додавання вбудованого git сховища: %s"
+
+msgid ""
+"Use -f if you really want to add them.\n"
+"Turn this message off by running\n"
+"\"git config advice.addIgnoredFile false\""
+msgstr ""
+"Використовуйте -f, якщо ви дійсно хочете їх додати.\n"
+"Щоб вимкнути це повідомлення, виконайте\n"
+"\"git config advice.addIgnoredFile false\""
+
+msgid "adding files failed"
+msgstr "додавання файлів завершилося невдало"
+
+#, c-format
+msgid "--chmod param '%s' must be either -x or +x"
+msgstr "--chmod параметр \"%s\" має бути -x або +x"
+
+#, c-format
+msgid "'%s' and pathspec arguments cannot be used together"
+msgstr "\"%s\" та аргументи визначника шляху не можна використовувати разом"
+
+#, c-format
+msgid "Nothing specified, nothing added.\n"
+msgstr "Нічого не зазначено, нічого не додано.\n"
+
+msgid ""
+"Maybe you wanted to say 'git add .'?\n"
+"Turn this message off by running\n"
+"\"git config advice.addEmptyPathspec false\""
+msgstr ""
+"Можливо, ви хотіли вказати \"git add .\"?\n"
+"Щоб вимкнути це повідомлення, виконайте\n"
+"\"git config advice.addEmptyPathspec false\""
+
+msgid "index file corrupt"
+msgstr "індексний файл пошкоджено"
+
+#, c-format
+msgid "bad action '%s' for '%s'"
+msgstr "невірна дія \"%s\" для \"%s\""
+
+#, c-format
+msgid "invalid value for '%s': '%s'"
+msgstr "неприпустиме значення для \"%s\": \"%s\""
+
+#, c-format
+msgid "could not read '%s'"
+msgstr "не вдалося прочитати \"%s\""
+
+msgid "could not parse author script"
+msgstr "не вдалося розібрати author script"
+
+#, c-format
+msgid "could not parse %s"
+msgstr "не вдалося розібрати %s"
+
+#, c-format
+msgid "'%s' was deleted by the applypatch-msg hook"
+msgstr "\"%s\" було видалено applypatch-msg гачком"
+
+#, c-format
+msgid "Malformed input line: '%s'."
+msgstr "Невірно сформований рядок вводу: \"%s\"."
+
+#, c-format
+msgid "Failed to copy notes from '%s' to '%s'"
+msgstr "Не вдалося скопіювати нотатки з \"%s\" в \"%s\""
+
+msgid "fseek failed"
+msgstr "fseek завершився невдало"
+
+#, c-format
+msgid "could not open '%s' for reading"
+msgstr "не вдалося відкрити \"%s\" для читання"
+
+#, c-format
+msgid "could not open '%s' for writing"
+msgstr "не вдалося відкрити \"%s\" для запису"
+
+#, c-format
+msgid "could not parse patch '%s'"
+msgstr "не вдалося розібрати латку \"%s\""
+
+msgid "Only one StGIT patch series can be applied at once"
+msgstr "Можна застосовувати лише одну серію StGIT латок одразу"
+
+msgid "invalid timestamp"
+msgstr "неприпустима позначка часу"
+
+msgid "invalid Date line"
+msgstr "неприпустимий рядок дати"
+
+msgid "invalid timezone offset"
+msgstr "неприпустиме зміщення часового поясу"
+
+msgid "Patch format detection failed."
+msgstr "Не вдалося визначити формат латки."
+
+#, c-format
+msgid "failed to create directory '%s'"
+msgstr "не вдалося створити директорію \"%s\""
+
+msgid "Failed to split patches."
+msgstr "Не вдалося розділити латки."
+
+#, c-format
+msgid "When you have resolved this problem, run \"%s --continue\"."
+msgstr "Коли ви вирішите цю проблему, виконайте \"%s --continue\"."
+
+#, c-format
+msgid "If you prefer to skip this patch, run \"%s --skip\" instead."
+msgstr ""
+"Якщо ви бажаєте пропустити цю латку, виконайте \"%s --skip\" замість цього."
+
+#, c-format
+msgid "To record the empty patch as an empty commit, run \"%s --allow-empty\"."
+msgstr ""
+"Щоб записати порожню латку як порожній коміт, виконайте \"%s --allow-empty\"."
+
+#, c-format
+msgid "To restore the original branch and stop patching, run \"%s --abort\"."
+msgstr ""
+"Щоб повернути гілку до початкового стану і зупинити латання, виконайте \"%s "
+"--abort\"."
+
+msgid "Patch sent with format=flowed; space at the end of lines might be lost."
+msgstr ""
+"Латку надіслано з параметром format=flowed; пробіли в кінці рядків можуть "
+"бути втрачені."
+
+#, c-format
+msgid "missing author line in commit %s"
+msgstr "відсутній рядок автора в коміті %s"
+
+#, c-format
+msgid "invalid ident line: %.*s"
+msgstr "неприпустимий ідентифікаційний рядок: %.*s"
+
+#, c-format
+msgid "unable to parse commit %s"
+msgstr "не вдалося розібрати коміт %s"
+
+msgid "Repository lacks necessary blobs to fall back on 3-way merge."
+msgstr ""
+"У сховищі не вистачає необхідних blob-обʼєктів, щоб повернутися до "
+"тристороннього злиття."
+
+msgid "Using index info to reconstruct a base tree..."
+msgstr ""
+"Використання індексної інформації для реконстрування базового дерева..."
+
+msgid ""
+"Did you hand edit your patch?\n"
+"It does not apply to blobs recorded in its index."
+msgstr ""
+"Ви відредагували свою латку вручну?\n"
+"Це не стосується blob-обʼєктів, записаних у його індексі."
+
+msgid "Falling back to patching base and 3-way merge..."
+msgstr "Повернення до бази латки та тристороннього злиття..."
+
+msgid "Failed to merge in the changes."
+msgstr "Не вдалося злити зміни."
+
+msgid "git write-tree failed to write a tree"
+msgstr "git write-tree не вдалося записати дерево"
+
+msgid "applying to an empty history"
+msgstr "застосування до порожньої історії"
+
+msgid "failed to write commit object"
+msgstr "не вдалося записати об’єкт коміту"
+
+#, c-format
+msgid "cannot resume: %s does not exist."
+msgstr "неможливо продовжити: %s не існує."
+
+msgid "Commit Body is:"
+msgstr "Тіло коміту:"
+
+#. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]
+#. in your translation. The program will only accept English
+#. input at this point.
+#.
+
+#, c-format
+msgid "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: "
+msgstr ""
+"Застосувати? [y]-так / [n]-ні / [e]-редагувати / [v]-переглянути латку / [a]-"
+"застосувати все: "
+
+msgid "unable to write index file"
+msgstr "не вдалося записати індексний файл"
+
+#, c-format
+msgid "Dirty index: cannot apply patches (dirty: %s)"
+msgstr "Індекс забруднено: неможливо застосувати латки (забруднено: %s)"
+
+#, c-format
+msgid "Skipping: %.*s"
+msgstr "Пропуск: %.*s"
+
+#, c-format
+msgid "Creating an empty commit: %.*s"
+msgstr "Створення порожнього коміту: %.*s"
+
+msgid "Patch is empty."
+msgstr "Латка порожня."
+
+#, c-format
+msgid "Applying: %.*s"
+msgstr "Застосування: %.*s"
+
+msgid "No changes -- Patch already applied."
+msgstr "Без змін - латку вже застосовано."
+
+#, c-format
+msgid "Patch failed at %s %.*s"
+msgstr "Латання не вдалося на %s %.*s"
+
+msgid "Use 'git am --show-current-patch=diff' to see the failed patch"
+msgstr ""
+"Використовуйте \"git am --show-current-patch=diff\", щоб побачити невдалу "
+"латку"
+
+msgid "No changes - recorded it as an empty commit."
+msgstr "Без змін - записаний як порожній коміт."
+
+msgid ""
+"No changes - did you forget to use 'git add'?\n"
+"If there is nothing left to stage, chances are that something else\n"
+"already introduced the same changes; you might want to skip this patch."
+msgstr ""
+"Без змін - ви забули використати \"git add\"?\n"
+"Якщо нічого індексувати, є ймовірність того, що хтось інший\n"
+"вже вніс ті самі зміни; можливо, ви захочете пропустити цю латку."
+
+msgid ""
+"You still have unmerged paths in your index.\n"
+"You should 'git add' each file with resolved conflicts to mark them as "
+"such.\n"
+"You might run `git rm` on a file to accept \"deleted by them\" for it."
+msgstr ""
+"У вашому індексі все ще залишаються не злиті шляхи.\n"
+"Вам слід виконати \"git add\" для кожного файлу з розвʼязаними конфліктами, "
+"щоб позначити їх як такі.\n"
+"Ви можете виконати \"git rm\" для файлу, щоб прийняти \"видалено ними\"."
+
+msgid "unable to write new index file"
+msgstr "не вдалося записати новий файл індексу"
+
+#, c-format
+msgid "Could not parse object '%s'."
+msgstr "Не вдалося розібрати об'єкт '%s'."
+
+msgid "failed to clean index"
+msgstr "не вдалося очистити індекс"
+
+msgid ""
+"You seem to have moved HEAD since the last 'am' failure.\n"
+"Not rewinding to ORIG_HEAD"
+msgstr ""
+"Здається, ви пересунули HEAD після останньої невдачі з \"am\".\n"
+"Не відбувається перемотування до ORIG_HEAD"
+
+#, c-format
+msgid "failed to read '%s'"
+msgstr "не вдалося прочитати \"%s\""
+
+#, c-format
+msgid "options '%s=%s' and '%s=%s' cannot be used together"
+msgstr "опції \"%s=%s\" and \"%s=%s\" не можна використовувати разом"
+
+msgid "git am [<options>] [(<mbox> | <Maildir>)...]"
+msgstr "git am [<опції>] [(<скринька> [<поштова директорія>)...]"
+
+msgid "git am [<options>] (--continue | --skip | --abort)"
+msgstr "git am [<опції>] (--continue | --skip | --abort)"
+
+msgid "run interactively"
+msgstr "запустити інтерактивно"
+
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "обійти pre-applypatch та applypatch-msg гачки"
+
+msgid "historical option -- no-op"
+msgstr "стара опція -- не працює"
+
+msgid "allow fall back on 3way merging if needed"
+msgstr "дозволити повернутися до тристороннього злиття у разі потреби"
+
+msgid "be quiet"
+msgstr "працювати тихесенько"
+
+msgid "add a Signed-off-by trailer to the commit message"
+msgstr "додати Signed-off-by причеп у допис до коміту"
+
+msgid "recode into utf8 (default)"
+msgstr "перекодувати в utf8 (за замовчуванням)"
+
+msgid "pass -k flag to git-mailinfo"
+msgstr "передати -k прапорець до git-mailinfo"
+
+msgid "pass -b flag to git-mailinfo"
+msgstr "передати -b прапорець до git-mailinfo"
+
+msgid "pass -m flag to git-mailinfo"
+msgstr "передати -m прапорець до git-mailinfo"
+
+msgid "pass --keep-cr flag to git-mailsplit for mbox format"
+msgstr "передати --keep-cr прапорець до git-mailsplit для формату mbox"
+
+msgid "do not pass --keep-cr flag to git-mailsplit independent of am.keepcr"
+msgstr ""
+"не передавати --keep-cr прапорець до git-mailsplit незалежно від am.keepcr"
+
+msgid "strip everything before a scissors line"
+msgstr "прибрати все раніше відрізної лінії"
+
+msgid "pass it through git-mailinfo"
+msgstr "передати через git-mailinfo"
+
+msgid "pass it through git-apply"
+msgstr "передати через git-apply"
+
+msgid "n"
+msgstr "n"
+
+msgid "format"
+msgstr "формат"
+
+msgid "format the patch(es) are in"
+msgstr "формат латки(-ок)"
+
+msgid "override error message when patch failure occurs"
+msgstr "перевизначити повідомлення про помилку при збої латання"
+
+msgid "continue applying patches after resolving a conflict"
+msgstr "продовжити застосування латки після розвʼязання конфлікту"
+
+msgid "synonyms for --continue"
+msgstr "те ж саме, що й --continue"
+
+msgid "skip the current patch"
+msgstr "пропустити поточну латку"
+
+msgid "restore the original branch and abort the patching operation"
+msgstr "відновити початкову гілку і перервати операцію латання"
+
+msgid "abort the patching operation but keep HEAD where it is"
+msgstr "перервати латання, але залишити HEAD на тому місці, де він знаходиться"
+
+msgid "show the patch being applied"
+msgstr "показати латку, що застосовується"
+
+msgid "record the empty patch as an empty commit"
+msgstr "записати порожню латку як порожній коміт"
+
+msgid "lie about committer date"
+msgstr "брехати про дату комітера"
+
+msgid "use current timestamp for author date"
+msgstr "використовувати поточну мітку часу для дати автора"
+
+msgid "key-id"
+msgstr "key-id"
+
+msgid "GPG-sign commits"
+msgstr "підписати коміти GPG-підписом"
+
+msgid "how to handle empty patches"
+msgstr "як обробляти порожні латки"
+
+msgid "(internal use for git-rebase)"
+msgstr "(внутрішнє використання для git-rebase)"
+
+msgid ""
+"The -b/--binary option has been a no-op for long time, and\n"
+"it will be removed. Please do not use it anymore."
+msgstr ""
+"Опція -b/--binary вже давно не працює і\n"
+"буде видалена. Будь ласка, не використовуйте її більше."
+
+msgid "failed to read the index"
+msgstr "не вдалося прочитати індекс"
+
+#, c-format
+msgid "previous rebase directory %s still exists but mbox given."
+msgstr ""
+"попередня директорія перебазування %s все ще існує, але було надано mbox."
+
+#, c-format
+msgid ""
+"Stray %s directory found.\n"
+"Use \"git am --abort\" to remove it."
+msgstr ""
+"Знайдено блукаючу директорію %s.\n"
+"Скористайтеся командою \"git am --abort\", щоб вилучити її."
+
+msgid "Resolve operation not in progress, we are not resuming."
+msgstr "Наразі не виконується операція розвʼязання, ми не продовжуємо."
+
+msgid "interactive mode requires patches on the command line"
+msgstr "інтерактивний режим вимагає латки у командному рядку"
+
+msgid "git apply [<options>] [<patch>...]"
+msgstr "git apply [<опції>] [<латка>...]"
+
+msgid "could not redirect output"
+msgstr "неможливо перенаправити вивід"
+
+msgid "git archive: Remote with no URL"
+msgstr "git archive: віддалене призначення без URL"
+
+msgid "git archive: expected ACK/NAK, got a flush packet"
+msgstr "git archive: очікувалося ACK/NAK, отримано flush-пакет"
+
+#, c-format
+msgid "git archive: NACK %s"
+msgstr "git archive: NACK %s"
+
+msgid "git archive: protocol error"
+msgstr "git archive: помилка протоколу"
+
+msgid "git archive: expected a flush"
+msgstr "git archive: очікувався flush"
+
+msgid ""
+"git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]    [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--]    [<pathspec>...]"
+msgstr ""
+"git bisect start [--term-{new,bad}=<термін> --term-{old,good}=<термін>]    "
+"[--no-checkout] [--first-parent] [<поганий> [<добрий>...]] [--]    "
+"[<визначник шляху>...]"
+
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (добрий|поганий) [<ревізія>...]"
+
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<ревізія>|<діапазон>)...]"
+
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<коміт>]"
+
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <лог файл>"
+
+msgid "git bisect run <cmd>..."
+msgstr "git bisect run <команда>..."
+
+#, c-format
+msgid "cannot open file '%s' in mode '%s'"
+msgstr "неможливо відкрити файл \"%s\" у режимі \"%s\""
+
+#, c-format
+msgid "could not write to file '%s'"
+msgstr "не вдалося записати в файл \"%s\""
+
+#, c-format
+msgid "cannot open file '%s' for reading"
+msgstr "неможливо відкрити файл \"%s\" для читання"
+
+#, c-format
+msgid "'%s' is not a valid term"
+msgstr "\"%s\" не є допустимим терміном"
+
+#, c-format
+msgid "can't use the builtin command '%s' as a term"
+msgstr "неможливо використати вбудовану команду \"%s\" як термін"
+
+#, c-format
+msgid "can't change the meaning of the term '%s'"
+msgstr "неможливо змінити значення терміну \"%s\""
+
+msgid "please use two different terms"
+msgstr "будь ласка, використовуйте два різних терміна"
+
+#, c-format
+msgid "We are not bisecting.\n"
+msgstr "Ми не робимо бісекцію.\n"
+
+#, c-format
+msgid "'%s' is not a valid commit"
+msgstr "\"%s\" не є дійсним комітом"
+
+#, c-format
+msgid ""
+"could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
+msgstr ""
+"не вдалося переключитися на початковий HEAD \"%s\". Спробуйте \"git bisect "
+"reset <коміт>\"."
+
+#, c-format
+msgid "Bad bisect_write argument: %s"
+msgstr "Невірний bisect_write аргумент: %s"
+
+#, c-format
+msgid "couldn't get the oid of the rev '%s'"
+msgstr "не вдалося отримати oid для rev \"%s\""
+
+#, c-format
+msgid "couldn't open the file '%s'"
+msgstr "не вдалося відкрити файл \"%s\""
+
+#, c-format
+msgid "Invalid command: you're currently in a %s/%s bisect"
+msgstr "Неприпустима команда: наразі ви в процесі %s/%s бісекції"
+
+#, c-format
+msgid ""
+"You need to give me at least one %s and %s revision.\n"
+"You can use \"git bisect %s\" and \"git bisect %s\" for that."
+msgstr ""
+"Ви маєте надати принаймні одну %s та %s ревізію.\n"
+"Для цього ви можете скористатися командами \"git bisect %s\" і \"git bisect "
+"%s\"."
+
+#, c-format
+msgid ""
+"You need to start by \"git bisect start\".\n"
+"You then need to give me at least one %s and %s revision.\n"
+"You can use \"git bisect %s\" and \"git bisect %s\" for that."
+msgstr ""
+"Вам потрібно почати з \"git bisect start\".\n"
+"Потім вам потрібно надати принаймні одну %s і %s ревізію.\n"
+"Для цього ви можете скористатися командами \"git bisect %s\" і \"git bisect "
+"%s\"."
+
+#, c-format
+msgid "bisecting only with a %s commit"
+msgstr "бісекція лише з %s комітом"
+
+#. TRANSLATORS: Make sure to include [Y] and [n] in your
+#. translation. The program will only accept English input
+#. at this point.
+#.
+
+msgid "Are you sure [Y/n]? "
+msgstr "Ви впевнені [Y/n]? "
+
+msgid "status: waiting for both good and bad commits\n"
+msgstr "статус: чекаємо на добрий і поганий коміти\n"
+
+#, c-format
+msgid "status: waiting for bad commit, %d good commit known\n"
+msgid_plural "status: waiting for bad commit, %d good commits known\n"
+msgstr[0] "статус: чекаємо на поганий коміт, відомий %d добрий коміт\n"
+msgstr[1] "статус: чекаємо на поганий коміт, відомі %d добрих коміти\n"
+msgstr[2] "статус: чекаємо на поганий коміт, відомі %d добрих комітів\n"
+
+msgid "status: waiting for good commit(s), bad commit known\n"
+msgstr "статус: чекаємо на добрий коміт(и), поганий коміт відомий\n"
+
+msgid "no terms defined"
+msgstr "терміни не визначені"
+
+#, c-format
+msgid ""
+"Your current terms are %s for the old state\n"
+"and %s for the new state.\n"
+msgstr ""
+"Ваші поточні терміни: %s для старого стану\n"
+"і %s для нового стану.\n"
+
+#, c-format
+msgid ""
+"invalid argument %s for 'git bisect terms'.\n"
+"Supported options are: --term-good|--term-old and --term-bad|--term-new."
+msgstr ""
+"неприпустимий аргумент %s для \"git bisect terms\".\n"
+"Підтримувані опції: --term-good|--term-old і --term-bad|--term-new."
+
+msgid "revision walk setup failed\n"
+msgstr "не вдалося налаштувати проходження по ревізіям\n"
+
+#, c-format
+msgid "could not open '%s' for appending"
+msgstr "не вдалося відкрити \"%s\" для додавання"
+
+msgid "'' is not a valid term"
+msgstr "\"\" не є допустимим терміном"
+
+#, c-format
+msgid "unrecognized option: '%s'"
+msgstr "нерозпізнана опція: \"%s\""
+
+#, c-format
+msgid "'%s' does not appear to be a valid revision"
+msgstr "\"%s\" не є дійсною ревізією"
+
+msgid "bad HEAD - I need a HEAD"
+msgstr "невірний HEAD - потрібен HEAD"
+
+#, c-format
+msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
+msgstr ""
+"переключення на \"%s\" завершилося невдало. Спробуйте \"git bisect start "
+"<дійсна-гілка>\"."
+
+msgid "bad HEAD - strange symbolic ref"
+msgstr "невірний HEAD - дивне символьне посилання"
+
+#, c-format
+msgid "invalid ref: '%s'"
+msgstr "неприпустиме посилання: \"%s\""
+
+msgid "You need to start by \"git bisect start\"\n"
+msgstr "Вам потрібно почати з \"git bisect start\"\n"
+
+#. TRANSLATORS: Make sure to include [Y] and [n] in your
+#. translation. The program will only accept English input
+#. at this point.
+#.
+
+msgid "Do you want me to do it for you [Y/n]? "
+msgstr "Ви хочете, щоб я зробив це для вас [Y/n]? "
+
+msgid "Please call `--bisect-state` with at least one argument"
+msgstr ""
+"Будь ласка, використовуйте \"--bisect-state\" з принаймні одним аргументом"
+
+#, c-format
+msgid "'git bisect %s' can take only one argument."
+msgstr "\"git bisect %s\" приймає лише один аргумент."
+
+#, c-format
+msgid "Bad rev input: %s"
+msgstr "Невірне значення ревізії: %s"
+
+#, c-format
+msgid "Bad rev input (not a commit): %s"
+msgstr "Невірне значення ревізії (не є комітом): %s"
+
+msgid "We are not bisecting."
+msgstr "Наразі ви не робите бісекцію."
+
+#, c-format
+msgid "'%s'?? what are you talking about?"
+msgstr "\"%s\"? Що ви маєте на увазі?"
+
+#, c-format
+msgid "cannot read file '%s' for replaying"
+msgstr "не вдалося прочитати файл \"%s\" для відтворення"
+
+#, c-format
+msgid "running %s\n"
+msgstr "виконання %s\n"
+
+msgid "bisect run failed: no command provided."
+msgstr "бісекція завершилася невдало: не надано команду."
+
+#, c-format
+msgid "unable to verify %s on good revision"
+msgstr "не вдалося розпізнати %s як припустиму ревізію"
+
+#, c-format
+msgid "bogus exit code %d for good revision"
+msgstr "хибний код виходу %d для доброї ревізії"
+
+#, c-format
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "бісекція завершилася невдало: код виходу %d з %s є < 0 або >= 128"
+
+#, c-format
+msgid "cannot open file '%s' for writing"
+msgstr "не вдалося відкрити файл \"%s\" для запису"
+
+msgid "bisect run cannot continue any more"
+msgstr "неможливо продовжити бісекцію"
+
+msgid "bisect run success"
+msgstr "бісекцію завершено успішно"
+
+msgid "bisect found first bad commit"
+msgstr "бісекція знайшла перший поганий коміт"
+
+#, c-format
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr ""
+"бісекція завершилася невдало: \"git bisect %s\" завершено з кодом помилки %d"
+
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "\"%s\" вимагає або відсутності аргументу, або коміт"
+
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "\"%s\" вимагає 0 або 1 аргумент"
+
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "\"%s\" вимагає 0 аргументів"
+
+msgid "no logfile given"
+msgstr "не надано лог-файл"
+
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "\"%s\" завершено невдало: не надано команду."
+
+msgid "need a command"
+msgstr "потрібна команда"
+
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "невідома команда: \"%s\""
+
+msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git blame [<опції>] [<rev-опції>] [<ревізія>] [--] <файл>"
+
+msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
+msgstr "git annotate [<опції>] [<rev-опції>] [<ревізія>] [--] <файл>"
+
+msgid "<rev-opts> are documented in git-rev-list(1)"
+msgstr "<rev-опції> задокументовані у git-rev-list(1)"
+
+#, c-format
+msgid "expecting a color: %s"
+msgstr "очікування кольору: %s"
+
+msgid "must end with a color"
+msgstr "повинно закінчуватися кольором"
+
+#, c-format
+msgid "cannot find revision %s to ignore"
+msgstr "неможливо знайти ревізію %s для ігнорування"
+
+msgid "show blame entries as we find them, incrementally"
+msgstr "показувати blame записи по мірі того, як ми їх знаходимо, поступово"
+
+msgid "do not show object names of boundary commits (Default: off)"
+msgstr "не показувати назви об’єктів межевих комітів (за замовчуванням: off)"
+
+msgid "do not treat root commits as boundaries (Default: off)"
+msgstr "не розглядати кореневі коміти як межі (за замовчуванням: off)"
+
+msgid "show work cost statistics"
+msgstr "показати статистику вартості робіт"
+
+msgid "force progress reporting"
+msgstr "примусово звітувати прогрес"
+
+msgid "show output score for blame entries"
+msgstr "показати вихідний показник для blame записів"
+
+msgid "show original filename (Default: auto)"
+msgstr "показати оригінальне ім’я файлу (за замовчуванням: auto)"
+
+msgid "show original linenumber (Default: off)"
+msgstr "показати початковий номер рядка (за замовчуванням: off)"
+
+msgid "show in a format designed for machine consumption"
+msgstr ""
+
+msgid "show porcelain format with per-line commit information"
+msgstr ""
+
+msgid "use the same output mode as git-annotate (Default: off)"
+msgstr ""
+
+msgid "show raw timestamp (Default: off)"
+msgstr ""
+
+msgid "show long commit SHA1 (Default: off)"
+msgstr ""
+
+msgid "suppress author name and timestamp (Default: off)"
+msgstr ""
+
+msgid "show author email instead of name (Default: off)"
+msgstr ""
+
+msgid "ignore whitespace differences"
+msgstr ""
+
+msgid "rev"
+msgstr ""
+
+msgid "ignore <rev> when blaming"
+msgstr ""
+
+msgid "ignore revisions from <file>"
+msgstr ""
+
+msgid "color redundant metadata from previous line differently"
+msgstr ""
+
+msgid "color lines by age"
+msgstr ""
+
+msgid "spend extra cycles to find better match"
+msgstr ""
+
+msgid "use revisions from <file> instead of calling git-rev-list"
+msgstr ""
+
+msgid "use <file>'s contents as the final image"
+msgstr ""
+
+msgid "score"
+msgstr ""
+
+msgid "find line copies within and across files"
+msgstr ""
+
+msgid "find line movements within and across files"
+msgstr ""
+
+msgid "range"
+msgstr ""
+
+msgid "process only line range <start>,<end> or function :<funcname>"
+msgstr ""
+
+msgid "--progress can't be used with --incremental or porcelain formats"
+msgstr ""
+"--progress не можна використовувати з форматами --incremental або porcelain"
+
+#. TRANSLATORS: This string is used to tell us the
+#. maximum display width for a relative timestamp in
+#. "git blame" output.  For C locale, "4 years, 11
+#. months ago", which takes 22 places, is the longest
+#. among various forms of relative timestamps, but
+#. your language may need more or fewer display
+#. columns.
+#.
+
+msgid "4 years, 11 months ago"
+msgstr ""
+
+#, c-format
+msgid "file %s has only %lu line"
+msgid_plural "file %s has only %lu lines"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "Blaming lines"
+msgstr ""
+
+msgid "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
+msgstr ""
+
+msgid ""
+"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
+"point>]"
+msgstr ""
+
+msgid "git branch [<options>] [-l] [<pattern>...]"
+msgstr "git branch [<опції>] [-l] [<шаблон>...]"
+
+msgid "git branch [<options>] [-r] (-d | -D) <branch-name>..."
+msgstr "git branch [<опції>] [-r] (-d | -D) <имʼя-гілки>..."
+
+msgid "git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"
+msgstr "git branch [<опції>] (-m | -M) [<стара-гілка>] <нова-гілка>"
+
+msgid "git branch [<options>] (-c | -C) [<old-branch>] <new-branch>"
+msgstr "git branch [<опції>] (-c | -C) [<стара-гілка>] <нова-гілка>"
+
+msgid "git branch [<options>] [-r | -a] [--points-at]"
+msgstr "git branch [<опції>] [-r | -a] [--points-at]"
+
+msgid "git branch [<options>] [-r | -a] [--format]"
+msgstr "git branch [<опції>] [-r | -a] [--format]"
+
+#, c-format
+msgid ""
+"deleting branch '%s' that has been merged to\n"
+"         '%s', but not yet merged to HEAD."
+msgstr ""
+
+#, c-format
+msgid ""
+"not deleting branch '%s' that is not yet merged to\n"
+"         '%s', even though it is merged to HEAD."
+msgstr ""
+
+#, c-format
+msgid "Couldn't look up commit object for '%s'"
+msgstr "Не вдалося знайти об’єкт коміту для \"%s\""
+
+#, c-format
+msgid ""
+"The branch '%s' is not fully merged.\n"
+"If you are sure you want to delete it, run 'git branch -D %s'."
+msgstr ""
+
+msgid "Update of config-file failed"
+msgstr ""
+
+msgid "cannot use -a with -d"
+msgstr "не можна використовувати -a з -d"
+
+#, c-format
+msgid "Cannot delete branch '%s' checked out at '%s'"
+msgstr "Неможливо видалити гілку \"%s\" за адресою \"%s\""
+
+#, c-format
+msgid "remote-tracking branch '%s' not found."
+msgstr "віддалено відстежувана гілка \"%s\" не знайдена."
+
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"гілка \"%s\" не знайдена.\n"
+"Ви забули --remote?"
+
+#, c-format
+msgid "branch '%s' not found."
+msgstr "гілка \"%s\" не знайдена."
+
+#, c-format
+msgid "Deleted remote-tracking branch %s (was %s).\n"
+msgstr ""
+
+#, c-format
+msgid "Deleted branch %s (was %s).\n"
+msgstr "Видалено гілку %s (була %s).\n"
+
+msgid "unable to parse format string"
+msgstr "не вдалося розібрати рядок форматування"
+
+msgid "could not resolve HEAD"
+msgstr "не вдалося розвʼязати HEAD"
+
+#, c-format
+msgid "HEAD (%s) points outside of refs/heads/"
+msgstr "HEAD (%s) пунктів за межами refs/heads/"
+
+#, c-format
+msgid "Branch %s is being rebased at %s"
+msgstr ""
+
+#, c-format
+msgid "Branch %s is being bisected at %s"
+msgstr "Гілка %s бісектується в точці %s"
+
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "HEAD робочого дерева %s не оновлено"
+
+#, c-format
+msgid "Invalid branch name: '%s'"
+msgstr "Неприпустима назва гілки: \"%s\""
+
+#, c-format
+msgid "No commit on branch '%s' yet."
+msgstr "Поки що немає комітів в гілці \"%s\"."
+
+#, c-format
+msgid "No branch named '%s'."
+msgstr "Немає гілки з ім’ям \"%s\"."
+
+msgid "Branch rename failed"
+msgstr ""
+
+msgid "Branch copy failed"
+msgstr ""
+
+#, c-format
+msgid "Created a copy of a misnamed branch '%s'"
+msgstr "Створено копію неправильно названої гілки \"%s\""
+
+#, c-format
+msgid "Renamed a misnamed branch '%s' away"
+msgstr "Перейменовано неправильно названу гілку \"%s\""
+
+#, c-format
+msgid "Branch renamed to %s, but HEAD is not updated!"
+msgstr ""
+
+msgid "Branch is renamed, but update of config-file failed"
+msgstr ""
+
+msgid "Branch is copied, but update of config-file failed"
+msgstr ""
+
+#, c-format
+msgid ""
+"Please edit the description for the branch\n"
+"  %s\n"
+"Lines starting with '%c' will be stripped.\n"
+msgstr ""
+
+msgid "Generic options"
+msgstr ""
+
+msgid "show hash and subject, give twice for upstream branch"
+msgstr ""
+
+msgid "suppress informational messages"
+msgstr ""
+
+msgid "set branch tracking configuration"
+msgstr "налаштувати конфігурацію відстежуваних гілок"
+
+msgid "do not use"
+msgstr ""
+
+msgid "upstream"
+msgstr ""
+
+msgid "change the upstream info"
+msgstr ""
+
+msgid "unset the upstream info"
+msgstr ""
+
+msgid "use colored output"
+msgstr ""
+
+msgid "act on remote-tracking branches"
+msgstr "працювати з віддалено відстежуваними гілками"
+
+msgid "print only branches that contain the commit"
+msgstr ""
+
+msgid "print only branches that don't contain the commit"
+msgstr ""
+
+msgid "Specific git-branch actions:"
+msgstr ""
+
+msgid "list both remote-tracking and local branches"
+msgstr ""
+
+msgid "delete fully merged branch"
+msgstr ""
+
+msgid "delete branch (even if not merged)"
+msgstr ""
+
+msgid "move/rename a branch and its reflog"
+msgstr ""
+
+msgid "move/rename a branch, even if target exists"
+msgstr ""
+
+msgid "do not output a newline after empty formatted refs"
+msgstr ""
+
+msgid "copy a branch and its reflog"
+msgstr ""
+
+msgid "copy a branch, even if target exists"
+msgstr ""
+
+msgid "list branch names"
+msgstr "показати назви гілок"
+
+msgid "show current branch name"
+msgstr "показати назву поточної гілки"
+
+msgid "create the branch's reflog"
+msgstr ""
+
+msgid "edit the description for the branch"
+msgstr "редагувати опис гілки"
+
+msgid "force creation, move/rename, deletion"
+msgstr ""
+
+msgid "print only branches that are merged"
+msgstr ""
+
+msgid "print only branches that are not merged"
+msgstr ""
+
+msgid "list branches in columns"
+msgstr ""
+
+msgid "object"
+msgstr ""
+
+msgid "print only branches of the object"
+msgstr ""
+
+msgid "sorting and filtering are case insensitive"
+msgstr ""
+
+msgid "recurse through submodules"
+msgstr "рекурсивно через підмодулі"
+
+msgid "format to use for the output"
+msgstr ""
+
+msgid "Failed to resolve HEAD as a valid ref."
+msgstr "Не вдалося розпізнати HEAD як дійсне посилання."
+
+msgid "HEAD not found below refs/heads!"
+msgstr "HEAD не знайдено під посиланнями/заголовками!"
+
+msgid ""
+"branch with --recurse-submodules can only be used if submodule."
+"propagateBranches is enabled"
+msgstr ""
+
+msgid "--recurse-submodules can only be used to create branches"
+msgstr ""
+
+msgid "branch name required"
+msgstr ""
+
+msgid "Cannot give description to detached HEAD"
+msgstr ""
+
+msgid "cannot edit description of more than one branch"
+msgstr ""
+
+msgid "cannot copy the current branch while not on any."
+msgstr ""
+
+msgid "cannot rename the current branch while not on any."
+msgstr ""
+
+msgid "too many branches for a copy operation"
+msgstr ""
+
+msgid "too many arguments for a rename operation"
+msgstr ""
+
+msgid "too many arguments to set new upstream"
+msgstr ""
+
+#, c-format
+msgid ""
+"could not set upstream of HEAD to %s when it does not point to any branch."
+msgstr ""
+
+#, c-format
+msgid "no such branch '%s'"
+msgstr "немає такої гілки \"%s\""
+
+#, c-format
+msgid "branch '%s' does not exist"
+msgstr "гілка \"%s\" не існує"
+
+msgid "too many arguments to unset upstream"
+msgstr "забагато аргументів для скидання значення першоджерельного сховища"
+
+msgid "could not unset upstream of HEAD when it does not point to any branch."
+msgstr ""
+"неможливво скинути значення першоджерельного сховища для HEAD, якщо він не "
+"вказує на жодну гілку."
+
+#, c-format
+msgid "Branch '%s' has no upstream information"
+msgstr "Гілка \"%s\" не має інформації щодо першоджерельного сховища"
+
+msgid ""
+"The -a, and -r, options to 'git branch' do not take a branch name.\n"
+"Did you mean to use: -a|-r --list <pattern>?"
+msgstr ""
+
+msgid ""
+"the '--set-upstream' option is no longer supported. Please use '--track' or "
+"'--set-upstream-to' instead."
+msgstr ""
+
+msgid "git version:\n"
+msgstr ""
+
+#, c-format
+msgid "uname() failed with error '%s' (%d)\n"
+msgstr ""
+
+msgid "compiler info: "
+msgstr ""
+
+msgid "libc info: "
+msgstr ""
+
+msgid "not run from a git repository - no hooks to show\n"
+msgstr ""
+
+msgid ""
+"git bugreport [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+"              [--diagnose[=<mode>]]"
+msgstr ""
+
+msgid ""
+"Thank you for filling out a Git bug report!\n"
+"Please answer the following questions to help us understand your issue.\n"
+"\n"
+"What did you do before the bug happened? (Steps to reproduce your issue)\n"
+"\n"
+"What did you expect to happen? (Expected behavior)\n"
+"\n"
+"What happened instead? (Actual behavior)\n"
+"\n"
+"What's different between what you expected and what actually happened?\n"
+"\n"
+"Anything else you want to add:\n"
+"\n"
+"Please review the rest of the bug report below.\n"
+"You can delete any lines you don't wish to share.\n"
+msgstr ""
+
+msgid "mode"
+msgstr ""
+
+msgid ""
+"create an additional zip archive of detailed diagnostics (default 'stats')"
+msgstr ""
+
+msgid "specify a destination for the bugreport file(s)"
+msgstr ""
+
+msgid "specify a strftime format suffix for the filename(s)"
+msgstr ""
+
+#, c-format
+msgid "could not create leading directories for '%s'"
+msgstr "не вдалося створити провідні каталоги для \"%s\""
+
+#, c-format
+msgid "unable to create diagnostics archive %s"
+msgstr "не вдалося створити архів діагностики %s"
+
+msgid "System Info"
+msgstr ""
+
+msgid "Enabled Hooks"
+msgstr ""
+
+#, c-format
+msgid "unable to write to %s"
+msgstr "не вдалося записати до %s"
+
+#, c-format
+msgid "Created new report at '%s'.\n"
+msgstr ""
+
+msgid ""
+"git bundle create [-q | --quiet | --progress]\n"
+"                  [--version=<version>] <file> <git-rev-list-args>"
+msgstr ""
+
+msgid "git bundle verify [-q | --quiet] <file>"
+msgstr ""
+
+msgid "git bundle list-heads <file> [<refname>...]"
+msgstr ""
+
+msgid "git bundle unbundle [--progress] <file> [<refname>...]"
+msgstr ""
+
+msgid "need a <file> argument"
+msgstr ""
+
+msgid "do not show progress meter"
+msgstr ""
+
+msgid "show progress meter"
+msgstr "показувати прогрес виконання"
+
+msgid "historical; same as --progress"
+msgstr ""
+
+msgid "historical; does nothing"
+msgstr "історична; не робить нічогісенько"
+
+msgid "specify bundle format version"
+msgstr ""
+
+msgid "Need a repository to create a bundle."
+msgstr ""
+
+msgid "do not show bundle details"
+msgstr ""
+
+#, c-format
+msgid "%s is okay\n"
+msgstr ""
+
+msgid "Need a repository to unbundle."
+msgstr "Потрібне сховище для розділення."
+
+msgid "Unbundling objects"
+msgstr "Розділення об’єктів"
+
+#, c-format
+msgid "cannot read object %s '%s'"
+msgstr "неможливо прочитати об’єкт %s \"%s\""
+
+msgid "flush is only for --buffer mode"
+msgstr ""
+
+msgid "empty command in input"
+msgstr ""
+
+#, c-format
+msgid "whitespace before command: '%s'"
+msgstr ""
+
+#, c-format
+msgid "%s requires arguments"
+msgstr ""
+
+#, c-format
+msgid "%s takes no arguments"
+msgstr "%s не потребує аргументів"
+
+msgid "only one batch option may be specified"
+msgstr ""
+
+msgid "git cat-file <type> <object>"
+msgstr ""
+
+msgid "git cat-file (-e | -p) <object>"
+msgstr ""
+
+msgid "git cat-file (-t | -s) [--allow-unknown-type] <object>"
+msgstr ""
+
+msgid ""
+"git cat-file (--batch | --batch-check | --batch-command) [--batch-all-"
+"objects]\n"
+"             [--buffer] [--follow-symlinks] [--unordered]\n"
+"             [--textconv | --filters] [-z]"
+msgstr ""
+
+msgid ""
+"git cat-file (--textconv | --filters)\n"
+"             [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>]"
+msgstr ""
+
+msgid "Check object existence or emit object contents"
+msgstr ""
+
+msgid "check if <object> exists"
+msgstr "перевірити, чи існує <об’єкт>"
+
+msgid "pretty-print <object> content"
+msgstr ""
+
+msgid "Emit [broken] object attributes"
+msgstr ""
+
+msgid "show object type (one of 'blob', 'tree', 'commit', 'tag', ...)"
+msgstr ""
+
+msgid "show object size"
+msgstr ""
+
+msgid "allow -s and -t to work with broken/corrupt objects"
+msgstr ""
+
+msgid "use mail map file"
+msgstr ""
+
+msgid "Batch objects requested on stdin (or --batch-all-objects)"
+msgstr ""
+
+msgid "show full <object> or <rev> contents"
+msgstr ""
+
+msgid "like --batch, but don't emit <contents>"
+msgstr ""
+
+msgid "stdin is NUL-terminated"
+msgstr ""
+
+msgid "read commands from stdin"
+msgstr "читати команди з stdin"
+
+msgid "with --batch[-check]: ignores stdin, batches all known objects"
+msgstr ""
+
+msgid "Change or optimize batch output"
+msgstr ""
+
+msgid "buffer --batch output"
+msgstr ""
+
+msgid "follow in-tree symlinks"
+msgstr ""
+
+msgid "do not order objects before emitting them"
+msgstr ""
+
+msgid ""
+"Emit object (blob or tree) with conversion or filter (stand-alone, or with "
+"batch)"
+msgstr ""
+
+msgid "run textconv on object's content"
+msgstr ""
+
+msgid "run filters on object's content"
+msgstr ""
+
+msgid "blob|tree"
+msgstr ""
+
+msgid "use a <path> for (--textconv | --filters); Not with 'batch'"
+msgstr ""
+
+#, c-format
+msgid "'%s=<%s>' needs '%s' or '%s'"
+msgstr ""
+
+msgid "path|tree-ish"
+msgstr ""
+
+#, c-format
+msgid "'%s' requires a batch mode"
+msgstr ""
+
+#, c-format
+msgid "'-%c' is incompatible with batch mode"
+msgstr ""
+
+msgid "batch modes take no arguments"
+msgstr ""
+
+#, c-format
+msgid "<rev> required with '%s'"
+msgstr ""
+
+#, c-format
+msgid "<object> required with '-%c'"
+msgstr ""
+
+#, c-format
+msgid "only two arguments allowed in <type> <object> mode, not %d"
+msgstr ""
+
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <деревоподібне джерело>] [-a | --all | "
+"<атрибут>...]"
+
+msgid "report all attributes set on file"
+msgstr ""
+
+msgid "use .gitattributes only from the index"
+msgstr ""
+
+msgid "read file names from stdin"
+msgstr ""
+
+msgid "terminate input and output records by a NUL character"
+msgstr ""
+
+msgid "<tree-ish>"
+msgstr ""
+
+msgid "which tree-ish to check attributes at"
+msgstr "атрибути якого деревоподібного джерела перевіряти"
+
+msgid "suppress progress reporting"
+msgstr "не звітувати прогрес"
+
+msgid "show non-matching input paths"
+msgstr ""
+
+msgid "ignore index when checking"
+msgstr ""
+
+msgid "cannot specify pathnames with --stdin"
+msgstr ""
+
+msgid "-z only makes sense with --stdin"
+msgstr ""
+
+msgid "no path specified"
+msgstr "шлях не вказано"
+
+msgid "--quiet is only valid with a single pathname"
+msgstr ""
+
+msgid "cannot have both --quiet and --verbose"
+msgstr ""
+
+msgid "--non-matching is only valid with --verbose"
+msgstr ""
+
+msgid "git check-mailmap [<options>] <contact>..."
+msgstr "git check-mailmap [<опції>] <контакт>..."
+
+msgid "also read contacts from stdin"
+msgstr ""
+
+#, c-format
+msgid "unable to parse contact: %s"
+msgstr "не вдалося розібрати контакт: %s"
+
+msgid "no contacts specified"
+msgstr ""
+
+msgid "git checkout--worker [<options>]"
+msgstr "git checkout--worker [<опції>]"
+
+msgid "string"
+msgstr ""
+
+msgid "when creating files, prepend <string>"
+msgstr ""
+
+msgid "git checkout-index [<options>] [--] [<file>...]"
+msgstr "git checkout-index [<опції>] [—] [<файл>...]"
+
+msgid "stage should be between 1 and 3 or all"
+msgstr ""
+
+msgid "check out all files in the index"
+msgstr ""
+
+msgid "do not skip files with skip-worktree set"
+msgstr ""
+
+msgid "force overwrite of existing files"
+msgstr ""
+
+msgid "no warning for existing files and files not in index"
+msgstr ""
+
+msgid "don't checkout new files"
+msgstr ""
+
+msgid "update stat information in the index file"
+msgstr "оновити статистичну інформацію в індексному файлі"
+
+msgid "read list of paths from the standard input"
+msgstr ""
+
+msgid "write the content to temporary files"
+msgstr ""
+
+msgid "copy out the files from named stage"
+msgstr ""
+
+msgid "git checkout [<options>] <branch>"
+msgstr "git checkout [<опції>] <гілка>"
+
+msgid "git checkout [<options>] [<branch>] -- <file>..."
+msgstr "git checkout [<опції>] [<гілка>] -- <файл>..."
+
+msgid "git switch [<options>] [<branch>]"
+msgstr "git switch [<опції>] [<гілка>]"
+
+msgid "git restore [<options>] [--source=<branch>] <file>..."
+msgstr "git restore [<опції>] [--source=<гілка>] <файл>..."
+
+#, c-format
+msgid "path '%s' does not have our version"
+msgstr "шлях '%s' не містить нашої версії"
+
+#, c-format
+msgid "path '%s' does not have their version"
+msgstr "шлях '%s' не містить їхньої версії"
+
+#, c-format
+msgid "path '%s' does not have all necessary versions"
+msgstr "шлях '%s' не містить всіх необхідних версій"
+
+#, c-format
+msgid "path '%s' does not have necessary versions"
+msgstr "шлях '%s' не містить необхідних версій"
+
+#, c-format
+msgid "path '%s': cannot merge"
+msgstr "шлях '%s': неможливо злити"
+
+#, c-format
+msgid "Unable to add merge result for '%s'"
+msgstr "Неможливо додати результат злиття для '%s'"
+
+#, c-format
+msgid "Recreated %d merge conflict"
+msgid_plural "Recreated %d merge conflicts"
+msgstr[0] "Відтворено %d конфлікт злиття"
+msgstr[1] "Відтворено %d конфлікта злиття"
+msgstr[2] "Відтворено %d конфліктів злиття"
+
+#, c-format
+msgid "Updated %d path from %s"
+msgid_plural "Updated %d paths from %s"
+msgstr[0] "Оновлено %d шлях з %s"
+msgstr[1] "Оновлено %d шляхи з %s"
+msgstr[2] "Оновлено %d шляхів з %s"
+
+#, c-format
+msgid "Updated %d path from the index"
+msgid_plural "Updated %d paths from the index"
+msgstr[0] "Оновлено %d шлях з індексу"
+msgstr[1] "Оновлено %d шляхи з індексу"
+msgstr[2] "Оновлено %d шляхів з індексу"
+
+#, c-format
+msgid "'%s' cannot be used with updating paths"
+msgstr "'%s' не можна використовувати зі шляхами оновлення"
+
+#, c-format
+msgid "Cannot update paths and switch to branch '%s' at the same time."
+msgstr "Неможливо одночасно оновити шляхи та переключитись на гілку '%s'."
+
+#, c-format
+msgid "neither '%s' or '%s' is specified"
+msgstr "не вказано ні '%s', ні '%s'"
+
+#, c-format
+msgid "'%s' must be used when '%s' is not specified"
+msgstr "'%s' повинен використовуватися, якщо не вказано '%s'"
+
+#, c-format
+msgid "'%s' or '%s' cannot be used with %s"
+msgstr "'%s' або '%s' не можна використовувати з %s"
+
+#, c-format
+msgid "path '%s' is unmerged"
+msgstr "шлях '%s' не злитий"
+
+msgid "you need to resolve your current index first"
+msgstr "спочатку потрібно розібратись з вашим поточним індексом"
+
+#, c-format
+msgid ""
+"cannot continue with staged changes in the following files:\n"
+"%s"
+msgstr ""
+"неможливо продовжити з індексованими змінами в наступних файлах:\n"
+"%s"
+
+#, c-format
+msgid "Can not do reflog for '%s': %s\n"
+msgstr "Неможливо виконати reflog для '%s': %s\n"
+
+msgid "HEAD is now at"
+msgstr "HEAD зараз на"
+
+msgid "unable to update HEAD"
+msgstr "не вдалося оновити HEAD"
+
+#, c-format
+msgid "Reset branch '%s'\n"
+msgstr "Скинути гілку '%s'\n"
+
+#, c-format
+msgid "Already on '%s'\n"
+msgstr "Вже на '%s'\n"
+
+#, c-format
+msgid "Switched to and reset branch '%s'\n"
+msgstr "Переключено на та скинуто гілку '%s'\n"
+
+#, c-format
+msgid "Switched to a new branch '%s'\n"
+msgstr "Переключено на нову гілку '%s'\n"
+
+#, c-format
+msgid "Switched to branch '%s'\n"
+msgstr "Переключено на гілку '%s'\n"
+
+#, c-format
+msgid " ... and %d more.\n"
+msgstr " ... та ще %d.\n"
+
+#, c-format
+msgid ""
+"Warning: you are leaving %d commit behind, not connected to\n"
+"any of your branches:\n"
+"\n"
+"%s\n"
+msgid_plural ""
+"Warning: you are leaving %d commits behind, not connected to\n"
+"any of your branches:\n"
+"\n"
+"%s\n"
+msgstr[0] ""
+"Попередження: ви залишаєте позаду %d коміт, не підключений до\n"
+"жодної з ваших гілок:\n"
+"\n"
+"%s\n"
+msgstr[1] ""
+"Попередження: ви залишаєте позаду %d коміта, не підключених до\n"
+"жодної з ваших гілок:\n"
+"\n"
+"%s\n"
+msgstr[2] ""
+"Попередження: ви залишаєте позаду %d комітів, не підключених до\n"
+"жодної з ваших гілок:\n"
+"\n"
+"%s\n"
+
+#, c-format
+msgid ""
+"If you want to keep it by creating a new branch, this may be a good time\n"
+"to do so with:\n"
+"\n"
+" git branch <new-branch-name> %s\n"
+"\n"
+msgid_plural ""
+"If you want to keep them by creating a new branch, this may be a good time\n"
+"to do so with:\n"
+"\n"
+" git branch <new-branch-name> %s\n"
+"\n"
+msgstr[0] ""
+"Якщо ви хочете зберегти його, створивши нову гілку, то зараз є чудова "
+"нагода\n"
+"зробити це за допомогою:\n"
+"git branch <назва-нової-гілки> %s\n"
+"\n"
+msgstr[1] ""
+"Якщо ви хочете зберегти їх, створивши нову гілку, то зараз є чудова нагода\n"
+"зробити це за допомогою:\n"
+"git branch <назва-нової-гілки> %s\n"
+"\n"
+msgstr[2] ""
+"Якщо ви хочете зберегти їх, створивши нову гілку, то зараз є чудова нагода\n"
+"зробити це за допомогою:\n"
+"git branch <назва-нової-гілки> %s\n"
+"\n"
+
+msgid "internal error in revision walk"
+msgstr "внутрішня помилка при проходженні по ревізіям"
+
+msgid "Previous HEAD position was"
+msgstr "Попередня позиція HEAD була"
+
+msgid "You are on a branch yet to be born"
+msgstr "Ви на гілці, яка ще не iснує"
+
+#, c-format
+msgid ""
+"'%s' could be both a local file and a tracking branch.\n"
+"Please use -- (and optionally --no-guess) to disambiguate"
+msgstr ""
+"\"%s\" може бути як локальним файлом, так і відстежуваною гілкою.\n"
+"Будь ласка, використовуйте -- (і, за бажанням, --no-guess), для визначення"
+
+msgid ""
+"If you meant to check out a remote tracking branch on, e.g. 'origin',\n"
+"you can do so by fully qualifying the name with the --track option:\n"
+"\n"
+"    git checkout --track origin/<name>\n"
+"\n"
+"If you'd like to always have checkouts of an ambiguous <name> prefer\n"
+"one remote, e.g. the 'origin' remote, consider setting\n"
+"checkout.defaultRemote=origin in your config."
+msgstr ""
+"Якщо ви хотіли переключитись на віддалено відстежувану гілку, наприклад, "
+"'origin',\n"
+"ви можете зробити це, повністю вказавши назву з опцією --track:\n"
+"\n"
+"    git checkout --track origin/<назва>.\n"
+"\n"
+"Якщо при переключенні з неоднозначною <назвою> ви бажаєте завжди віддавати "
+"перевагу\n"
+"певному віддаленому сховищу, наприклад, 'origin', розгляньте можливість "
+"додання\n"
+"checkout.defaultRemote=origin до вашого конфігураційного файлу."
+
+#, c-format
+msgid "'%s' matched multiple (%d) remote tracking branches"
+msgstr "\"%s\" відповідає декільком (%d) гілкам віддаленого відстежування"
+
+msgid "only one reference expected"
+msgstr "очікувалось тільки одне посилання"
+
+#, c-format
+msgid "only one reference expected, %d given."
+msgstr "очікувалось тільки одне посилання, надано %d."
+
+#, c-format
+msgid "invalid reference: %s"
+msgstr "неприпустиме посилання: %s"
+
+#, c-format
+msgid "reference is not a tree: %s"
+msgstr "посилання не є деревом: %s"
+
+#, c-format
+msgid "a branch is expected, got tag '%s'"
+msgstr "очікувалась гілка, надано тег '%s'"
+
+#, c-format
+msgid "a branch is expected, got remote branch '%s'"
+msgstr "очікувалась гілка, надана віддалена гілка '%s'"
+
+#, c-format
+msgid "a branch is expected, got '%s'"
+msgstr "очікувалась гілка, надано '%s'"
+
+#, c-format
+msgid "a branch is expected, got commit '%s'"
+msgstr "очікувалась гілка, надано коміт '%s'"
+
+msgid ""
+"If you want to detach HEAD at the commit, try again with the --detach option."
+msgstr ""
+"Якщо ви хочете від'єднати HEAD на цьому коміті, спробуйте ще раз з опцією --"
+"detach."
+
+msgid ""
+"cannot switch branch while merging\n"
+"Consider \"git merge --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під час злиття\n"
+"Спробуйте \"git merge --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch in the middle of an am session\n"
+"Consider \"git am --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під час am сеансу\n"
+"Спробуйте \"git am --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch while rebasing\n"
+"Consider \"git rebase --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під час перебазування\n"
+"Спробуйте \"git rebase --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch while cherry-picking\n"
+"Consider \"git cherry-pick --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під час висмикування\n"
+"Спробуйте \"git cherry-pick --quit\" або \"git worktree add\"."
+
+msgid ""
+"cannot switch branch while reverting\n"
+"Consider \"git revert --quit\" or \"git worktree add\"."
+msgstr ""
+"неможливо змінити гілку під час вивертання\n"
+"Спробуйте \"git revert --quit\" або \"git worktree add\"."
+
+msgid "you are switching branch while bisecting"
+msgstr "ви переключаєте гілку під час бісекції"
+
+msgid "paths cannot be used with switching branches"
+msgstr "шляхи не можуть використовуватись при переключенні гілок"
+
+#, c-format
+msgid "'%s' cannot be used with switching branches"
+msgstr "'%s' не може використовуватись при переключенні гілок"
+
+#, c-format
+msgid "'%s' cannot be used with '%s'"
+msgstr "'%s' не може використовуватись з '%s'"
+
+#, c-format
+msgid "'%s' cannot take <start-point>"
+msgstr "'%s' не може прийняти <стартова-точка>"
+
+#, c-format
+msgid "Cannot switch branch to a non-commit '%s'"
+msgstr "Неможливо переключити гілку на не коміт '%s'"
+
+msgid "missing branch or commit argument"
+msgstr "відсутня гілка або коміт"
+
+msgid "perform a 3-way merge with the new branch"
+msgstr "здійснити 3-стороннє злиття з новою гілкою"
+
+msgid "style"
+msgstr "стиль"
+
+msgid "conflict style (merge, diff3, or zdiff3)"
+msgstr "конфлікт стилю (merge, diff3 або zdiff3)"
+
+msgid "detach HEAD at named commit"
+msgstr "відʼєднати HEAD на вказаному коміті"
+
+msgid "force checkout (throw away local modifications)"
+msgstr "переключити примусово (викинути локальні зміни)"
+
+msgid "new-branch"
+msgstr "нова-гілка"
+
+msgid "new unparented branch"
+msgstr "нова гілка без джерела"
+
+msgid "update ignored files (default)"
+msgstr "оновити ігноровані файли (за замовчуванням)"
+
+msgid "do not check if another worktree is holding the given ref"
+msgstr "не перевіряти, чи інше робоче дерево містить дане посилання"
+
+msgid "checkout our version for unmerged files"
+msgstr "використовувати нашу версію для незлитих файлів"
+
+msgid "checkout their version for unmerged files"
+msgstr "використовувати їхню версію для незлитих файлів"
+
+msgid "do not limit pathspecs to sparse entries only"
+msgstr "не обмежувати визначники шляхів лише розрідженими записами"
+
+#, c-format
+msgid "options '-%c', '-%c', and '%s' cannot be used together"
+msgstr "опції '-%c', '-%c' та '%s' не можуть використовуватись разом"
+
+msgid "--track needs a branch name"
+msgstr "--track потребує назви гілки"
+
+#, c-format
+msgid "missing branch name; try -%c"
+msgstr "відсутня назва гілки; спробуйте -%c"
+
+#, c-format
+msgid "could not resolve %s"
+msgstr "не вдалося розвʼязати %s"
+
+msgid "invalid path specification"
+msgstr "неприпустиме зазначення шляху"
+
+#, c-format
+msgid "'%s' is not a commit and a branch '%s' cannot be created from it"
+msgstr "'%s' не є комітом, і з нього не можна створити гілку '%s'"
+
+#, c-format
+msgid "git checkout: --detach does not take a path argument '%s'"
+msgstr "git checkout: --detach не приймає аргумент шляху '%s'"
+
+msgid ""
+"git checkout: --ours/--theirs, --force and --merge are incompatible when\n"
+"checking out of the index."
+msgstr ""
+"git checkout: --ours/--theirs, --force та --merge несумісні при\n"
+"при прееключенні індексу."
+
+msgid "you must specify path(s) to restore"
+msgstr "необхідно вказати шлях(и) для відновлення"
+
+msgid "branch"
+msgstr "гілка"
+
+msgid "create and checkout a new branch"
+msgstr "створити та перейти до нової гілки"
+
+msgid "create/reset and checkout a branch"
+msgstr "створити/скинути та перейти до нової гілки"
+
+msgid "create reflog for new branch"
+msgstr "створити reflog для нової гілки"
+
+msgid "second guess 'git checkout <no-such-branch>' (default)"
+msgstr "друга здогадка \"git checkout <гілка-не-існує>\" (за замовчуванням)"
+
+msgid "use overlay mode (default)"
+msgstr "використовувати режим накладення (за замовчуванням)"
+
+msgid "create and switch to a new branch"
+msgstr "створити та переключити на нову гілку"
+
+msgid "create/reset and switch to a branch"
+msgstr "створити/скинути та переключити на гілку"
+
+msgid "second guess 'git switch <no-such-branch>'"
+msgstr "друга здогадка \"git switch <гілка-не-існує>\" (за замовчуванням)"
+
+msgid "throw away local modifications"
+msgstr "викинути локальні зміни"
+
+msgid "which tree-ish to checkout from"
+msgstr "з якого деревоподібного джерела створювати"
+
+msgid "restore the index"
+msgstr "відновити індекс"
+
+msgid "restore the working tree (default)"
+msgstr "відновити робоче дерево (за замовчуванням)"
+
+msgid "ignore unmerged entries"
+msgstr "ігнорувати незлиті записи"
+
+msgid "use overlay mode"
+msgstr "використовувати режим накладення"
+
+msgid ""
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
+msgstr ""
+
+#, c-format
+msgid "Removing %s\n"
+msgstr "Видалення %s\n"
+
+#, c-format
+msgid "Would remove %s\n"
+msgstr "Було б видалено %s\n"
+
+#, c-format
+msgid "Skipping repository %s\n"
+msgstr "Пропуск сховища %s\n"
+
+#, c-format
+msgid "Would skip repository %s\n"
+msgstr "Було б пропущено сховище %s\n"
+
+#, c-format
+msgid "failed to remove %s"
+msgstr "не вдалося видалити %s"
+
+#, c-format
+msgid "could not lstat %s\n"
+msgstr "не вдалося виконати lstat %s\n"
+
+msgid "Refusing to remove current working directory\n"
+msgstr "Відмова в видаленні поточної робочої директорії\n"
+
+msgid "Would refuse to remove current working directory\n"
+msgstr "Було б відмовлено в видаленні поточної робочої директорії\n"
+
+#, c-format
+msgid ""
+"Prompt help:\n"
+"1          - select a numbered item\n"
+"foo        - select item based on unique prefix\n"
+"           - (empty) select nothing\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Prompt help:\n"
+"1          - select a single item\n"
+"3-5        - select a range of items\n"
+"2-3,6-9    - select multiple ranges\n"
+"foo        - select item based on unique prefix\n"
+"-...       - unselect specified items\n"
+"*          - choose all items\n"
+"           - (empty) finish selecting\n"
+msgstr ""
+
+#, c-format
+msgid "Huh (%s)?\n"
+msgstr ""
+
+#, c-format
+msgid "Input ignore patterns>> "
+msgstr ""
+
+#, c-format
+msgid "WARNING: Cannot find items matched by: %s"
+msgstr ""
+
+msgid "Select items to delete"
+msgstr ""
+
+#. TRANSLATORS: Make sure to keep [y/N] as is
+
+#, c-format
+msgid "Remove %s [y/N]? "
+msgstr ""
+
+msgid ""
+"clean               - start cleaning\n"
+"filter by pattern   - exclude items from deletion\n"
+"select by numbers   - select items to be deleted by numbers\n"
+"ask each            - confirm each deletion (like \"rm -i\")\n"
+"quit                - stop cleaning\n"
+"help                - this screen\n"
+"?                   - help for prompt selection"
+msgstr ""
+
+msgid "Would remove the following item:"
+msgid_plural "Would remove the following items:"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "No more files to clean, exiting."
+msgstr ""
+
+msgid "do not print names of files removed"
+msgstr ""
+
+msgid "force"
+msgstr ""
+
+msgid "interactive cleaning"
+msgstr ""
+
+msgid "remove whole directories"
+msgstr ""
+
+msgid "pattern"
+msgstr ""
+
+msgid "add <pattern> to ignore rules"
+msgstr ""
+
+msgid "remove ignored files, too"
+msgstr "видалити також ігноровані файли"
+
+msgid "remove only ignored files"
+msgstr "видалити лише ігноровані файли"
+
+msgid ""
+"clean.requireForce set to true and neither -i, -n, nor -f given; refusing to "
+"clean"
+msgstr ""
+
+msgid ""
+"clean.requireForce defaults to true and neither -i, -n, nor -f given; "
+"refusing to clean"
+msgstr ""
+
+msgid "-x and -X cannot be used together"
+msgstr "-x та -X не можна використовувати разом"
+
+msgid "git clone [<options>] [--] <repo> [<dir>]"
+msgstr "git clone [<опції>] [--] <сховище> [<директорія>]"
+
+msgid "don't clone shallow repository"
+msgstr "не клонувати неглибоке сховище"
+
+msgid "don't create a checkout"
+msgstr "не переходити до гілки"
+
+msgid "create a bare repository"
+msgstr "створити порожнє сховище"
+
+msgid "create a mirror repository (implies bare)"
+msgstr "створити дзеркальне сховище (включає опцію bare)"
+
+msgid "to clone from a local repository"
+msgstr "клонувати з локального сховища"
+
+msgid "don't use local hardlinks, always copy"
+msgstr "не використовувати локальні жорсткі посилання, завжди копіювати"
+
+msgid "setup as shared repository"
+msgstr "налаштувати як спільне сховище"
+
+msgid "pathspec"
+msgstr "визначник шляху"
+
+msgid "initialize submodules in the clone"
+msgstr "ініціалізувати підмодулі в клоні"
+
+msgid "number of submodules cloned in parallel"
+msgstr "кількість підмодулів, що клонуються паралельно"
+
+msgid "template-directory"
+msgstr "директорія-шаблонів"
+
+msgid "directory from which templates will be used"
+msgstr "директорія, з якої брати шаблони"
+
+msgid "reference repository"
+msgstr "посилання на сховище"
+
+msgid "use --reference only while cloning"
+msgstr "використовуйте --reference тільки під час клонування"
+
+msgid "name"
+msgstr "назва"
+
+msgid "use <name> instead of 'origin' to track upstream"
+msgstr ""
+"використовуйте <назва> замість \"origin\" для відстежування першоджерельного "
+"сховища"
+
+msgid "checkout <branch> instead of the remote's HEAD"
+msgstr "перейти до <гілки> замість HEAD віддаленого сховища"
+
+msgid "path to git-upload-pack on the remote"
+msgstr "шлях до git-upload-pack на віддаленому сервері"
+
+msgid "depth"
+msgstr "глибина"
+
+msgid "create a shallow clone of that depth"
+msgstr "створити поверхневий клон вказаної глибини"
+
+msgid "create a shallow clone since a specific time"
+msgstr "створити поверхневий клон з певного часу"
+
+msgid "revision"
+msgstr "ревізія"
+
+msgid "deepen history of shallow clone, excluding rev"
+msgstr "поглибити історію поверхневого клону, за винятком rev"
+
+msgid "clone only one branch, HEAD or --branch"
+msgstr "клонувати лише одну гілку, HEAD або --branch"
+
+msgid "don't clone any tags, and make later fetches not to follow them"
+msgstr ""
+"не клонувати жодних тегів і не слідувати за ними під час отримувань пізніше"
+
+msgid "any cloned submodules will be shallow"
+msgstr "будь-які клоновані підмодулі будуть поверхневими"
+
+msgid "gitdir"
+msgstr "git-директорія"
+
+msgid "separate git dir from working tree"
+msgstr "відокремити git-директорію від робочого дерева"
+
+msgid "key=value"
+msgstr "ключ=значення"
+
+msgid "set config inside the new repository"
+msgstr "встановити конфігурацію всередині нового сховища"
+
+msgid "server-specific"
+msgstr "тільки для сервера"
+
+msgid "option to transmit"
+msgstr "опція для передачі"
+
+msgid "use IPv4 addresses only"
+msgstr "використовувати тільки IPv4 адреси"
+
+msgid "use IPv6 addresses only"
+msgstr "використовувати тільки IPv6 адреси"
+
+msgid "apply partial clone filters to submodules"
+msgstr "застосувати часткові фільтри клонів до підмодулів"
+
+msgid "any cloned submodules will use their remote-tracking branch"
+msgstr ""
+"будь-які клоновані підмодулі будуть використовувати свою віддалено "
+"відстежувану гілку"
+
+msgid "initialize sparse-checkout file to include only files at root"
+msgstr ""
+"ініціалізувати, щоб файл часткового переходу включав лише файли в корені"
+
+msgid "uri"
+msgstr "uri"
+
+msgid "a URI for downloading bundles before fetching from origin remote"
+msgstr "URI для завантаження пакунків перед отриманням з віддаленого джерела"
+
+#, c-format
+msgid "info: Could not add alternate for '%s': %s\n"
+msgstr "инфо: Не вдалося додати альтернативу для '%s': %s\n"
+
+#, c-format
+msgid "failed to stat '%s'"
+msgstr "не вдалося виконати stat '%s'"
+
+#, c-format
+msgid "%s exists and is not a directory"
+msgstr "%s існує і не є директорією"
+
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "\"%s\" є символьним посиланням, відмова від клонування з --local"
+
+#, c-format
+msgid "failed to start iterator over '%s'"
+msgstr "не вдалося запустити перебір для '%s'"
+
+#, c-format
+msgid "symlink '%s' exists, refusing to clone with --local"
+msgstr "символьне посилання '%s' існує, не можу клонувати з --local"
+
+#, c-format
+msgid "failed to unlink '%s'"
+msgstr "не вдалося розʼєднати '%s'"
+
+#, c-format
+msgid "failed to create link '%s'"
+msgstr "не вдалося створити посилання '%s'"
+
+#, c-format
+msgid "failed to copy file to '%s'"
+msgstr "не вдалося скопіювати файл у '%s'"
+
+#, c-format
+msgid "failed to iterate over '%s'"
+msgstr "не вдалося перебрати '%s'"
+
+#, c-format
+msgid "done.\n"
+msgstr "готово.\n"
+
+msgid ""
+"Clone succeeded, but checkout failed.\n"
+"You can inspect what was checked out with 'git status'\n"
+"and retry with 'git restore --source=HEAD :/'\n"
+msgstr ""
+"Клонування пройшло успішно, але не вдалося перейти до гілки.\n"
+"Ви можете перевірити, що було додано за допомогою 'git status'\n"
+"і повторити спробу за допомогою 'git restore --source=HEAD :/'\n"
+
+#, c-format
+msgid "Could not find remote branch %s to clone."
+msgstr "Не вдалося знайти віддалену гілку %s для клонування."
+
+msgid "remote did not send all necessary objects"
+msgstr "віддалене сховище не надіслало всі необхідні обʼєкти"
+
+#, c-format
+msgid "unable to update %s"
+msgstr "не вдалося оновити %s"
+
+msgid "failed to initialize sparse-checkout"
+msgstr "не вдалося ініціалізувати частковий перехід"
+
+msgid "remote HEAD refers to nonexistent ref, unable to checkout"
+msgstr "віддалений HEAD посилається на неіснуючого рефа, неможливо перейти"
+
+msgid "unable to checkout working tree"
+msgstr "не вдалося завантажити стан робочої директорії"
+
+msgid "unable to write parameters to config file"
+msgstr "не вдалося записати параметри до конфігураційного файлу"
+
+msgid "cannot repack to clean up"
+msgstr "неможливо перепакувати, щоб очистити"
+
+msgid "cannot unlink temporary alternates file"
+msgstr "не вдається розʼєднати файл тимчасових альтернатив"
+
+msgid "Too many arguments."
+msgstr "Забагато аргументів."
+
+msgid "You must specify a repository to clone."
+msgstr "Треба вказати сховище для клонування."
+
+msgid ""
+"--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-"
+"exclude"
+msgstr ""
+"--bundle-uri несумісний з --depth, --shallow-since та --shallow-exclude"
+
+#, c-format
+msgid "repository '%s' does not exist"
+msgstr "сховище '%s' не існує"
+
+#, c-format
+msgid "depth %s is not a positive number"
+msgstr "глибина %s не є додатнім числом"
+
+#, c-format
+msgid "destination path '%s' already exists and is not an empty directory."
+msgstr "шлях призначення '%s' вже існує і не є порожньою директорією."
+
+#, c-format
+msgid "repository path '%s' already exists and is not an empty directory."
+msgstr "шлях до сховища '%s' вже існує і не є порожньою директорією."
+
+#, c-format
+msgid "working tree '%s' already exists."
+msgstr "робоче дерево '%s' вже існує."
+
+#, c-format
+msgid "could not create leading directories of '%s'"
+msgstr "не вдалося створити провідні директорії для '%s'"
+
+#, c-format
+msgid "could not create work tree dir '%s'"
+msgstr "не вдалося створити директорію робочого дерева '%s'"
+
+#, c-format
+msgid "Cloning into bare repository '%s'...\n"
+msgstr "Клонування у порожнє сховище '%s'...\n"
+
+#, c-format
+msgid "Cloning into '%s'...\n"
+msgstr "Клонування в '%s'...\n"
+
+msgid ""
+"clone --recursive is not compatible with both --reference and --reference-if-"
+"able"
+msgstr ""
+"clone --recursive не сумісне з --reference та --reference-if-able одночасно"
+
+#, c-format
+msgid "'%s' is not a valid remote name"
+msgstr "\"%s\" не є дійсною назвою віддаленого сховища"
+
+msgid "--depth is ignored in local clones; use file:// instead."
+msgstr ""
+"--depth ігнорується у локальних клонах; використовуйте file:// замість цього."
+
+msgid "--shallow-since is ignored in local clones; use file:// instead."
+msgstr ""
+"--shallow-since ігнорується у локальних клонах; використовуйте file:// "
+"замість цього."
+
+msgid "--shallow-exclude is ignored in local clones; use file:// instead."
+msgstr ""
+"--shallow-exclude ігнорується у локальних клонах; використовуйте file:// "
+"замість цього."
+
+msgid "--filter is ignored in local clones; use file:// instead."
+msgstr ""
+"--filter ігнорується у локальних клонах; використовуйте file:// замість "
+"нього."
+
+msgid "source repository is shallow, reject to clone."
+msgstr "джерельне сховище є неглибоким, клонування відхилено."
+
+msgid "source repository is shallow, ignoring --local"
+msgstr "джерельне сховище є неглибоким, --local ігнорується"
+
+msgid "--local is ignored"
+msgstr "--local ігнорується"
+
+msgid "cannot clone from filtered bundle"
+msgstr "неможливо клонувати з відфільтрованого пакета"
+
+msgid "failed to initialize the repo, skipping bundle URI"
+msgstr "не вдалося ініціалізувати репо, URI пакета пропускається"
+
+#, c-format
+msgid "failed to fetch objects from bundle URI '%s'"
+msgstr "не вдалося отримати об'єкти з пакету URI '%s'"
+
+msgid "failed to fetch advertised bundles"
+msgstr "не вдалося отримати обіцяні пакети"
+
+msgid "remote transport reported error"
+msgstr "операція віддаленного отримання повідомила про помилку"
+
+#, c-format
+msgid "Remote branch %s not found in upstream %s"
+msgstr "Віддалену гілку %s не знайдено у першоджерельному сховищі %s"
+
+msgid "You appear to have cloned an empty repository."
+msgstr "Здається, ви клонували порожнє сховище."
+
+msgid "git column [<options>]"
+msgstr "git column [<опції>]"
+
+msgid "lookup config vars"
+msgstr ""
+
+msgid "layout to use"
+msgstr ""
+
+msgid "maximum width"
+msgstr ""
+
+msgid "padding space on left border"
+msgstr ""
+
+msgid "padding space on right border"
+msgstr ""
+
+msgid "padding space between columns"
+msgstr ""
+
+msgid "--command must be the first argument"
+msgstr ""
+
+msgid ""
+"git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]"
+msgstr ""
+
+msgid ""
+"git commit-graph write [--object-dir <dir>] [--append]\n"
+"                       [--split[=<strategy>]] [--reachable | --stdin-packs | "
+"--stdin-commits]\n"
+"                       [--changed-paths] [--[no-]max-new-filters <n>] [--"
+"[no-]progress]\n"
+"                       <split options>"
+msgstr ""
+
+msgid "dir"
+msgstr "dir"
+
+msgid "the object directory to store the graph"
+msgstr ""
+
+msgid "if the commit-graph is split, only verify the tip file"
+msgstr ""
+
+#, c-format
+msgid "Could not open commit-graph '%s'"
+msgstr "Не вдалося відкрити коміт-граф \"%s\""
+
+#, c-format
+msgid "unrecognized --split argument, %s"
+msgstr ""
+
+#, c-format
+msgid "unexpected non-hex object ID: %s"
+msgstr ""
+
+#, c-format
+msgid "invalid object: %s"
+msgstr "неприпустимий об’єкт: %s"
+
+#, c-format
+msgid "option `%s' expects a numerical value"
+msgstr ""
+
+msgid "start walk at all refs"
+msgstr ""
+
+msgid "scan pack-indexes listed by stdin for commits"
+msgstr ""
+
+msgid "start walk at commits listed by stdin"
+msgstr ""
+
+msgid "include all commits already in the commit-graph file"
+msgstr ""
+
+msgid "enable computation for changed paths"
+msgstr ""
+
+msgid "allow writing an incremental commit-graph file"
+msgstr ""
+
+msgid "maximum number of commits in a non-base split commit-graph"
+msgstr ""
+
+msgid "maximum ratio between two levels of a split commit-graph"
+msgstr ""
+
+msgid "only expire files older than a given date-time"
+msgstr ""
+
+msgid "maximum number of changed-path Bloom filters to compute"
+msgstr ""
+
+msgid "use at most one of --reachable, --stdin-commits, or --stdin-packs"
+msgstr ""
+
+msgid "Collecting commits from input"
+msgstr ""
+
+msgid "git commit-tree <tree> [(-p <parent>)...]"
+msgstr ""
+
+msgid ""
+"git commit-tree [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]\n"
+"                [(-F <file>)...] <tree>"
+msgstr ""
+
+#, c-format
+msgid "duplicate parent %s ignored"
+msgstr ""
+
+#, c-format
+msgid "not a valid object name %s"
+msgstr "невірне ім’я об’єкта %s"
+
+#, c-format
+msgid "git commit-tree: failed to read '%s'"
+msgstr ""
+
+#, c-format
+msgid "git commit-tree: failed to close '%s'"
+msgstr ""
+
+msgid "parent"
+msgstr ""
+
+msgid "id of a parent commit object"
+msgstr ""
+
+msgid "message"
+msgstr ""
+
+msgid "commit message"
+msgstr ""
+
+msgid "read commit log message from file"
+msgstr ""
+
+msgid "GPG sign commit"
+msgstr "підписати коміт за допомогою GPG"
+
+msgid "must give exactly one tree"
+msgstr ""
+
+msgid "git commit-tree: failed to read"
+msgstr ""
+
+msgid ""
+"git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n"
+"           [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|"
+"reword):]<commit>)]\n"
+"           [-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n"
+"           [--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n"
+"           [--date=<date>] [--cleanup=<mode>] [--[no-]status]\n"
+"           [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+"           [(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n"
+"           [--] [<pathspec>...]"
+msgstr ""
+
+msgid "git status [<options>] [--] [<pathspec>...]"
+msgstr "git status [<опції>] [--] [<визначник шляху>...]"
+
+msgid ""
+"You asked to amend the most recent commit, but doing so would make\n"
+"it empty. You can repeat your command with --allow-empty, or you can\n"
+"remove the commit entirely with \"git reset HEAD^\".\n"
+msgstr ""
+
+msgid ""
+"The previous cherry-pick is now empty, possibly due to conflict resolution.\n"
+"If you wish to commit it anyway, use:\n"
+"\n"
+"    git commit --allow-empty\n"
+"\n"
+msgstr ""
+
+msgid "Otherwise, please use 'git rebase --skip'\n"
+msgstr ""
+
+msgid "Otherwise, please use 'git cherry-pick --skip'\n"
+msgstr ""
+
+msgid ""
+"and then use:\n"
+"\n"
+"    git cherry-pick --continue\n"
+"\n"
+"to resume cherry-picking the remaining commits.\n"
+"If you wish to skip this commit, use:\n"
+"\n"
+"    git cherry-pick --skip\n"
+"\n"
+msgstr ""
+
+msgid "failed to unpack HEAD tree object"
+msgstr ""
+
+msgid "No paths with --include/--only does not make sense."
+msgstr ""
+
+msgid "unable to create temporary index"
+msgstr "не вдалося створити тимчасовий індекс"
+
+msgid "interactive add failed"
+msgstr ""
+
+msgid "unable to update temporary index"
+msgstr "не вдалося оновити тимчасовий індекс"
+
+msgid "Failed to update main cache tree"
+msgstr ""
+
+msgid "unable to write new_index file"
+msgstr "не вдалося записати new_index файл"
+
+msgid "cannot do a partial commit during a merge."
+msgstr "неможливо зробити частковий коміт під час злиття."
+
+msgid "cannot do a partial commit during a cherry-pick."
+msgstr ""
+
+msgid "cannot do a partial commit during a rebase."
+msgstr "неможливо зробити частковий коміт під час перебазування."
+
+msgid "cannot read the index"
+msgstr "неможливо прочитати індекс"
+
+msgid "unable to write temporary index file"
+msgstr "не вдалося записати тимчасовий файл індексу"
+
+#, c-format
+msgid "commit '%s' lacks author header"
+msgstr ""
+
+#, c-format
+msgid "commit '%s' has malformed author line"
+msgstr ""
+
+msgid "malformed --author parameter"
+msgstr ""
+
+#, c-format
+msgid "invalid date format: %s"
+msgstr "неприпустимий формат дати: %s"
+
+msgid ""
+"unable to select a comment character that is not used\n"
+"in the current commit message"
+msgstr ""
+
+#, c-format
+msgid "could not lookup commit %s"
+msgstr "не вдалося знайти коміт %s"
+
+#, c-format
+msgid "(reading log message from standard input)\n"
+msgstr ""
+
+msgid "could not read log from standard input"
+msgstr ""
+
+#, c-format
+msgid "could not read log file '%s'"
+msgstr "не вдалося прочитати лог файл \"%s\""
+
+#, c-format
+msgid "options '%s' and '%s:%s' cannot be used together"
+msgstr "опції \"%s\" та \"%s:%s\" не можна використовувати разом"
+
+msgid "could not read SQUASH_MSG"
+msgstr ""
+
+msgid "could not read MERGE_MSG"
+msgstr ""
+
+#, c-format
+msgid "could not open '%s'"
+msgstr "не вдалося відкрити \"%s\""
+
+msgid "could not write commit template"
+msgstr "не вдалося записати шаблон комітів"
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be ignored.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be ignored, and an empty message aborts the commit.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be kept; you may remove them yourself if you want to.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Please enter the commit message for your changes. Lines starting\n"
+"with '%c' will be kept; you may remove them yourself if you want to.\n"
+"An empty message aborts the commit.\n"
+msgstr ""
+
+msgid ""
+"\n"
+"It looks like you may be committing a merge.\n"
+"If this is not correct, please run\n"
+"\tgit update-ref -d MERGE_HEAD\n"
+"and try again.\n"
+msgstr ""
+
+msgid ""
+"\n"
+"It looks like you may be committing a cherry-pick.\n"
+"If this is not correct, please run\n"
+"\tgit update-ref -d CHERRY_PICK_HEAD\n"
+"and try again.\n"
+msgstr ""
+
+#, c-format
+msgid "%sAuthor:    %.*s <%.*s>"
+msgstr ""
+
+#, c-format
+msgid "%sDate:      %s"
+msgstr ""
+
+#, c-format
+msgid "%sCommitter: %.*s <%.*s>"
+msgstr ""
+
+msgid "Cannot read index"
+msgstr "Неможливо прочитати індекс"
+
+msgid "unable to pass trailers to --trailers"
+msgstr "не вдалося передати trailers до --trailers"
+
+msgid "Error building trees"
+msgstr ""
+
+#, c-format
+msgid "Please supply the message using either -m or -F option.\n"
+msgstr ""
+
+#, c-format
+msgid "--author '%s' is not 'Name <email>' and matches no existing author"
+msgstr ""
+
+#, c-format
+msgid "Invalid ignored mode '%s'"
+msgstr "Неприпустимий режим ігнорування \"%s\""
+
+#, c-format
+msgid "Invalid untracked files mode '%s'"
+msgstr "Неприпустимий режим невідстежуваних файлів \"%s\""
+
+msgid "You are in the middle of a merge -- cannot reword."
+msgstr "Ви перебуваєте в процесі злиття -- неможливо переформулювати."
+
+msgid "You are in the middle of a cherry-pick -- cannot reword."
+msgstr ""
+"Ви перебуваєте в середині процесу висмикування -- неможливо переформулювати."
+
+#, c-format
+msgid "reword option of '%s' and path '%s' cannot be used together"
+msgstr ""
+"параметр переформулювання \"%s\" і шлях \"%s\" не можна використовувати разом"
+
+#, c-format
+msgid "reword option of '%s' and '%s' cannot be used together"
+msgstr "опція переформулювання \"%s\" і \"%s\" не може бути використана разом"
+
+msgid "You have nothing to amend."
+msgstr ""
+
+msgid "You are in the middle of a merge -- cannot amend."
+msgstr "Ви перебуваєте в процесі злиття -- не можна вносити зміни."
+
+msgid "You are in the middle of a cherry-pick -- cannot amend."
+msgstr "Ви перебуваєте в процесі висмикування - не можна вносити зміни."
+
+msgid "You are in the middle of a rebase -- cannot amend."
+msgstr "Ви перебуваєте в процесі перебазуавння -- не можна вносити зміни."
+
+msgid "--reset-author can be used only with -C, -c or --amend."
+msgstr ""
+
+#, c-format
+msgid "unknown option: --fixup=%s:%s"
+msgstr ""
+
+#, c-format
+msgid "paths '%s ...' with -a does not make sense"
+msgstr "шляхи \"%s ...\" з -a не мають сенсу"
+
+msgid "show status concisely"
+msgstr ""
+
+msgid "show branch information"
+msgstr "показати інформацію про гілку"
+
+msgid "show stash information"
+msgstr ""
+
+msgid "compute full ahead/behind values"
+msgstr ""
+
+msgid "version"
+msgstr "версія"
+
+msgid "machine-readable output"
+msgstr "машинозчитуваний вивід"
+
+msgid "show status in long format (default)"
+msgstr ""
+
+msgid "terminate entries with NUL"
+msgstr ""
+
+msgid "show untracked files, optional modes: all, normal, no. (Default: all)"
+msgstr ""
+
+msgid ""
+"show ignored files, optional modes: traditional, matching, no. (Default: "
+"traditional)"
+msgstr ""
+
+msgid "when"
+msgstr ""
+
+msgid ""
+"ignore changes to submodules, optional when: all, dirty, untracked. "
+"(Default: all)"
+msgstr ""
+
+msgid "list untracked files in columns"
+msgstr "показати невідстежувані файли в стовпчиках"
+
+msgid "do not detect renames"
+msgstr ""
+
+msgid "detect renames, optionally set similarity index"
+msgstr ""
+
+msgid "Unsupported combination of ignored and untracked-files arguments"
+msgstr ""
+
+msgid "suppress summary after successful commit"
+msgstr ""
+
+msgid "show diff in commit message template"
+msgstr ""
+
+msgid "Commit message options"
+msgstr ""
+
+msgid "read message from file"
+msgstr ""
+
+msgid "author"
+msgstr ""
+
+msgid "override author for commit"
+msgstr ""
+
+msgid "date"
+msgstr ""
+
+msgid "override date for commit"
+msgstr ""
+
+msgid "commit"
+msgstr "коміт"
+
+msgid "reuse and edit message from specified commit"
+msgstr ""
+
+msgid "reuse message from specified commit"
+msgstr ""
+
+#. TRANSLATORS: Leave "[(amend|reword):]" as-is,
+#. and only translate <commit>.
+#.
+
+msgid "[(amend|reword):]commit"
+msgstr ""
+
+msgid ""
+"use autosquash formatted message to fixup or amend/reword specified commit"
+msgstr ""
+
+msgid "use autosquash formatted message to squash specified commit"
+msgstr ""
+
+msgid "the commit is authored by me now (used with -C/-c/--amend)"
+msgstr ""
+
+msgid "trailer"
+msgstr ""
+
+msgid "add custom trailer(s)"
+msgstr ""
+
+msgid "add a Signed-off-by trailer"
+msgstr ""
+
+msgid "use specified template file"
+msgstr ""
+
+msgid "force edit of commit"
+msgstr "редагувати коміт примусово"
+
+msgid "include status in commit message template"
+msgstr ""
+
+msgid "Commit contents options"
+msgstr ""
+
+msgid "commit all changed files"
+msgstr ""
+
+msgid "add specified files to index for commit"
+msgstr ""
+
+msgid "interactively add files"
+msgstr "додавати файли інтерактивно"
+
+msgid "interactively add changes"
+msgstr ""
+
+msgid "commit only specified files"
+msgstr ""
+
+msgid "bypass pre-commit and commit-msg hooks"
+msgstr ""
+
+msgid "show what would be committed"
+msgstr "показати, що буде додано до коміту"
+
+msgid "amend previous commit"
+msgstr ""
+
+msgid "bypass post-rewrite hook"
+msgstr "обійти post-rewrite гачок"
+
+msgid "ok to record an empty change"
+msgstr ""
+
+msgid "ok to record a change with an empty message"
+msgstr ""
+
+msgid "could not parse HEAD commit"
+msgstr "не вдалося розібрати HEAD коміт"
+
+#, c-format
+msgid "Corrupt MERGE_HEAD file (%s)"
+msgstr ""
+
+msgid "could not read MERGE_MODE"
+msgstr ""
+
+#, c-format
+msgid "could not read commit message: %s"
+msgstr "не вдалося прочитати допис до коміта: %s"
+
+#, c-format
+msgid "Aborting commit due to empty commit message.\n"
+msgstr ""
+
+#, c-format
+msgid "Aborting commit; you did not edit the message.\n"
+msgstr ""
+
+#, c-format
+msgid "Aborting commit due to empty commit message body.\n"
+msgstr ""
+
+msgid ""
+"repository has been updated, but unable to write\n"
+"new_index file. Check that disk is not full and quota is\n"
+"not exceeded, and then \"git restore --staged :/\" to recover."
+msgstr ""
+
+msgid "git config [<options>]"
+msgstr "git config [<опції>]"
+
+#, c-format
+msgid "unrecognized --type argument, %s"
+msgstr ""
+
+msgid "only one type at a time"
+msgstr ""
+
+msgid "Config file location"
+msgstr ""
+
+msgid "use global config file"
+msgstr ""
+
+msgid "use system config file"
+msgstr ""
+
+msgid "use repository config file"
+msgstr "використовувати конфігураційний файл сховища"
+
+msgid "use per-worktree config file"
+msgstr "використовувати конфігураційний файл робочого дерева"
+
+msgid "use given config file"
+msgstr ""
+
+msgid "blob-id"
+msgstr ""
+
+msgid "read config from given blob object"
+msgstr ""
+
+msgid "Action"
+msgstr ""
+
+msgid "get value: name [value-pattern]"
+msgstr ""
+
+msgid "get all values: key [value-pattern]"
+msgstr ""
+
+msgid "get values for regexp: name-regex [value-pattern]"
+msgstr ""
+
+msgid "get value specific for the URL: section[.var] URL"
+msgstr ""
+
+msgid "replace all matching variables: name value [value-pattern]"
+msgstr ""
+
+msgid "add a new variable: name value"
+msgstr ""
+
+msgid "remove a variable: name [value-pattern]"
+msgstr ""
+
+msgid "remove all matches: name [value-pattern]"
+msgstr ""
+
+msgid "rename section: old-name new-name"
+msgstr ""
+
+msgid "remove a section: name"
+msgstr ""
+
+msgid "list all"
+msgstr ""
+
+msgid "use string equality when comparing values to 'value-pattern'"
+msgstr ""
+
+msgid "open an editor"
+msgstr ""
+
+msgid "find the color configured: slot [default]"
+msgstr ""
+
+msgid "find the color setting: slot [stdout-is-tty]"
+msgstr ""
+
+msgid "Type"
+msgstr ""
+
+msgid "type"
+msgstr ""
+
+msgid "value is given this type"
+msgstr ""
+
+msgid "value is \"true\" or \"false\""
+msgstr ""
+
+msgid "value is decimal number"
+msgstr ""
+
+msgid "value is --bool or --int"
+msgstr ""
+
+msgid "value is --bool or string"
+msgstr ""
+
+msgid "value is a path (file or directory name)"
+msgstr ""
+
+msgid "value is an expiry date"
+msgstr ""
+
+msgid "Other"
+msgstr ""
+
+msgid "terminate values with NUL byte"
+msgstr ""
+
+msgid "show variable names only"
+msgstr ""
+
+msgid "respect include directives on lookup"
+msgstr ""
+
+msgid "show origin of config (file, standard input, blob, command line)"
+msgstr ""
+
+msgid "show scope of config (worktree, local, global, system, command)"
+msgstr ""
+
+msgid "value"
+msgstr "значення"
+
+msgid "with --get, use default value when missing entry"
+msgstr ""
+
+#, c-format
+msgid "wrong number of arguments, should be %d"
+msgstr ""
+
+#, c-format
+msgid "wrong number of arguments, should be from %d to %d"
+msgstr ""
+
+#, c-format
+msgid "invalid key pattern: %s"
+msgstr "неприпустимий шаблон ключа: %s"
+
+#, c-format
+msgid "invalid pattern: %s"
+msgstr "неприпустимий шаблон: %s"
+
+#, c-format
+msgid "failed to format default config value: %s"
+msgstr "не вдалося відформатувати початкове значення конфігурації: %s"
+
+#, c-format
+msgid "cannot parse color '%s'"
+msgstr "не вдалося розібрати колір \"%s\""
+
+msgid "unable to parse default color value"
+msgstr "не вдалося розібрати початкове значення кольору"
+
+msgid "not in a git directory"
+msgstr "не в директорії git"
+
+msgid "writing to stdin is not supported"
+msgstr ""
+
+msgid "writing config blobs is not supported"
+msgstr ""
+
+#, c-format
+msgid ""
+"# This is Git's per-user configuration file.\n"
+"[user]\n"
+"# Please adapt and uncomment the following lines:\n"
+"#\tname = %s\n"
+"#\temail = %s\n"
+msgstr ""
+
+msgid "only one config file at a time"
+msgstr ""
+
+msgid "--local can only be used inside a git repository"
+msgstr "--local можна використовувати лише всередині git сховища"
+
+msgid "--blob can only be used inside a git repository"
+msgstr "--blob можна використовувати лише всередині git сховища"
+
+msgid "--worktree can only be used inside a git repository"
+msgstr "--worktree можна використовувати лише всередині git сховища"
+
+msgid "$HOME not set"
+msgstr ""
+
+msgid ""
+"--worktree cannot be used with multiple working trees unless the config\n"
+"extension worktreeConfig is enabled. Please read \"CONFIGURATION FILE\"\n"
+"section in \"git help worktree\" for details"
+msgstr ""
+
+msgid "--get-color and variable type are incoherent"
+msgstr ""
+
+msgid "only one action at a time"
+msgstr ""
+
+msgid "--name-only is only applicable to --list or --get-regexp"
+msgstr ""
+
+msgid ""
+"--show-origin is only applicable to --get, --get-all, --get-regexp, and --"
+"list"
+msgstr ""
+
+msgid "--default is only applicable to --get"
+msgstr ""
+
+msgid "--fixed-value only applies with 'value-pattern'"
+msgstr ""
+
+#, c-format
+msgid "unable to read config file '%s'"
+msgstr "не вдалося прочитати файл конфігурації \"%s\""
+
+msgid "error processing config file(s)"
+msgstr "помилка при обробці файлу(ів) конфігурації"
+
+msgid "editing stdin is not supported"
+msgstr ""
+
+msgid "editing blobs is not supported"
+msgstr ""
+
+#, c-format
+msgid "cannot create configuration file %s"
+msgstr "неможливо створити конфігураційний файл %s"
+
+#, c-format
+msgid ""
+"cannot overwrite multiple values with a single value\n"
+"       Use a regexp, --add or --replace-all to change %s."
+msgstr ""
+
+#, c-format
+msgid "no such section: %s"
+msgstr "немає такого розділу: %s"
+
+msgid "print sizes in human readable format"
+msgstr ""
+
+#, c-format
+msgid ""
+"The permissions on your socket directory are too loose; other\n"
+"users may be able to read your cached credentials. Consider running:\n"
+"\n"
+"\tchmod 0700 %s"
+msgstr ""
+
+msgid "print debugging messages to stderr"
+msgstr ""
+
+msgid "credential-cache--daemon unavailable; no unix socket support"
+msgstr ""
+
+msgid "credential-cache unavailable; no unix socket support"
+msgstr ""
+
+#, c-format
+msgid "unable to get credential storage lock in %d ms"
+msgstr ""
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"
+msgstr ""
+
+msgid ""
+"git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"
+msgstr ""
+
+msgid "git describe <blob>"
+msgstr ""
+
+msgid "head"
+msgstr "head"
+
+msgid "lightweight"
+msgstr ""
+
+msgid "annotated"
+msgstr ""
+
+#, c-format
+msgid "annotated tag %s not available"
+msgstr ""
+
+#, c-format
+msgid "tag '%s' is externally known as '%s'"
+msgstr ""
+
+#, c-format
+msgid "no tag exactly matches '%s'"
+msgstr ""
+
+#, c-format
+msgid "No exact match on refs or tags, searching to describe\n"
+msgstr ""
+
+#, c-format
+msgid "finished search at %s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"No annotated tags can describe '%s'.\n"
+"However, there were unannotated tags: try --tags."
+msgstr ""
+
+#, c-format
+msgid ""
+"No tags can describe '%s'.\n"
+"Try --always, or create some tags."
+msgstr ""
+
+#, c-format
+msgid "traversed %lu commits\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"more than %i tags found; listed %i most recent\n"
+"gave up search at %s\n"
+msgstr ""
+
+#, c-format
+msgid "describe %s\n"
+msgstr ""
+
+#, c-format
+msgid "Not a valid object name %s"
+msgstr "Неприпустиме ім’я об’єкта %s"
+
+#, c-format
+msgid "%s is neither a commit nor blob"
+msgstr ""
+
+msgid "find the tag that comes after the commit"
+msgstr ""
+
+msgid "debug search strategy on stderr"
+msgstr ""
+
+msgid "use any ref"
+msgstr "використати будь-яке посилання"
+
+msgid "use any tag, even unannotated"
+msgstr ""
+
+msgid "always use long format"
+msgstr ""
+
+msgid "only follow first parent"
+msgstr ""
+
+msgid "only output exact matches"
+msgstr ""
+
+msgid "consider <n> most recent tags (default: 10)"
+msgstr ""
+
+msgid "only consider tags matching <pattern>"
+msgstr ""
+
+msgid "do not consider tags matching <pattern>"
+msgstr ""
+
+msgid "show abbreviated commit object as fallback"
+msgstr ""
+
+msgid "mark"
+msgstr ""
+
+msgid "append <mark> on dirty working tree (default: \"-dirty\")"
+msgstr ""
+"додати <mark> на брудному робочому дереві (за замовчуванням: \\”-dirty\\”)"
+
+msgid "append <mark> on broken working tree (default: \"-broken\")"
+msgstr ""
+
+msgid "No names found, cannot describe anything."
+msgstr ""
+
+#, c-format
+msgid "option '%s' and commit-ishes cannot be used together"
+msgstr "опцію \"%s\" не можна використовувати разом з комітоподібними"
+
+msgid ""
+"git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]\n"
+"             [--mode=<mode>]"
+msgstr ""
+
+msgid "specify a destination for the diagnostics archive"
+msgstr ""
+
+msgid "specify a strftime format suffix for the filename"
+msgstr ""
+
+msgid "specify the content of the diagnostic archive"
+msgstr ""
+
+msgid "--merge-base only works with two commits"
+msgstr ""
+
+#, c-format
+msgid "'%s': not a regular file or symlink"
+msgstr ""
+
+msgid "no merge given, only parents."
+msgstr ""
+
+#, c-format
+msgid "invalid option: %s"
+msgstr "неприпустима опція %s"
+
+#, c-format
+msgid "%s...%s: no merge base"
+msgstr ""
+
+msgid "Not a git repository"
+msgstr "Не є git сховищем"
+
+#, c-format
+msgid "invalid object '%s' given."
+msgstr "надано неприпустимий об’єкт \"%s\"."
+
+#, c-format
+msgid "more than two blobs given: '%s'"
+msgstr ""
+
+#, c-format
+msgid "unhandled object '%s' given."
+msgstr "надано необроблений об’єкт \"%s\"."
+
+#, c-format
+msgid "%s...%s: multiple merge bases, using %s"
+msgstr ""
+
+msgid "git difftool [<options>] [<commit> [<commit>]] [--] [<path>...]"
+msgstr ""
+
+#, c-format
+msgid "could not read symlink %s"
+msgstr "не вдалося прочитати символьне посилання %s"
+
+#, c-format
+msgid "could not read symlink file %s"
+msgstr "не вдалося прочитати файл символьного посилання %s"
+
+#, c-format
+msgid "could not read object %s for symlink %s"
+msgstr "не вдалося прочитати об’єкт %s для символьного посилання %s"
+
+msgid ""
+"combined diff formats ('-c' and '--cc') are not supported in\n"
+"directory diff mode ('-d' and '--dir-diff')."
+msgstr ""
+
+#, c-format
+msgid "both files modified: '%s' and '%s'."
+msgstr ""
+
+msgid "working tree file has been left."
+msgstr "залишено файл робочого дерева."
+
+#, c-format
+msgid "could not copy '%s' to '%s'"
+msgstr "не вдалося скопіювати \"%s\" в \"%s\""
+
+#, c-format
+msgid "temporary files exist in '%s'."
+msgstr ""
+
+msgid "you may want to cleanup or recover these."
+msgstr ""
+
+#, c-format
+msgid "failed: %d"
+msgstr ""
+
+msgid "use `diff.guitool` instead of `diff.tool`"
+msgstr ""
+
+msgid "perform a full-directory diff"
+msgstr ""
+
+msgid "do not prompt before launching a diff tool"
+msgstr ""
+
+msgid "use symlinks in dir-diff mode"
+msgstr ""
+
+msgid "tool"
+msgstr ""
+
+msgid "use the specified diff tool"
+msgstr ""
+
+msgid "print a list of diff tools that may be used with `--tool`"
+msgstr ""
+
+msgid ""
+"make 'git-difftool' exit when an invoked diff tool returns a non-zero exit "
+"code"
+msgstr ""
+
+msgid "specify a custom command for viewing diffs"
+msgstr ""
+
+msgid "passed to `diff`"
+msgstr ""
+
+msgid "difftool requires worktree or --no-index"
+msgstr ""
+
+msgid "no <tool> given for --tool=<tool>"
+msgstr ""
+
+msgid "no <cmd> given for --extcmd=<cmd>"
+msgstr ""
+
+msgid "git fast-export [<rev-list-opts>]"
+msgstr ""
+
+msgid "Error: Cannot export nested tags unless --mark-tags is specified."
+msgstr ""
+
+msgid "--anonymize-map token cannot be empty"
+msgstr ""
+
+msgid "show progress after <n> objects"
+msgstr ""
+
+msgid "select handling of signed tags"
+msgstr ""
+
+msgid "select handling of tags that tag filtered objects"
+msgstr ""
+
+msgid "select handling of commit messages in an alternate encoding"
+msgstr ""
+
+msgid "dump marks to this file"
+msgstr ""
+
+msgid "import marks from this file"
+msgstr ""
+
+msgid "import marks from this file if it exists"
+msgstr ""
+
+msgid "fake a tagger when tags lack one"
+msgstr ""
+
+msgid "output full tree for each commit"
+msgstr ""
+
+msgid "use the done feature to terminate the stream"
+msgstr ""
+
+msgid "skip output of blob data"
+msgstr ""
+
+msgid "refspec"
+msgstr ""
+
+msgid "apply refspec to exported refs"
+msgstr ""
+
+msgid "anonymize output"
+msgstr ""
+
+msgid "from:to"
+msgstr ""
+
+msgid "convert <from> to <to> in anonymized output"
+msgstr ""
+
+msgid "reference parents which are not in fast-export stream by object id"
+msgstr ""
+
+msgid "show original object ids of blobs/commits"
+msgstr ""
+
+msgid "label tags with mark ids"
+msgstr ""
+
+#, c-format
+msgid "Missing from marks for submodule '%s'"
+msgstr ""
+
+#, c-format
+msgid "Missing to marks for submodule '%s'"
+msgstr ""
+
+#, c-format
+msgid "Expected 'mark' command, got %s"
+msgstr ""
+
+#, c-format
+msgid "Expected 'to' command, got %s"
+msgstr ""
+
+msgid "Expected format name:filename for submodule rewrite option"
+msgstr ""
+
+#, c-format
+msgid "feature '%s' forbidden in input without --allow-unsafe-features"
+msgstr ""
+
+#, c-format
+msgid "Lockfile created but not reported: %s"
+msgstr "Файл блокування створено, але не звітовано: %s"
+
+msgid "git fetch [<options>] [<repository> [<refspec>...]]"
+msgstr "git fetch [<опції>] [<сховище> [<визначник посилання>...]]"
+
+msgid "git fetch [<options>] <group>"
+msgstr "git fetch [<опції>] [<група>]"
+
+msgid "git fetch --multiple [<options>] [(<repository> | <group>)...]"
+msgstr "git fetch --multiple [<опції>] [(<сховище> | <група>)...]"
+
+msgid "git fetch --all [<options>]"
+msgstr "git fetch --all [<опції>]"
+
+msgid "fetch.parallel cannot be negative"
+msgstr ""
+
+msgid "couldn't find remote ref HEAD"
+msgstr "не вдалося знайти посилання віддаленого HEAD"
+
+#, c-format
+msgid "From %.*s\n"
+msgstr ""
+
+#, c-format
+msgid "object %s not found"
+msgstr "об’єкт %s не знайдено"
+
+msgid "[up to date]"
+msgstr ""
+
+msgid "[rejected]"
+msgstr ""
+
+msgid "can't fetch into checked-out branch"
+msgstr "неможливо виконати отримання в активну гілку"
+
+msgid "[tag update]"
+msgstr ""
+
+msgid "unable to update local ref"
+msgstr "не вдалося оновити локальне посилання"
+
+msgid "would clobber existing tag"
+msgstr ""
+
+msgid "[new tag]"
+msgstr ""
+
+msgid "[new branch]"
+msgstr "[нова гілка]"
+
+msgid "[new ref]"
+msgstr "[нове посилання]"
+
+msgid "forced update"
+msgstr "примусове оновлення"
+
+msgid "non-fast-forward"
+msgstr ""
+
+#, c-format
+msgid "cannot open '%s'"
+msgstr "неможливо відкрити \"%s\""
+
+msgid ""
+"fetch normally indicates which branches had a forced update,\n"
+"but that check has been disabled; to re-enable, use '--show-forced-updates'\n"
+"flag or run 'git config fetch.showForcedUpdates true'"
+msgstr ""
+
+#, c-format
+msgid ""
+"it took %.2f seconds to check forced updates; you can use\n"
+"'--no-show-forced-updates' or run 'git config fetch.showForcedUpdates "
+"false'\n"
+"to avoid this check\n"
+msgstr ""
+
+#, c-format
+msgid "%s did not send all necessary objects\n"
+msgstr "%s не надіслав всі необхідні обʼєкти\n"
+
+#, c-format
+msgid "rejected %s because shallow roots are not allowed to be updated"
+msgstr ""
+
+#, c-format
+msgid ""
+"some local refs could not be updated; try running\n"
+" 'git remote prune %s' to remove any old, conflicting branches"
+msgstr ""
+
+#, c-format
+msgid "   (%s will become dangling)"
+msgstr ""
+
+#, c-format
+msgid "   (%s has become dangling)"
+msgstr ""
+
+msgid "[deleted]"
+msgstr "[видалено]"
+
+msgid "(none)"
+msgstr ""
+
+#, c-format
+msgid "refusing to fetch into branch '%s' checked out at '%s'"
+msgstr ""
+
+#, c-format
+msgid "option \"%s\" value \"%s\" is not valid for %s"
+msgstr ""
+
+#, c-format
+msgid "option \"%s\" is ignored for %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s is not a valid object"
+msgstr "%s не є припустимим об’єктом"
+
+#, c-format
+msgid "the object %s does not exist"
+msgstr "об’єкт %s не існує"
+
+msgid "multiple branches detected, incompatible with --set-upstream"
+msgstr ""
+
+#, c-format
+msgid ""
+"could not set upstream of HEAD to '%s' from '%s' when it does not point to "
+"any branch."
+msgstr ""
+
+msgid "not setting upstream for a remote remote-tracking branch"
+msgstr ""
+"не встановлено першоджерельне сховище для віддалено відстежуваної гілки"
+
+msgid "not setting upstream for a remote tag"
+msgstr "не встановлено першоджерельне сховище для віддаленого тега"
+
+msgid "unknown branch type"
+msgstr "невідомий тип гілки"
+
+msgid ""
+"no source branch found;\n"
+"you need to specify exactly one branch with the --set-upstream option"
+msgstr ""
+
+#, c-format
+msgid "Fetching %s\n"
+msgstr "Отримання %s\n"
+
+#, c-format
+msgid "could not fetch %s"
+msgstr "не вдалося отримати %s"
+
+#, c-format
+msgid "could not fetch '%s' (exit code: %d)\n"
+msgstr ""
+
+msgid ""
+"no remote repository specified; please specify either a URL or a\n"
+"remote name from which new revisions should be fetched"
+msgstr ""
+
+msgid "you need to specify a tag name"
+msgstr ""
+
+msgid "fetch from all remotes"
+msgstr ""
+
+msgid "set upstream for git pull/fetch"
+msgstr "встановити першоджерельне сховище для git pull/fetch"
+
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr ""
+
+msgid "use atomic transaction to update references"
+msgstr "використати атомарну транзакцію для оновлення посилань"
+
+msgid "path to upload pack on remote end"
+msgstr "шлях для завантаження пакунка на віддаленій стороні"
+
+msgid "force overwrite of local reference"
+msgstr ""
+
+msgid "fetch from multiple remotes"
+msgstr ""
+
+msgid "fetch all tags and associated objects"
+msgstr ""
+
+msgid "do not fetch all tags (--no-tags)"
+msgstr ""
+
+msgid "number of submodules fetched in parallel"
+msgstr "кількість підмодулів, що завантажуються паралельно"
+
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr ""
+
+msgid "prune remote-tracking branches no longer on remote"
+msgstr ""
+
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr ""
+
+msgid "on-demand"
+msgstr ""
+
+msgid "control recursive fetching of submodules"
+msgstr "контролювати рекурсивне отримання підмодулів"
+
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr ""
+
+msgid "keep downloaded pack"
+msgstr ""
+
+msgid "allow updating of HEAD ref"
+msgstr ""
+
+msgid "deepen history of shallow clone"
+msgstr "поглибити історію поверхневого клону"
+
+msgid "deepen history of shallow repository based on time"
+msgstr "поглибити історію поверхневого клону залежно від часу"
+
+msgid "convert to a complete repository"
+msgstr "перетворити на повне сховище"
+
+msgid "re-fetch without negotiating common commits"
+msgstr ""
+
+msgid "prepend this to submodule path output"
+msgstr ""
+
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr ""
+
+msgid "accept refs that update .git/shallow"
+msgstr ""
+
+msgid "refmap"
+msgstr ""
+
+msgid "specify fetch refmap"
+msgstr ""
+
+msgid "report that we have only objects reachable from this object"
+msgstr ""
+
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr ""
+
+msgid "run 'maintenance --auto' after fetching"
+msgstr ""
+
+msgid "check for forced-updates on all updated branches"
+msgstr ""
+
+msgid "write the commit-graph after fetching"
+msgstr ""
+
+msgid "accept refspecs from stdin"
+msgstr ""
+
+msgid "--negotiate-only needs one or more --negotiation-tip=*"
+msgstr ""
+
+msgid "negative depth in --deepen is not supported"
+msgstr ""
+
+msgid "--unshallow on a complete repository does not make sense"
+msgstr ""
+
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "не вдалося отримати пакунки з \"%s\""
+
+msgid "fetch --all does not take a repository argument"
+msgstr "fetch --all не приймає сховище як аргумент"
+
+msgid "fetch --all does not make sense with refspecs"
+msgstr "fetch --all не має сенсу з визначниками посилань"
+
+#, c-format
+msgid "no such remote or remote group: %s"
+msgstr ""
+
+msgid "fetching a group and specifying refspecs does not make sense"
+msgstr ""
+
+msgid "must supply remote when using --negotiate-only"
+msgstr ""
+
+msgid "protocol does not support --negotiate-only, exiting"
+msgstr ""
+
+msgid ""
+"--filter can only be used with the remote configured in extensions."
+"partialclone"
+msgstr ""
+
+msgid "--atomic can only be used when fetching from one remote"
+msgstr ""
+"--atomic може бути використано лише при отриманні з одного віддаленого "
+"джерела"
+
+msgid "--stdin can only be used when fetching from one remote"
+msgstr ""
+
+msgid ""
+"git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"
+msgstr ""
+
+msgid "populate log with at most <n> entries from shortlog"
+msgstr ""
+
+msgid "alias for --log (deprecated)"
+msgstr ""
+
+msgid "text"
+msgstr ""
+
+msgid "use <text> as start of message"
+msgstr ""
+
+msgid "use <name> instead of the real target branch"
+msgstr "використовувати <назва> замість реальної цільової гілки"
+
+msgid "file to read from"
+msgstr "файл, з якого читати"
+
+msgid "git for-each-ref [<options>] [<pattern>]"
+msgstr "git for-each-ref [<опції>] [<шаблон>]"
+
+msgid "git for-each-ref [--points-at <object>]"
+msgstr ""
+
+msgid "git for-each-ref [--merged [<commit>]] [--no-merged [<commit>]]"
+msgstr ""
+
+msgid "git for-each-ref [--contains [<commit>]] [--no-contains [<commit>]]"
+msgstr ""
+
+msgid "quote placeholders suitably for shells"
+msgstr ""
+
+msgid "quote placeholders suitably for perl"
+msgstr ""
+
+msgid "quote placeholders suitably for python"
+msgstr ""
+
+msgid "quote placeholders suitably for Tcl"
+msgstr ""
+
+msgid "show only <n> matched refs"
+msgstr ""
+
+msgid "respect format colors"
+msgstr ""
+
+msgid "print only refs which points at the given object"
+msgstr ""
+
+msgid "print only refs that are merged"
+msgstr ""
+
+msgid "print only refs that are not merged"
+msgstr ""
+
+msgid "print only refs which contain the commit"
+msgstr ""
+
+msgid "print only refs which don't contain the commit"
+msgstr ""
+
+msgid "read reference patterns from stdin"
+msgstr "читати шаблони посилань з stdin"
+
+msgid "unknown arguments supplied with --stdin"
+msgstr ""
+
+msgid "git for-each-repo --config=<config> [--] <arguments>"
+msgstr ""
+
+msgid "config"
+msgstr ""
+
+msgid "config key storing a list of repository paths"
+msgstr ""
+
+msgid "missing --config=<config>"
+msgstr ""
+
+#, c-format
+msgid "got bad config --config=%s"
+msgstr ""
+
+msgid "unknown"
+msgstr "невідомо"
+
+#. TRANSLATORS: e.g. error in tree 01bfda: <more explanation>
+
+#, c-format
+msgid "error in %s %s: %s"
+msgstr ""
+
+#. TRANSLATORS: e.g. warning in tree 01bfda: <more explanation>
+
+#, c-format
+msgid "warning in %s %s: %s"
+msgstr ""
+
+#, c-format
+msgid "broken link from %7s %s"
+msgstr ""
+
+msgid "wrong object type in link"
+msgstr "невірний тип об’єкта в посиланні"
+
+#, c-format
+msgid ""
+"broken link from %7s %s\n"
+"              to %7s %s"
+msgstr ""
+
+msgid "Checking connectivity"
+msgstr "Перевірка підключення"
+
+#, c-format
+msgid "missing %s %s"
+msgstr ""
+
+#, c-format
+msgid "unreachable %s %s"
+msgstr ""
+
+#, c-format
+msgid "dangling %s %s"
+msgstr ""
+
+msgid "could not create lost-found"
+msgstr "не вдалося створити lost-found"
+
+#, c-format
+msgid "could not write '%s'"
+msgstr "не вдалося записати \"%s\""
+
+#, c-format
+msgid "could not finish '%s'"
+msgstr "не вдалося завершити \"%s\""
+
+#, c-format
+msgid "Checking %s"
+msgstr "Перевірка %s"
+
+#, c-format
+msgid "Checking connectivity (%d objects)"
+msgstr "Перевірка підключення (%d обʼєктів)"
+
+#, c-format
+msgid "Checking %s %s"
+msgstr "Перевірка %s %s"
+
+msgid "broken links"
+msgstr ""
+
+#, c-format
+msgid "root %s"
+msgstr ""
+
+#, c-format
+msgid "tagged %s %s (%s) in %s"
+msgstr ""
+
+#, c-format
+msgid "%s: object corrupt or missing"
+msgstr ""
+
+#, c-format
+msgid "%s: invalid reflog entry %s"
+msgstr "%s: неприпустимий запис reflog %s"
+
+#, c-format
+msgid "Checking reflog %s->%s"
+msgstr ""
+
+#, c-format
+msgid "%s: invalid sha1 pointer %s"
+msgstr "%s: невірний вказівник sha1 %s"
+
+#, c-format
+msgid "%s: not a commit"
+msgstr "%s не є комітом"
+
+msgid "notice: No default references"
+msgstr ""
+
+#, c-format
+msgid "%s: hash-path mismatch, found at: %s"
+msgstr ""
+
+#, c-format
+msgid "%s: object corrupt or missing: %s"
+msgstr ""
+
+#, c-format
+msgid "%s: object is of unknown type '%s': %s"
+msgstr ""
+
+#, c-format
+msgid "%s: object could not be parsed: %s"
+msgstr ""
+
+#, c-format
+msgid "bad sha1 file: %s"
+msgstr ""
+
+msgid "Checking object directory"
+msgstr "Перевірка директорії об’єкта"
+
+msgid "Checking object directories"
+msgstr "Перевірка директорій обʼєкта"
+
+#, c-format
+msgid "Checking %s link"
+msgstr "Перевірка %s посилання"
+
+#, c-format
+msgid "invalid %s"
+msgstr "неприпустимий %s"
+
+#, c-format
+msgid "%s points to something strange (%s)"
+msgstr ""
+
+#, c-format
+msgid "%s: detached HEAD points at nothing"
+msgstr ""
+
+#, c-format
+msgid "notice: %s points to an unborn branch (%s)"
+msgstr ""
+
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "Перевірка дерева кеша для \"%s\""
+
+#, c-format
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s: невірний sha1 вказівник в cache-tree для %s"
+
+msgid "non-tree in cache-tree"
+msgstr ""
+
+#, c-format
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s: невірний sha1 вказівник в resolve-undo для %s"
+
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "не вдалося завантажити rev-index для пакуна \"%s\""
+
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "невірний rev-index для пакуна \"%s\""
+
+msgid ""
+"git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs]\n"
+"         [--[no-]full] [--strict] [--verbose] [--lost-found]\n"
+"         [--[no-]dangling] [--[no-]progress] [--connectivity-only]\n"
+"         [--[no-]name-objects] [<object>...]"
+msgstr ""
+
+msgid "show unreachable objects"
+msgstr ""
+
+msgid "show dangling objects"
+msgstr "показувати висячі об’єкти"
+
+msgid "report tags"
+msgstr ""
+
+msgid "report root nodes"
+msgstr ""
+
+msgid "make index objects head nodes"
+msgstr ""
+
+msgid "make reflogs head nodes (default)"
+msgstr "зробити reflogs головними вузлами (за замовчуванням)"
+
+msgid "also consider packs and alternate objects"
+msgstr ""
+
+msgid "check only connectivity"
+msgstr ""
+
+msgid "enable more strict checking"
+msgstr ""
+
+msgid "write dangling objects in .git/lost-found"
+msgstr ""
+
+msgid "show progress"
+msgstr ""
+
+msgid "show verbose names for reachable objects"
+msgstr ""
+
+msgid "Checking objects"
+msgstr "Перевірка обʼєктів"
+
+#, c-format
+msgid "%s: object missing"
+msgstr ""
+
+#, c-format
+msgid "invalid parameter: expected sha1, got '%s'"
+msgstr "неприпустимий параметр: очікувався sha1, надано \"%s\""
+
+msgid "git fsmonitor--daemon start [<options>]"
+msgstr ""
+
+msgid "git fsmonitor--daemon run [<options>]"
+msgstr ""
+
+#, c-format
+msgid "value of '%s' out of range: %d"
+msgstr ""
+
+#, c-format
+msgid "value of '%s' not bool or int: %d"
+msgstr ""
+
+#, c-format
+msgid "fsmonitor-daemon is watching '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "fsmonitor-daemon is not watching '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "could not create fsmonitor cookie '%s'"
+msgstr "не вдалося створити fsmonitor cookie \"%s\""
+
+#, c-format
+msgid "fsmonitor: cookie_result '%d' != SEEN"
+msgstr ""
+
+#, c-format
+msgid "could not start IPC thread pool on '%s'"
+msgstr "не вдалося запустити пул потоків IPC на \"%s\""
+
+msgid "could not start fsmonitor listener thread"
+msgstr ""
+
+msgid "could not start fsmonitor health thread"
+msgstr ""
+
+msgid "could not initialize listener thread"
+msgstr ""
+
+msgid "could not initialize health thread"
+msgstr ""
+
+#, c-format
+msgid "could not cd home '%s'"
+msgstr "не вдалося виконати cd home \"%s\""
+
+#, c-format
+msgid "fsmonitor--daemon is already running '%s'"
+msgstr ""
+
+#, c-format
+msgid "running fsmonitor-daemon in '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "starting fsmonitor-daemon in '%s'\n"
+msgstr ""
+
+msgid "daemon failed to start"
+msgstr "не вдалося запустити демон"
+
+msgid "daemon not online yet"
+msgstr ""
+
+msgid "daemon terminated"
+msgstr ""
+
+msgid "detach from console"
+msgstr "від’єднати від консолі"
+
+msgid "use <n> ipc worker threads"
+msgstr ""
+
+msgid "max seconds to wait for background daemon startup"
+msgstr ""
+
+#, c-format
+msgid "invalid 'ipc-threads' value (%d)"
+msgstr "невірне значення \"ipc-threads\" (%d)"
+
+#, c-format
+msgid "Unhandled subcommand '%s'"
+msgstr ""
+
+msgid "fsmonitor--daemon not supported on this platform"
+msgstr ""
+
+msgid "git gc [<options>]"
+msgstr "git gc [<опції>]"
+
+#, c-format
+msgid "Failed to fstat %s: %s"
+msgstr "Не вдалося виконати fstat %s: %s"
+
+#, c-format
+msgid "failed to parse '%s' value '%s'"
+msgstr "не вдалося розібрати \"%s\" значення \"%s\""
+
+#, c-format
+msgid "cannot stat '%s'"
+msgstr "неможливо виконати stat \"%s\""
+
+#, c-format
+msgid ""
+"The last gc run reported the following. Please correct the root cause\n"
+"and remove %s\n"
+"Automatic cleanup will not be performed until the file is removed.\n"
+"\n"
+"%s"
+msgstr ""
+
+msgid "prune unreferenced objects"
+msgstr "видалити об’єкти без посилань"
+
+msgid "pack unreferenced objects separately"
+msgstr ""
+
+msgid "be more thorough (increased runtime)"
+msgstr ""
+
+msgid "enable auto-gc mode"
+msgstr ""
+
+msgid "force running gc even if there may be another gc running"
+msgstr ""
+
+msgid "repack all other packs except the largest pack"
+msgstr ""
+
+#, c-format
+msgid "failed to parse gc.logExpiry value %s"
+msgstr "не вдалося розібрати gc.logExpiry значення %s"
+
+#, c-format
+msgid "failed to parse prune expiry value %s"
+msgstr ""
+
+#, c-format
+msgid "Auto packing the repository in background for optimum performance.\n"
+msgstr ""
+
+#, c-format
+msgid "Auto packing the repository for optimum performance.\n"
+msgstr ""
+
+#, c-format
+msgid "See \"git help gc\" for manual housekeeping.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"gc is already running on machine '%s' pid %<PRIuMAX> (use --force if not)"
+msgstr ""
+
+msgid ""
+"There are too many unreachable loose objects; run 'git prune' to remove them."
+msgstr ""
+
+msgid ""
+"git maintenance run [--auto] [--[no-]quiet] [--task=<task>] [--schedule]"
+msgstr ""
+
+msgid "--no-schedule is not allowed"
+msgstr ""
+
+#, c-format
+msgid "unrecognized --schedule argument '%s'"
+msgstr ""
+
+msgid "failed to write commit-graph"
+msgstr "не вдалося записати граф комітів"
+
+msgid "failed to prefetch remotes"
+msgstr "не вдалося виконати попереднє отримання з віддалених сховищ"
+
+msgid "failed to start 'git pack-objects' process"
+msgstr "не вдалося розпочати \"git pack-objects\" процес"
+
+msgid "failed to finish 'git pack-objects' process"
+msgstr ""
+
+msgid "failed to write multi-pack-index"
+msgstr ""
+
+msgid "'git multi-pack-index expire' failed"
+msgstr ""
+
+msgid "'git multi-pack-index repack' failed"
+msgstr ""
+
+msgid ""
+"skipping incremental-repack task because core.multiPackIndex is disabled"
+msgstr ""
+
+#, c-format
+msgid "lock file '%s' exists, skipping maintenance"
+msgstr ""
+
+#, c-format
+msgid "task '%s' failed"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a valid task"
+msgstr "\"%s\" не є припустимим завданням"
+
+#, c-format
+msgid "task '%s' cannot be selected multiple times"
+msgstr "завдання \"%s\" не можна вибрати кілька разів"
+
+msgid "run tasks based on the state of the repository"
+msgstr ""
+
+msgid "frequency"
+msgstr ""
+
+msgid "run tasks based on frequency"
+msgstr ""
+
+msgid "do not report progress or other information over stderr"
+msgstr ""
+
+msgid "task"
+msgstr ""
+
+msgid "run a specific task"
+msgstr ""
+
+msgid "use at most one of --auto and --schedule=<frequency>"
+msgstr ""
+
+#, c-format
+msgid "unable to add '%s' value of '%s'"
+msgstr "не вдалося додати значення \"%s\" до \"%s\""
+
+msgid "return success even if repository was not registered"
+msgstr ""
+
+#, c-format
+msgid "unable to unset '%s' value of '%s'"
+msgstr "не вдалося скинути значення \"%s\" для \"%s\""
+
+#, c-format
+msgid "repository '%s' is not registered"
+msgstr "сховище \"%s\" не зареєстровано"
+
+#, c-format
+msgid "failed to expand path '%s'"
+msgstr "не вдалося розгорнути шлях \"%s\""
+
+msgid "failed to start launchctl"
+msgstr "не вдалося запустити launchctl"
+
+#, c-format
+msgid "failed to create directories for '%s'"
+msgstr "не вдалося створити директорії для \"%s\""
+
+#, c-format
+msgid "failed to bootstrap service %s"
+msgstr "не вдалося розгорнути службу %s"
+
+msgid "failed to create temp xml file"
+msgstr "не вдалося створити тимчасовий xml файл"
+
+msgid "failed to start schtasks"
+msgstr "не вдалося запустити schtasks"
+
+msgid "failed to run 'crontab -l'; your system might not support 'cron'"
+msgstr ""
+
+msgid "failed to create crontab temporary file"
+msgstr "не вдалося створити тимчасовий crontab файл"
+
+msgid "failed to open temporary file"
+msgstr "не вдалося відкрити тимчасовий файл"
+
+msgid "failed to run 'crontab'; your system might not support 'cron'"
+msgstr ""
+
+msgid "'crontab' died"
+msgstr ""
+
+msgid "failed to start systemctl"
+msgstr "не вдалося стартувати systemctl"
+
+msgid "failed to run systemctl"
+msgstr "не вдалося запустити systemctl"
+
+#, c-format
+msgid "failed to delete '%s'"
+msgstr "не вдалося видалити \"%s\""
+
+#, c-format
+msgid "failed to flush '%s'"
+msgstr "не вдалося очистити \"%s\""
+
+#, c-format
+msgid "unrecognized --scheduler argument '%s'"
+msgstr ""
+
+msgid "neither systemd timers nor crontab are available"
+msgstr ""
+
+#, c-format
+msgid "%s scheduler is not available"
+msgstr ""
+
+msgid "another process is scheduling background maintenance"
+msgstr ""
+
+msgid "git maintenance start [--scheduler=<scheduler>]"
+msgstr ""
+
+msgid "scheduler"
+msgstr ""
+
+msgid "scheduler to trigger git maintenance run"
+msgstr ""
+
+msgid "failed to add repo to global config"
+msgstr ""
+
+msgid "git maintenance <subcommand> [<options>]"
+msgstr ""
+
+msgid "git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"
+msgstr "git grep [<опції>] [-e] <шаблон> [<ревізія>...] [[--] <шлях>...]"
+
+#, c-format
+msgid "grep: failed to create thread: %s"
+msgstr "grep: не вдалося створити потік: %s"
+
+#, c-format
+msgid "invalid number of threads specified (%d) for %s"
+msgstr "невірно вказано кількість потоків (%d) для %s"
+
+#. TRANSLATORS: %s is the configuration
+#. variable for tweaking threads, currently
+#. grep.threads
+#.
+
+#, c-format
+msgid "no threads support, ignoring %s"
+msgstr "немає підтримки потоків, ігноруються %s"
+
+#, c-format
+msgid "unable to read tree (%s)"
+msgstr "не вдалося прочитати дерево (%s)"
+
+#, c-format
+msgid "unable to grep from object of type %s"
+msgstr "не вдалося виконати grep з об’єкта типу %s"
+
+#, c-format
+msgid "switch `%c' expects a numerical value"
+msgstr ""
+
+msgid "search in index instead of in the work tree"
+msgstr "шукати в індексі замість робочого дерева"
+
+msgid "find in contents not managed by git"
+msgstr ""
+
+msgid "search in both tracked and untracked files"
+msgstr "шукати як у відстежуваних, так і в невідстежуваних файлах"
+
+msgid "ignore files specified via '.gitignore'"
+msgstr ""
+
+msgid "recursively search in each submodule"
+msgstr "шукати рекурсивно в кожному підмодулі"
+
+msgid "show non-matching lines"
+msgstr ""
+
+msgid "case insensitive matching"
+msgstr ""
+
+msgid "match patterns only at word boundaries"
+msgstr ""
+
+msgid "process binary files as text"
+msgstr ""
+
+msgid "don't match patterns in binary files"
+msgstr ""
+
+msgid "process binary files with textconv filters"
+msgstr ""
+
+msgid "search in subdirectories (default)"
+msgstr ""
+
+msgid "descend at most <depth> levels"
+msgstr ""
+
+msgid "use extended POSIX regular expressions"
+msgstr ""
+
+msgid "use basic POSIX regular expressions (default)"
+msgstr ""
+
+msgid "interpret patterns as fixed strings"
+msgstr ""
+
+msgid "use Perl-compatible regular expressions"
+msgstr ""
+
+msgid "show line numbers"
+msgstr ""
+
+msgid "show column number of first match"
+msgstr ""
+
+msgid "don't show filenames"
+msgstr ""
+
+msgid "show filenames"
+msgstr ""
+
+msgid "show filenames relative to top directory"
+msgstr ""
+
+msgid "show only filenames instead of matching lines"
+msgstr ""
+
+msgid "synonym for --files-with-matches"
+msgstr ""
+
+msgid "show only the names of files without match"
+msgstr ""
+
+msgid "print NUL after filenames"
+msgstr ""
+
+msgid "show only matching parts of a line"
+msgstr ""
+
+msgid "show the number of matches instead of matching lines"
+msgstr ""
+
+msgid "highlight matches"
+msgstr ""
+
+msgid "print empty line between matches from different files"
+msgstr ""
+
+msgid "show filename only once above matches from same file"
+msgstr ""
+
+msgid "show <n> context lines before and after matches"
+msgstr ""
+
+msgid "show <n> context lines before matches"
+msgstr ""
+
+msgid "show <n> context lines after matches"
+msgstr ""
+
+msgid "use <n> worker threads"
+msgstr ""
+
+msgid "shortcut for -C NUM"
+msgstr ""
+
+msgid "show a line with the function name before matches"
+msgstr ""
+
+msgid "show the surrounding function"
+msgstr ""
+
+msgid "read patterns from file"
+msgstr ""
+
+msgid "match <pattern>"
+msgstr ""
+
+msgid "combine patterns specified with -e"
+msgstr ""
+
+msgid "indicate hit with exit status without output"
+msgstr ""
+
+msgid "show only matches from files that match all patterns"
+msgstr ""
+
+msgid "pager"
+msgstr ""
+
+msgid "show matching files in the pager"
+msgstr ""
+
+msgid "allow calling of grep(1) (ignored by this build)"
+msgstr ""
+
+msgid "maximum number of results per file"
+msgstr ""
+
+msgid "no pattern given"
+msgstr ""
+
+msgid "--no-index or --untracked cannot be used with revs"
+msgstr "--no-index або --untracked не можна використовувати з ревізіями"
+
+#, c-format
+msgid "unable to resolve revision: %s"
+msgstr "не вдалося розвʼязати ревізію: %s"
+
+msgid "--untracked not supported with --recurse-submodules"
+msgstr ""
+
+msgid "invalid option combination, ignoring --threads"
+msgstr ""
+
+msgid "no threads support, ignoring --threads"
+msgstr "немає підтримки потоків, ігнорування --threads"
+
+#, c-format
+msgid "invalid number of threads specified (%d)"
+msgstr "вказано неприпустиму кількість потоків (%d)"
+
+msgid "--open-files-in-pager only works on the worktree"
+msgstr ""
+
+msgid "--[no-]exclude-standard cannot be used for tracked contents"
+msgstr ""
+
+msgid "both --cached and trees are given"
+msgstr ""
+
+msgid ""
+"git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
+"                [--stdin [--literally]] [--] <file>..."
+msgstr ""
+
+msgid "git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]"
+msgstr ""
+
+msgid "object type"
+msgstr "тип обʼєкта"
+
+msgid "write the object into the object database"
+msgstr ""
+
+msgid "read the object from stdin"
+msgstr ""
+
+msgid "store file as is without filters"
+msgstr ""
+
+msgid ""
+"just hash any random garbage to create corrupt objects for debugging Git"
+msgstr ""
+
+msgid "process file as it were from this path"
+msgstr ""
+
+msgid "print all available commands"
+msgstr ""
+
+msgid "show external commands in --all"
+msgstr ""
+
+msgid "show aliases in --all"
+msgstr ""
+
+msgid "exclude guides"
+msgstr ""
+
+msgid "show man page"
+msgstr ""
+
+msgid "show manual in web browser"
+msgstr ""
+
+msgid "show info page"
+msgstr ""
+
+msgid "print command description"
+msgstr ""
+
+msgid "print list of useful guides"
+msgstr ""
+
+msgid "print list of user-facing repository, command and file interfaces"
+msgstr ""
+
+msgid "print list of file formats, protocols and other developer interfaces"
+msgstr ""
+
+msgid "print all configuration variable names"
+msgstr ""
+
+msgid "git help [[-i|--info] [-m|--man] [-w|--web]] [<command>|<doc>]"
+msgstr ""
+
+#, c-format
+msgid "unrecognized help format '%s'"
+msgstr ""
+
+msgid "Failed to start emacsclient."
+msgstr "Не вдалося запустити emacs клієнт."
+
+msgid "Failed to parse emacsclient version."
+msgstr "Не вдалося розібрати версію emacs клієнта."
+
+#, c-format
+msgid "emacsclient version '%d' too old (< 22)."
+msgstr ""
+
+#, c-format
+msgid "failed to exec '%s'"
+msgstr "не вдалося виконати \"%s\""
+
+#, c-format
+msgid ""
+"'%s': path for unsupported man viewer.\n"
+"Please consider using 'man.<tool>.cmd' instead."
+msgstr ""
+
+#, c-format
+msgid ""
+"'%s': cmd for supported man viewer.\n"
+"Please consider using 'man.<tool>.path' instead."
+msgstr ""
+
+#, c-format
+msgid "'%s': unknown man viewer."
+msgstr ""
+
+msgid "no man viewer handled the request"
+msgstr ""
+
+msgid "no info viewer handled the request"
+msgstr ""
+
+#, c-format
+msgid "'%s' is aliased to '%s'"
+msgstr "\"%s\" є псевдонімом для \"%s\""
+
+#, c-format
+msgid "bad alias.%s string: %s"
+msgstr ""
+
+#, c-format
+msgid "the '%s' option doesn't take any non-option arguments"
+msgstr ""
+
+msgid ""
+"the '--no-[external-commands|aliases]' options can only be used with '--all'"
+msgstr ""
+
+#, c-format
+msgid "usage: %s%s"
+msgstr ""
+
+msgid "'git help config' for more information"
+msgstr ""
+
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+
+msgid "silently ignore missing requested <hook-name>"
+msgstr ""
+
+msgid "file to read into hooks' stdin"
+msgstr "файл, з якого читати stdin хука"
+
+#, c-format
+msgid "object type mismatch at %s"
+msgstr "не співпадає тип обʼєкта для %s"
+
+#, c-format
+msgid "did not receive expected object %s"
+msgstr "очікуваних обʼєктів не отримано %s"
+
+#, c-format
+msgid "object %s: expected type %s, found %s"
+msgstr "обʼєкт %s: очікувався тип %s, знайдено %s"
+
+#, c-format
+msgid "cannot fill %d byte"
+msgid_plural "cannot fill %d bytes"
+msgstr[0] "не вдається заповнити %d байт"
+msgstr[1] "не вдається заповнити %d байти"
+msgstr[2] "не вдається заповнити %d байтів"
+
+msgid "early EOF"
+msgstr "ранній EOF"
+
+msgid "read error on input"
+msgstr "помилка зчитування на вході"
+
+msgid "used more bytes than were available"
+msgstr "використано більше байтів, ніж було доступно"
+
+msgid "pack too large for current definition of off_t"
+msgstr "пакунок занадто великий для поточного визначення off_t"
+
+#, c-format
+msgid "pack exceeds maximum allowed size (%s)"
+msgstr "пакунок перевищує максимально дозволений розмір (%s)"
+
+msgid "pack signature mismatch"
+msgstr "не співпадає підпис пакунка"
+
+#, c-format
+msgid "pack version %<PRIu32> unsupported"
+msgstr "версія пакунка %<PRIu32> не підтримується"
+
+#, c-format
+msgid "pack has bad object at offset %<PRIuMAX>: %s"
+msgstr "пакунок має невірний обʼєкт зі зміщенням %<PRIuMAX>: %s"
+
+#, c-format
+msgid "inflate returned %d"
+msgstr "розпаковувач повернув %d"
+
+msgid "offset value overflow for delta base object"
+msgstr "переповнення значення зсуву для обʼєкту дельти з базою"
+
+msgid "delta base offset is out of bound"
+msgstr "зсув дельти з базою виходить за межі"
+
+#, c-format
+msgid "unknown object type %d"
+msgstr "невідомий тип обʼєкта %d"
+
+msgid "cannot pread pack file"
+msgstr "неможливо прочитати файл пакунка"
+
+#, c-format
+msgid "premature end of pack file, %<PRIuMAX> byte missing"
+msgid_plural "premature end of pack file, %<PRIuMAX> bytes missing"
+msgstr[0] "передчасний кінець файлу пакунка, %<PRIuMAX> байт відсутній"
+msgstr[1] "передчасний кінець файлу пакунка, %<PRIuMAX> байта відсутні"
+msgstr[2] "передчасний кінець файлу пакунка, %<PRIuMAX> байтів відсутні"
+
+msgid "serious inflate inconsistency"
+msgstr "серйозне неспівпадіння під час розпакування"
+
+#, c-format
+msgid "SHA1 COLLISION FOUND WITH %s !"
+msgstr "ВИЯВЛЕНО SHA1 КОЛІЗІЮ З %s!"
+
+#, c-format
+msgid "unable to read %s"
+msgstr "не вдалося прочитати %s"
+
+#, c-format
+msgid "cannot read existing object info %s"
+msgstr "неможливо прочитати інформацію про існуючий об’єкт %s"
+
+#, c-format
+msgid "cannot read existing object %s"
+msgstr "неможливо прочитати існуючий об’єкт %s"
+
+#, c-format
+msgid "invalid blob object %s"
+msgstr "неприпустимий об’єкт blob %s"
+
+msgid "fsck error in packed object"
+msgstr "помилка fsck у запакованому обʼєкті"
+
+#, c-format
+msgid "Not all child objects of %s are reachable"
+msgstr "Не всі дочірні об’єкти %s доступні"
+
+msgid "failed to apply delta"
+msgstr "не вдалося застосувати дельту"
+
+msgid "Receiving objects"
+msgstr "Отримання об’єктів"
+
+msgid "Indexing objects"
+msgstr "Індексація об’єктів"
+
+msgid "pack is corrupted (SHA1 mismatch)"
+msgstr "пакунок пошкоджено (SHA1 не співпадає)"
+
+msgid "cannot fstat packfile"
+msgstr "неможливо зробити fstat файла пакунка"
+
+msgid "pack has junk at the end"
+msgstr "мотлох наприкінці пакунка"
+
+msgid "confusion beyond insanity in parse_pack_objects()"
+msgstr "плутанина на межі пекельного борошна в parse_pack_objects()"
+
+msgid "Resolving deltas"
+msgstr "Розв’язання дельт"
+
+#, c-format
+msgid "unable to create thread: %s"
+msgstr "не вдалося створити потік: %s"
+
+msgid "confusion beyond insanity"
+msgstr "плутанина на межі пекельного борошна"
+
+#, c-format
+msgid "completed with %d local object"
+msgid_plural "completed with %d local objects"
+msgstr[0] "завершено з %d локальним об’єктом"
+msgstr[1] "завершено з %d локальними об’єктами"
+msgstr[2] "завершено з %d локальними об’єктами"
+
+#, c-format
+msgid "Unexpected tail checksum for %s (disk corruption?)"
+msgstr "Неочікувана контрольна сума наприкінці %s (пошкодження диска?)"
+
+#, c-format
+msgid "pack has %d unresolved delta"
+msgid_plural "pack has %d unresolved deltas"
+msgstr[0] "пакунок має %d невирішену дельту"
+msgstr[1] "пакунок має %d невирішених дельти"
+msgstr[2] "пакунок має %d невирішених дельт"
+
+#, c-format
+msgid "unable to deflate appended object (%d)"
+msgstr "не вдалося запакувати доданий об’єкт (%d)"
+
+#, c-format
+msgid "local object %s is corrupt"
+msgstr "локальний обʼєкт %s пошкоджено"
+
+#, c-format
+msgid "packfile name '%s' does not end with '.%s'"
+msgstr "ім’я файла пакунка '%s' не закінчується на '.%s'"
+
+#, c-format
+msgid "cannot write %s file '%s'"
+msgstr "неможливо записати %s файл '%s'"
+
+#, c-format
+msgid "cannot close written %s file '%s'"
+msgstr "неможливо закрити записаний %s файл '%s'"
+
+#, c-format
+msgid "unable to rename temporary '*.%s' file to '%s'"
+msgstr "не вдається перейменувати тимчасовий файл '*.%s' на '%s'"
+
+msgid "error while closing pack file"
+msgstr "помилка під час закриття файлу пакунка"
+
+#, c-format
+msgid "bad pack.indexVersion=%<PRIu32>"
+msgstr "невірний pack.indexVersion=%<PRIu32>"
+
+#, c-format
+msgid "Cannot open existing pack file '%s'"
+msgstr "Неможливо відкрити існуючий файл пакунка '%s"
+
+#, c-format
+msgid "Cannot open existing pack idx file for '%s'"
+msgstr "Неможливо відкрити існуючий індексний файл пакунка для '%s"
+
+#, c-format
+msgid "non delta: %d object"
+msgid_plural "non delta: %d objects"
+msgstr[0] "не дельта: %d об’єкт"
+msgstr[1] "не дельта: %d об’єкта"
+msgstr[2] "не дельта: %d об’єктів"
+
+#, c-format
+msgid "chain length = %d: %lu object"
+msgid_plural "chain length = %d: %lu objects"
+msgstr[0] "довжина ланцюжка = %d: %lu об’єкт"
+msgstr[1] "довжина ланцюжка = %d: %lu об’єкти"
+msgstr[2] "довжина ланцюжка = %d: %lu об’єктів"
+
+msgid "Cannot come back to cwd"
+msgstr "Неможливо повернутися до поточної робочої директорії"
+
+#, c-format
+msgid "bad %s"
+msgstr "невірний %s"
+
+#, c-format
+msgid "unknown hash algorithm '%s'"
+msgstr "невідомий хеш-алгоритм '%s'"
+
+msgid "--stdin requires a git repository"
+msgstr "--stdin вимагає наявності git сховища"
+
+msgid "--verify with no packfile name given"
+msgstr "--verify без зазначення имені файла пакунка"
+
+msgid "fsck error in pack objects"
+msgstr "помилка fsck в об’єктах пакунка"
+
+#, c-format
+msgid "cannot stat template '%s'"
+msgstr "неможливо виконати stat шаблона \"%s\""
+
+#, c-format
+msgid "cannot opendir '%s'"
+msgstr "неможливо виконати opendir \"%s\""
+
+#, c-format
+msgid "cannot readlink '%s'"
+msgstr "неможливо виконати readlink \"%s\""
+
+#, c-format
+msgid "cannot symlink '%s' '%s'"
+msgstr "неможливо виконати symlink \"%s\" \"%s\""
+
+#, c-format
+msgid "cannot copy '%s' to '%s'"
+msgstr "неможливо скопіювати \"%s\" до \"%s\""
+
+#, c-format
+msgid "ignoring template %s"
+msgstr ""
+
+#, c-format
+msgid "templates not found in %s"
+msgstr "шаблонів не знайдено в %s"
+
+#, c-format
+msgid "not copying templates from '%s': %s"
+msgstr "не копіюються шаблони з \"%s\": %s"
+
+#, c-format
+msgid "invalid initial branch name: '%s'"
+msgstr "неприпустиме початкове ім’я гілки: \"%s\""
+
+#, c-format
+msgid "unable to handle file type %d"
+msgstr "не вдалося обробити тип файлу %d"
+
+#, c-format
+msgid "unable to move %s to %s"
+msgstr "не вдалося перемістити %s на %s"
+
+msgid "attempt to reinitialize repository with different hash"
+msgstr ""
+
+#, c-format
+msgid "%s already exists"
+msgstr "%s вже існує"
+
+#, c-format
+msgid "re-init: ignored --initial-branch=%s"
+msgstr ""
+
+#, c-format
+msgid "Reinitialized existing shared Git repository in %s%s\n"
+msgstr ""
+
+#, c-format
+msgid "Reinitialized existing Git repository in %s%s\n"
+msgstr ""
+
+#, c-format
+msgid "Initialized empty shared Git repository in %s%s\n"
+msgstr ""
+
+#, c-format
+msgid "Initialized empty Git repository in %s%s\n"
+msgstr ""
+
+msgid ""
+"git init [-q | --quiet] [--bare] [--template=<template-directory>]\n"
+"         [--separate-git-dir <git-dir>] [--object-format=<format>]\n"
+"         [-b <branch-name> | --initial-branch=<branch-name>]\n"
+"         [--shared[=<permissions>]] [<directory>]"
+msgstr ""
+
+msgid "permissions"
+msgstr "права доступу"
+
+msgid "specify that the git repository is to be shared amongst several users"
+msgstr ""
+
+msgid "override the name of the initial branch"
+msgstr ""
+
+msgid "hash"
+msgstr ""
+
+msgid "specify the hash algorithm to use"
+msgstr ""
+
+#, c-format
+msgid "cannot mkdir %s"
+msgstr ""
+
+#, c-format
+msgid "cannot chdir to %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s (or --work-tree=<directory>) not allowed without specifying %s (or --git-"
+"dir=<directory>)"
+msgstr ""
+
+#, c-format
+msgid "Cannot access work tree '%s'"
+msgstr "Не вдається отримати доступ до робочого дерева \"%s\""
+
+msgid "--separate-git-dir incompatible with bare repository"
+msgstr "--separate-git-dir несумісна з порожнім сховищем"
+
+msgid ""
+"git interpret-trailers [--in-place] [--trim-empty]\n"
+"                       [(--trailer <token>[(=|:)<value>])...]\n"
+"                       [--parse] [<file>...]"
+msgstr ""
+
+msgid "edit files in place"
+msgstr ""
+
+msgid "trim empty trailers"
+msgstr ""
+
+msgid "where to place the new trailer"
+msgstr ""
+
+msgid "action if trailer already exists"
+msgstr "що робити, якщо trailer вже існує"
+
+msgid "action if trailer is missing"
+msgstr ""
+
+msgid "output only the trailers"
+msgstr ""
+
+msgid "do not apply config rules"
+msgstr ""
+
+msgid "join whitespace-continued values"
+msgstr ""
+
+msgid "set parsing options"
+msgstr ""
+
+msgid "do not treat --- specially"
+msgstr ""
+
+msgid "trailer(s) to add"
+msgstr ""
+
+msgid "--trailer with --only-input does not make sense"
+msgstr ""
+
+msgid "no input file given for in-place editing"
+msgstr ""
+
+msgid "git log [<options>] [<revision-range>] [[--] <path>...]"
+msgstr "git log [<опції>] [<діапазон-ревізій>] [[--] <шлях>...]"
+
+msgid "git show [<options>] <object>..."
+msgstr "git show [<опції>] <обʼєкт>..."
+
+#, c-format
+msgid "invalid --decorate option: %s"
+msgstr "неприпустима --decorate опція: %s"
+
+msgid "suppress diff output"
+msgstr ""
+
+msgid "show source"
+msgstr ""
+
+msgid "clear all previously-defined decoration filters"
+msgstr ""
+
+msgid "only decorate refs that match <pattern>"
+msgstr ""
+
+msgid "do not decorate refs that match <pattern>"
+msgstr ""
+
+msgid "decorate options"
+msgstr ""
+
+msgid ""
+"trace the evolution of line range <start>,<end> or function :<funcname> in "
+"<file>"
+msgstr ""
+
+#, c-format
+msgid "unrecognized argument: %s"
+msgstr ""
+
+msgid "-L<range>:<file> cannot be used with pathspec"
+msgstr "-L<діапазон>:<файл> не можна використовувати з визначником шляху"
+
+#, c-format
+msgid "Final output: %d %s\n"
+msgstr ""
+
+msgid "unable to create temporary object directory"
+msgstr "не вдалося створити тимчасову директорію об’єкта"
+
+#, c-format
+msgid "git show %s: bad file"
+msgstr ""
+
+#, c-format
+msgid "could not read object %s"
+msgstr "не вдалося прочитати об’єкт %s"
+
+#, c-format
+msgid "unknown type: %d"
+msgstr "невідомий тип: %d"
+
+#, c-format
+msgid "%s: invalid cover from description mode"
+msgstr ""
+
+msgid "format.headers without value"
+msgstr ""
+
+#, c-format
+msgid "cannot open patch file %s"
+msgstr "не вдається відкрити файл латки %s"
+
+msgid "need exactly one range"
+msgstr ""
+
+msgid "not a range"
+msgstr ""
+
+msgid "cover letter needs email format"
+msgstr ""
+
+msgid "failed to create cover-letter file"
+msgstr "не вдалося створити файл супровідного листа"
+
+#, c-format
+msgid "insane in-reply-to: %s"
+msgstr ""
+
+msgid "git format-patch [<options>] [<since> | <revision-range>]"
+msgstr "git format-patch [<опції>] [<відколи> | <діапазон-ревізій>]"
+
+msgid "two output directories?"
+msgstr ""
+
+#, c-format
+msgid "unknown commit %s"
+msgstr "невідомий коміт %s"
+
+#, c-format
+msgid "failed to resolve '%s' as a valid ref"
+msgstr "не вдалося розпізнати \"%s\" як припустиме посилання"
+
+msgid "could not find exact merge base"
+msgstr "не вдалося знайти точну базу для злиття"
+
+msgid ""
+"failed to get upstream, if you want to record base commit automatically,\n"
+"please use git branch --set-upstream-to to track a remote branch.\n"
+"Or you could specify base commit by --base=<base-commit-id> manually"
+msgstr ""
+
+msgid "failed to find exact merge base"
+msgstr "не вдалося знайти точну базу для злиття"
+
+msgid "base commit should be the ancestor of revision list"
+msgstr ""
+
+msgid "base commit shouldn't be in revision list"
+msgstr ""
+
+msgid "cannot get patch id"
+msgstr "неможливо отримати ідентифікатор латки"
+
+msgid "failed to infer range-diff origin of current series"
+msgstr ""
+
+#, c-format
+msgid "using '%s' as range-diff origin of current series"
+msgstr ""
+
+msgid "use [PATCH n/m] even with a single patch"
+msgstr ""
+
+msgid "use [PATCH] even with multiple patches"
+msgstr ""
+
+msgid "print patches to standard out"
+msgstr ""
+
+msgid "generate a cover letter"
+msgstr ""
+
+msgid "use simple number sequence for output file names"
+msgstr ""
+
+msgid "sfx"
+msgstr ""
+
+msgid "use <sfx> instead of '.patch'"
+msgstr ""
+
+msgid "start numbering patches at <n> instead of 1"
+msgstr ""
+
+msgid "reroll-count"
+msgstr ""
+
+msgid "mark the series as Nth re-roll"
+msgstr ""
+
+msgid "max length of output filename"
+msgstr ""
+
+msgid "use [RFC PATCH] instead of [PATCH]"
+msgstr ""
+
+msgid "cover-from-description-mode"
+msgstr ""
+
+msgid "generate parts of a cover letter based on a branch's description"
+msgstr ""
+
+msgid "use [<prefix>] instead of [PATCH]"
+msgstr ""
+
+msgid "store resulting files in <dir>"
+msgstr ""
+
+msgid "don't strip/add [PATCH]"
+msgstr ""
+
+msgid "don't output binary diffs"
+msgstr ""
+
+msgid "output all-zero hash in From header"
+msgstr ""
+
+msgid "don't include a patch matching a commit upstream"
+msgstr ""
+
+msgid "show patch format instead of default (patch + stat)"
+msgstr ""
+
+msgid "Messaging"
+msgstr ""
+
+msgid "header"
+msgstr "заголовок"
+
+msgid "add email header"
+msgstr ""
+
+msgid "email"
+msgstr ""
+
+msgid "add To: header"
+msgstr ""
+
+msgid "add Cc: header"
+msgstr ""
+
+msgid "ident"
+msgstr ""
+
+msgid "set From address to <ident> (or committer ident if absent)"
+msgstr ""
+
+msgid "message-id"
+msgstr ""
+
+msgid "make first mail a reply to <message-id>"
+msgstr ""
+
+msgid "boundary"
+msgstr ""
+
+msgid "attach the patch"
+msgstr ""
+
+msgid "inline the patch"
+msgstr ""
+
+msgid "enable message threading, styles: shallow, deep"
+msgstr ""
+
+msgid "signature"
+msgstr ""
+
+msgid "add a signature"
+msgstr ""
+
+msgid "base-commit"
+msgstr ""
+
+msgid "add prerequisite tree info to the patch series"
+msgstr ""
+
+msgid "add a signature from a file"
+msgstr ""
+
+msgid "don't print the patch filenames"
+msgstr ""
+
+msgid "show progress while generating patches"
+msgstr ""
+
+msgid "show changes against <rev> in cover letter or single patch"
+msgstr ""
+
+msgid "show changes against <refspec> in cover letter or single patch"
+msgstr ""
+
+msgid "percentage by which creation is weighted"
+msgstr ""
+
+msgid "show in-body From: even if identical to the e-mail header"
+msgstr ""
+
+#, c-format
+msgid "invalid ident line: %s"
+msgstr "неприпустимий рядок ідентифікатора: %s"
+
+msgid "--name-only does not make sense"
+msgstr ""
+
+msgid "--name-status does not make sense"
+msgstr ""
+
+msgid "--check does not make sense"
+msgstr ""
+
+msgid "--remerge-diff does not make sense"
+msgstr ""
+
+#, c-format
+msgid "could not create directory '%s'"
+msgstr "не вдалося створити директорію \"%s\""
+
+msgid "--interdiff requires --cover-letter or single patch"
+msgstr ""
+
+msgid "Interdiff:"
+msgstr ""
+
+#, c-format
+msgid "Interdiff against v%d:"
+msgstr ""
+
+msgid "--range-diff requires --cover-letter or single patch"
+msgstr ""
+
+msgid "Range-diff:"
+msgstr ""
+
+#, c-format
+msgid "Range-diff against v%d:"
+msgstr ""
+
+#, c-format
+msgid "unable to read signature file '%s'"
+msgstr "не вдалося прочитати файл підпису \"%s\""
+
+msgid "Generating patches"
+msgstr "Створення латок"
+
+msgid "failed to create output files"
+msgstr "не вдалося створити вихідні файли"
+
+msgid "git cherry [-v] [<upstream> [<head> [<limit>]]]"
+msgstr ""
+
+#, c-format
+msgid ""
+"Could not find a tracked remote branch, please specify <upstream> manually.\n"
+msgstr ""
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not start with '('"
+msgstr "невірний формат ls-файлів: елемент \"%s\" не починається з \"(\""
+
+#, c-format
+msgid "bad ls-files format: element '%s' does not end in ')'"
+msgstr "невірний формат ls-файлів: елемент \"%s\" не закінчується на \")\""
+
+#, c-format
+msgid "bad ls-files format: %%%.*s"
+msgstr ""
+
+msgid "git ls-files [<options>] [<file>...]"
+msgstr "git ls-files [<опції>] [<файл>...]"
+
+msgid "separate paths with the NUL character"
+msgstr ""
+
+msgid "identify the file status with tags"
+msgstr ""
+
+msgid "use lowercase letters for 'assume unchanged' files"
+msgstr ""
+
+msgid "use lowercase letters for 'fsmonitor clean' files"
+msgstr ""
+
+msgid "show cached files in the output (default)"
+msgstr ""
+
+msgid "show deleted files in the output"
+msgstr ""
+
+msgid "show modified files in the output"
+msgstr ""
+
+msgid "show other files in the output"
+msgstr ""
+
+msgid "show ignored files in the output"
+msgstr ""
+
+msgid "show staged contents' object name in the output"
+msgstr ""
+
+msgid "show files on the filesystem that need to be removed"
+msgstr ""
+
+msgid "show 'other' directories' names only"
+msgstr ""
+
+msgid "show line endings of files"
+msgstr ""
+
+msgid "don't show empty directories"
+msgstr ""
+
+msgid "show unmerged files in the output"
+msgstr ""
+
+msgid "show resolve-undo information"
+msgstr ""
+
+msgid "skip files matching pattern"
+msgstr ""
+
+msgid "read exclude patterns from <file>"
+msgstr ""
+
+msgid "read additional per-directory exclude patterns in <file>"
+msgstr ""
+
+msgid "add the standard git exclusions"
+msgstr ""
+
+msgid "make the output relative to the project top directory"
+msgstr ""
+
+msgid "if any <file> is not in the index, treat this as an error"
+msgstr ""
+
+msgid "tree-ish"
+msgstr ""
+
+msgid "pretend that paths removed since <tree-ish> are still present"
+msgstr ""
+
+msgid "show debugging data"
+msgstr ""
+
+msgid "suppress duplicate entries"
+msgstr ""
+
+msgid "show sparse directories in the presence of a sparse index"
+msgstr ""
+
+msgid ""
+"--format cannot be used with -s, -o, -k, -t, --resolve-undo, --deduplicate, "
+"--eol"
+msgstr ""
+
+msgid ""
+"git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
+"              [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
+"              [--symref] [<repository> [<patterns>...]]"
+msgstr ""
+
+msgid "do not print remote URL"
+msgstr ""
+
+msgid "exec"
+msgstr ""
+
+msgid "path of git-upload-pack on the remote host"
+msgstr "шлях до git-upload-pack на віддаленому сервері"
+
+msgid "limit to tags"
+msgstr ""
+
+msgid "limit to heads"
+msgstr ""
+
+msgid "do not show peeled tags"
+msgstr ""
+
+msgid "take url.<base>.insteadOf into account"
+msgstr ""
+
+msgid "exit with exit code 2 if no matching refs are found"
+msgstr ""
+
+msgid "show underlying ref in addition to the object pointed by it"
+msgstr ""
+
+msgid "git ls-tree [<options>] <tree-ish> [<path>...]"
+msgstr "git ls-tree [<опції>] <деревоподібне-джерело> [<шлях>...]"
+
+#, c-format
+msgid "could not get object info about '%s'"
+msgstr "не вдалося отримати інформацію про обʼєкт \"%s\""
+
+#, c-format
+msgid "bad ls-tree format: element '%s' does not start with '('"
+msgstr "невірний формат ls-дерева: елемент \"%s\" не починається з \"(\""
+
+#, c-format
+msgid "bad ls-tree format: element '%s' does not end in ')'"
+msgstr "невірний формат ls-дерева: елемент \"%s\" не закінчується на \")\""
+
+#, c-format
+msgid "bad ls-tree format: %%%.*s"
+msgstr ""
+
+msgid "only show trees"
+msgstr ""
+
+msgid "recurse into subtrees"
+msgstr ""
+
+msgid "show trees when recursing"
+msgstr ""
+
+msgid "terminate entries with NUL byte"
+msgstr ""
+
+msgid "include object size"
+msgstr "включити розмір об’єкта"
+
+msgid "list only filenames"
+msgstr ""
+
+msgid "list only objects"
+msgstr "показати лише обʼєкти"
+
+msgid "use full path names"
+msgstr ""
+
+msgid "list entire tree; not just current directory (implies --full-name)"
+msgstr ""
+
+msgid "--format can't be combined with other format-altering options"
+msgstr "--format не можна комбінувати з іншими опціями зміни формату"
+
+#. TRANSLATORS: keep <> in "<" mail ">" info.
+
+msgid "git mailinfo [<options>] <msg> <patch> < mail >info"
+msgstr ""
+
+msgid "keep subject"
+msgstr ""
+
+msgid "keep non patch brackets in subject"
+msgstr ""
+
+msgid "copy Message-ID to the end of commit message"
+msgstr ""
+
+msgid "re-code metadata to i18n.commitEncoding"
+msgstr ""
+
+msgid "disable charset re-coding of metadata"
+msgstr ""
+
+msgid "encoding"
+msgstr ""
+
+msgid "re-code metadata to this encoding"
+msgstr ""
+
+msgid "use scissors"
+msgstr ""
+
+msgid "<action>"
+msgstr ""
+
+msgid "action when quoted CR is found"
+msgstr ""
+
+msgid "use headers in message's body"
+msgstr ""
+
+msgid "reading patches from stdin/tty..."
+msgstr ""
+
+#, c-format
+msgid "empty mbox: '%s'"
+msgstr ""
+
+msgid "git merge-base [-a | --all] <commit> <commit>..."
+msgstr ""
+
+msgid "git merge-base [-a | --all] --octopus <commit>..."
+msgstr ""
+
+msgid "git merge-base --is-ancestor <commit> <commit>"
+msgstr ""
+
+msgid "git merge-base --independent <commit>..."
+msgstr ""
+
+msgid "git merge-base --fork-point <ref> [<commit>]"
+msgstr ""
+
+msgid "output all common ancestors"
+msgstr ""
+
+msgid "find ancestors for a single n-way merge"
+msgstr ""
+
+msgid "list revs not reachable from others"
+msgstr ""
+
+msgid "is the first one ancestor of the other?"
+msgstr ""
+
+msgid "find where <commit> forked from reflog of <ref>"
+msgstr ""
+
+msgid ""
+"git merge-file [<options>] [-L <name1> [-L <orig> [-L <name2>]]] <file1> "
+"<orig-file> <file2>"
+msgstr ""
+
+msgid "send results to standard output"
+msgstr ""
+
+msgid "use a diff3 based merge"
+msgstr ""
+
+msgid "use a zealous diff3 based merge"
+msgstr ""
+
+msgid "for conflicts, use our version"
+msgstr ""
+
+msgid "for conflicts, use their version"
+msgstr ""
+
+msgid "for conflicts, use a union version"
+msgstr ""
+
+msgid "for conflicts, use this marker size"
+msgstr ""
+
+msgid "do not warn about conflicts"
+msgstr ""
+
+msgid "set labels for file1/orig-file/file2"
+msgstr ""
+
+#, c-format
+msgid "unknown option %s"
+msgstr "невідома опція %s"
+
+#, c-format
+msgid "could not parse object '%s'"
+msgstr "не вдалося розібрати обʼєкт \"%s\""
+
+#, c-format
+msgid "cannot handle more than %d base. Ignoring %s."
+msgid_plural "cannot handle more than %d bases. Ignoring %s."
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "not handling anything other than two heads merge."
+msgstr ""
+
+#, c-format
+msgid "could not resolve ref '%s'"
+msgstr "не вдалося розвʼязати посилання \"%s\""
+
+#, c-format
+msgid "Merging %s with %s\n"
+msgstr ""
+
+msgid "not something we can merge"
+msgstr ""
+
+msgid "refusing to merge unrelated histories"
+msgstr ""
+
+msgid "failure to merge"
+msgstr ""
+
+msgid "git merge-tree [--write-tree] [<options>] <branch1> <branch2>"
+msgstr ""
+
+msgid "git merge-tree [--trivial-merge] <base-tree> <branch1> <branch2>"
+msgstr ""
+
+msgid "do a real merge instead of a trivial merge"
+msgstr ""
+
+msgid "do a trivial merge only"
+msgstr ""
+
+msgid "also show informational/conflict messages"
+msgstr ""
+
+msgid "list filenames without modes/oids/stages"
+msgstr ""
+
+msgid "allow merging unrelated histories"
+msgstr ""
+
+msgid "perform multiple merges, one per line of input"
+msgstr ""
+
+msgid "specify a merge-base for the merge"
+msgstr "вказати базу для злиття"
+
+msgid "--trivial-merge is incompatible with all other options"
+msgstr ""
+
+msgid "--merge-base is incompatible with --stdin"
+msgstr ""
+
+#, c-format
+msgid "malformed input line: '%s'."
+msgstr "невірно сформований рядок вводу: \"%s\"."
+
+#, c-format
+msgid "merging cannot continue; got unclean result of %d"
+msgstr ""
+
+msgid "git merge [<options>] [<commit>...]"
+msgstr "git merge [<опції>] [<коміт>...]"
+
+msgid "switch `m' requires a value"
+msgstr ""
+
+#, c-format
+msgid "option `%s' requires a value"
+msgstr "опція \"%s\" вимагає значення"
+
+#, c-format
+msgid "Could not find merge strategy '%s'.\n"
+msgstr "Не вдалося знайти стратегію злиття \"%s\".\n"
+
+#, c-format
+msgid "Available strategies are:"
+msgstr ""
+
+#, c-format
+msgid "Available custom strategies are:"
+msgstr ""
+
+msgid "do not show a diffstat at the end of the merge"
+msgstr ""
+
+msgid "show a diffstat at the end of the merge"
+msgstr ""
+
+msgid "(synonym to --stat)"
+msgstr ""
+
+msgid "add (at most <n>) entries from shortlog to merge commit message"
+msgstr ""
+
+msgid "create a single commit instead of doing a merge"
+msgstr ""
+
+msgid "perform a commit if the merge succeeds (default)"
+msgstr ""
+
+msgid "edit message before committing"
+msgstr "редагувати повідомлення перед комітом"
+
+msgid "allow fast-forward (default)"
+msgstr ""
+
+msgid "abort if fast-forward is not possible"
+msgstr ""
+
+msgid "verify that the named commit has a valid GPG signature"
+msgstr ""
+
+msgid "strategy"
+msgstr ""
+
+msgid "merge strategy to use"
+msgstr ""
+
+msgid "option=value"
+msgstr ""
+
+msgid "option for selected merge strategy"
+msgstr ""
+
+msgid "merge commit message (for a non-fast-forward merge)"
+msgstr ""
+
+msgid "use <name> instead of the real target"
+msgstr "використовувати <назва> замість реальної цілі"
+
+msgid "abort the current in-progress merge"
+msgstr "перервати поточне злиття"
+
+msgid "--abort but leave index and working tree alone"
+msgstr "--abort, але зберегти стан індекса і робочого дерева"
+
+msgid "continue the current in-progress merge"
+msgstr "продовжити поточний процес злиття"
+
+msgid "bypass pre-merge-commit and commit-msg hooks"
+msgstr ""
+
+msgid "could not run stash."
+msgstr "не вдалося виконати stash."
+
+msgid "stash failed"
+msgstr ""
+
+#, c-format
+msgid "not a valid object: %s"
+msgstr "не є припустимим обʼєктом: %s"
+
+msgid "read-tree failed"
+msgstr ""
+
+msgid "Already up to date. (nothing to squash)"
+msgstr ""
+
+msgid "Already up to date."
+msgstr ""
+
+#, c-format
+msgid "Squash commit -- not updating HEAD\n"
+msgstr ""
+
+#, c-format
+msgid "No merge message -- not updating HEAD\n"
+msgstr ""
+
+#, c-format
+msgid "'%s' does not point to a commit"
+msgstr "\"%s\" не вказує на коміт"
+
+#, c-format
+msgid "Bad branch.%s.mergeoptions string: %s"
+msgstr ""
+
+msgid "Unable to write index."
+msgstr "Не вдалося записати індекс."
+
+msgid "Not handling anything other than two heads merge."
+msgstr ""
+
+#, c-format
+msgid "unknown strategy option: -X%s"
+msgstr ""
+
+#, c-format
+msgid "unable to write %s"
+msgstr "не вдалося записати %s"
+
+#, c-format
+msgid "Could not read from '%s'"
+msgstr "Не вдалося прочитати з \"%s\""
+
+#, c-format
+msgid "Not committing merge; use 'git commit' to complete the merge.\n"
+msgstr ""
+"Не виконується злиття; використовуйте \"git commit\" для завершення злиття.\n"
+
+msgid ""
+"Please enter a commit message to explain why this merge is necessary,\n"
+"especially if it merges an updated upstream into a topic branch.\n"
+"\n"
+msgstr ""
+
+msgid "An empty message aborts the commit.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Lines starting with '%c' will be ignored, and an empty message aborts\n"
+"the commit.\n"
+msgstr ""
+
+msgid "Empty commit message."
+msgstr ""
+
+#, c-format
+msgid "Wonderful.\n"
+msgstr ""
+
+#, c-format
+msgid "Automatic merge failed; fix conflicts and then commit the result.\n"
+msgstr ""
+
+msgid "No current branch."
+msgstr "Немає поточної гілки."
+
+msgid "No remote for the current branch."
+msgstr "Немає віддаленого призначення для поточної гілки."
+
+msgid "No default upstream defined for the current branch."
+msgstr ""
+
+#, c-format
+msgid "No remote-tracking branch for %s from %s"
+msgstr ""
+
+#, c-format
+msgid "Bad value '%s' in environment '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not close '%s'"
+msgstr "не вдалося закрити \"%s\""
+
+#, c-format
+msgid "not something we can merge in %s: %s"
+msgstr ""
+
+msgid "--abort expects no arguments"
+msgstr ""
+
+msgid "There is no merge to abort (MERGE_HEAD missing)."
+msgstr ""
+
+msgid "--quit expects no arguments"
+msgstr ""
+
+msgid "--continue expects no arguments"
+msgstr ""
+
+msgid "There is no merge in progress (MERGE_HEAD missing)."
+msgstr ""
+
+msgid ""
+"You have not concluded your merge (MERGE_HEAD exists).\n"
+"Please, commit your changes before you merge."
+msgstr ""
+
+msgid ""
+"You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
+"Please, commit your changes before you merge."
+msgstr ""
+
+msgid "You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."
+msgstr ""
+
+msgid "No commit specified and merge.defaultToUpstream not set."
+msgstr ""
+
+msgid "Squash commit into empty head not supported yet"
+msgstr ""
+
+msgid "Non-fast-forward commit does not make sense into an empty head"
+msgstr "Не fast-forward коміт не має сенсу з порожнім HEAD"
+
+#, c-format
+msgid "%s - not something we can merge"
+msgstr ""
+
+msgid "Can merge only exactly one commit into empty head"
+msgstr ""
+
+#, c-format
+msgid "Updating %s..%s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+"  %s"
+msgstr ""
+
+#, c-format
+msgid "Trying really trivial in-index merge...\n"
+msgstr ""
+
+#, c-format
+msgid "Nope.\n"
+msgstr ""
+
+#, c-format
+msgid "Rewinding the tree to pristine...\n"
+msgstr ""
+
+#, c-format
+msgid "Trying merge strategy %s...\n"
+msgstr ""
+
+#, c-format
+msgid "No merge strategy handled the merge.\n"
+msgstr ""
+
+#, c-format
+msgid "Merge with strategy %s failed.\n"
+msgstr ""
+
+#, c-format
+msgid "Using the %s strategy to prepare resolving by hand.\n"
+msgstr ""
+
+#, c-format
+msgid "Automatic merge went well; stopped before committing as requested\n"
+msgstr ""
+
+#, c-format
+msgid "When finished, apply stashed changes with `git stash pop`\n"
+msgstr ""
+
+#, c-format
+msgid "warning: tag input does not pass fsck: %s"
+msgstr ""
+
+#, c-format
+msgid "error: tag input does not pass fsck: %s"
+msgstr ""
+
+#, c-format
+msgid "%d (FSCK_IGNORE?) should never trigger this callback"
+msgstr ""
+
+#, c-format
+msgid "could not read tagged object '%s'"
+msgstr "не вдалося прочитати тегований об’єкт \"%s\""
+
+#, c-format
+msgid "object '%s' tagged as '%s', but is a '%s' type"
+msgstr ""
+
+msgid "could not read from stdin"
+msgstr "не вдалося прочитати з stdin"
+
+msgid "tag on stdin did not pass our strict fsck check"
+msgstr ""
+
+msgid "tag on stdin did not refer to a valid object"
+msgstr ""
+
+msgid "unable to write tag file"
+msgstr "не вдалося записати файл тегів"
+
+msgid "input is NUL terminated"
+msgstr ""
+
+msgid "allow missing objects"
+msgstr "дозволити відсутні об’єкти"
+
+msgid "allow creation of more than one tree"
+msgstr ""
+
+msgid ""
+"git multi-pack-index [<options>] write [--preferred-pack=<pack>][--refs-"
+"snapshot=<path>]"
+msgstr ""
+
+msgid "git multi-pack-index [<options>] verify"
+msgstr "git multi-pack-index [<опції>] verify"
+
+msgid "git multi-pack-index [<options>] expire"
+msgstr "git multi-pack-index [<опції>] expire"
+
+msgid "git multi-pack-index [<options>] repack [--batch-size=<size>]"
+msgstr ""
+
+msgid "directory"
+msgstr "директорія"
+
+msgid "object directory containing set of packfile and pack-index pairs"
+msgstr ""
+
+msgid "preferred-pack"
+msgstr ""
+
+msgid "pack for reuse when computing a multi-pack bitmap"
+msgstr ""
+
+msgid "write multi-pack bitmap"
+msgstr ""
+
+msgid "write multi-pack index containing only given indexes"
+msgstr ""
+
+msgid "refs snapshot for selecting bitmap commits"
+msgstr ""
+
+msgid ""
+"during repack, collect pack-files of smaller size into a batch that is "
+"larger than this size"
+msgstr ""
+
+msgid "git mv [<options>] <source>... <destination>"
+msgstr "git mv [<опції>] <джерело>... <призначення>"
+
+#, c-format
+msgid "Directory %s is in index and no submodule?"
+msgstr ""
+
+msgid "Please stage your changes to .gitmodules or stash them to proceed"
+msgstr ""
+
+#, c-format
+msgid "%.*s is in index"
+msgstr ""
+
+msgid "force move/rename even if target exists"
+msgstr ""
+
+msgid "skip move/rename errors"
+msgstr ""
+
+#, c-format
+msgid "destination '%s' is not a directory"
+msgstr "місце призначення \"%s\" не є директорією"
+
+#, c-format
+msgid "Checking rename of '%s' to '%s'\n"
+msgstr ""
+
+msgid "bad source"
+msgstr "невірне джерело"
+
+msgid "destination exists"
+msgstr ""
+
+msgid "can not move directory into itself"
+msgstr ""
+
+msgid "cannot move directory over file"
+msgstr ""
+
+msgid "source directory is empty"
+msgstr ""
+
+msgid "not under version control"
+msgstr ""
+
+msgid "conflicted"
+msgstr ""
+
+#, c-format
+msgid "overwriting '%s'"
+msgstr ""
+
+msgid "Cannot overwrite"
+msgstr ""
+
+msgid "multiple sources for the same target"
+msgstr ""
+
+msgid "destination directory does not exist"
+msgstr "директорія призначення не існує"
+
+msgid "destination exists in the index"
+msgstr "призначення існує в індексі"
+
+#, c-format
+msgid "%s, source=%s, destination=%s"
+msgstr ""
+
+#, c-format
+msgid "Renaming %s to %s\n"
+msgstr "Перейменування %s на %s\n"
+
+#, c-format
+msgid "renaming '%s' failed"
+msgstr ""
+
+msgid "git name-rev [<options>] <commit>..."
+msgstr "git name-rev [<опції>] <коміт>..."
+
+msgid "git name-rev [<options>] --all"
+msgstr "git name-rev [<опції>] --all"
+
+msgid "git name-rev [<options>] --annotate-stdin"
+msgstr ""
+
+msgid "print only ref-based names (no object names)"
+msgstr ""
+
+msgid "only use tags to name the commits"
+msgstr ""
+
+msgid "only use refs matching <pattern>"
+msgstr ""
+
+msgid "ignore refs matching <pattern>"
+msgstr ""
+
+msgid "list all commits reachable from all refs"
+msgstr ""
+
+msgid "deprecated: use --annotate-stdin instead"
+msgstr ""
+
+msgid "annotate text from stdin"
+msgstr ""
+
+msgid "allow to print `undefined` names (default)"
+msgstr ""
+
+msgid "dereference tags in the input (internal use)"
+msgstr ""
+
+msgid "git notes [--ref <notes-ref>] [list [<object>]]"
+msgstr ""
+
+msgid ""
+"git notes [--ref <notes-ref>] add [-f] [--allow-empty] [-m <msg> | -F <file> "
+"| (-c | -C) <object>] [<object>]"
+msgstr ""
+
+msgid "git notes [--ref <notes-ref>] copy [-f] <from-object> <to-object>"
+msgstr ""
+
+msgid ""
+"git notes [--ref <notes-ref>] append [--allow-empty] [-m <msg> | -F <file> | "
+"(-c | -C) <object>] [<object>]"
+msgstr ""
+
+msgid "git notes [--ref <notes-ref>] edit [--allow-empty] [<object>]"
+msgstr ""
+
+msgid "git notes [--ref <notes-ref>] show [<object>]"
+msgstr ""
+
+msgid ""
+"git notes [--ref <notes-ref>] merge [-v | -q] [-s <strategy>] <notes-ref>"
+msgstr ""
+
+msgid "git notes [--ref <notes-ref>] remove [<object>...]"
+msgstr ""
+
+msgid "git notes [--ref <notes-ref>] prune [-n] [-v]"
+msgstr ""
+
+msgid "git notes [--ref <notes-ref>] get-ref"
+msgstr ""
+
+msgid "git notes [list [<object>]]"
+msgstr ""
+
+msgid "git notes add [<options>] [<object>]"
+msgstr "git notes add [<опції>] [<обʼєкт>]"
+
+msgid "git notes copy [<options>] <from-object> <to-object>"
+msgstr ""
+
+msgid "git notes copy --stdin [<from-object> <to-object>]..."
+msgstr ""
+
+msgid "git notes append [<options>] [<object>]"
+msgstr "git notes append [<опції>] [<обʼєкт>]"
+
+msgid "git notes edit [<object>]"
+msgstr ""
+
+msgid "git notes show [<object>]"
+msgstr ""
+
+msgid "git notes merge [<options>] <notes-ref>"
+msgstr "git notes merge [<опції>] <посилання-нотатки>"
+
+msgid "git notes merge --commit [<options>]"
+msgstr ""
+
+msgid "git notes merge --abort [<options>]"
+msgstr ""
+
+msgid "git notes remove [<object>]"
+msgstr ""
+
+msgid "git notes prune [<options>]"
+msgstr "git notes prune [<опції>]"
+
+msgid "Write/edit the notes for the following object:"
+msgstr ""
+
+#, c-format
+msgid "unable to start 'show' for object '%s'"
+msgstr "не вдалося запустити \"show\" для об’єкта \"%s\""
+
+msgid "could not read 'show' output"
+msgstr "не вдалося прочитати вивід \"show\""
+
+#, c-format
+msgid "failed to finish 'show' for object '%s'"
+msgstr "не вдалося завершити \"show\" для об’єкта \"%s\""
+
+msgid "please supply the note contents using either -m or -F option"
+msgstr ""
+
+msgid "unable to write note object"
+msgstr "не вдалося записати об’єкт нотатки"
+
+#, c-format
+msgid "the note contents have been left in %s"
+msgstr ""
+
+#, c-format
+msgid "could not open or read '%s'"
+msgstr "не вдалося відкрити або прочитати \"%s\""
+
+#, c-format
+msgid "failed to resolve '%s' as a valid ref."
+msgstr "не вдалося розпізнати \"%s\" як припустиме посилання."
+
+#, c-format
+msgid "failed to read object '%s'."
+msgstr "не вдалося прочитати обʼєкт \"%s\"."
+
+#, c-format
+msgid "cannot read note data from non-blob object '%s'."
+msgstr "неможливо прочитати дані нотатки з не-blob обʼєкту \"%s\"."
+
+#, c-format
+msgid "failed to copy notes from '%s' to '%s'"
+msgstr "не вдалося скопіювати нотатки з \"%s\" в \"%s\""
+
+#. TRANSLATORS: the first %s will be replaced by a git
+#. notes command: 'add', 'merge', 'remove', etc.
+#.
+
+#, c-format
+msgid "refusing to %s notes in %s (outside of refs/notes/)"
+msgstr ""
+
+#, c-format
+msgid "no note found for object %s."
+msgstr "для обʼєкта %s не знайдено жодної нотатки."
+
+msgid "note contents as a string"
+msgstr ""
+
+msgid "note contents in a file"
+msgstr ""
+
+msgid "reuse and edit specified note object"
+msgstr ""
+
+msgid "reuse specified note object"
+msgstr ""
+
+msgid "allow storing empty note"
+msgstr ""
+
+msgid "replace existing notes"
+msgstr "замінити існуючі нотатки"
+
+#, c-format
+msgid ""
+"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite "
+"existing notes"
+msgstr ""
+
+#, c-format
+msgid "Overwriting existing notes for object %s\n"
+msgstr ""
+
+#, c-format
+msgid "Removing note for object %s\n"
+msgstr "Видалення нотатки для обʼєкта %s\n"
+
+msgid "read objects from stdin"
+msgstr ""
+
+msgid "load rewriting config for <command> (implies --stdin)"
+msgstr ""
+
+msgid "too few arguments"
+msgstr "замало аргументів"
+
+#, c-format
+msgid ""
+"Cannot copy notes. Found existing notes for object %s. Use '-f' to overwrite "
+"existing notes"
+msgstr ""
+
+#, c-format
+msgid "missing notes on source object %s. Cannot copy."
+msgstr ""
+
+#, c-format
+msgid ""
+"The -m/-F/-c/-C options have been deprecated for the 'edit' subcommand.\n"
+"Please use 'git notes add -f -m/-F/-c/-C' instead.\n"
+msgstr ""
+
+msgid "failed to delete ref NOTES_MERGE_PARTIAL"
+msgstr ""
+
+msgid "failed to delete ref NOTES_MERGE_REF"
+msgstr ""
+
+msgid "failed to remove 'git notes merge' worktree"
+msgstr ""
+
+msgid "failed to read ref NOTES_MERGE_PARTIAL"
+msgstr ""
+
+msgid "could not find commit from NOTES_MERGE_PARTIAL."
+msgstr ""
+
+msgid "could not parse commit from NOTES_MERGE_PARTIAL."
+msgstr ""
+
+msgid "failed to resolve NOTES_MERGE_REF"
+msgstr ""
+
+msgid "failed to finalize notes merge"
+msgstr "не вдалося завершити злиття нотаток"
+
+#, c-format
+msgid "unknown notes merge strategy %s"
+msgstr ""
+
+msgid "General options"
+msgstr ""
+
+msgid "Merge options"
+msgstr ""
+
+msgid ""
+"resolve notes conflicts using the given strategy (manual/ours/theirs/union/"
+"cat_sort_uniq)"
+msgstr ""
+
+msgid "Committing unmerged notes"
+msgstr "Виконнання коміту незлитих нотаток"
+
+msgid "finalize notes merge by committing unmerged notes"
+msgstr ""
+
+msgid "Aborting notes merge resolution"
+msgstr ""
+
+msgid "abort notes merge"
+msgstr "перервати злиття нотаток"
+
+msgid "cannot mix --commit, --abort or -s/--strategy"
+msgstr ""
+
+msgid "must specify a notes ref to merge"
+msgstr "необхідно вказати посилання нотаток для злиття"
+
+#, c-format
+msgid "unknown -s/--strategy: %s"
+msgstr ""
+
+#, c-format
+msgid "a notes merge into %s is already in-progress at %s"
+msgstr ""
+
+#, c-format
+msgid "failed to store link to current notes ref (%s)"
+msgstr "не вдалося зберегти ланку на поточні нотатки посилання (%s)"
+
+#, c-format
+msgid ""
+"Automatic notes merge failed. Fix conflicts in %s and commit the result with "
+"'git notes merge --commit', or abort the merge with 'git notes merge --"
+"abort'.\n"
+msgstr ""
+
+#, c-format
+msgid "Failed to resolve '%s' as a valid ref."
+msgstr "Не вдалося розвʼязати \"%s\" як припустиме посилання."
+
+#, c-format
+msgid "Object %s has no note\n"
+msgstr ""
+
+msgid "attempt to remove non-existent note is not an error"
+msgstr ""
+
+msgid "read object names from the standard input"
+msgstr ""
+
+msgid "do not remove, show only"
+msgstr ""
+
+msgid "report pruned notes"
+msgstr ""
+
+msgid "notes-ref"
+msgstr ""
+
+msgid "use notes from <notes-ref>"
+msgstr ""
+
+#, c-format
+msgid "unknown subcommand: `%s'"
+msgstr ""
+
+msgid "git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"
+msgstr ""
+
+msgid ""
+"git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"
+msgstr ""
+
+#, c-format
+msgid ""
+"write_reuse_object: could not locate %s, expected at offset %<PRIuMAX> in "
+"pack %s"
+msgstr ""
+
+#, c-format
+msgid "bad packed object CRC for %s"
+msgstr ""
+
+#, c-format
+msgid "corrupt packed object for %s"
+msgstr "пошкоджений запакований обʼєкт для %s"
+
+#, c-format
+msgid "recursive delta detected for object %s"
+msgstr "виявлено рекурсивну дельту для обʼєкта %s"
+
+#, c-format
+msgid "ordered %u objects, expected %<PRIu32>"
+msgstr ""
+
+#, c-format
+msgid "expected object at offset %<PRIuMAX> in pack %s"
+msgstr "очікувався обʼєкт на зміщенні %<PRIuMAX> пакунка %s"
+
+msgid "disabling bitmap writing, packs are split due to pack.packSizeLimit"
+msgstr ""
+
+msgid "Writing objects"
+msgstr "Запис обʼєктів"
+
+#, c-format
+msgid "failed to stat %s"
+msgstr "не вдалося виконати stat %s"
+
+#, c-format
+msgid "failed utime() on %s"
+msgstr "не вдалося виконати utime() на %s"
+
+msgid "failed to write bitmap index"
+msgstr "не вдалося записати bitmap індекс"
+
+#, c-format
+msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
+msgstr ""
+
+msgid "disabling bitmap writing, as some objects are not being packed"
+msgstr ""
+
+#, c-format
+msgid "delta base offset overflow in pack for %s"
+msgstr "переповнення зміщення дельти бази у пакунку для %s"
+
+#, c-format
+msgid "delta base offset out of bound for %s"
+msgstr "зміщення бази дельти виходить за межі для %s"
+
+msgid "Counting objects"
+msgstr "Підрахунок обʼєктів"
+
+#, c-format
+msgid "unable to get size of %s"
+msgstr "не вдалося отримати розмір %s"
+
+#, c-format
+msgid "unable to parse object header of %s"
+msgstr "не вдалося розібрати заголовок обʼєкта %s"
+
+#, c-format
+msgid "object %s cannot be read"
+msgstr "обʼєкт %s не може бути прочитаний"
+
+#, c-format
+msgid "object %s inconsistent object length (%<PRIuMAX> vs %<PRIuMAX>)"
+msgstr ""
+
+msgid "suboptimal pack - out of memory"
+msgstr ""
+
+#, c-format
+msgid "Delta compression using up to %d threads"
+msgstr ""
+
+#, c-format
+msgid "unable to pack objects reachable from tag %s"
+msgstr "не вдалося запакувати обʼєкти, доступні з тегу %s"
+
+#, c-format
+msgid "unable to get type of object %s"
+msgstr "не вдалося отримати тип обʼєкта %s"
+
+msgid "Compressing objects"
+msgstr "Компресія обʼєктів"
+
+msgid "inconsistency with delta count"
+msgstr ""
+
+#, c-format
+msgid ""
+"value of uploadpack.blobpackfileuri must be of the form '<object-hash> <pack-"
+"hash> <uri>' (got '%s')"
+msgstr ""
+
+#, c-format
+msgid ""
+"object already configured in another uploadpack.blobpackfileuri (got '%s')"
+msgstr ""
+
+#, c-format
+msgid "could not get type of object %s in pack %s"
+msgstr "не вдалося отримати тип обʼєкта %s у пакунку %s"
+
+#, c-format
+msgid "could not find pack '%s'"
+msgstr "не вдалося знайти пакунок \"%s\""
+
+#, c-format
+msgid "packfile %s cannot be accessed"
+msgstr ""
+
+msgid "Enumerating cruft objects"
+msgstr "Перерахування марних обʼєктів"
+
+msgid "unable to add cruft objects"
+msgstr "не вдалося додати марні обʼєкти"
+
+msgid "Traversing cruft objects"
+msgstr "Проходження по марним обʼєктам"
+
+#, c-format
+msgid ""
+"expected edge object ID, got garbage:\n"
+" %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"expected object ID, got garbage:\n"
+" %s"
+msgstr ""
+
+msgid "could not load cruft pack .mtimes"
+msgstr ""
+
+msgid "cannot open pack index"
+msgstr "не вдалося відкрити індекс пакунка"
+
+#, c-format
+msgid "loose object at %s could not be examined"
+msgstr ""
+
+msgid "unable to force loose object"
+msgstr "не вдалося примусово вивільнити обʼєкт"
+
+#, c-format
+msgid "not a rev '%s'"
+msgstr ""
+
+#, c-format
+msgid "bad revision '%s'"
+msgstr "невірна ревізія \"%s\""
+
+msgid "unable to add recent objects"
+msgstr "не вдалося додати нещодавні обʼєкти"
+
+#, c-format
+msgid "unsupported index version %s"
+msgstr ""
+
+#, c-format
+msgid "bad index version '%s'"
+msgstr "невірна версія індексу \"%s\""
+
+msgid "show progress meter during object writing phase"
+msgstr ""
+
+msgid "similar to --all-progress when progress meter is shown"
+msgstr ""
+
+msgid "<version>[,<offset>]"
+msgstr ""
+
+msgid "write the pack index file in the specified idx format version"
+msgstr ""
+
+msgid "maximum size of each output pack file"
+msgstr ""
+
+msgid "ignore borrowed objects from alternate object store"
+msgstr ""
+
+msgid "ignore packed objects"
+msgstr "ігнорувати запаковані обʼєкти"
+
+msgid "limit pack window by objects"
+msgstr ""
+
+msgid "limit pack window by memory in addition to object limit"
+msgstr ""
+
+msgid "maximum length of delta chain allowed in the resulting pack"
+msgstr ""
+
+msgid "reuse existing deltas"
+msgstr "повторно використати існуючі дельти"
+
+msgid "reuse existing objects"
+msgstr "повторно використати існуючі обʼєкти"
+
+msgid "use OFS_DELTA objects"
+msgstr ""
+
+msgid "use threads when searching for best delta matches"
+msgstr ""
+
+msgid "do not create an empty pack output"
+msgstr "не створювати вивід порожнього пакунка"
+
+msgid "read revision arguments from standard input"
+msgstr ""
+
+msgid "limit the objects to those that are not yet packed"
+msgstr ""
+
+msgid "include objects reachable from any reference"
+msgstr ""
+
+msgid "include objects referred by reflog entries"
+msgstr ""
+
+msgid "include objects referred to by the index"
+msgstr ""
+
+msgid "read packs from stdin"
+msgstr ""
+
+msgid "output pack to stdout"
+msgstr ""
+
+msgid "include tag objects that refer to objects to be packed"
+msgstr ""
+
+msgid "keep unreachable objects"
+msgstr ""
+
+msgid "pack loose unreachable objects"
+msgstr ""
+
+msgid "unpack unreachable objects newer than <time>"
+msgstr ""
+
+msgid "create a cruft pack"
+msgstr ""
+
+msgid "expire cruft objects older than <time>"
+msgstr ""
+
+msgid "use the sparse reachability algorithm"
+msgstr ""
+
+msgid "create thin packs"
+msgstr "створити тонкі пакунки"
+
+msgid "create packs suitable for shallow fetches"
+msgstr ""
+
+msgid "ignore packs that have companion .keep file"
+msgstr ""
+
+msgid "ignore this pack"
+msgstr "ігнорувати цей пакунок"
+
+msgid "pack compression level"
+msgstr ""
+
+msgid "do not hide commits by grafts"
+msgstr ""
+
+msgid "use a bitmap index if available to speed up counting objects"
+msgstr ""
+
+msgid "write a bitmap index together with the pack index"
+msgstr ""
+
+msgid "write a bitmap index if possible"
+msgstr ""
+
+msgid "handling for missing objects"
+msgstr "обробка для відсутніх обʼєктів"
+
+msgid "do not pack objects in promisor packfiles"
+msgstr ""
+
+msgid "respect islands during delta compression"
+msgstr ""
+
+msgid "protocol"
+msgstr ""
+
+msgid "exclude any configured uploadpack.blobpackfileuri with this protocol"
+msgstr ""
+
+#, c-format
+msgid "delta chain depth %d is too deep, forcing %d"
+msgstr ""
+
+#, c-format
+msgid "pack.deltaCacheLimit is too high, forcing %d"
+msgstr ""
+
+#, c-format
+msgid "bad pack compression level %d"
+msgstr ""
+
+msgid "--max-pack-size cannot be used to build a pack for transfer"
+msgstr ""
+
+msgid "minimum pack size limit is 1 MiB"
+msgstr ""
+
+msgid "--thin cannot be used to build an indexable pack"
+msgstr ""
+
+msgid "cannot use --filter without --stdout"
+msgstr ""
+
+msgid "cannot use --filter with --stdin-packs"
+msgstr ""
+
+msgid "cannot use internal rev list with --stdin-packs"
+msgstr ""
+
+msgid "cannot use internal rev list with --cruft"
+msgstr ""
+
+msgid "cannot use --stdin-packs with --cruft"
+msgstr ""
+
+msgid "cannot use --max-pack-size with --cruft"
+msgstr ""
+
+msgid "Enumerating objects"
+msgstr "Перерахування обʼєктів"
+
+#, c-format
+msgid ""
+"Total %<PRIu32> (delta %<PRIu32>), reused %<PRIu32> (delta %<PRIu32>), pack-"
+"reused %<PRIu32>"
+msgstr ""
+
+msgid ""
+"'git pack-redundant' is nominated for removal.\n"
+"If you still use this command, please add an extra\n"
+"option, '--i-still-use-this', on the command line\n"
+"and let us know you still use it by sending an e-mail\n"
+"to <git@vger.kernel.org>.  Thanks.\n"
+msgstr ""
+
+msgid "refusing to run without --i-still-use-this"
+msgstr ""
+
+msgid "git pack-refs [--all] [--no-prune]"
+msgstr ""
+
+msgid "pack everything"
+msgstr ""
+
+msgid "prune loose refs (default)"
+msgstr "видалити вивільнені посилання (за замовчуванням)"
+
+msgid "git patch-id [--stable | --unstable | --verbatim]"
+msgstr ""
+
+msgid "use the unstable patch-id algorithm"
+msgstr ""
+
+msgid "use the stable patch-id algorithm"
+msgstr ""
+
+msgid "don't strip whitespace from the patch"
+msgstr ""
+
+msgid "git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"
+msgstr ""
+
+msgid "report pruned objects"
+msgstr ""
+
+msgid "expire objects older than <time>"
+msgstr ""
+
+msgid "limit traversal to objects outside promisor packfiles"
+msgstr ""
+
+msgid "cannot prune in a precious-objects repo"
+msgstr "неможливо виконати видалення в precious-objects сховищі"
+
+msgid "git pull [<options>] [<repository> [<refspec>...]]"
+msgstr "git pull [<опції>] [<сховище> [<визначник посилання>...]]"
+
+msgid "control for recursive fetching of submodules"
+msgstr "управління рекурсивним отриманням підмодулів"
+
+msgid "Options related to merging"
+msgstr ""
+
+msgid "incorporate changes by rebasing rather than merging"
+msgstr ""
+
+msgid "allow fast-forward"
+msgstr ""
+
+msgid "control use of pre-merge-commit and commit-msg hooks"
+msgstr ""
+
+msgid "automatically stash/stash pop before and after"
+msgstr ""
+
+msgid "Options related to fetching"
+msgstr ""
+
+msgid "force overwrite of local branch"
+msgstr ""
+
+msgid "number of submodules pulled in parallel"
+msgstr "кількість підмодулів, що затягуються паралельно"
+
+msgid ""
+"There is no candidate for rebasing against among the refs that you just "
+"fetched."
+msgstr ""
+
+msgid ""
+"There are no candidates for merging among the refs that you just fetched."
+msgstr ""
+
+msgid ""
+"Generally this means that you provided a wildcard refspec which had no\n"
+"matches on the remote end."
+msgstr ""
+
+#, c-format
+msgid ""
+"You asked to pull from the remote '%s', but did not specify\n"
+"a branch. Because this is not the default configured remote\n"
+"for your current branch, you must specify a branch on the command line."
+msgstr ""
+
+msgid "You are not currently on a branch."
+msgstr "Наразі ви не на гілці."
+
+msgid "Please specify which branch you want to rebase against."
+msgstr ""
+
+msgid "Please specify which branch you want to merge with."
+msgstr ""
+
+msgid "See git-pull(1) for details."
+msgstr ""
+
+msgid "<remote>"
+msgstr ""
+
+msgid "<branch>"
+msgstr "<гілка>"
+
+msgid "There is no tracking information for the current branch."
+msgstr ""
+
+msgid ""
+"If you wish to set tracking information for this branch you can do so with:"
+msgstr ""
+
+#, c-format
+msgid ""
+"Your configuration specifies to merge with the ref '%s'\n"
+"from the remote, but no such ref was fetched."
+msgstr ""
+
+#, c-format
+msgid "unable to access commit %s"
+msgstr "не вдалося отримати доступ до коміту %s"
+
+msgid "ignoring --verify-signatures for rebase"
+msgstr ""
+
+msgid ""
+"You have divergent branches and need to specify how to reconcile them.\n"
+"You can do so by running one of the following commands sometime before\n"
+"your next pull:\n"
+"\n"
+"  git config pull.rebase false  # merge\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"
+msgstr ""
+
+msgid "Updating an unborn branch with changes added to the index."
+msgstr ""
+
+msgid "pull with rebase"
+msgstr ""
+
+msgid "Please commit or stash them."
+msgstr ""
+
+#, c-format
+msgid ""
+"fetch updated the current branch head.\n"
+"fast-forwarding your working tree from\n"
+"commit %s."
+msgstr ""
+
+#, c-format
+msgid ""
+"Cannot fast-forward your working tree.\n"
+"After making sure that you saved anything precious from\n"
+"$ git diff %s\n"
+"output, run\n"
+"$ git reset --hard\n"
+"to recover."
+msgstr ""
+
+msgid "Cannot merge multiple branches into empty head."
+msgstr ""
+
+msgid "Cannot rebase onto multiple branches."
+msgstr ""
+
+msgid "Cannot fast-forward to multiple branches."
+msgstr ""
+
+msgid "Need to specify how to reconcile divergent branches."
+msgstr ""
+
+msgid "cannot rebase with locally recorded submodule modifications"
+msgstr ""
+
+msgid "git push [<options>] [<repository> [<refspec>...]]"
+msgstr "git push [<опції>] [<сховище> [<визначник посилання>...]]"
+
+msgid "tag shorthand without <tag>"
+msgstr "скорочення тегу без <тег>"
+
+msgid "--delete only accepts plain target ref names"
+msgstr "--delete приймає лише прості назви посилань"
+
+msgid ""
+"\n"
+"To choose either option permanently, see push.default in 'git help config'.\n"
+msgstr ""
+"\n"
+"Щоб обрати будь-яку з опцій постійною, скористайтесь опцією push.default у "
+"'git help config'.\n"
+
+msgid ""
+"\n"
+"To avoid automatically configuring an upstream branch when its name\n"
+"won't match the local branch, see option 'simple' of branch.autoSetupMerge\n"
+"in 'git help config'.\n"
+msgstr ""
+"\n"
+"Щоб уникнути автоматичного налаштування гілки перводжерельного сховища, якщо "
+"її назва\n"
+"не збігається з назвою локальної гілки, скористайтесь опцією 'simple' для "
+"branch.autoSetupMerge\n"
+"у “git help config”.\n"
+
+#, c-format
+msgid ""
+"The upstream branch of your current branch does not match\n"
+"the name of your current branch.  To push to the upstream branch\n"
+"on the remote, use\n"
+"\n"
+"    git push %s HEAD:%s\n"
+"\n"
+"To push to the branch of the same name on the remote, use\n"
+"\n"
+"    git push %s HEAD\n"
+"%s%s"
+msgstr ""
+"Назва гілки перводжерельного сховища для вашої поточної гілки не збігається "
+"з\n"
+"назвою вашої поточної гілки.  Щоб надіслати до гілки\n"
+"першоджерельного сховища, скористайтесь командою\n"
+"\n"
+"    git push %s HEAD:%s\n"
+"\n"
+"Щоб надіслати до однойменної гілки на віддаленому сервері скористайтесь\n"
+"\n"
+"    git push %s HEAD\n"
+"%s%s"
+
+#, c-format
+msgid ""
+"You are not currently on a branch.\n"
+"To push the history leading to the current (detached HEAD)\n"
+"state now, use\n"
+"\n"
+"    git push %s HEAD:<name-of-remote-branch>\n"
+msgstr ""
+"Ви зараз не перебуваєте на гілці.\n"
+"Щоб надіслати історію, що веде до поточного (відокремленого HEAD)\n"
+"стану, скористайтесь командою\n"
+"\n"
+"    git push %s HEAD:<назва-віддаленої-гілки>\n"
+
+msgid ""
+"\n"
+"To have this happen automatically for branches without a tracking\n"
+"upstream, see 'push.autoSetupRemote' in 'git help config'.\n"
+msgstr ""
+"\n"
+"Щоб це відбувалося автоматично для невідстежуваних гілок\n"
+"першоджерельного сховища, дивіться 'push.autoSetupRemote' у 'git help "
+"config'.\n"
+
+#, c-format
+msgid ""
+"The current branch %s has no upstream branch.\n"
+"To push the current branch and set the remote as upstream, use\n"
+"\n"
+"    git push --set-upstream %s %s\n"
+"%s"
+msgstr ""
+"Поточна гілка %s не має гілки у першоджeрельному сховищі.\n"
+"Щоб надіслати поточну гілку і встановити віддалене призначення "
+"першоджерельним сховищем, скористайтеся\n"
+"\n"
+"    git push --set-upstream %s %s\n"
+"%s"
+
+#, c-format
+msgid "The current branch %s has multiple upstream branches, refusing to push."
+msgstr "Поточна гілка %s має декілька висхідних гілок, відмова надсилання."
+
+msgid ""
+"You didn't specify any refspecs to push, and push.default is \"nothing\"."
+msgstr ""
+"Ви не вказали жодних визначників посилань для надсилання, і push.default "
+"дорівнює \"nothing\"."
+
+#, c-format
+msgid ""
+"You are pushing to remote '%s', which is not the upstream of\n"
+"your current branch '%s', without telling me what to push\n"
+"to update which remote branch."
+msgstr ""
+"Ви надсилаєте до віддаленої гілки '%s', яка не є першоджерелом\n"
+"вашої поточної гілки '%s', не кажучі мені, що надсилати\n"
+"і яку віддалену гілку оновлювати."
+
+msgid ""
+"Updates were rejected because the tip of your current branch is behind\n"
+"its remote counterpart. Integrate the remote changes (e.g.\n"
+"'git pull ...') before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
+msgstr ""
+"Оновлення було відхилено, оскільки верхівка вашої поточної гілки знаходиться "
+"позаду\n"
+"її віддаленого аналога. Інтегруйте віддалені зміни (наприклад, через\n"
+"'git pull ...') перед повторним надсиланням.\n"
+"Докладніше у \"Примітці про перемотування\" команди \"git push --help\"."
+
+msgid ""
+"Updates were rejected because a pushed branch tip is behind its remote\n"
+"counterpart. Check out this branch and integrate the remote changes\n"
+"(e.g. 'git pull ...') before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
+msgstr ""
+"Оновлення було відхилено, оскільки верхівка вашої поточної гілки знаходиться "
+"позаду\n"
+"її віддаленого аналога. Стягнить цю гілку та інтегруйте віддалені зміни\n"
+"(наприклад, через 'git pull...') перед повторним надсиланням.\n"
+"Докладніше у \"Примітці про перемотування\" команди \"git push --help\"."
+
+msgid ""
+"Updates were rejected because the remote contains work that you do\n"
+"not have locally. This is usually caused by another repository pushing\n"
+"to the same ref. You may want to first integrate the remote changes\n"
+"(e.g., 'git pull ...') before pushing again.\n"
+"See the 'Note about fast-forwards' in 'git push --help' for details."
+msgstr ""
+"Оновлення було відхилено, оскільки у віддаленому сховищі міститься робота, "
+"якої\n"
+"немає локально. Зазвичай це стається, коли інше сховище надсилає\n"
+"до того самого посилання. Можливо, вам слід спочатку інтегрувати віддалені "
+"зміни\n"
+"(наприклад, через 'git pull ...') перед повторним надсиланням.\n"
+"Докладніше у \"Примітці про перемотування\" команди \"git push --help\"."
+
+msgid "Updates were rejected because the tag already exists in the remote."
+msgstr ""
+"Оновлення було відхилено, оскільки тег вже існує на віддаленому сховищі."
+
+msgid ""
+"You cannot update a remote ref that points at a non-commit object,\n"
+"or update a remote ref to make it point at a non-commit object,\n"
+"without using the '--force' option.\n"
+msgstr ""
+"Ви не можете оновити віддалене посилання, яке вказує на об’єкт, що не є "
+"об’єктом коміту,\n"
+"або оновити віддалене посилання так, щоб воно вказувало на об’єкт, що не є "
+"об’єктом коміту,\n"
+"без використання опції '--force'.\n"
+
+msgid ""
+"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"
+msgstr ""
+"Оновлення було відхилено, оскільки верхівка віддалено відстежуваної \n"
+"гілки була оновлена з моменту останнього стягування. Можливо, ви захочете\n"
+"інтегрувати ці зміни локально (наприклад, через 'git pull ...')\n"
+"перед примусовим оновленням.\n"
+
+#, c-format
+msgid "Pushing to %s\n"
+msgstr "Надсилання до %s\n"
+
+#, c-format
+msgid "failed to push some refs to '%s'"
+msgstr "не вдалося надіслати деякі посилання до '%s'"
+
+msgid ""
+"recursing into submodule with push.recurseSubmodules=only; using on-demand "
+"instead"
+msgstr ""
+"рекурсія в підмодулі з push.recurseSubmodules=only; натомість використовую "
+"on-demand"
+
+#, c-format
+msgid "invalid value for '%s'"
+msgstr "неприпустиме значення для '%s'"
+
+msgid "repository"
+msgstr "сховище"
+
+msgid "push all branches"
+msgstr "надіслати всі гілки"
+
+msgid "mirror all refs"
+msgstr "віддзеркалити всі посилання"
+
+msgid "delete refs"
+msgstr "видалити посилання"
+
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "надіслати теги (не може бути використано з --all, --branches або --mirror)"
+
+msgid "force updates"
+msgstr "оновити примусово"
+
+msgid "<refname>:<expect>"
+msgstr "<refname>:<expect>"
+
+msgid "require old value of ref to be at this value"
+msgstr "вимагати, щоб старе значення посилання було рівним цьому значенню"
+
+msgid "require remote updates to be integrated locally"
+msgstr "вимагати локальної інтеграції віддалених оновлень"
+
+msgid "control recursive pushing of submodules"
+msgstr "контролювати рекурсивне надсилання підмодулів"
+
+msgid "use thin pack"
+msgstr "використовуйте тонке пакування"
+
+msgid "receive pack program"
+msgstr "отримати пакетну програму"
+
+msgid "set upstream for git pull/status"
+msgstr "встановити першоджерельне сховище для git pull/status"
+
+msgid "prune locally removed refs"
+msgstr "обрізати локально видалені посилання"
+
+msgid "bypass pre-push hook"
+msgstr "обійти pre-push гачок"
+
+msgid "push missing but relevant tags"
+msgstr "надсилання відсутнє, але є релевантні теги"
+
+msgid "GPG sign the push"
+msgstr "підписати надсилання за допомогою GPG"
+
+msgid "request atomic transaction on remote side"
+msgstr "запросити атомарну транзакцію на віддаленій стороні"
+
+msgid "--delete doesn't make sense without any refs"
+msgstr "--delete не має сенсу без рефів"
+
+#, c-format
+msgid "bad repository '%s'"
+msgstr "невірне сховище \"%s\""
+
+msgid ""
+"No configured push destination.\n"
+"Either specify the URL from the command-line or configure a remote "
+"repository using\n"
+"\n"
+"    git remote add <name> <url>\n"
+"\n"
+"and then push using the remote name\n"
+"\n"
+"    git push <name>\n"
+msgstr ""
+"Немає налаштованого місця призначення надсилання.\n"
+"Або зазначте URL-адресу з командного рядка, або налаштуйте віддалене сховище "
+"за допомогою\n"
+"\n"
+"    git remote add <назва> <адреса>\n"
+"\n"
+"а потім виконайте надсилання, використовуючи назву віддаленого сховища\n"
+"\n"
+"    git push <ім'я>\n"
+
+msgid "--all can't be combined with refspecs"
+msgstr "--all не можна комбінувати з визначниками посилань"
+
+msgid "--mirror can't be combined with refspecs"
+msgstr "--mirror не можна комбінувати з визначниками посилань"
+
+msgid "push options must not have new line characters"
+msgstr "опції push не можуть містити символи нового рядка"
+
+msgid "git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"
+msgstr ""
+
+msgid "git range-diff [<options>] <old-tip>...<new-tip>"
+msgstr ""
+
+msgid "git range-diff [<options>] <base> <old-tip> <new-tip>"
+msgstr ""
+
+msgid "use simple diff colors"
+msgstr ""
+
+msgid "notes"
+msgstr ""
+
+msgid "passed to 'git log'"
+msgstr ""
+
+msgid "only emit output related to the first range"
+msgstr ""
+
+msgid "only emit output related to the second range"
+msgstr ""
+
+#, c-format
+msgid "not a revision: '%s'"
+msgstr "не є ревізією: \"%s\""
+
+#, c-format
+msgid "not a commit range: '%s'"
+msgstr "не діапазон комітів: \"%s\""
+
+#, c-format
+msgid "not a symmetric range: '%s'"
+msgstr "не симетричний діапазон: \"%s\""
+
+msgid "need two commit ranges"
+msgstr "потрібно два діапазони комітів"
+
+msgid ""
+"git read-tree [(-m [--trivial] [--aggressive] | --reset | --"
+"prefix=<prefix>)\n"
+"              [-u | -i]] [--index-output=<file>] [--no-sparse-checkout]\n"
+"              (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])"
+msgstr ""
+
+msgid "write resulting index to <file>"
+msgstr ""
+
+msgid "only empty the index"
+msgstr "тільки очистити індекс"
+
+msgid "Merging"
+msgstr ""
+
+msgid "perform a merge in addition to a read"
+msgstr "виконати злиття на додачу до читання"
+
+msgid "3-way merge if no file level merging required"
+msgstr ""
+
+msgid "3-way merge in presence of adds and removes"
+msgstr ""
+
+msgid "same as -m, but discard unmerged entries"
+msgstr "те саме, що й -m, але відкидає незлиті записи"
+
+msgid "<subdirectory>/"
+msgstr ""
+
+msgid "read the tree into the index under <subdirectory>/"
+msgstr ""
+
+msgid "update working tree with merge result"
+msgstr ""
+
+msgid "gitignore"
+msgstr ""
+
+msgid "allow explicitly ignored files to be overwritten"
+msgstr ""
+
+msgid "don't check the working tree after merging"
+msgstr "не перевіряти робоче дерево після злиття"
+
+msgid "don't update the index or the work tree"
+msgstr ""
+
+msgid "skip applying sparse checkout filter"
+msgstr "пропустити застосування sparse checkout фільтра"
+
+msgid "debug unpack-trees"
+msgstr ""
+
+msgid "suppress feedback messages"
+msgstr ""
+
+msgid "You need to resolve your current index first"
+msgstr "Спочатку вам потрібно розвʼязати поточний індекс"
+
+msgid ""
+"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase> | --keep-base] "
+"[<upstream> [<branch>]]"
+msgstr ""
+
+msgid ""
+"git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]"
+msgstr ""
+
+#, c-format
+msgid "could not read '%s'."
+msgstr "не вдалося прочитати \"%s\"."
+
+#, c-format
+msgid "could not create temporary %s"
+msgstr "не вдалося створити тимчасовий %s"
+
+msgid "could not mark as interactive"
+msgstr "не вдалося позначити як інтерактивний"
+
+msgid "could not generate todo list"
+msgstr "не вдалося створити список справ"
+
+msgid "a base commit must be provided with --upstream or --onto"
+msgstr ""
+
+#, c-format
+msgid "%s requires the merge backend"
+msgstr ""
+
+#, c-format
+msgid "invalid onto: '%s'"
+msgstr "неприпустимий onto: \"%s\""
+
+#, c-format
+msgid "invalid orig-head: '%s'"
+msgstr "неприпустимий orig-head: \"%s\""
+
+#, c-format
+msgid "ignoring invalid allow_rerere_autoupdate: '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not remove '%s'"
+msgstr "не вдалося видалити \"%s\""
+
+msgid ""
+"Resolve all conflicts manually, mark them as resolved with\n"
+"\"git add/rm <conflicted_files>\", then run \"git rebase --continue\".\n"
+"You can instead skip this commit: run \"git rebase --skip\".\n"
+"To abort and get back to the state before \"git rebase\", run \"git rebase --"
+"abort\"."
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"git encountered an error while preparing the patches to replay\n"
+"these revisions:\n"
+"\n"
+"    %s\n"
+"\n"
+"As a result, git cannot rebase them."
+msgstr ""
+
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr ""
+
+#, c-format
+msgid "could not switch to %s"
+msgstr "не вдалося переключитись на %s"
+
+msgid "apply options and merge options cannot be used together"
+msgstr "apply опції не можна використовувати разом з merge опціями"
+
+#, c-format
+msgid ""
+"unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and "
+"\"ask\"."
+msgstr ""
+
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+
+#, c-format
+msgid ""
+"%s\n"
+"Please specify which branch you want to rebase against.\n"
+"See git-rebase(1) for details.\n"
+"\n"
+"    git rebase '<branch>'\n"
+"\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"If you wish to set tracking information for this branch you can do so with:\n"
+"\n"
+"    git branch --set-upstream-to=%s/<branch> %s\n"
+"\n"
+msgstr ""
+"Якщо ви бажаєте налаштувати відстежування для цієї гілки, ви можете зробити "
+"це за допомогою:\n"
+"\n"
+"    git branch --set-upstream-to=%s/<гілка> %s\n"
+"\n"
+
+msgid "exec commands cannot contain newlines"
+msgstr ""
+
+msgid "empty exec command"
+msgstr ""
+
+msgid "rebase onto given branch instead of upstream"
+msgstr ""
+
+msgid "use the merge-base of upstream and branch as the current base"
+msgstr ""
+
+msgid "allow pre-rebase hook to run"
+msgstr ""
+
+msgid "be quiet. implies --no-stat"
+msgstr ""
+
+msgid "display a diffstat of what changed upstream"
+msgstr ""
+
+msgid "do not show diffstat of what changed upstream"
+msgstr ""
+
+msgid "add a Signed-off-by trailer to each commit"
+msgstr ""
+
+msgid "make committer date match author date"
+msgstr ""
+
+msgid "ignore author date and use current date"
+msgstr ""
+
+msgid "synonym of --reset-author-date"
+msgstr ""
+
+msgid "passed to 'git apply'"
+msgstr ""
+
+msgid "ignore changes in whitespace"
+msgstr ""
+
+msgid "cherry-pick all commits, even if unchanged"
+msgstr ""
+
+msgid "continue"
+msgstr ""
+
+msgid "skip current patch and continue"
+msgstr ""
+
+msgid "abort and check out the original branch"
+msgstr "перервати і перейти до початкової гілки"
+
+msgid "abort but keep HEAD where it is"
+msgstr ""
+
+msgid "edit the todo list during an interactive rebase"
+msgstr ""
+
+msgid "show the patch file being applied or merged"
+msgstr ""
+
+msgid "use apply strategies to rebase"
+msgstr ""
+
+msgid "use merging strategies to rebase"
+msgstr ""
+
+msgid "let the user edit the list of commits to rebase"
+msgstr ""
+
+msgid "(REMOVED) was: try to recreate merges instead of ignoring them"
+msgstr ""
+
+msgid "how to handle commits that become empty"
+msgstr ""
+
+msgid "keep commits which start empty"
+msgstr ""
+
+msgid "move commits that begin with squash!/fixup! under -i"
+msgstr ""
+
+msgid "update branches that point to commits that are being rebased"
+msgstr ""
+
+msgid "add exec lines after each commit of the editable list"
+msgstr ""
+
+msgid "allow rebasing commits with empty messages"
+msgstr ""
+
+msgid "try to rebase merges instead of skipping them"
+msgstr ""
+
+msgid "use 'merge-base --fork-point' to refine upstream"
+msgstr ""
+"використовуйте \"merge-base --fork-point\" для уточнення першоджерельного "
+"сховища"
+
+msgid "use the given merge strategy"
+msgstr ""
+
+msgid "option"
+msgstr ""
+
+msgid "pass the argument through to the merge strategy"
+msgstr ""
+
+msgid "rebase all reachable commits up to the root(s)"
+msgstr ""
+
+msgid "automatically re-schedule any `exec` that fails"
+msgstr ""
+
+msgid "apply all changes, even those already present upstream"
+msgstr ""
+
+msgid "It looks like 'git am' is in progress. Cannot rebase."
+msgstr ""
+
+msgid ""
+"`rebase --preserve-merges` (-p) is no longer supported.\n"
+"Use `git rebase --abort` to terminate current rebase.\n"
+"Or downgrade to v2.33, or earlier, to complete the rebase."
+msgstr ""
+
+msgid ""
+"--preserve-merges was replaced by --rebase-merges\n"
+"Note: Your `pull.rebase` configuration may also be set to 'preserve',\n"
+"which is no longer supported; use 'merges' instead"
+msgstr ""
+
+msgid "No rebase in progress?"
+msgstr "Перебазування не відбувається?"
+
+msgid "The --edit-todo action can only be used during interactive rebase."
+msgstr ""
+
+msgid "Cannot read HEAD"
+msgstr ""
+
+msgid ""
+"You must edit all merge conflicts and then\n"
+"mark them as resolved using git add"
+msgstr ""
+
+msgid "could not discard worktree changes"
+msgstr "не вдалося відкинути зміни робочого дерева"
+
+#, c-format
+msgid "could not move back to %s"
+msgstr "не вдалося повернутися до %s"
+
+#, c-format
+msgid ""
+"It seems that there is already a %s directory, and\n"
+"I wonder if you are in the middle of another rebase.  If that is the\n"
+"case, please try\n"
+"\t%s\n"
+"If that is not the case, please\n"
+"\t%s\n"
+"and run me again.  I am stopping in case you still have something\n"
+"valuable there.\n"
+msgstr ""
+
+msgid "switch `C' expects a numerical value"
+msgstr ""
+
+msgid "--strategy requires --merge or --interactive"
+msgstr ""
+
+msgid ""
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
+"autosquash"
+msgstr ""
+
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr ""
+
+msgid ""
+"apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
+"update-refs"
+msgstr ""
+
+#, c-format
+msgid "Unknown rebase backend: %s"
+msgstr ""
+
+msgid "--reschedule-failed-exec requires --exec or --interactive"
+msgstr ""
+
+#, c-format
+msgid "invalid upstream '%s'"
+msgstr "неприпустиме першоджерельне сховище \"%s\""
+
+msgid "Could not create new root commit"
+msgstr "Не вдалося створити новий кореневий коміт"
+
+#, c-format
+msgid "no such branch/commit '%s'"
+msgstr "немає такої гілки/коміту \"%s\""
+
+#, c-format
+msgid "No such ref: %s"
+msgstr "Немає такого посилання: %s"
+
+msgid "Could not resolve HEAD to a commit"
+msgstr "Не вдалося розвʼязати HEAD у коміт"
+
+#, c-format
+msgid "'%s': need exactly one merge base with branch"
+msgstr ""
+
+#, c-format
+msgid "'%s': need exactly one merge base"
+msgstr ""
+
+#, c-format
+msgid "Does not point to a valid commit '%s'"
+msgstr "Не вказує на припустимий коміт \"%s\""
+
+msgid "HEAD is up to date."
+msgstr "HEAD знаходиться в актуальному стані."
+
+#, c-format
+msgid "Current branch %s is up to date.\n"
+msgstr "Поточна гілка %s знаходиться в актуальному стані.\n"
+
+msgid "HEAD is up to date, rebase forced."
+msgstr ""
+
+#, c-format
+msgid "Current branch %s is up to date, rebase forced.\n"
+msgstr ""
+"Поточна гілка %s знаходиться в актуальному стані, перебазовуйте примусово.\n"
+
+msgid "The pre-rebase hook refused to rebase."
+msgstr ""
+
+#, c-format
+msgid "Changes to %s:\n"
+msgstr "Зміни у %s:\n"
+
+#, c-format
+msgid "Changes from %s to %s:\n"
+msgstr ""
+
+#, c-format
+msgid "First, rewinding head to replay your work on top of it...\n"
+msgstr ""
+
+msgid "Could not detach HEAD"
+msgstr "Не вдалося відʼєднати HEAD"
+
+#, c-format
+msgid "Fast-forwarded %s to %s.\n"
+msgstr ""
+
+msgid "git receive-pack <git-dir>"
+msgstr "git receive-pack <git-директорія>"
+
+msgid ""
+"By default, updating the current branch in a non-bare repository\n"
+"is denied, because it will make the index and work tree inconsistent\n"
+"with what you pushed, and will require 'git reset --hard' to match\n"
+"the work tree to HEAD.\n"
+"\n"
+"You can set the 'receive.denyCurrentBranch' configuration variable\n"
+"to 'ignore' or 'warn' in the remote repository to allow pushing into\n"
+"its current branch; however, this is not recommended unless you\n"
+"arranged to update its work tree to match what you pushed in some\n"
+"other way.\n"
+"\n"
+"To squelch this message and still keep the default behaviour, set\n"
+"'receive.denyCurrentBranch' configuration variable to 'refuse'."
+msgstr ""
+
+msgid ""
+"By default, deleting the current branch is denied, because the next\n"
+"'git clone' won't result in any file checked out, causing confusion.\n"
+"\n"
+"You can set 'receive.denyDeleteCurrent' configuration variable to\n"
+"'warn' or 'ignore' in the remote repository to allow deleting the\n"
+"current branch, with or without a warning message.\n"
+"\n"
+"To squelch this message, you can set it to 'refuse'."
+msgstr ""
+
+msgid "quiet"
+msgstr ""
+
+msgid "you must specify a directory"
+msgstr "необхідно вказати директорію"
+
+msgid "git reflog [show] [<log-options>] [<ref>]"
+msgstr "git reflog [show] [<лог-опції>] [<посилання>]"
+
+msgid ""
+"git reflog expire [--expire=<time>] [--expire-unreachable=<time>]\n"
+"                  [--rewrite] [--updateref] [--stale-fix]\n"
+"                  [--dry-run | -n] [--verbose] [--all [--single-worktree] | "
+"<refs>...]"
+msgstr ""
+
+msgid ""
+"git reflog delete [--rewrite] [--updateref]\n"
+"                  [--dry-run | -n] [--verbose] <ref>@{<specifier>}..."
+msgstr ""
+
+msgid "git reflog exists <ref>"
+msgstr ""
+
+#, c-format
+msgid "invalid timestamp '%s' given to '--%s'"
+msgstr "неприпустима позначка часу \"%s\" передана до \"--%s\""
+
+msgid "do not actually prune any entries"
+msgstr ""
+
+msgid ""
+"rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"
+msgstr ""
+
+msgid "update the reference to the value of the top reflog entry"
+msgstr ""
+
+msgid "print extra information on screen"
+msgstr ""
+
+msgid "timestamp"
+msgstr "позначка часу"
+
+msgid "prune entries older than the specified time"
+msgstr ""
+
+msgid ""
+"prune entries older than <time> that are not reachable from the current tip "
+"of the branch"
+msgstr ""
+
+msgid "prune any reflog entries that point to broken commits"
+msgstr ""
+
+msgid "process the reflogs of all references"
+msgstr ""
+
+msgid "limits processing to reflogs from the current worktree only"
+msgstr ""
+
+#, c-format
+msgid "Marking reachable objects..."
+msgstr ""
+
+#, c-format
+msgid "%s points nowhere!"
+msgstr ""
+
+msgid "no reflog specified to delete"
+msgstr ""
+
+#, c-format
+msgid "invalid ref format: %s"
+msgstr "неприпустимий формат посилання: %s"
+
+msgid ""
+"git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--"
+"mirror=<fetch|push>] <name> <url>"
+msgstr ""
+
+msgid "git remote rename [--[no-]progress] <old> <new>"
+msgstr ""
+
+msgid "git remote remove <name>"
+msgstr ""
+
+msgid "git remote set-head <name> (-a | --auto | -d | --delete | <branch>)"
+msgstr ""
+
+msgid "git remote [-v | --verbose] show [-n] <name>"
+msgstr ""
+
+msgid "git remote prune [-n | --dry-run] <name>"
+msgstr ""
+
+msgid ""
+"git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]"
+msgstr ""
+
+msgid "git remote set-branches [--add] <name> <branch>..."
+msgstr ""
+
+msgid "git remote get-url [--push] [--all] <name>"
+msgstr ""
+
+msgid "git remote set-url [--push] <name> <newurl> [<oldurl>]"
+msgstr ""
+
+msgid "git remote set-url --add <name> <newurl>"
+msgstr ""
+
+msgid "git remote set-url --delete <name> <url>"
+msgstr ""
+
+msgid "git remote add [<options>] <name> <url>"
+msgstr "git remote add [<опції>] <назва> <url>"
+
+msgid "git remote set-branches <name> <branch>..."
+msgstr ""
+
+msgid "git remote set-branches --add <name> <branch>..."
+msgstr ""
+
+msgid "git remote show [<options>] <name>"
+msgstr "git remote show [<опції>] <назва>"
+
+msgid "git remote prune [<options>] <name>"
+msgstr "git remote prune [<опції>] <назва>"
+
+msgid "git remote update [<options>] [<group> | <remote>]..."
+msgstr "git remote update [<опції>] [<група> | <віддаленe-призначення>]..."
+
+#, c-format
+msgid "Updating %s"
+msgstr ""
+
+#, c-format
+msgid "Could not fetch %s"
+msgstr "Не вдалося отримати %s"
+
+msgid ""
+"--mirror is dangerous and deprecated; please\n"
+"\t use --mirror=fetch or --mirror=push instead"
+msgstr ""
+
+#, c-format
+msgid "unknown mirror argument: %s"
+msgstr ""
+
+msgid "fetch the remote branches"
+msgstr ""
+
+msgid "import all tags and associated objects when fetching"
+msgstr ""
+
+msgid "or do not fetch any tag at all (--no-tags)"
+msgstr ""
+
+msgid "branch(es) to track"
+msgstr ""
+
+msgid "master branch"
+msgstr "master гілка"
+
+msgid "set up remote as a mirror to push to or fetch from"
+msgstr ""
+
+msgid "specifying a master branch makes no sense with --mirror"
+msgstr ""
+
+msgid "specifying branches to track makes sense only with fetch mirrors"
+msgstr ""
+
+#, c-format
+msgid "remote %s already exists."
+msgstr "віддалений %s вже існує."
+
+#, c-format
+msgid "Could not setup master '%s'"
+msgstr "Не вдалося налаштувати master \"%s\""
+
+#, c-format
+msgid "more than one %s"
+msgstr ""
+
+#, c-format
+msgid "unhandled branch.%s.rebase=%s; assuming 'true'"
+msgstr ""
+
+#, c-format
+msgid "Could not get fetch map for refspec %s"
+msgstr "Не вдалося забрати карту отримання для визначника посилання %s"
+
+msgid "(matching)"
+msgstr ""
+
+msgid "(delete)"
+msgstr "(видалити)"
+
+#, c-format
+msgid "could not set '%s'"
+msgstr "не вдалося встановити \"%s\""
+
+#, c-format
+msgid "could not unset '%s'"
+msgstr "не вдалося скинути \"%s\""
+
+#, c-format
+msgid ""
+"The %s configuration remote.pushDefault in:\n"
+"\t%s:%d\n"
+"now names the non-existent remote '%s'"
+msgstr ""
+
+#, c-format
+msgid "No such remote: '%s'"
+msgstr "Немає такого віддаленого призначення: \"%s\""
+
+#, c-format
+msgid "Could not rename config section '%s' to '%s'"
+msgstr "Не вдалося перейменувати розділ конфігурації з \"%s\" на \"%s\""
+
+#, c-format
+msgid ""
+"Not updating non-default fetch refspec\n"
+"\t%s\n"
+"\tPlease update the configuration manually if necessary."
+msgstr ""
+
+msgid "Renaming remote references"
+msgstr ""
+
+#, c-format
+msgid "deleting '%s' failed"
+msgstr ""
+
+#, c-format
+msgid "creating '%s' failed"
+msgstr ""
+
+msgid ""
+"Note: A branch outside the refs/remotes/ hierarchy was not removed;\n"
+"to delete it, use:"
+msgid_plural ""
+"Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
+"to delete them, use:"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "Could not remove config section '%s'"
+msgstr "Не вдалося видалити секцію конфігурації \"%s\""
+
+#, c-format
+msgid " new (next fetch will store in remotes/%s)"
+msgstr ""
+
+msgid " tracked"
+msgstr " відстежується"
+
+msgid " skipped"
+msgstr ""
+
+msgid " stale (use 'git remote prune' to remove)"
+msgstr ""
+
+msgid " ???"
+msgstr ""
+
+#, c-format
+msgid "invalid branch.%s.merge; cannot rebase onto > 1 branch"
+msgstr ""
+
+#, c-format
+msgid "rebases interactively onto remote %s"
+msgstr "перебазувати інтерактивно у віддалену %s"
+
+#, c-format
+msgid "rebases interactively (with merges) onto remote %s"
+msgstr ""
+
+#, c-format
+msgid "rebases onto remote %s"
+msgstr ""
+
+#, c-format
+msgid " merges with remote %s"
+msgstr ""
+
+#, c-format
+msgid "merges with remote %s"
+msgstr ""
+
+#, c-format
+msgid "%-*s    and with remote %s\n"
+msgstr ""
+
+msgid "create"
+msgstr ""
+
+msgid "delete"
+msgstr "видалити"
+
+msgid "up to date"
+msgstr "в актуальному стані"
+
+msgid "fast-forwardable"
+msgstr ""
+
+msgid "local out of date"
+msgstr ""
+
+#, c-format
+msgid "    %-*s forces to %-*s (%s)"
+msgstr ""
+
+#, c-format
+msgid "    %-*s pushes to %-*s (%s)"
+msgstr ""
+
+#, c-format
+msgid "    %-*s forces to %s"
+msgstr ""
+
+#, c-format
+msgid "    %-*s pushes to %s"
+msgstr ""
+
+msgid "do not query remotes"
+msgstr ""
+
+#, c-format
+msgid "* remote %s"
+msgstr ""
+
+#, c-format
+msgid "  Fetch URL: %s"
+msgstr ""
+
+msgid "(no URL)"
+msgstr ""
+
+#. TRANSLATORS: the colon ':' should align
+#. with the one in " Fetch URL: %s"
+#. translation.
+#.
+
+#, c-format
+msgid "  Push  URL: %s"
+msgstr ""
+
+#, c-format
+msgid "  HEAD branch: %s"
+msgstr "  HEAD гілка: %s"
+
+msgid "(not queried)"
+msgstr ""
+
+msgid "(unknown)"
+msgstr "(невідомо)"
+
+#, c-format
+msgid ""
+"  HEAD branch (remote HEAD is ambiguous, may be one of the following):\n"
+msgstr ""
+
+#, c-format
+msgid "  Remote branch:%s"
+msgid_plural "  Remote branches:%s"
+msgstr[0] " Віддалена гілка:%s"
+msgstr[1] " Віддалені гілки:%s"
+msgstr[2] " Віддалених гілок:%s"
+
+msgid " (status not queried)"
+msgstr ""
+
+msgid "  Local branch configured for 'git pull':"
+msgid_plural "  Local branches configured for 'git pull':"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "  Local refs will be mirrored by 'git push'"
+msgstr ""
+
+#, c-format
+msgid "  Local ref configured for 'git push'%s:"
+msgid_plural "  Local refs configured for 'git push'%s:"
+msgstr[0] "  Локальне посилання налаштовано для \"git push\"%s:"
+msgstr[1] "  Локальних посилання налаштовано для \"git push\"%s:"
+msgstr[2] "  Локальних посилань налаштовано для \"git push\"%s:"
+
+msgid "set refs/remotes/<name>/HEAD according to remote"
+msgstr ""
+
+msgid "delete refs/remotes/<name>/HEAD"
+msgstr ""
+
+msgid "Cannot determine remote HEAD"
+msgstr ""
+
+msgid "Multiple remote HEAD branches. Please choose one explicitly with:"
+msgstr ""
+
+#, c-format
+msgid "Could not delete %s"
+msgstr "Не вдалося видалити %s"
+
+#, c-format
+msgid "Not a valid ref: %s"
+msgstr "Не є припустимим посиланням: %s"
+
+#, c-format
+msgid "Could not setup %s"
+msgstr "Не вдалося налаштувати %s"
+
+#, c-format
+msgid " %s will become dangling!"
+msgstr ""
+
+#, c-format
+msgid " %s has become dangling!"
+msgstr ""
+
+#, c-format
+msgid "Pruning %s"
+msgstr "Видалення %s"
+
+#, c-format
+msgid "URL: %s"
+msgstr ""
+
+#, c-format
+msgid " * [would prune] %s"
+msgstr ""
+
+#, c-format
+msgid " * [pruned] %s"
+msgstr ""
+
+msgid "prune remotes after fetching"
+msgstr ""
+
+#, c-format
+msgid "No such remote '%s'"
+msgstr "Немає такого віддаленого призначення \"%s\""
+
+msgid "add branch"
+msgstr "додати гілку"
+
+msgid "no remote specified"
+msgstr ""
+
+msgid "query push URLs rather than fetch URLs"
+msgstr ""
+
+msgid "return all URLs"
+msgstr ""
+
+#, c-format
+msgid "no URLs configured for remote '%s'"
+msgstr "не налаштовано URL-адреси для віддаленого \"%s\""
+
+msgid "manipulate push URLs"
+msgstr ""
+
+msgid "add URL"
+msgstr ""
+
+msgid "delete URLs"
+msgstr "видалити URL-адреси"
+
+msgid "--add --delete doesn't make sense"
+msgstr "--add --delete не має сенсу"
+
+#, c-format
+msgid "Invalid old URL pattern: %s"
+msgstr ""
+
+#, c-format
+msgid "No such URL found: %s"
+msgstr ""
+
+msgid "Will not delete all non-push URLs"
+msgstr ""
+
+msgid "be verbose; must be placed before a subcommand"
+msgstr ""
+
+msgid "git repack [<options>]"
+msgstr "git repack [<опції>]"
+
+msgid ""
+"Incremental repacks are incompatible with bitmap indexes.  Use\n"
+"--no-write-bitmap-index or disable the pack.writeBitmaps configuration."
+msgstr ""
+
+msgid "could not start pack-objects to repack promisor objects"
+msgstr ""
+
+msgid "repack: Expecting full hex object ID lines only from pack-objects."
+msgstr ""
+
+msgid "could not finish pack-objects to repack promisor objects"
+msgstr ""
+
+#, c-format
+msgid "cannot open index for %s"
+msgstr "неможливо відкрити індекс для %s"
+
+#, c-format
+msgid "pack %s too large to consider in geometric progression"
+msgstr ""
+
+#, c-format
+msgid "pack %s too large to roll up"
+msgstr ""
+
+#, c-format
+msgid "could not open tempfile %s for writing"
+msgstr ""
+
+msgid "could not close refs snapshot tempfile"
+msgstr ""
+
+#, c-format
+msgid "could not remove stale bitmap: %s"
+msgstr "не вдалося видалити застарілий bitmap: %s"
+
+msgid "pack everything in a single pack"
+msgstr ""
+
+msgid "same as -a, and turn unreachable objects loose"
+msgstr ""
+
+msgid "same as -a, pack unreachable cruft objects separately"
+msgstr ""
+
+msgid "approxidate"
+msgstr ""
+
+msgid "with --cruft, expire objects older than this"
+msgstr ""
+
+msgid "remove redundant packs, and run git-prune-packed"
+msgstr ""
+
+msgid "pass --no-reuse-delta to git-pack-objects"
+msgstr ""
+
+msgid "pass --no-reuse-object to git-pack-objects"
+msgstr ""
+
+msgid "do not run git-update-server-info"
+msgstr ""
+
+msgid "pass --local to git-pack-objects"
+msgstr ""
+
+msgid "write bitmap index"
+msgstr "записати bitmap індекс"
+
+msgid "pass --delta-islands to git-pack-objects"
+msgstr ""
+
+msgid "with -A, do not loosen objects older than this"
+msgstr ""
+
+msgid "with -a, repack unreachable objects"
+msgstr ""
+
+msgid "size of the window used for delta compression"
+msgstr ""
+
+msgid "bytes"
+msgstr ""
+
+msgid "same as the above, but limit memory size instead of entries count"
+msgstr ""
+
+msgid "limits the maximum delta depth"
+msgstr ""
+
+msgid "limits the maximum number of threads"
+msgstr ""
+
+msgid "maximum size of each packfile"
+msgstr ""
+
+msgid "repack objects in packs marked with .keep"
+msgstr ""
+
+msgid "do not repack this pack"
+msgstr ""
+
+msgid "find a geometric progression with factor <N>"
+msgstr ""
+
+msgid "write a multi-pack index of the resulting packs"
+msgstr ""
+
+msgid "pack prefix to store a pack containing pruned objects"
+msgstr ""
+
+msgid "cannot delete packs in a precious-objects repo"
+msgstr ""
+
+msgid "Nothing new to pack."
+msgstr ""
+
+#, c-format
+msgid "pack prefix %s does not begin with objdir %s"
+msgstr "префікс пакунку %s не починається з objdir %s"
+
+#, c-format
+msgid "renaming pack to '%s' failed"
+msgstr ""
+
+#, c-format
+msgid "pack-objects did not write a '%s' file for pack %s-%s"
+msgstr ""
+
+#, c-format
+msgid "could not unlink: %s"
+msgstr "не вдалося відʼєднати %s"
+
+msgid "git replace [-f] <object> <replacement>"
+msgstr ""
+
+msgid "git replace [-f] --edit <object>"
+msgstr ""
+
+msgid "git replace [-f] --graft <commit> [<parent>...]"
+msgstr ""
+
+msgid "git replace -d <object>..."
+msgstr ""
+
+msgid "git replace [--format=<format>] [-l [<pattern>]]"
+msgstr ""
+
+#, c-format
+msgid ""
+"invalid replace format '%s'\n"
+"valid formats are 'short', 'medium' and 'long'"
+msgstr ""
+
+#, c-format
+msgid "replace ref '%s' not found"
+msgstr ""
+
+#, c-format
+msgid "Deleted replace ref '%s'"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a valid ref name"
+msgstr "\"%s\" не є припустимою назвою посилання"
+
+#, c-format
+msgid "replace ref '%s' already exists"
+msgstr "змінний ref \"%s\" вже існує"
+
+#, c-format
+msgid ""
+"Objects must be of the same type.\n"
+"'%s' points to a replaced object of type '%s'\n"
+"while '%s' points to a replacement object of type '%s'."
+msgstr ""
+
+#, c-format
+msgid "unable to open %s for writing"
+msgstr "не вдалося відкрити %s для запису"
+
+msgid "cat-file reported failure"
+msgstr ""
+
+#, c-format
+msgid "unable to open %s for reading"
+msgstr "не вдалося відкрити %s для читання"
+
+msgid "unable to spawn mktree"
+msgstr "не вдалося породити mktree"
+
+msgid "unable to read from mktree"
+msgstr "не вдалося прочитати з mktree"
+
+msgid "mktree reported failure"
+msgstr ""
+
+msgid "mktree did not return an object name"
+msgstr "mktree не повернув назву обʼєкта"
+
+#, c-format
+msgid "unable to fstat %s"
+msgstr "не вдалося виконати fstat %s"
+
+msgid "unable to write object to database"
+msgstr "не вдалося записати обʼєкт до бази даних"
+
+#, c-format
+msgid "unable to get object type for %s"
+msgstr "не вдалося отримати тип обʼєкта для %s"
+
+msgid "editing object file failed"
+msgstr ""
+
+#, c-format
+msgid "new object is the same as the old one: '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not parse %s as a commit"
+msgstr "не вдалося розібрати %s як коміт"
+
+#, c-format
+msgid "bad mergetag in commit '%s'"
+msgstr "неправильний mergetag в коміті \"%s\""
+
+#, c-format
+msgid "malformed mergetag in commit '%s'"
+msgstr ""
+
+#, c-format
+msgid ""
+"original commit '%s' contains mergetag '%s' that is discarded; use --edit "
+"instead of --graft"
+msgstr ""
+
+#, c-format
+msgid "the original commit '%s' has a gpg signature"
+msgstr ""
+
+msgid "the signature will be removed in the replacement commit!"
+msgstr ""
+
+#, c-format
+msgid "could not write replacement commit for: '%s'"
+msgstr "не вдалося записати коміт заміни для: \"%s\""
+
+#, c-format
+msgid "graft for '%s' unnecessary"
+msgstr ""
+
+#, c-format
+msgid "new commit is the same as the old one: '%s'"
+msgstr ""
+
+#, c-format
+msgid ""
+"could not convert the following graft(s):\n"
+"%s"
+msgstr ""
+
+msgid "list replace refs"
+msgstr ""
+
+msgid "delete replace refs"
+msgstr "видалити змінні посилання"
+
+msgid "edit existing object"
+msgstr "редагувати існуючий обʼєкт"
+
+msgid "change a commit's parents"
+msgstr ""
+
+msgid "convert existing graft file"
+msgstr ""
+
+msgid "replace the ref if it exists"
+msgstr ""
+
+msgid "do not pretty-print contents for --edit"
+msgstr ""
+
+msgid "use this format"
+msgstr "використати цей формат"
+
+msgid "--format cannot be used when not listing"
+msgstr "--format не можна використовувати без list"
+
+msgid "-f only makes sense when writing a replacement"
+msgstr ""
+
+msgid "--raw only makes sense with --edit"
+msgstr ""
+
+msgid "-d needs at least one argument"
+msgstr ""
+
+msgid "bad number of arguments"
+msgstr ""
+
+msgid "-e needs exactly one argument"
+msgstr ""
+
+msgid "-g needs at least one argument"
+msgstr ""
+
+msgid "--convert-graft-file takes no argument"
+msgstr ""
+
+msgid "only one pattern can be given with -l"
+msgstr ""
+
+msgid ""
+"git rerere [clear | forget <pathspec>... | diff | status | remaining | gc]"
+msgstr ""
+
+msgid "register clean resolutions in index"
+msgstr ""
+
+msgid "'git rerere forget' without paths is deprecated"
+msgstr ""
+
+#, c-format
+msgid "unable to generate diff for '%s'"
+msgstr "не вдалося згенерувати diff для \"%s\""
+
+msgid ""
+"git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"
+msgstr ""
+"git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"
+
+msgid "git reset [-q] [<tree-ish>] [--] <pathspec>..."
+msgstr "git reset [-q] [<деревоподібне джерело>] [--] <визначник шляху>..."
+
+msgid ""
+"git reset [-q] [--pathspec-from-file [--pathspec-file-nul]] [<tree-ish>]"
+msgstr ""
+"git reset [-q] [--pathspec-from-file [--pathspec-file-nul]] [<деревоподібне "
+"джерело>]"
+
+msgid "git reset --patch [<tree-ish>] [--] [<pathspec>...]"
+msgstr ""
+"git reset --patch [<деревоподібне джерело>] [--] [<визначник шляху>...]"
+
+msgid "mixed"
+msgstr "змішане"
+
+msgid "soft"
+msgstr "м’яке"
+
+msgid "hard"
+msgstr "жорстке"
+
+msgid "merge"
+msgstr "злити"
+
+msgid "keep"
+msgstr "зберегти"
+
+msgid "You do not have a valid HEAD."
+msgstr "У вас немає дійсного HEAD."
+
+msgid "Failed to find tree of HEAD."
+msgstr "Не вдалося знайти дерево HEAD."
+
+#, c-format
+msgid "Failed to find tree of %s."
+msgstr "Не вдалося знайти дерево %s."
+
+#, c-format
+msgid "HEAD is now at %s"
+msgstr "HEAD зараз на %s"
+
+#, c-format
+msgid "Cannot do a %s reset in the middle of a merge."
+msgstr "Неможливо виконати %s скидання посеред злиття."
+
+msgid "be quiet, only report errors"
+msgstr "тихесенько, повідомляти лише про помилки"
+
+msgid "skip refreshing the index after reset"
+msgstr "пропустити оновлення індексу після скидання"
+
+msgid "reset HEAD and index"
+msgstr "скинути HEAD та індекс"
+
+msgid "reset only HEAD"
+msgstr "скинути тільки HEAD"
+
+msgid "reset HEAD, index and working tree"
+msgstr "скинути HEAD, індекс та робоче дерево"
+
+msgid "reset HEAD but keep local changes"
+msgstr "скинути HEAD, але зберегти локальні зміни"
+
+msgid "record only the fact that removed paths will be added later"
+msgstr "записати лише той факт, що вилучені шляхи будуть додані пізніше"
+
+#, c-format
+msgid "Failed to resolve '%s' as a valid revision."
+msgstr "Не вдалося розпізнати '%s' як припустиму ревізію."
+
+#, c-format
+msgid "Failed to resolve '%s' as a valid tree."
+msgstr "Не вдалося розпізнати '%s' як припустиме дерево."
+
+msgid "--mixed with paths is deprecated; use 'git reset -- <paths>' instead."
+msgstr ""
+"використання --mixed зі шляхами застаріло; використовуйте 'git reset -- "
+"<paths>' замість цього."
+
+#, c-format
+msgid "Cannot do %s reset with paths."
+msgstr "Неможливо виконати %s скидання зі шляхами."
+
+#, c-format
+msgid "%s reset is not allowed in a bare repository"
+msgstr "%s скидання не дозволяється у порожньому сховищі"
+
+msgid "Unstaged changes after reset:"
+msgstr "Неіндексовані зміни після скидання:"
+
+#, c-format
+msgid ""
+"It took %.2f seconds to refresh the index after reset.  You can use\n"
+"'--no-refresh' to avoid this."
+msgstr ""
+"Оновлення індексу після скидання зайняло %.2f секунд.  Ви можете "
+"скористатися параметром\n"
+"'--no-refresh', щоб уникнути цього."
+
+#, c-format
+msgid "Could not reset index file to revision '%s'."
+msgstr "Не вдалося скинути індексний файл до ревізії '%s'."
+
+msgid "Could not write new index file."
+msgstr "Не вдалося записати новий індексний файл."
+
+#, c-format
+msgid "unable to get disk usage of %s"
+msgstr "не вдалося отримати дані про використання диска %s"
+
+#, c-format
+msgid "invalid value for '%s': '%s', the only allowed format is '%s'"
+msgstr ""
+
+msgid "rev-list does not support display of notes"
+msgstr ""
+
+#, c-format
+msgid "marked counting and '%s' cannot be used together"
+msgstr "позначений підрахунок та \"%s\" не можна використовувати разом"
+
+msgid "git rev-parse --parseopt [<options>] -- [<args>...]"
+msgstr "git rev-parse --parseopt [<опції>] -- [<аргументи>...]"
+
+msgid "keep the `--` passed as an arg"
+msgstr ""
+
+msgid "stop parsing after the first non-option argument"
+msgstr ""
+
+msgid "output in stuck long form"
+msgstr ""
+
+msgid "premature end of input"
+msgstr "передчасне закінчення вхідних даних"
+
+msgid "no usage string given before the `--' separator"
+msgstr ""
+
+msgid "missing opt-spec before option flags"
+msgstr ""
+
+msgid "Needed a single revision"
+msgstr ""
+
+msgid ""
+"git rev-parse --parseopt [<options>] -- [<args>...]\n"
+"   or: git rev-parse --sq-quote [<arg>...]\n"
+"   or: git rev-parse [<options>] [<arg>...]\n"
+"\n"
+"Run \"git rev-parse --parseopt -h\" for more information on the first usage."
+msgstr ""
+
+msgid "--resolve-git-dir requires an argument"
+msgstr ""
+
+#, c-format
+msgid "not a gitdir '%s'"
+msgstr ""
+
+msgid "--git-path requires an argument"
+msgstr ""
+
+msgid "-n requires an argument"
+msgstr "-n потребує аргумент"
+
+msgid "--path-format requires an argument"
+msgstr ""
+
+#, c-format
+msgid "unknown argument to --path-format: %s"
+msgstr ""
+
+msgid "--default requires an argument"
+msgstr ""
+
+msgid "--prefix requires an argument"
+msgstr ""
+
+#, c-format
+msgid "unknown mode for --abbrev-ref: %s"
+msgstr ""
+
+msgid "--exclude-hidden cannot be used together with --branches"
+msgstr "--exclude-hidden неможливо використати разом з --branches"
+
+msgid "--exclude-hidden cannot be used together with --tags"
+msgstr ""
+
+msgid "--exclude-hidden cannot be used together with --remotes"
+msgstr ""
+
+msgid "this operation must be run in a work tree"
+msgstr ""
+
+#, c-format
+msgid "unknown mode for --show-object-format: %s"
+msgstr ""
+
+msgid ""
+"git revert [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] "
+"<commit>..."
+msgstr ""
+
+msgid "git revert (--continue | --skip | --abort | --quit)"
+msgstr ""
+
+msgid ""
+"git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
+"                [-S[<keyid>]] <commit>..."
+msgstr ""
+
+msgid "git cherry-pick (--continue | --skip | --abort | --quit)"
+msgstr "git cherry-pick (--continue | --skip | --abort | --quit)"
+
+#, c-format
+msgid "option `%s' expects a number greater than zero"
+msgstr ""
+
+#, c-format
+msgid "%s: %s cannot be used with %s"
+msgstr "%s: %s неможливо використовувати з %s"
+
+msgid "end revert or cherry-pick sequence"
+msgstr ""
+
+msgid "resume revert or cherry-pick sequence"
+msgstr ""
+
+msgid "cancel revert or cherry-pick sequence"
+msgstr ""
+
+msgid "skip current commit and continue"
+msgstr ""
+
+msgid "don't automatically commit"
+msgstr "не комітити автоматично"
+
+msgid "edit the commit message"
+msgstr ""
+
+msgid "parent-number"
+msgstr ""
+
+msgid "select mainline parent"
+msgstr ""
+
+msgid "merge strategy"
+msgstr ""
+
+msgid "option for merge strategy"
+msgstr "опція для стратегії злиття"
+
+msgid "append commit name"
+msgstr ""
+
+msgid "preserve initially empty commits"
+msgstr ""
+
+msgid "allow commits with empty messages"
+msgstr ""
+
+msgid "keep redundant, empty commits"
+msgstr ""
+
+msgid "use the 'reference' format to refer to commits"
+msgstr ""
+
+msgid "revert failed"
+msgstr "вивертання не вдалося"
+
+msgid "cherry-pick failed"
+msgstr ""
+
+msgid ""
+"git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch]\n"
+"       [--quiet] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+"       [--] [<pathspec>...]"
+msgstr ""
+
+msgid ""
+"the following file has staged content different from both the\n"
+"file and the HEAD:"
+msgid_plural ""
+"the following files have staged content different from both the\n"
+"file and the HEAD:"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid ""
+"\n"
+"(use -f to force removal)"
+msgstr ""
+
+msgid "the following file has changes staged in the index:"
+msgid_plural "the following files have changes staged in the index:"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid ""
+"\n"
+"(use --cached to keep the file, or -f to force removal)"
+msgstr ""
+
+msgid "the following file has local modifications:"
+msgid_plural "the following files have local modifications:"
+msgstr[0] "наступний файл має локальні зміни:"
+msgstr[1] "наступні файли мають локальні зміни:"
+msgstr[2] "наступних файлів мають локальні зміни:"
+
+msgid "do not list removed files"
+msgstr ""
+
+msgid "only remove from the index"
+msgstr "видалити тільки з індексу"
+
+msgid "override the up-to-date check"
+msgstr ""
+
+msgid "allow recursive removal"
+msgstr ""
+
+msgid "exit with a zero status even if nothing matched"
+msgstr ""
+
+msgid "No pathspec was given. Which files should I remove?"
+msgstr ""
+
+msgid "please stage your changes to .gitmodules or stash them to proceed"
+msgstr ""
+
+#, c-format
+msgid "not removing '%s' recursively without -r"
+msgstr ""
+
+#, c-format
+msgid "git rm: unable to remove %s"
+msgstr "git rm: не вдалося видалити %s"
+
+msgid ""
+"git send-pack [--mirror] [--dry-run] [--force]\n"
+"              [--receive-pack=<git-receive-pack>]\n"
+"              [--verbose] [--thin] [--atomic]\n"
+"              [--[no-]signed | --signed=(true|false|if-asked)]\n"
+"              [<host>:]<directory> (--all | <ref>...)"
+msgstr ""
+
+msgid "remote name"
+msgstr "віддалена назва"
+
+msgid "push all refs"
+msgstr "надіслати всі посилання"
+
+msgid "use stateless RPC protocol"
+msgstr ""
+
+msgid "read refs from stdin"
+msgstr ""
+
+msgid "print status from remote helper"
+msgstr ""
+
+msgid "git shortlog [<options>] [<revision-range>] [[--] <path>...]"
+msgstr "git shortlog [<опції>] [<діапазон-ревізій>] [[--] <шлях>...]"
+
+msgid "git log --pretty=short | git shortlog [<options>]"
+msgstr ""
+
+msgid "using multiple --group options with stdin is not supported"
+msgstr ""
+
+#, c-format
+msgid "using %s with stdin is not supported"
+msgstr ""
+
+#, c-format
+msgid "unknown group type: %s"
+msgstr "невідомий тип групи: %s"
+
+msgid "group by committer rather than author"
+msgstr ""
+
+msgid "sort output according to the number of commits per author"
+msgstr ""
+
+msgid "suppress commit descriptions, only provides commit count"
+msgstr ""
+
+msgid "show the email address of each author"
+msgstr ""
+
+msgid "<w>[,<i1>[,<i2>]]"
+msgstr ""
+
+msgid "linewrap output"
+msgstr "обгортати рядки виводу"
+
+msgid "field"
+msgstr ""
+
+msgid "group by field"
+msgstr ""
+
+msgid "too many arguments given outside repository"
+msgstr ""
+
+msgid ""
+"git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
+"                [--current] [--color[=<when>] | --no-color] [--sparse]\n"
+"                [--more=<n> | --list | --independent | --merge-base]\n"
+"                [--no-name | --sha1-name] [--topics]\n"
+"                [(<rev> | <glob>)...]"
+msgstr ""
+
+msgid "git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]"
+msgstr ""
+
+#, c-format
+msgid "ignoring %s; cannot handle more than %d ref"
+msgid_plural "ignoring %s; cannot handle more than %d refs"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "no matching refs with %s"
+msgstr ""
+
+msgid "show remote-tracking and local branches"
+msgstr ""
+
+msgid "show remote-tracking branches"
+msgstr "показати віддалено відстежувані гілки"
+
+msgid "color '*!+-' corresponding to the branch"
+msgstr ""
+
+msgid "show <n> more commits after the common ancestor"
+msgstr ""
+
+msgid "synonym to more=-1"
+msgstr ""
+
+msgid "suppress naming strings"
+msgstr "не показувати назву"
+
+msgid "include the current branch"
+msgstr "включити поточну гілку"
+
+msgid "name commits with their object names"
+msgstr ""
+
+msgid "show possible merge bases"
+msgstr ""
+
+msgid "show refs unreachable from any other ref"
+msgstr ""
+
+msgid "show commits in topological order"
+msgstr ""
+
+msgid "show only commits not on the first branch"
+msgstr ""
+
+msgid "show merges reachable from only one tip"
+msgstr ""
+
+msgid "topologically sort, maintaining date order where possible"
+msgstr ""
+
+msgid "<n>[,<base>]"
+msgstr ""
+
+msgid "show <n> most recent ref-log entries starting at base"
+msgstr ""
+
+msgid "no branches given, and HEAD is not valid"
+msgstr ""
+
+msgid "--reflog option needs one branch name"
+msgstr "--reflog потребує одну назву гілки"
+
+#, c-format
+msgid "only %d entry can be shown at one time."
+msgid_plural "only %d entries can be shown at one time."
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "no such ref %s"
+msgstr "немає такого посилання %s"
+
+#, c-format
+msgid "cannot handle more than %d rev."
+msgid_plural "cannot handle more than %d revs."
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "'%s' is not a valid ref."
+msgstr "\"%s\" не є припустимим посиланням."
+
+#, c-format
+msgid "cannot find commit %s (%s)"
+msgstr ""
+
+msgid "hash-algorithm"
+msgstr "хеш-алгоритм"
+
+msgid "Unknown hash algorithm"
+msgstr "Невідомий хеш-алгоритм"
+
+msgid ""
+"git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference]\n"
+"             [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
+"             [--heads] [--] [<pattern>...]"
+msgstr ""
+
+msgid "git show-ref --exclude-existing[=<pattern>]"
+msgstr ""
+
+msgid "only show tags (can be combined with heads)"
+msgstr "показати тільки теги (можна комбінувати з heads)"
+
+msgid "only show heads (can be combined with tags)"
+msgstr "показати тільки верхівки (можна комбінувати з tags)"
+
+msgid "stricter reference checking, requires exact ref path"
+msgstr ""
+
+msgid "show the HEAD reference, even if it would be filtered out"
+msgstr ""
+
+msgid "dereference tags into object IDs"
+msgstr "розіменувати теги в ідентифікатори обʼєктів"
+
+msgid "only show SHA1 hash using <n> digits"
+msgstr ""
+
+msgid "do not print results to stdout (useful with --verify)"
+msgstr ""
+
+msgid "show refs from stdin that aren't in local repository"
+msgstr "показати посилання з stdin, яких немає в локальному сховищі"
+
+msgid ""
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
+msgstr ""
+
+msgid "this worktree is not sparse"
+msgstr ""
+
+msgid "this worktree is not sparse (sparse-checkout file may not exist)"
+msgstr ""
+
+#, c-format
+msgid ""
+"directory '%s' contains untracked files, but is not in the sparse-checkout "
+"cone"
+msgstr ""
+
+#, c-format
+msgid "failed to remove directory '%s'"
+msgstr "не вдалося видалити директорію \"%s\""
+
+msgid "failed to create directory for sparse-checkout file"
+msgstr "не вдалося створити директорію для файлу часткового переходу"
+
+msgid "failed to initialize worktree config"
+msgstr "не вдалося ініціалізувати конфігурацію робочого дерева"
+
+msgid "failed to modify sparse-index config"
+msgstr "не вдалося змінити sparse-index конфігурацію"
+
+msgid "initialize the sparse-checkout in cone mode"
+msgstr "ініціалізувати частковий перехід в режимі конуса"
+
+msgid "toggle the use of a sparse index"
+msgstr ""
+
+#, c-format
+msgid "unable to create leading directories of %s"
+msgstr "не вдалося створити провідні директорії %s"
+
+#, c-format
+msgid "failed to open '%s'"
+msgstr "не вдалося відкрити \"%s\""
+
+#, c-format
+msgid "could not normalize path %s"
+msgstr "не вдалося нормалізувати шлях %s"
+
+#, c-format
+msgid "unable to unquote C-style string '%s'"
+msgstr ""
+
+msgid "unable to load existing sparse-checkout patterns"
+msgstr "не вдалося завантажити існуючі шаблони часткових переходів"
+
+msgid "existing sparse-checkout patterns do not use cone mode"
+msgstr ""
+
+msgid "please run from the toplevel directory in non-cone mode"
+msgstr ""
+
+msgid "specify directories rather than patterns (no leading slash)"
+msgstr ""
+
+msgid ""
+"specify directories rather than patterns.  If your directory starts with a "
+"'!', pass --skip-checks"
+msgstr ""
+
+msgid ""
+"specify directories rather than patterns.  If your directory really has any "
+"of '*?[]\\' in it, pass --skip-checks"
+msgstr ""
+
+#, c-format
+msgid ""
+"'%s' is not a directory; to treat it as a directory anyway, rerun with --"
+"skip-checks"
+msgstr ""
+
+#, c-format
+msgid ""
+"pass a leading slash before paths such as '%s' if you want a single file "
+"(see NON-CONE PROBLEMS in the git-sparse-checkout manual)."
+msgstr ""
+
+msgid "git sparse-checkout add [--skip-checks] (--stdin | <patterns>)"
+msgstr ""
+
+msgid ""
+"skip some sanity checks on the given paths that might give false positives"
+msgstr ""
+
+msgid "read patterns from standard in"
+msgstr ""
+
+msgid "no sparse-checkout to add to"
+msgstr ""
+
+msgid ""
+"git sparse-checkout set [--[no-]cone] [--[no-]sparse-index] [--skip-checks] "
+"(--stdin | <patterns>)"
+msgstr ""
+
+msgid "must be in a sparse-checkout to reapply sparsity patterns"
+msgstr ""
+
+msgid "error while refreshing working directory"
+msgstr "помилка під час оновлення робочої директорії"
+
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+
+msgid "terminate input and output files by a NUL character"
+msgstr ""
+
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+
+msgid "use patterns in <file> instead of the current ones."
+msgstr "використовувати шаблони з <file> замість поточних."
+
+msgid "git stash list [<log-options>]"
+msgstr "git stash list [<лог-опції>]"
+
+msgid ""
+"git stash show [-u | --include-untracked | --only-untracked] [<diff-"
+"options>] [<stash>]"
+msgstr ""
+
+msgid "git stash drop [-q | --quiet] [<stash>]"
+msgstr ""
+
+msgid "git stash pop [--index] [-q | --quiet] [<stash>]"
+msgstr ""
+
+msgid "git stash apply [--index] [-q | --quiet] [<stash>]"
+msgstr ""
+
+msgid "git stash branch <branchname> [<stash>]"
+msgstr ""
+
+msgid "git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"
+msgstr ""
+
+msgid ""
+"git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q "
+"| --quiet]\n"
+"          [-u | --include-untracked] [-a | --all] [(-m | --message) "
+"<message>]\n"
+"          [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
+"          [--] [<pathspec>...]]"
+msgstr ""
+
+msgid ""
+"git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | "
+"--quiet]\n"
+"          [-u | --include-untracked] [-a | --all] [<message>]"
+msgstr ""
+
+msgid "git stash create [<message>]"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a stash-like commit"
+msgstr "\"%s\" не є сховоподібним комітом"
+
+#, c-format
+msgid "Too many revisions specified:%s"
+msgstr ""
+
+msgid "No stash entries found."
+msgstr ""
+
+#, c-format
+msgid "%s is not a valid reference"
+msgstr "%s не є припустимим посиланням"
+
+msgid "git stash clear with arguments is unimplemented"
+msgstr ""
+
+#, c-format
+msgid ""
+"WARNING: Untracked file in way of tracked file!  Renaming\n"
+"            %s -> %s\n"
+"         to make room.\n"
+msgstr ""
+
+msgid "cannot apply a stash in the middle of a merge"
+msgstr "неможливо застосувати схов посеред злиття"
+
+#, c-format
+msgid "could not generate diff %s^!."
+msgstr "не вдалося згенерувати різницю %s^!."
+
+msgid "conflicts in index. Try without --index."
+msgstr ""
+
+msgid "could not save index tree"
+msgstr "не вдалося зберегти дерево індекса"
+
+#, c-format
+msgid "Merging %s with %s"
+msgstr ""
+
+msgid "Index was not unstashed."
+msgstr ""
+
+msgid "could not restore untracked files from stash"
+msgstr "не вдалося відновити невідстежувані файли зі схову"
+
+msgid "attempt to recreate the index"
+msgstr "спроба відтворити індекс"
+
+#, c-format
+msgid "Dropped %s (%s)"
+msgstr ""
+
+#, c-format
+msgid "%s: Could not drop stash entry"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a stash reference"
+msgstr "\"%s\" не є посиланням схова"
+
+msgid "The stash entry is kept in case you need it again."
+msgstr ""
+
+msgid "No branch name specified"
+msgstr ""
+
+msgid "failed to parse tree"
+msgstr "не вдалося розібрати дерево"
+
+msgid "failed to unpack trees"
+msgstr "не вдалося розпакувати дерева"
+
+msgid "include untracked files in the stash"
+msgstr "в тому числі невідстежувані файли схову"
+
+msgid "only show untracked files in the stash"
+msgstr "показувати тільки невідстежувані файли схову"
+
+#, c-format
+msgid "Cannot update %s with %s"
+msgstr "Неможливо оновити %s з %s"
+
+msgid "stash message"
+msgstr ""
+
+msgid "\"git stash store\" requires one <commit> argument"
+msgstr ""
+
+msgid "No staged changes"
+msgstr "Немає індексованих змін"
+
+msgid "No changes selected"
+msgstr "Не обрано жодних змін"
+
+msgid "You do not have the initial commit yet"
+msgstr "У вас ще немає початкового коміту"
+
+msgid "Cannot save the current index state"
+msgstr "Неможливо зберегти поточний стан індексу"
+
+msgid "Cannot save the untracked files"
+msgstr "Неможливо зберегти невідстежувані файли"
+
+msgid "Cannot save the current worktree state"
+msgstr ""
+
+msgid "Cannot save the current staged state"
+msgstr "Неможливо зберегти поточний індексований стан"
+
+msgid "Cannot record working tree state"
+msgstr "Неможливо записати стан робочого дерева"
+
+msgid "Can't use --patch and --include-untracked or --all at the same time"
+msgstr ""
+"Не можна використовувати --patch і --include-untracked або --all одночасно"
+
+msgid "Can't use --staged and --include-untracked or --all at the same time"
+msgstr ""
+
+msgid "Did you forget to 'git add'?"
+msgstr ""
+
+msgid "No local changes to save"
+msgstr ""
+
+msgid "Cannot initialize stash"
+msgstr "Неможливо ініціалізувати схов"
+
+msgid "Cannot save the current status"
+msgstr ""
+
+#, c-format
+msgid "Saved working directory and index state %s"
+msgstr ""
+
+msgid "Cannot remove worktree changes"
+msgstr ""
+
+msgid "keep index"
+msgstr ""
+
+msgid "stash staged changes only"
+msgstr ""
+
+msgid "stash in patch mode"
+msgstr ""
+
+msgid "quiet mode"
+msgstr ""
+
+msgid "include untracked files in stash"
+msgstr "в тому числі невідстежувані файли схову"
+
+msgid "include ignore files"
+msgstr "в тому числи файли ігнорування"
+
+msgid "skip and remove all lines starting with comment character"
+msgstr ""
+
+msgid "prepend comment character and space to each line"
+msgstr ""
+
+#, c-format
+msgid "Expecting a full ref name, got %s"
+msgstr ""
+
+#, c-format
+msgid "could not get a repository handle for submodule '%s'"
+msgstr ""
+
+#, c-format
+msgid ""
+"could not look up configuration '%s'. Assuming this repository is its own "
+"authoritative upstream."
+msgstr ""
+
+#, c-format
+msgid "No url found for submodule path '%s' in .gitmodules"
+msgstr ""
+
+#, c-format
+msgid "Entering '%s'\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"run_command returned non-zero status for %s\n"
+"."
+msgstr ""
+
+#, c-format
+msgid ""
+"run_command returned non-zero status while recursing in the nested "
+"submodules of %s\n"
+"."
+msgstr ""
+
+msgid "suppress output of entering each submodule command"
+msgstr ""
+
+msgid "recurse into nested submodules"
+msgstr "рекурсивно у вкладених підмодулях"
+
+msgid "git submodule foreach [--quiet] [--recursive] [--] <command>"
+msgstr ""
+
+#, c-format
+msgid "Failed to register url for submodule path '%s'"
+msgstr "Не вдалося зареєструвати url для підмодуля за шляхом \"%s\""
+
+#, c-format
+msgid "Submodule '%s' (%s) registered for path '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "warning: command update mode suggested for submodule '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Failed to register update mode for submodule path '%s'"
+msgstr ""
+"Не вдалося зареєструвати режим оновлення для підмодуля за шляхом \"%s\""
+
+msgid "suppress output for initializing a submodule"
+msgstr ""
+
+msgid "git submodule init [<options>] [<path>]"
+msgstr "git submodule init [<опції>] [<шлях>]"
+
+#, c-format
+msgid "no submodule mapping found in .gitmodules for path '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not resolve HEAD ref inside the submodule '%s'"
+msgstr ""
+
+#, c-format
+msgid "failed to recurse into submodule '%s'"
+msgstr "не вдалося обробити рекурсивно підмодуль \"%s\""
+
+msgid "suppress submodule status output"
+msgstr ""
+
+msgid ""
+"use commit stored in the index instead of the one stored in the submodule "
+"HEAD"
+msgstr ""
+
+msgid "git submodule status [--quiet] [--cached] [--recursive] [<path>...]"
+msgstr ""
+
+#, c-format
+msgid "* %s %s(blob)->%s(submodule)"
+msgstr ""
+
+#, c-format
+msgid "* %s %s(submodule)->%s(blob)"
+msgstr ""
+
+#, c-format
+msgid "%s"
+msgstr ""
+
+#, c-format
+msgid "couldn't hash object from '%s'"
+msgstr "не вдалося хешувати обʼєкт з \"%s\""
+
+#, c-format
+msgid "unexpected mode %o\n"
+msgstr ""
+
+msgid "use the commit stored in the index instead of the submodule HEAD"
+msgstr "використати коміт, збережений в індексі, замість підмодуля HEAD"
+
+msgid "compare the commit in the index with that in the submodule HEAD"
+msgstr ""
+
+msgid "skip submodules with 'ignore_config' value set to 'all'"
+msgstr ""
+
+msgid "limit the summary size"
+msgstr ""
+
+msgid "git submodule summary [<options>] [<commit>] [--] [<path>]"
+msgstr ""
+
+msgid "could not fetch a revision for HEAD"
+msgstr ""
+
+#, c-format
+msgid "Synchronizing submodule url for '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "failed to register url for submodule path '%s'"
+msgstr "не вдалося зареєструвати url для підмодуля за шляхом \"%s\""
+
+#, c-format
+msgid "failed to update remote for submodule '%s'"
+msgstr "не вдалося оновити віддалене призначення для підмодуля \"%s\""
+
+msgid "suppress output of synchronizing submodule url"
+msgstr ""
+
+msgid "git submodule sync [--quiet] [--recursive] [<path>]"
+msgstr ""
+
+#, c-format
+msgid ""
+"Submodule work tree '%s' contains a .git directory. This will be replaced "
+"with a .git file by using absorbgitdirs."
+msgstr ""
+
+#, c-format
+msgid ""
+"Submodule work tree '%s' contains local modifications; use '-f' to discard "
+"them"
+msgstr ""
+
+#, c-format
+msgid "Cleared directory '%s'\n"
+msgstr "Очищено директорію \"%s\"\n"
+
+#, c-format
+msgid "Could not remove submodule work tree '%s'\n"
+msgstr "Не вдалося видалити робоче дерево підмодуля \"%s\"\n"
+
+#, c-format
+msgid "could not create empty submodule directory %s"
+msgstr "не вдалося створити порожню директорію підмодуля %s"
+
+#, c-format
+msgid "Submodule '%s' (%s) unregistered for path '%s'\n"
+msgstr ""
+
+msgid "remove submodule working trees even if they contain local changes"
+msgstr ""
+
+msgid "unregister all submodules"
+msgstr ""
+
+msgid ""
+"git submodule deinit [--quiet] [-f | --force] [--all | [--] [<path>...]]"
+msgstr ""
+
+msgid "Use '--all' if you really want to deinitialize all submodules"
+msgstr ""
+
+msgid ""
+"An alternate computed from a superproject's alternate is invalid.\n"
+"To allow Git to clone without an alternate in such a case, set\n"
+"submodule.alternateErrorStrategy to 'info' or, equivalently, clone with\n"
+"'--reference-if-able' instead of '--reference'."
+msgstr ""
+
+#, c-format
+msgid "could not get a repository handle for gitdir '%s'"
+msgstr "не вдалося отримати дескриптор сховища для gitdir \"%s\""
+
+#, c-format
+msgid "submodule '%s' cannot add alternate: %s"
+msgstr "підмодуль \"%s\" не може додати спільний обʼєкт: %s"
+
+#, c-format
+msgid "Value '%s' for submodule.alternateErrorStrategy is not recognized"
+msgstr ""
+
+#, c-format
+msgid "Value '%s' for submodule.alternateLocation is not recognized"
+msgstr ""
+
+#, c-format
+msgid "refusing to create/use '%s' in another submodule's git dir"
+msgstr ""
+
+#, c-format
+msgid "clone of '%s' into submodule path '%s' failed"
+msgstr ""
+
+#, c-format
+msgid "directory not empty: '%s'"
+msgstr ""
+
+#, c-format
+msgid "could not get submodule directory for '%s'"
+msgstr "не вдалося отримати директорію підмодуля для \"%s\""
+
+msgid "alternative anchor for relative paths"
+msgstr ""
+
+msgid "where the new submodule will be cloned to"
+msgstr "куди буде клоновано новий підмодуль"
+
+msgid "name of the new submodule"
+msgstr ""
+
+msgid "url where to clone the submodule from"
+msgstr ""
+
+msgid "depth for shallow clones"
+msgstr ""
+
+msgid "force cloning progress"
+msgstr "примусово звітувати прогрес клонування"
+
+msgid "disallow cloning into non-empty directory"
+msgstr ""
+
+msgid ""
+"git submodule--helper clone [--prefix=<path>] [--quiet] [--reference "
+"<repository>] [--name <name>] [--depth <depth>] [--single-branch] [--filter "
+"<filter-spec>] --url <url> --path <path>"
+msgstr ""
+
+#, c-format
+msgid "Invalid update mode '%s' configured for submodule path '%s'"
+msgstr ""
+"Неприпустимий режим оновлення \"%s\" налаштовано для підмодуля за шляхом "
+"\"%s\""
+
+#, c-format
+msgid "Submodule path '%s' not initialized"
+msgstr ""
+
+msgid "Maybe you want to use 'update --init'?"
+msgstr ""
+
+#, c-format
+msgid "Skipping unmerged submodule %s"
+msgstr ""
+
+#, c-format
+msgid "Skipping submodule '%s'"
+msgstr ""
+
+#, c-format
+msgid "Failed to clone '%s'. Retry scheduled"
+msgstr ""
+
+#, c-format
+msgid "Failed to clone '%s' a second time, aborting"
+msgstr ""
+
+#, c-format
+msgid "Unable to checkout '%s' in submodule path '%s'"
+msgstr ""
+
+#, c-format
+msgid "Unable to rebase '%s' in submodule path '%s'"
+msgstr "Не вдалося перебазувати \"%s\" в підмодулі за шляхом \"%s\""
+
+#, c-format
+msgid "Unable to merge '%s' in submodule path '%s'"
+msgstr "Не вдалося злити \"%s\" в підмодулі за шляхом \"%s\""
+
+#, c-format
+msgid "Execution of '%s %s' failed in submodule path '%s'"
+msgstr ""
+
+#, c-format
+msgid "Submodule path '%s': checked out '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Submodule path '%s': rebased into '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Submodule path '%s': merged in '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Submodule path '%s': '%s %s'\n"
+msgstr ""
+
+#, c-format
+msgid "Unable to fetch in submodule path '%s'; trying to directly fetch %s:"
+msgstr ""
+
+#, c-format
+msgid ""
+"Fetched in submodule path '%s', but it did not contain %s. Direct fetching "
+"of that commit failed."
+msgstr ""
+
+#, c-format
+msgid "could not initialize submodule at path '%s'"
+msgstr "не вдалося ініціалізувати підмодуль за шляхом \"%s\""
+
+#, c-format
+msgid ""
+"Submodule (%s) branch configured to inherit branch from superproject, but "
+"the superproject is not on any branch"
+msgstr ""
+
+#, c-format
+msgid "Unable to find current revision in submodule path '%s'"
+msgstr ""
+
+#, c-format
+msgid "Unable to fetch in submodule path '%s'"
+msgstr ""
+
+#, c-format
+msgid "Unable to find %s revision in submodule path '%s'"
+msgstr ""
+
+#, c-format
+msgid "Failed to recurse into submodule path '%s'"
+msgstr "Не вдалося обробити рекурсивно підмодуль за шляхом \"%s\""
+
+msgid "force checkout updates"
+msgstr "переключитися на оновлення примусово"
+
+msgid "initialize uninitialized submodules before update"
+msgstr "ініціалізувати неініціалізовані підмодулі перед оновленням"
+
+msgid "use SHA-1 of submodule's remote tracking branch"
+msgstr "використовувати SHA-1 гілки віддаленого відстежування підмодуля"
+
+msgid "traverse submodules recursively"
+msgstr ""
+
+msgid "don't fetch new objects from the remote site"
+msgstr ""
+
+msgid "use the 'checkout' update strategy (default)"
+msgstr ""
+
+msgid "use the 'merge' update strategy"
+msgstr ""
+
+msgid "use the 'rebase' update strategy"
+msgstr ""
+
+msgid "create a shallow clone truncated to the specified number of revisions"
+msgstr "створити поверхневий клон, урізаний до вказаної кількості ревізій"
+
+msgid "parallel jobs"
+msgstr ""
+
+msgid "whether the initial clone should follow the shallow recommendation"
+msgstr ""
+
+msgid "don't print cloning progress"
+msgstr ""
+
+msgid "disallow cloning into non-empty directory, implies --init"
+msgstr ""
+
+msgid ""
+"git submodule [--quiet] update [--init [--filter=<filter-spec>]] [--remote] "
+"[-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-"
+"shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] "
+"[--] [<path>...]"
+msgstr ""
+
+msgid "git submodule absorbgitdirs [<options>] [<path>...]"
+msgstr "git submodule absorbgitdirs [<опції>] [<шлях>...]"
+
+msgid "suppress output for setting url of a submodule"
+msgstr ""
+
+msgid "git submodule set-url [--quiet] <path> <newurl>"
+msgstr ""
+
+msgid "set the default tracking branch to master"
+msgstr ""
+
+msgid "set the default tracking branch"
+msgstr "встановити гілку відстежування за замовчуванням"
+
+msgid "git submodule set-branch [-q|--quiet] (-d|--default) <path>"
+msgstr ""
+
+msgid "git submodule set-branch [-q|--quiet] (-b|--branch) <branch> <path>"
+msgstr ""
+
+msgid "--branch or --default required"
+msgstr ""
+
+msgid "print only error messages"
+msgstr ""
+
+msgid "force creation"
+msgstr ""
+
+msgid "show whether the branch would be created"
+msgstr ""
+
+msgid ""
+"git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--"
+"quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"
+msgstr ""
+
+#, c-format
+msgid "creating branch '%s'"
+msgstr "створення гілки \"%s\""
+
+#, c-format
+msgid "Adding existing repo at '%s' to the index\n"
+msgstr ""
+
+#, c-format
+msgid "'%s' already exists and is not a valid git repo"
+msgstr "\"%s\" вже існує і не є припустимим git сховищем"
+
+#, c-format
+msgid "A git directory for '%s' is found locally with remote(s):\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"If you want to reuse this local git directory instead of cloning again from\n"
+"  %s\n"
+"use the '--force' option. If the local git directory is not the correct "
+"repo\n"
+"or you are unsure what this means choose another name with the '--name' "
+"option."
+msgstr ""
+
+#, c-format
+msgid "Reactivating local git directory for submodule '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "unable to checkout submodule '%s'"
+msgstr "не вдалося переключитись на підмодуль \"%s\""
+
+msgid "please make sure that the .gitmodules file is in the working tree"
+msgstr ""
+
+#, c-format
+msgid "Failed to add submodule '%s'"
+msgstr "Не вдалося додати підмодуль \"%s\""
+
+#, c-format
+msgid "Failed to register submodule '%s'"
+msgstr "Не вдалося зареєструвати підмодуль \"%s\""
+
+#, c-format
+msgid "'%s' already exists in the index"
+msgstr ""
+
+#, c-format
+msgid "'%s' already exists in the index and is not a submodule"
+msgstr ""
+
+#, c-format
+msgid "'%s' does not have a commit checked out"
+msgstr "\"%s\" не має активного коміту"
+
+msgid "branch of repository to add as submodule"
+msgstr ""
+
+msgid "allow adding an otherwise ignored submodule path"
+msgstr ""
+
+msgid "borrow the objects from reference repositories"
+msgstr ""
+
+msgid ""
+"sets the submodule's name to the given string instead of defaulting to its "
+"path"
+msgstr ""
+
+msgid "git submodule add [<options>] [--] <repository> [<path>]"
+msgstr "git submodule add [<опції>] [--] <сховище> [<шлях>]"
+
+msgid "Relative path can only be used from the toplevel of the working tree"
+msgstr ""
+
+#, c-format
+msgid "repo URL: '%s' must be absolute or begin with ./|../"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a valid submodule name"
+msgstr "\"%s\" не є припустимою назвою підмодуля"
+
+msgid "git submodule--helper <command>"
+msgstr ""
+
+msgid "git symbolic-ref [-m <reason>] <name> <ref>"
+msgstr ""
+
+msgid "git symbolic-ref [-q] [--short] [--no-recurse] <name>"
+msgstr ""
+
+msgid "git symbolic-ref --delete [-q] <name>"
+msgstr ""
+
+msgid "suppress error message for non-symbolic (detached) refs"
+msgstr ""
+
+msgid "delete symbolic ref"
+msgstr "видалити символьне посилання"
+
+msgid "shorten ref output"
+msgstr ""
+
+msgid "recursively dereference (default)"
+msgstr "рекурсивне розіменування (за замовчуванням)"
+
+msgid "reason"
+msgstr ""
+
+msgid "reason of the update"
+msgstr ""
+
+msgid ""
+"git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
+"        <tagname> [<commit> | <object>]"
+msgstr ""
+
+msgid "git tag -d <tagname>..."
+msgstr ""
+
+msgid ""
+"git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
+"        [--points-at <object>] [--column[=<options>] | --no-column]\n"
+"        [--create-reflog] [--sort=<key>] [--format=<format>]\n"
+"        [--merged <commit>] [--no-merged <commit>] [<pattern>...]"
+msgstr ""
+
+msgid "git tag -v [--format=<format>] <tagname>..."
+msgstr ""
+
+#, c-format
+msgid "tag '%s' not found."
+msgstr ""
+
+#, c-format
+msgid "Deleted tag '%s' (was %s)\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"Write a message for tag:\n"
+"  %s\n"
+"Lines starting with '%c' will be ignored.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"Write a message for tag:\n"
+"  %s\n"
+"Lines starting with '%c' will be kept; you may remove them yourself if you "
+"want to.\n"
+msgstr ""
+
+msgid "unable to sign the tag"
+msgstr "не вдалося підписати тег"
+
+#, c-format
+msgid ""
+"You have created a nested tag. The object referred to by your new tag is\n"
+"already a tag. If you meant to tag the object that it points to, use:\n"
+"\n"
+"\tgit tag -f %s %s^{}"
+msgstr ""
+
+msgid "bad object type."
+msgstr "невірний тип обʼєкта."
+
+msgid "no tag message?"
+msgstr ""
+
+#, c-format
+msgid "The tag message has been left in %s\n"
+msgstr ""
+
+msgid "list tag names"
+msgstr ""
+
+msgid "print <n> lines of each tag message"
+msgstr ""
+
+msgid "delete tags"
+msgstr "видалити теги"
+
+msgid "verify tags"
+msgstr ""
+
+msgid "Tag creation options"
+msgstr ""
+
+msgid "annotated tag, needs a message"
+msgstr ""
+
+msgid "tag message"
+msgstr ""
+
+msgid "force edit of tag message"
+msgstr ""
+
+msgid "annotated and GPG-signed tag"
+msgstr ""
+
+msgid "use another key to sign the tag"
+msgstr ""
+
+msgid "replace the tag if exists"
+msgstr ""
+
+msgid "create a reflog"
+msgstr "створити reflog"
+
+msgid "Tag listing options"
+msgstr ""
+
+msgid "show tag list in columns"
+msgstr ""
+
+msgid "print only tags that contain the commit"
+msgstr ""
+
+msgid "print only tags that don't contain the commit"
+msgstr ""
+
+msgid "print only tags that are merged"
+msgstr ""
+
+msgid "print only tags that are not merged"
+msgstr ""
+
+msgid "print only tags of the object"
+msgstr ""
+
+#, c-format
+msgid "the '%s' option is only allowed in list mode"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a valid tag name."
+msgstr "\"%s\" не є припустимою назвою тега."
+
+#, c-format
+msgid "tag '%s' already exists"
+msgstr "тег \"%s\" вже існує"
+
+#, c-format
+msgid "Invalid cleanup mode %s"
+msgstr "Неприпустимий режим очищення %s"
+
+#, c-format
+msgid "Updated tag '%s' (was %s)\n"
+msgstr ""
+
+msgid "pack exceeds maximum allowed size"
+msgstr "пакунок перевищує максимально дозволений розмір"
+
+msgid "failed to write object in stream"
+msgstr "не вдалося записати обʼєкт потоку"
+
+#, c-format
+msgid "inflate returned (%d)"
+msgstr "розпаковувач повернув (%d)"
+
+msgid "invalid blob object from stream"
+msgstr "неприпустимий обʼєкт blob з потоку"
+
+msgid "Unpacking objects"
+msgstr "Розпакування обʼєктів"
+
+#, c-format
+msgid "failed to create directory %s"
+msgstr "не вдалося створити директорію %s"
+
+#, c-format
+msgid "failed to delete file %s"
+msgstr "не вдалося видалити файл %s"
+
+#, c-format
+msgid "failed to delete directory %s"
+msgstr "не вдалося видалити директорію %s"
+
+#, c-format
+msgid "Testing mtime in '%s' "
+msgstr ""
+
+msgid "directory stat info does not change after adding a new file"
+msgstr ""
+
+msgid "directory stat info does not change after adding a new directory"
+msgstr ""
+
+msgid "directory stat info changes after updating a file"
+msgstr ""
+
+msgid "directory stat info changes after adding a file inside subdirectory"
+msgstr ""
+
+msgid "directory stat info does not change after deleting a file"
+msgstr ""
+
+msgid "directory stat info does not change after deleting a directory"
+msgstr ""
+
+msgid " OK"
+msgstr ""
+
+msgid "git update-index [<options>] [--] [<file>...]"
+msgstr "git update-index [<опції>] [--] [<файл>...]"
+
+msgid "continue refresh even when index needs update"
+msgstr ""
+
+msgid "refresh: ignore submodules"
+msgstr "оновити: ігнорувати підмодулі"
+
+msgid "do not ignore new files"
+msgstr "не ігнорувати нові файли"
+
+msgid "let files replace directories and vice-versa"
+msgstr ""
+
+msgid "notice files missing from worktree"
+msgstr ""
+
+msgid "refresh even if index contains unmerged entries"
+msgstr ""
+
+msgid "refresh stat information"
+msgstr ""
+
+msgid "like --refresh, but ignore assume-unchanged setting"
+msgstr ""
+
+msgid "<mode>,<object>,<path>"
+msgstr ""
+
+msgid "add the specified entry to the index"
+msgstr "додати вказаний запис до індексу"
+
+msgid "mark files as \"not changing\""
+msgstr ""
+
+msgid "clear assumed-unchanged bit"
+msgstr ""
+
+msgid "mark files as \"index-only\""
+msgstr ""
+
+msgid "clear skip-worktree bit"
+msgstr ""
+
+msgid "do not touch index-only entries"
+msgstr ""
+
+msgid "add to index only; do not add content to object database"
+msgstr ""
+
+msgid "remove named paths even if present in worktree"
+msgstr ""
+
+msgid "with --stdin: input lines are terminated by null bytes"
+msgstr ""
+
+msgid "read list of paths to be updated from standard input"
+msgstr ""
+
+msgid "add entries from standard input to the index"
+msgstr ""
+
+msgid "repopulate stages #2 and #3 for the listed paths"
+msgstr ""
+
+msgid "only update entries that differ from HEAD"
+msgstr ""
+
+msgid "ignore files missing from worktree"
+msgstr ""
+
+msgid "report actions to standard output"
+msgstr ""
+
+msgid "(for porcelains) forget saved unresolved conflicts"
+msgstr ""
+
+msgid "write index in this format"
+msgstr ""
+
+msgid "enable or disable split index"
+msgstr ""
+
+msgid "enable/disable untracked cache"
+msgstr ""
+
+msgid "test if the filesystem supports untracked cache"
+msgstr ""
+
+msgid "enable untracked cache without testing the filesystem"
+msgstr ""
+
+msgid "write out the index even if is not flagged as changed"
+msgstr ""
+
+msgid "enable or disable file system monitor"
+msgstr ""
+
+msgid "mark files as fsmonitor valid"
+msgstr ""
+
+msgid "clear fsmonitor valid bit"
+msgstr ""
+
+msgid ""
+"core.splitIndex is set to false; remove or change it, if you really want to "
+"enable split index"
+msgstr ""
+
+msgid ""
+"core.splitIndex is set to true; remove or change it, if you really want to "
+"disable split index"
+msgstr ""
+
+msgid ""
+"core.untrackedCache is set to true; remove or change it, if you really want "
+"to disable the untracked cache"
+msgstr ""
+
+msgid "Untracked cache disabled"
+msgstr "Невідстежуваний кеш вимкнено"
+
+msgid ""
+"core.untrackedCache is set to false; remove or change it, if you really want "
+"to enable the untracked cache"
+msgstr ""
+
+#, c-format
+msgid "Untracked cache enabled for '%s'"
+msgstr "Увімкнено невідстежуваний кеш для \"%s\""
+
+msgid "core.fsmonitor is unset; set it if you really want to enable fsmonitor"
+msgstr ""
+
+msgid "fsmonitor enabled"
+msgstr ""
+
+msgid ""
+"core.fsmonitor is set; remove it if you really want to disable fsmonitor"
+msgstr ""
+
+msgid "fsmonitor disabled"
+msgstr ""
+
+msgid "git update-ref [<options>] -d <refname> [<old-val>]"
+msgstr "git update-ref [<опції>] -d <назва посилання> [<старе значення>]"
+
+msgid "git update-ref [<options>]    <refname> <new-val> [<old-val>]"
+msgstr ""
+
+msgid "git update-ref [<options>] --stdin [-z]"
+msgstr ""
+
+msgid "delete the reference"
+msgstr "видалити посилання"
+
+msgid "update <refname> not the one it points to"
+msgstr ""
+
+msgid "stdin has NUL-terminated arguments"
+msgstr ""
+
+msgid "read updates from stdin"
+msgstr ""
+
+msgid "update the info files from scratch"
+msgstr "оновити інформаційні файли з чистого аркуша"
+
+msgid ""
+"git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
+"                [--advertise-refs] <directory>"
+msgstr ""
+
+msgid "quit after a single request/response exchange"
+msgstr ""
+
+msgid "serve up the info/refs for git-http-backend"
+msgstr ""
+
+msgid "do not try <directory>/.git/ if <directory> is no Git directory"
+msgstr ""
+
+msgid "interrupt transfer after <n> seconds of inactivity"
+msgstr ""
+
+msgid "git verify-commit [-v | --verbose] [--raw] <commit>..."
+msgstr ""
+
+msgid "print commit contents"
+msgstr ""
+
+msgid "print raw gpg status output"
+msgstr ""
+
+msgid "git verify-pack [-v | --verbose] [-s | --stat-only] [--] <pack>.idx..."
+msgstr ""
+
+msgid "verbose"
+msgstr ""
+
+msgid "show statistics only"
+msgstr ""
+
+msgid "git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."
+msgstr ""
+
+msgid "print tag contents"
+msgstr ""
+
+msgid ""
+"git worktree add [-f] [--detach] [--checkout] [--lock [--reason <string>]]\n"
+"                 [-b <new-branch>] <path> [<commit-ish>]"
+msgstr ""
+
+msgid "git worktree list [-v | --porcelain [-z]]"
+msgstr ""
+
+msgid "git worktree lock [--reason <string>] <worktree>"
+msgstr ""
+
+msgid "git worktree move <worktree> <new-path>"
+msgstr ""
+
+msgid "git worktree prune [-n] [-v] [--expire <expire>]"
+msgstr ""
+
+msgid "git worktree remove [-f] <worktree>"
+msgstr ""
+
+msgid "git worktree repair [<path>...]"
+msgstr ""
+
+msgid "git worktree unlock <worktree>"
+msgstr ""
+
+#, c-format
+msgid "Removing %s/%s: %s"
+msgstr ""
+
+msgid "report pruned working trees"
+msgstr "звітувати про видалення робочих дерев"
+
+msgid "expire working trees older than <time>"
+msgstr ""
+
+#, c-format
+msgid "'%s' already exists"
+msgstr "\"%s\" вже існує"
+
+#, c-format
+msgid "unusable worktree destination '%s'"
+msgstr "непридатне місце призначення робочого дерева \"%s\""
+
+#, c-format
+msgid ""
+"'%s' is a missing but locked worktree;\n"
+"use '%s -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"
+msgstr ""
+
+#, c-format
+msgid ""
+"'%s' is a missing but already registered worktree;\n"
+"use '%s -f' to override, or 'prune' or 'remove' to clear"
+msgstr ""
+
+#, c-format
+msgid "failed to copy '%s' to '%s'; sparse-checkout may not work correctly"
+msgstr ""
+
+#, c-format
+msgid "failed to copy worktree config from '%s' to '%s'"
+msgstr "не вдалося скопіювати конфігурацію робочого дерева з \"%s\" до \"%s\""
+
+#, c-format
+msgid "failed to unset '%s' in '%s'"
+msgstr "не вдалося скинути \"%s\" в \"%s\""
+
+#, c-format
+msgid "could not create directory of '%s'"
+msgstr "не вдалося створити директорію \"%s\""
+
+msgid "initializing"
+msgstr ""
+
+#, c-format
+msgid "Preparing worktree (new branch '%s')"
+msgstr ""
+
+#, c-format
+msgid "Preparing worktree (resetting branch '%s'; was at %s)"
+msgstr ""
+
+#, c-format
+msgid "Preparing worktree (checking out '%s')"
+msgstr ""
+
+#, c-format
+msgid "Preparing worktree (detached HEAD %s)"
+msgstr ""
+
+msgid "checkout <branch> even if already checked out in other worktree"
+msgstr ""
+
+msgid "create a new branch"
+msgstr "створити нову гілку"
+
+msgid "create or reset a branch"
+msgstr "створити або скинути гілку"
+
+msgid "populate the new working tree"
+msgstr "заповнити нове робоче дерево"
+
+msgid "keep the new working tree locked"
+msgstr "зберегти нове робоче дерево зафіксованим"
+
+msgid "reason for locking"
+msgstr ""
+
+msgid "set up tracking mode (see git-branch(1))"
+msgstr ""
+
+msgid "try to match the new branch name with a remote-tracking branch"
+msgstr ""
+"спробуйте співставити нову назву гілки з назвою віддалено відстежуваної гілки"
+
+#, c-format
+msgid "options '%s', '%s', and '%s' cannot be used together"
+msgstr "опції \"%s\", \"%s\" та \"%s\" не можна використовувати разом"
+
+msgid "added with --lock"
+msgstr ""
+
+msgid "--[no-]track can only be used if a new branch is created"
+msgstr ""
+
+msgid "show extended annotations and reasons, if available"
+msgstr ""
+
+msgid "add 'prunable' annotation to worktrees older than <time>"
+msgstr ""
+
+msgid "terminate records with a NUL character"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not a working tree"
+msgstr "\"%s\" не є робочим деревом"
+
+msgid "The main working tree cannot be locked or unlocked"
+msgstr ""
+
+#, c-format
+msgid "'%s' is already locked, reason: %s"
+msgstr ""
+
+#, c-format
+msgid "'%s' is already locked"
+msgstr ""
+
+#, c-format
+msgid "'%s' is not locked"
+msgstr "\"%s\" не зафіксовано"
+
+msgid "working trees containing submodules cannot be moved or removed"
+msgstr ""
+
+msgid "force move even if worktree is dirty or locked"
+msgstr ""
+
+#, c-format
+msgid "'%s' is a main working tree"
+msgstr "\"%s\" є головним робочим деревом"
+
+#, c-format
+msgid "could not figure out destination name from '%s'"
+msgstr ""
+
+#, c-format
+msgid ""
+"cannot move a locked working tree, lock reason: %s\n"
+"use 'move -f -f' to override or unlock first"
+msgstr ""
+
+msgid ""
+"cannot move a locked working tree;\n"
+"use 'move -f -f' to override or unlock first"
+msgstr ""
+
+#, c-format
+msgid "validation failed, cannot move working tree: %s"
+msgstr ""
+
+#, c-format
+msgid "failed to move '%s' to '%s'"
+msgstr "не вдалося перенести \"%s\" до \"%s\""
+
+#, c-format
+msgid "failed to run 'git status' on '%s'"
+msgstr "не вдалося виконати \"git status\" на \"%s\""
+
+#, c-format
+msgid "'%s' contains modified or untracked files, use --force to delete it"
+msgstr ""
+
+#, c-format
+msgid "failed to run 'git status' on '%s', code %d"
+msgstr "не вдалося виконати \"git status\" на \"%s\", код %d"
+
+msgid "force removal even if worktree is dirty or locked"
+msgstr ""
+
+#, c-format
+msgid ""
+"cannot remove a locked working tree, lock reason: %s\n"
+"use 'remove -f -f' to override or unlock first"
+msgstr ""
+
+msgid ""
+"cannot remove a locked working tree;\n"
+"use 'remove -f -f' to override or unlock first"
+msgstr ""
+
+#, c-format
+msgid "validation failed, cannot remove working tree: %s"
+msgstr ""
+
+#, c-format
+msgid "repair: %s: %s"
+msgstr ""
+
+#, c-format
+msgid "error: %s: %s"
+msgstr ""
+
+msgid "git write-tree [--missing-ok] [--prefix=<prefix>/]"
+msgstr ""
+
+msgid "<prefix>/"
+msgstr ""
+
+msgid "write tree object for a subdirectory <prefix>"
+msgstr ""
+
+msgid "only useful for debugging"
+msgstr ""
+
+msgid "core.fsyncMethod = batch is unsupported on this platform"
+msgstr ""
+
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "не вдалося розібрати ключ списку пакунків %s зі значенням \"%s\""
+
+#, c-format
+msgid "bundle list at '%s' has no mode"
+msgstr ""
+
+msgid "failed to create temporary file"
+msgstr "не вдалося створити тимчасовий файл"
+
+msgid "insufficient capabilities"
+msgstr ""
+
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "файл, завантажений з \"%s\", не є пакунком"
+
+msgid "failed to store maximum creation token"
+msgstr "не вдалося зберегти токен максимального створення"
+
+#, c-format
+msgid "unrecognized bundle mode from URI '%s'"
+msgstr ""
+
+#, c-format
+msgid "exceeded bundle URI recursion limit (%d)"
+msgstr ""
+
+#, c-format
+msgid "failed to download bundle from URI '%s'"
+msgstr "не вдалося завантажити пакунок з URI \"%s\""
+
+#, c-format
+msgid "file at URI '%s' is not a bundle or bundle list"
+msgstr ""
+
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr ""
+
+msgid "bundle-uri: expected flush after arguments"
+msgstr ""
+
+msgid "bundle-uri: got an empty line"
+msgstr ""
+
+msgid "bundle-uri: line is not of the form 'key=value'"
+msgstr ""
+
+msgid "bundle-uri: line has empty key or value"
+msgstr ""
+
+#, c-format
+msgid "unrecognized bundle hash algorithm: %s"
+msgstr "нерозпізнаний хеш-алгоритм пакунка: %s"
+
+#, c-format
+msgid "unknown capability '%s'"
+msgstr "невідома властивість \"%s\""
+
+#, c-format
+msgid "'%s' does not look like a v2 or v3 bundle file"
+msgstr ""
+
+#, c-format
+msgid "unrecognized header: %s%s (%d)"
+msgstr ""
+
+msgid "Repository lacks these prerequisite commits:"
+msgstr ""
+
+msgid "need a repository to verify a bundle"
+msgstr ""
+
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr ""
+
+#, c-format
+msgid "The bundle contains this ref:"
+msgid_plural "The bundle contains these %<PRIuMAX> refs:"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "The bundle records a complete history."
+msgstr ""
+
+#, c-format
+msgid "The bundle requires this ref:"
+msgid_plural "The bundle requires these %<PRIuMAX> refs:"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "unable to dup bundle descriptor"
+msgstr "не вдалося продублювати дескриптор пакунка"
+
+msgid "Could not spawn pack-objects"
+msgstr "Не вдалося розмножити об’єкти пакунків"
+
+msgid "pack-objects died"
+msgstr ""
+
+#, c-format
+msgid "ref '%s' is excluded by the rev-list options"
+msgstr ""
+
+#, c-format
+msgid "unsupported bundle version %d"
+msgstr ""
+
+#, c-format
+msgid "cannot write bundle version %d with algorithm %s"
+msgstr ""
+
+msgid "Refusing to create empty bundle."
+msgstr ""
+
+#, c-format
+msgid "cannot create '%s'"
+msgstr "неможливо створити \"%s\""
+
+msgid "index-pack died"
+msgstr ""
+
+msgid "terminating chunk id appears earlier than expected"
+msgstr ""
+
+#, c-format
+msgid "improper chunk offset(s) %<PRIx64> and %<PRIx64>"
+msgstr ""
+
+#, c-format
+msgid "duplicate chunk ID %<PRIx32> found"
+msgstr ""
+
+#, c-format
+msgid "final chunk has non-zero id %<PRIx32>"
+msgstr ""
+
+msgid "invalid hash version"
+msgstr "неприпустима версія хешу"
+
+#, c-format
+msgid "invalid color value: %.*s"
+msgstr "неприпустиме значення кольору: %.*s"
+
+msgid "Add file contents to the index"
+msgstr ""
+
+msgid "Apply a series of patches from a mailbox"
+msgstr ""
+
+msgid "Annotate file lines with commit information"
+msgstr ""
+
+msgid "Apply a patch to files and/or to the index"
+msgstr ""
+
+msgid "Import a GNU Arch repository into Git"
+msgstr ""
+
+msgid "Create an archive of files from a named tree"
+msgstr ""
+
+msgid "Use binary search to find the commit that introduced a bug"
+msgstr ""
+
+msgid "Show what revision and author last modified each line of a file"
+msgstr ""
+
+msgid "List, create, or delete branches"
+msgstr "Показати, створити або видалити гілки"
+
+msgid "Collect information for user to file a bug report"
+msgstr ""
+
+msgid "Move objects and refs by archive"
+msgstr ""
+
+msgid "Provide content or type and size information for repository objects"
+msgstr ""
+
+msgid "Display gitattributes information"
+msgstr ""
+
+msgid "Debug gitignore / exclude files"
+msgstr ""
+
+msgid "Show canonical names and email addresses of contacts"
+msgstr ""
+
+msgid "Ensures that a reference name is well formed"
+msgstr ""
+
+msgid "Switch branches or restore working tree files"
+msgstr "Перемкнути гілки або відновити файли робочого дерева"
+
+msgid "Copy files from the index to the working tree"
+msgstr ""
+
+msgid "Find commits yet to be applied to upstream"
+msgstr ""
+
+msgid "Apply the changes introduced by some existing commits"
+msgstr ""
+
+msgid "Graphical alternative to git-commit"
+msgstr ""
+
+msgid "Remove untracked files from the working tree"
+msgstr "Видалити невідстежувані файли з робочого дерева"
+
+msgid "Clone a repository into a new directory"
+msgstr ""
+
+msgid "Display data in columns"
+msgstr ""
+
+msgid "Record changes to the repository"
+msgstr "Записати зміни у сховище"
+
+msgid "Write and verify Git commit-graph files"
+msgstr ""
+
+msgid "Create a new commit object"
+msgstr ""
+
+msgid "Get and set repository or global options"
+msgstr ""
+
+msgid "Count unpacked number of objects and their disk consumption"
+msgstr ""
+
+msgid "Retrieve and store user credentials"
+msgstr ""
+
+msgid "Helper to temporarily store passwords in memory"
+msgstr ""
+
+msgid "Helper to store credentials on disk"
+msgstr ""
+
+msgid "Export a single commit to a CVS checkout"
+msgstr ""
+
+msgid "Salvage your data out of another SCM people love to hate"
+msgstr ""
+
+msgid "A CVS server emulator for Git"
+msgstr ""
+
+msgid "A really simple server for Git repositories"
+msgstr ""
+
+msgid "Give an object a human readable name based on an available ref"
+msgstr ""
+
+msgid "Generate a zip archive of diagnostic information"
+msgstr ""
+
+msgid "Show changes between commits, commit and working tree, etc"
+msgstr "Показати зміни між комітами, комітом та робочим деревом, тощо"
+
+msgid "Compares files in the working tree and the index"
+msgstr ""
+
+msgid "Compare a tree to the working tree or index"
+msgstr "Порівняти дерево з робочим деревом або індексом"
+
+msgid "Compares the content and mode of blobs found via two tree objects"
+msgstr ""
+
+msgid "Show changes using common diff tools"
+msgstr ""
+
+msgid "Git data exporter"
+msgstr ""
+
+msgid "Backend for fast Git data importers"
+msgstr ""
+
+msgid "Download objects and refs from another repository"
+msgstr ""
+
+msgid "Receive missing objects from another repository"
+msgstr ""
+
+msgid "Rewrite branches"
+msgstr "Перезаписати гілки"
+
+msgid "Produce a merge commit message"
+msgstr ""
+
+msgid "Output information on each ref"
+msgstr ""
+
+msgid "Run a Git command on a list of repositories"
+msgstr ""
+
+msgid "Prepare patches for e-mail submission"
+msgstr ""
+
+msgid "Verifies the connectivity and validity of the objects in the database"
+msgstr ""
+
+msgid "Cleanup unnecessary files and optimize the local repository"
+msgstr ""
+
+msgid "Extract commit ID from an archive created using git-archive"
+msgstr ""
+
+msgid "Print lines matching a pattern"
+msgstr ""
+
+msgid "A portable graphical interface to Git"
+msgstr ""
+
+msgid "Compute object ID and optionally creates a blob from a file"
+msgstr ""
+
+msgid "Display help information about Git"
+msgstr ""
+
+msgid "Run git hooks"
+msgstr ""
+
+msgid "Server side implementation of Git over HTTP"
+msgstr ""
+
+msgid "Download from a remote Git repository via HTTP"
+msgstr ""
+
+msgid "Push objects over HTTP/DAV to another repository"
+msgstr ""
+
+msgid "Send a collection of patches from stdin to an IMAP folder"
+msgstr ""
+
+msgid "Build pack index file for an existing packed archive"
+msgstr ""
+
+msgid "Create an empty Git repository or reinitialize an existing one"
+msgstr ""
+
+msgid "Instantly browse your working repository in gitweb"
+msgstr ""
+
+msgid "Add or parse structured information in commit messages"
+msgstr ""
+
+msgid "Show commit logs"
+msgstr "Показати лог коміта"
+
+msgid "Show information about files in the index and the working tree"
+msgstr ""
+
+msgid "List references in a remote repository"
+msgstr "Показати посилання у віддаленому сховищі"
+
+msgid "List the contents of a tree object"
+msgstr ""
+
+msgid "Extracts patch and authorship from a single e-mail message"
+msgstr ""
+
+msgid "Simple UNIX mbox splitter program"
+msgstr ""
+
+msgid "Run tasks to optimize Git repository data"
+msgstr ""
+
+msgid "Join two or more development histories together"
+msgstr ""
+
+msgid "Find as good common ancestors as possible for a merge"
+msgstr ""
+
+msgid "Run a three-way file merge"
+msgstr ""
+
+msgid "Run a merge for files needing merging"
+msgstr ""
+
+msgid "The standard helper program to use with git-merge-index"
+msgstr ""
+
+msgid "Perform merge without touching index or working tree"
+msgstr ""
+
+msgid "Run merge conflict resolution tools to resolve merge conflicts"
+msgstr ""
+
+msgid "Creates a tag object with extra validation"
+msgstr ""
+
+msgid "Build a tree-object from ls-tree formatted text"
+msgstr ""
+
+msgid "Write and verify multi-pack-indexes"
+msgstr ""
+
+msgid "Move or rename a file, a directory, or a symlink"
+msgstr ""
+
+msgid "Find symbolic names for given revs"
+msgstr ""
+
+msgid "Add or inspect object notes"
+msgstr "Додайте або перевірте нотатки до обʼєктів"
+
+msgid "Import from and submit to Perforce repositories"
+msgstr ""
+
+msgid "Create a packed archive of objects"
+msgstr ""
+
+msgid "Find redundant pack files"
+msgstr "Знайти зайві файли пакунків"
+
+msgid "Pack heads and tags for efficient repository access"
+msgstr ""
+
+msgid "Compute unique ID for a patch"
+msgstr ""
+
+msgid "Prune all unreachable objects from the object database"
+msgstr ""
+
+msgid "Remove extra objects that are already in pack files"
+msgstr ""
+
+msgid "Fetch from and integrate with another repository or a local branch"
+msgstr ""
+
+msgid "Update remote refs along with associated objects"
+msgstr ""
+
+msgid "Applies a quilt patchset onto the current branch"
+msgstr ""
+
+msgid "Compare two commit ranges (e.g. two versions of a branch)"
+msgstr ""
+
+msgid "Reads tree information into the index"
+msgstr ""
+
+msgid "Reapply commits on top of another base tip"
+msgstr ""
+
+msgid "Receive what is pushed into the repository"
+msgstr ""
+
+msgid "Manage reflog information"
+msgstr ""
+
+msgid "Manage set of tracked repositories"
+msgstr "Керувати набором відстежуваних сховищ"
+
+msgid "Pack unpacked objects in a repository"
+msgstr ""
+
+msgid "Create, list, delete refs to replace objects"
+msgstr ""
+
+msgid "Generates a summary of pending changes"
+msgstr ""
+
+msgid "Reuse recorded resolution of conflicted merges"
+msgstr ""
+
+msgid "Reset current HEAD to the specified state"
+msgstr ""
+
+msgid "Restore working tree files"
+msgstr "Відновити файли робочого дерева"
+
+msgid "Lists commit objects in reverse chronological order"
+msgstr ""
+
+msgid "Pick out and massage parameters"
+msgstr ""
+
+msgid "Revert some existing commits"
+msgstr ""
+
+msgid "Remove files from the working tree and from the index"
+msgstr ""
+
+msgid "Send a collection of patches as emails"
+msgstr ""
+
+msgid "Push objects over Git protocol to another repository"
+msgstr ""
+
+msgid "Git's i18n setup code for shell scripts"
+msgstr ""
+
+msgid "Common Git shell script setup code"
+msgstr ""
+
+msgid "Restricted login shell for Git-only SSH access"
+msgstr ""
+
+msgid "Summarize 'git log' output"
+msgstr ""
+
+msgid "Show various types of objects"
+msgstr ""
+
+msgid "Show branches and their commits"
+msgstr "Показати гілки та їхні коміти"
+
+msgid "Show packed archive index"
+msgstr ""
+
+msgid "List references in a local repository"
+msgstr "Показати посилання у локальному сховищі"
+
+msgid "Reduce your working tree to a subset of tracked files"
+msgstr "Скоротити робоче дерево до підмножини відстежуваних файлів"
+
+msgid "Add file contents to the staging area"
+msgstr ""
+
+msgid "Stash the changes in a dirty working directory away"
+msgstr ""
+
+msgid "Show the working tree status"
+msgstr "Показати стан робочого дерева"
+
+msgid "Remove unnecessary whitespace"
+msgstr ""
+
+msgid "Initialize, update or inspect submodules"
+msgstr ""
+
+msgid "Bidirectional operation between a Subversion repository and Git"
+msgstr ""
+
+msgid "Switch branches"
+msgstr "Переключити гілки"
+
+msgid "Read, modify and delete symbolic refs"
+msgstr ""
+
+msgid "Create, list, delete or verify a tag object signed with GPG"
+msgstr ""
+
+msgid "Creates a temporary file with a blob's contents"
+msgstr ""
+
+msgid "Unpack objects from a packed archive"
+msgstr ""
+
+msgid "Register file contents in the working tree to the index"
+msgstr ""
+
+msgid "Update the object name stored in a ref safely"
+msgstr ""
+
+msgid "Update auxiliary info file to help dumb servers"
+msgstr ""
+
+msgid "Send archive back to git-archive"
+msgstr ""
+
+msgid "Send objects packed back to git-fetch-pack"
+msgstr ""
+
+msgid "Show a Git logical variable"
+msgstr ""
+
+msgid "Check the GPG signature of commits"
+msgstr ""
+
+msgid "Validate packed Git archive files"
+msgstr ""
+
+msgid "Check the GPG signature of tags"
+msgstr ""
+
+msgid "Display version information about Git"
+msgstr ""
+
+msgid "Show logs with difference each commit introduces"
+msgstr ""
+
+msgid "Manage multiple working trees"
+msgstr "Керувати кількома робочими деревами"
+
+msgid "Create a tree object from the current index"
+msgstr ""
+
+msgid "Defining attributes per path"
+msgstr ""
+
+msgid "Git command-line interface and conventions"
+msgstr ""
+
+msgid "A Git core tutorial for developers"
+msgstr ""
+
+msgid "Providing usernames and passwords to Git"
+msgstr ""
+
+msgid "Git for CVS users"
+msgstr ""
+
+msgid "Tweaking diff output"
+msgstr ""
+
+msgid "A useful minimum set of commands for Everyday Git"
+msgstr ""
+
+msgid "Frequently asked questions about using Git"
+msgstr ""
+
+msgid "The bundle file format"
+msgstr "Формат файлу пакета"
+
+msgid "Chunk-based file formats"
+msgstr ""
+
+msgid "Git commit-graph format"
+msgstr ""
+
+msgid "Git index format"
+msgstr ""
+
+msgid "Git pack format"
+msgstr ""
+
+msgid "Git cryptographic signature formats"
+msgstr ""
+
+msgid "A Git Glossary"
+msgstr ""
+
+msgid "Hooks used by Git"
+msgstr ""
+
+msgid "Specifies intentionally untracked files to ignore"
+msgstr ""
+
+msgid "The Git repository browser"
+msgstr ""
+
+msgid "Map author/committer names and/or E-Mail addresses"
+msgstr ""
+
+msgid "Defining submodule properties"
+msgstr ""
+
+msgid "Git namespaces"
+msgstr ""
+
+msgid "Protocol v0 and v1 capabilities"
+msgstr ""
+
+msgid "Things common to various protocols"
+msgstr ""
+
+msgid "Git HTTP-based protocols"
+msgstr ""
+
+msgid "How packs are transferred over-the-wire"
+msgstr ""
+
+msgid "Git Wire Protocol, Version 2"
+msgstr ""
+
+msgid "Helper programs to interact with remote repositories"
+msgstr ""
+
+msgid "Git Repository Layout"
+msgstr ""
+
+msgid "Specifying revisions and ranges for Git"
+msgstr ""
+
+msgid "Mounting one repository inside another"
+msgstr ""
+
+msgid "A tutorial introduction to Git"
+msgstr ""
+
+msgid "A tutorial introduction to Git: part two"
+msgstr ""
+
+msgid "Git web interface (web frontend to Git repositories)"
+msgstr ""
+
+msgid "An overview of recommended workflows with Git"
+msgstr ""
+
+msgid "A tool for managing large Git repositories"
+msgstr ""
+
+msgid "commit-graph file is too small"
+msgstr ""
+
+#, c-format
+msgid "commit-graph signature %X does not match signature %X"
+msgstr ""
+
+#, c-format
+msgid "commit-graph version %X does not match version %X"
+msgstr ""
+
+#, c-format
+msgid "commit-graph hash version %X does not match version %X"
+msgstr ""
+
+#, c-format
+msgid "commit-graph file is too small to hold %u chunks"
+msgstr ""
+
+msgid "commit-graph has no base graphs chunk"
+msgstr ""
+
+msgid "commit-graph chain does not match"
+msgstr ""
+
+#, c-format
+msgid "invalid commit-graph chain: line '%s' not a hash"
+msgstr ""
+
+msgid "unable to find all commit-graph files"
+msgstr "не вдалося знайти всі файли графа комітів"
+
+msgid "invalid commit position. commit-graph is likely corrupt"
+msgstr ""
+
+#, c-format
+msgid "could not find commit %s"
+msgstr "не вдалося знайти коміт %s"
+
+msgid "commit-graph requires overflow generation data but has none"
+msgstr ""
+
+msgid "Loading known commits in commit graph"
+msgstr ""
+
+msgid "Expanding reachable commits in commit graph"
+msgstr ""
+
+msgid "Clearing commit marks in commit graph"
+msgstr ""
+
+msgid "Computing commit graph topological levels"
+msgstr ""
+
+msgid "Computing commit graph generation numbers"
+msgstr ""
+
+msgid "Computing commit changed paths Bloom filters"
+msgstr ""
+
+msgid "Collecting referenced commits"
+msgstr ""
+
+#, c-format
+msgid "Finding commits for commit graph in %<PRIuMAX> pack"
+msgid_plural "Finding commits for commit graph in %<PRIuMAX> packs"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "error adding pack %s"
+msgstr "помилка додавання пакету %s"
+
+#, c-format
+msgid "error opening index for %s"
+msgstr ""
+
+msgid "Finding commits for commit graph among packed objects"
+msgstr ""
+
+msgid "Finding extra edges in commit graph"
+msgstr ""
+
+msgid "failed to write correct number of base graph ids"
+msgstr ""
+
+msgid "unable to create temporary graph layer"
+msgstr "не вдалося створити тимчасовий шар графа"
+
+#, c-format
+msgid "unable to adjust shared permissions for '%s'"
+msgstr "не вдалося налаштувати спільні дозволи для \"%s\""
+
+#, c-format
+msgid "Writing out commit graph in %d pass"
+msgid_plural "Writing out commit graph in %d passes"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "unable to open commit-graph chain file"
+msgstr "не вдалося відкрити ланцюжковий файл графа комітів"
+
+msgid "failed to rename base commit-graph file"
+msgstr ""
+
+msgid "failed to rename temporary commit-graph file"
+msgstr "не вдалося перейменувати тимчасовий файл графа комітів"
+
+msgid "Scanning merged commits"
+msgstr ""
+
+msgid "Merging commit-graph"
+msgstr ""
+
+msgid "attempting to write a commit-graph, but 'core.commitGraph' is disabled"
+msgstr ""
+
+msgid "too many commits to write graph"
+msgstr ""
+
+msgid "the commit-graph file has incorrect checksum and is likely corrupt"
+msgstr ""
+
+#, c-format
+msgid "commit-graph has incorrect OID order: %s then %s"
+msgstr ""
+
+#, c-format
+msgid "commit-graph has incorrect fanout value: fanout[%d] = %u != %u"
+msgstr ""
+
+#, c-format
+msgid "failed to parse commit %s from commit-graph"
+msgstr "не вдалося розібрати коміт %s з графа комітв"
+
+msgid "Verifying commits in commit graph"
+msgstr ""
+
+#, c-format
+msgid "failed to parse commit %s from object database for commit-graph"
+msgstr ""
+
+#, c-format
+msgid "root tree OID for commit %s in commit-graph is %s != %s"
+msgstr ""
+
+#, c-format
+msgid "commit-graph parent list for commit %s is too long"
+msgstr ""
+
+#, c-format
+msgid "commit-graph parent for %s is %s != %s"
+msgstr ""
+
+#, c-format
+msgid "commit-graph parent list for commit %s terminates early"
+msgstr ""
+
+#, c-format
+msgid ""
+"commit-graph has generation number zero for commit %s, but non-zero elsewhere"
+msgstr ""
+
+#, c-format
+msgid ""
+"commit-graph has non-zero generation number for commit %s, but zero elsewhere"
+msgstr ""
+
+#, c-format
+msgid "commit-graph generation for commit %s is %<PRIuMAX> < %<PRIuMAX>"
+msgstr ""
+
+#, c-format
+msgid "commit date for commit %s in commit-graph is %<PRIuMAX> != %<PRIuMAX>"
+msgstr ""
+
+#, c-format
+msgid "%s %s is not a commit!"
+msgstr ""
+
+msgid ""
+"Support for <GIT_DIR>/info/grafts is deprecated\n"
+"and will be removed in a future Git version.\n"
+"\n"
+"Please use \"git replace --convert-graft-file\"\n"
+"to convert the grafts into replace refs.\n"
+"\n"
+"Turn this message off by running\n"
+"\"git config advice.graftFileDeprecated false\""
+msgstr ""
+
+#, c-format
+msgid "Commit %s has an untrusted GPG signature, allegedly by %s."
+msgstr ""
+
+#, c-format
+msgid "Commit %s has a bad GPG signature allegedly by %s."
+msgstr ""
+
+#, c-format
+msgid "Commit %s does not have a GPG signature."
+msgstr "Коміт %s не має GPG підпису."
+
+#, c-format
+msgid "Commit %s has a good GPG signature by %s\n"
+msgstr ""
+
+msgid ""
+"Warning: commit message did not conform to UTF-8.\n"
+"You may want to amend it after fixing the message, or set the config\n"
+"variable i18n.commitEncoding to the encoding your project uses.\n"
+msgstr ""
+
+msgid "no compiler information available\n"
+msgstr ""
+
+msgid "no libc information available\n"
+msgstr ""
+
+#, c-format
+msgid "could not determine free disk size for '%s'"
+msgstr "не вдалося визначити вільний розмір диска для \"%s\""
+
+#, c-format
+msgid "could not get info for '%s'"
+msgstr "не вдалося отримати інформацію для \"%s\""
+
+#, c-format
+msgid "[GLE %ld] health thread could not open '%ls'"
+msgstr ""
+
+#, c-format
+msgid "[GLE %ld] health thread getting BHFI for '%ls'"
+msgstr ""
+
+#, c-format
+msgid "could not convert to wide characters: '%s'"
+msgstr "не вдалося перетворити в широкі символи: \"%s\""
+
+#, c-format
+msgid "BHFI changed '%ls'"
+msgstr ""
+
+#, c-format
+msgid "unhandled case in 'has_worktree_moved': %d"
+msgstr ""
+
+#, c-format
+msgid "health thread wait failed [GLE %ld]"
+msgstr ""
+
+#, c-format
+msgid "Invalid path: %s"
+msgstr "Неприпустимий шлях: %s"
+
+msgid "Unable to create FSEventStream."
+msgstr "Не вдалося створити FSEventStream."
+
+msgid "Failed to start the FSEventStream"
+msgstr "Не вдалося запустити потік FSEventStream"
+
+#, c-format
+msgid "[GLE %ld] could not convert path to UTF-8: '%.*ls'"
+msgstr ""
+
+#, c-format
+msgid "[GLE %ld] could not watch '%s'"
+msgstr ""
+
+#, c-format
+msgid "[GLE %ld] could not get longname of '%s'"
+msgstr ""
+
+#, c-format
+msgid "ReadDirectoryChangedW failed on '%s' [GLE %ld]"
+msgstr ""
+
+#, c-format
+msgid "GetOverlappedResult failed on '%s' [GLE %ld]"
+msgstr ""
+
+#, c-format
+msgid "could not read directory changes [GLE %ld]"
+msgstr "не вдалося прочитати зміни директорії [GLE %ld]"
+
+#, c-format
+msgid "opendir('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "lstat('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "strbuf_readlink('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "closedir('%s') failed"
+msgstr ""
+
+#, c-format
+msgid "[GLE %ld] unable to open for read '%ls'"
+msgstr "[GLE %ld] не вдалося відкрити для читання \"%ls\""
+
+#, c-format
+msgid "[GLE %ld] unable to get protocol information for '%ls'"
+msgstr ""
+
+#, c-format
+msgid "failed to copy SID (%ld)"
+msgstr "не вдалося скопіювати SID (%ld)"
+
+#, c-format
+msgid "failed to get owner for '%s' (%ld)"
+msgstr "не вдалося отримати власника для \"%s\" (%ld)"
+
+msgid "memory exhausted"
+msgstr ""
+
+msgid "Success"
+msgstr ""
+
+msgid "No match"
+msgstr ""
+
+msgid "Invalid regular expression"
+msgstr ""
+
+msgid "Invalid collation character"
+msgstr ""
+
+msgid "Invalid character class name"
+msgstr ""
+
+msgid "Trailing backslash"
+msgstr ""
+
+msgid "Invalid back reference"
+msgstr "Неприпустиме зворотнє посилання"
+
+msgid "Unmatched [ or [^"
+msgstr ""
+
+msgid "Unmatched ( or \\("
+msgstr ""
+
+msgid "Unmatched \\{"
+msgstr ""
+
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+msgid "Invalid range end"
+msgstr ""
+
+msgid "Memory exhausted"
+msgstr ""
+
+msgid "Invalid preceding regular expression"
+msgstr ""
+
+msgid "Premature end of regular expression"
+msgstr ""
+
+msgid "Regular expression too big"
+msgstr ""
+
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+msgid "No previous regular expression"
+msgstr ""
+
+msgid "could not send IPC command"
+msgstr ""
+
+msgid "could not read IPC response"
+msgstr "не вдалося прочитати IPC відповідь"
+
+#, c-format
+msgid "could not start accept_thread '%s'"
+msgstr "не вдалося розпочати accept_thread \"%s\""
+
+#, c-format
+msgid "could not start worker[0] for '%s'"
+msgstr "не вдалося запустити worker[0] для \"%s\""
+
+#, c-format
+msgid "ConnectNamedPipe failed for '%s' (%lu)"
+msgstr ""
+
+#, c-format
+msgid "could not create fd from pipe for '%s'"
+msgstr "не вдалося створити fd з каналу для \"%s\""
+
+#, c-format
+msgid "could not start thread[0] for '%s'"
+msgstr "не вдалося запустити thread[0] для \"%s\""
+
+#, c-format
+msgid "wait for hEvent failed for '%s'"
+msgstr "очікування на hEvent не вдалося для \"%s\""
+
+msgid "cannot resume in the background, please use 'fg' to resume"
+msgstr ""
+
+msgid "cannot restore terminal settings"
+msgstr ""
+
+#, c-format
+msgid ""
+"exceeded maximum include depth (%d) while including\n"
+"\t%s\n"
+"from\n"
+"\t%s\n"
+"This might be due to circular includes."
+msgstr ""
+
+#, c-format
+msgid "could not expand include path '%s'"
+msgstr "не вдалося визначити include path \"%s\""
+
+msgid "relative config includes must come from files"
+msgstr ""
+
+msgid "relative config include conditionals must come from files"
+msgstr ""
+
+msgid ""
+"remote URLs cannot be configured in file directly or indirectly included by "
+"includeIf.hasconfig:remote.*.url"
+msgstr ""
+
+#, c-format
+msgid "invalid config format: %s"
+msgstr "неприпустимий формат конфігурації: %s"
+
+#, c-format
+msgid "missing environment variable name for configuration '%.*s'"
+msgstr ""
+
+#, c-format
+msgid "missing environment variable '%s' for configuration '%.*s'"
+msgstr ""
+
+#, c-format
+msgid "key does not contain a section: %s"
+msgstr ""
+
+#, c-format
+msgid "key does not contain variable name: %s"
+msgstr ""
+
+#, c-format
+msgid "invalid key: %s"
+msgstr "неприпустимий ключ: %s"
+
+#, c-format
+msgid "invalid key (newline): %s"
+msgstr "неприпустимий ключ (новий рядок): %s"
+
+msgid "empty config key"
+msgstr ""
+
+#, c-format
+msgid "bogus config parameter: %s"
+msgstr ""
+
+#, c-format
+msgid "bogus format in %s"
+msgstr ""
+
+#, c-format
+msgid "bogus count in %s"
+msgstr ""
+
+#, c-format
+msgid "too many entries in %s"
+msgstr ""
+
+#, c-format
+msgid "missing config key %s"
+msgstr ""
+
+#, c-format
+msgid "missing config value %s"
+msgstr ""
+
+#, c-format
+msgid "bad config line %d in blob %s"
+msgstr ""
+
+#, c-format
+msgid "bad config line %d in file %s"
+msgstr ""
+
+#, c-format
+msgid "bad config line %d in standard input"
+msgstr ""
+
+#, c-format
+msgid "bad config line %d in submodule-blob %s"
+msgstr ""
+
+#, c-format
+msgid "bad config line %d in command line %s"
+msgstr ""
+
+#, c-format
+msgid "bad config line %d in %s"
+msgstr ""
+
+msgid "out of range"
+msgstr ""
+
+msgid "invalid unit"
+msgstr "неприпустима одиниця виміру"
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s': %s"
+msgstr ""
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in blob %s: %s"
+msgstr ""
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in file %s: %s"
+msgstr ""
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in standard input: %s"
+msgstr ""
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in submodule-blob %s: %s"
+msgstr ""
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in command line %s: %s"
+msgstr ""
+
+#, c-format
+msgid "bad numeric config value '%s' for '%s' in %s: %s"
+msgstr ""
+
+#, c-format
+msgid "invalid value for variable %s"
+msgstr "неприпустиме значення для змінної %s"
+
+#, c-format
+msgid "ignoring unknown core.fsync component '%s'"
+msgstr ""
+
+#, c-format
+msgid "bad boolean config value '%s' for '%s'"
+msgstr "неправильне булеве значення конфігурації \"%s\" для \"%s\""
+
+#, c-format
+msgid "failed to expand user dir in: '%s'"
+msgstr "не вдалося визначити директорію користувача в: \"%s\""
+
+#, c-format
+msgid "'%s' for '%s' is not a valid timestamp"
+msgstr "\"%s\" для \"%s\" не є припустимою міткою часу"
+
+#, c-format
+msgid "abbrev length out of range: %d"
+msgstr ""
+
+#, c-format
+msgid "bad zlib compression level %d"
+msgstr ""
+
+msgid "core.commentChar should only be one ASCII character"
+msgstr ""
+
+#, c-format
+msgid "ignoring unknown core.fsyncMethod value '%s'"
+msgstr ""
+
+msgid "core.fsyncObjectFiles is deprecated; use core.fsync instead"
+msgstr ""
+
+#, c-format
+msgid "invalid mode for object creation: %s"
+msgstr "неприпустимий режим створення обʼєкта: %s"
+
+#, c-format
+msgid "malformed value for %s"
+msgstr "неправильно сформоване значення для %s"
+
+#, c-format
+msgid "malformed value for %s: %s"
+msgstr "неправильно сформоване значення для %s: %s"
+
+msgid "must be one of nothing, matching, simple, upstream or current"
+msgstr ""
+
+#, c-format
+msgid "unable to load config blob object '%s'"
+msgstr "не вдалося завантажити config blob обʼєкт \"%s\""
+
+#, c-format
+msgid "reference '%s' does not point to a blob"
+msgstr "посилання \"%s\" не вказує на blob"
+
+#, c-format
+msgid "unable to resolve config blob '%s'"
+msgstr "не вдалося розпізнати config blob \"%s\""
+
+#, c-format
+msgid "failed to parse %s"
+msgstr "не вдалося розібрати %s"
+
+msgid "unable to parse command-line config"
+msgstr "не вдалося розібрати конфігурацію командного рядка"
+
+msgid "unknown error occurred while reading the configuration files"
+msgstr ""
+
+#, c-format
+msgid "Invalid %s: '%s'"
+msgstr "Неприпустимий %s: \"%s\""
+
+#, c-format
+msgid "splitIndex.maxPercentChange value '%d' should be between 0 and 100"
+msgstr ""
+
+#, c-format
+msgid "unable to parse '%s' from command-line config"
+msgstr "не вдалося розібрати \"%s\" з конфігурації командного рядка"
+
+#, c-format
+msgid "bad config variable '%s' in file '%s' at line %d"
+msgstr ""
+
+#, c-format
+msgid "invalid section name '%s'"
+msgstr "неприпустима назва секції \"%s\""
+
+#, c-format
+msgid "%s has multiple values"
+msgstr ""
+
+#, c-format
+msgid "failed to write new configuration file %s"
+msgstr "не вдалося записати новий конфігураційний файл %s"
+
+#, c-format
+msgid "could not lock config file %s"
+msgstr "не вдалося зафіксувати файл конфігурації %s"
+
+#, c-format
+msgid "opening %s"
+msgstr ""
+
+#, c-format
+msgid "invalid config file %s"
+msgstr "неприпустимий конфігураційний файл %s"
+
+#, c-format
+msgid "fstat on %s failed"
+msgstr ""
+
+#, c-format
+msgid "unable to mmap '%s'%s"
+msgstr "не вдалося виконати mmap \"%s\"%s"
+
+#, c-format
+msgid "chmod on %s failed"
+msgstr ""
+
+#, c-format
+msgid "could not write config file %s"
+msgstr "не вдалося записати конфігураційний файл %s"
+
+#, c-format
+msgid "could not set '%s' to '%s'"
+msgstr "не вдалося встановити \"%s\" в \"%s\""
+
+#, c-format
+msgid "invalid section name: %s"
+msgstr "неприпустима назва секції: %s"
+
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr ""
+
+#, c-format
+msgid "missing value for '%s'"
+msgstr "відсутнє значення для \"%s\""
+
+msgid "the remote end hung up upon initial contact"
+msgstr ""
+
+msgid ""
+"Could not read from remote repository.\n"
+"\n"
+"Please make sure you have the correct access rights\n"
+"and the repository exists."
+msgstr ""
+
+#, c-format
+msgid "server doesn't support '%s'"
+msgstr ""
+
+#, c-format
+msgid "server doesn't support feature '%s'"
+msgstr ""
+
+msgid "expected flush after capabilities"
+msgstr ""
+
+#, c-format
+msgid "ignoring capabilities after first line '%s'"
+msgstr ""
+
+msgid "protocol error: unexpected capabilities^{}"
+msgstr ""
+
+#, c-format
+msgid "protocol error: expected shallow sha-1, got '%s'"
+msgstr ""
+
+msgid "repository on the other end cannot be shallow"
+msgstr ""
+
+msgid "invalid packet"
+msgstr "неприпустимий пакет"
+
+#, c-format
+msgid "protocol error: unexpected '%s'"
+msgstr ""
+
+#, c-format
+msgid "unknown object format '%s' specified by server"
+msgstr ""
+
+#, c-format
+msgid "error on bundle-uri response line %d: %s"
+msgstr ""
+
+msgid "expected flush after bundle-uri listing"
+msgstr ""
+
+msgid "expected response end packet after ref listing"
+msgstr ""
+
+#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "неприпустима ls-refs відповідь: %s"
+
+msgid "expected flush after ref listing"
+msgstr ""
+
+#, c-format
+msgid "protocol '%s' is not supported"
+msgstr "протокол \"%s\" не підтримується"
+
+msgid "unable to set SO_KEEPALIVE on socket"
+msgstr ""
+
+#, c-format
+msgid "Looking up %s ... "
+msgstr ""
+
+#, c-format
+msgid "unable to look up %s (port %s) (%s)"
+msgstr "не вдалося знайти %s (порт %s) (%s)"
+
+#. TRANSLATORS: this is the end of "Looking up %s ... "
+
+#, c-format
+msgid ""
+"done.\n"
+"Connecting to %s (port %s) ... "
+msgstr ""
+
+#, c-format
+msgid ""
+"unable to connect to %s:\n"
+"%s"
+msgstr ""
+"не вдалося приєднатися до %s:\n"
+"%s"
+
+#. TRANSLATORS: this is the end of "Connecting to %s (port %s) ... "
+
+msgid "done."
+msgstr "готово."
+
+#, c-format
+msgid "unable to look up %s (%s)"
+msgstr "не вдалося знайти %s (%s)"
+
+#, c-format
+msgid "unknown port %s"
+msgstr "невідомий порт %s"
+
+#, c-format
+msgid "strange hostname '%s' blocked"
+msgstr ""
+
+#, c-format
+msgid "strange port '%s' blocked"
+msgstr ""
+
+#, c-format
+msgid "cannot start proxy %s"
+msgstr "неможливо запустити проксі %s"
+
+msgid "no path specified; see 'git help pull' for valid url syntax"
+msgstr ""
+
+msgid "newline is forbidden in git:// hosts and repo paths"
+msgstr ""
+
+msgid "ssh variant 'simple' does not support -4"
+msgstr ""
+
+msgid "ssh variant 'simple' does not support -6"
+msgstr ""
+
+msgid "ssh variant 'simple' does not support setting port"
+msgstr ""
+
+#, c-format
+msgid "strange pathname '%s' blocked"
+msgstr ""
+
+msgid "unable to fork"
+msgstr "неможливо розгалужити"
+
+msgid "Could not run 'git rev-list'"
+msgstr "Не вдалося запустити \"git rev-list\""
+
+msgid "failed write to rev-list"
+msgstr "не вдалося записати до rev-list"
+
+msgid "failed to close rev-list's stdin"
+msgstr ""
+
+#, c-format
+msgid "illegal crlf_action %d"
+msgstr ""
+
+#, c-format
+msgid "CRLF would be replaced by LF in %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"in the working copy of '%s', CRLF will be replaced by LF the next time Git "
+"touches it"
+msgstr ""
+
+#, c-format
+msgid "LF would be replaced by CRLF in %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"in the working copy of '%s', LF will be replaced by CRLF the next time Git "
+"touches it"
+msgstr ""
+
+#, c-format
+msgid "BOM is prohibited in '%s' if encoded as %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"The file '%s' contains a byte order mark (BOM). Please use UTF-%.*s as "
+"working-tree-encoding."
+msgstr ""
+
+#, c-format
+msgid "BOM is required in '%s' if encoded as %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"The file '%s' is missing a byte order mark (BOM). Please use UTF-%sBE or UTF-"
+"%sLE (depending on the byte order) as working-tree-encoding."
+msgstr ""
+
+#, c-format
+msgid "failed to encode '%s' from %s to %s"
+msgstr "не вдалося закодувати \"%s\" з %s в %s"
+
+#, c-format
+msgid "encoding '%s' from %s to %s and back is not the same"
+msgstr ""
+
+#, c-format
+msgid "cannot fork to run external filter '%s'"
+msgstr "неможливо розгалужити для запуску зовнішнього фільтра \"%s\""
+
+#, c-format
+msgid "cannot feed the input to external filter '%s'"
+msgstr "неможливо подати вхідні дані на зовнішній фільтр \"%s\""
+
+#, c-format
+msgid "external filter '%s' failed %d"
+msgstr ""
+
+#, c-format
+msgid "read from external filter '%s' failed"
+msgstr ""
+
+#, c-format
+msgid "external filter '%s' failed"
+msgstr ""
+
+msgid "unexpected filter type"
+msgstr ""
+
+msgid "path name too long for external filter"
+msgstr ""
+
+#, c-format
+msgid ""
+"external filter '%s' is not available anymore although not all paths have "
+"been filtered"
+msgstr ""
+
+msgid "true/false are no valid working-tree-encodings"
+msgstr ""
+
+#, c-format
+msgid "%s: clean filter '%s' failed"
+msgstr ""
+
+#, c-format
+msgid "%s: smudge filter %s failed"
+msgstr ""
+
+#, c-format
+msgid "skipping credential lookup for key: credential.%s"
+msgstr ""
+
+msgid "refusing to work with credential missing host field"
+msgstr ""
+
+msgid "refusing to work with credential missing protocol field"
+msgstr ""
+
+#, c-format
+msgid "url contains a newline in its %s component: %s"
+msgstr ""
+
+#, c-format
+msgid "url has no scheme: %s"
+msgstr ""
+
+#, c-format
+msgid "credential url cannot be parsed: %s"
+msgstr ""
+
+msgid "in the future"
+msgstr ""
+
+#, c-format
+msgid "%<PRIuMAX> second ago"
+msgid_plural "%<PRIuMAX> seconds ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "%<PRIuMAX> minute ago"
+msgid_plural "%<PRIuMAX> minutes ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "%<PRIuMAX> hour ago"
+msgid_plural "%<PRIuMAX> hours ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "%<PRIuMAX> day ago"
+msgid_plural "%<PRIuMAX> days ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "%<PRIuMAX> week ago"
+msgid_plural "%<PRIuMAX> weeks ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "%<PRIuMAX> month ago"
+msgid_plural "%<PRIuMAX> months ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "%<PRIuMAX> year"
+msgid_plural "%<PRIuMAX> years"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#. TRANSLATORS: "%s" is "<n> years"
+
+#, c-format
+msgid "%s, %<PRIuMAX> month ago"
+msgid_plural "%s, %<PRIuMAX> months ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid "%<PRIuMAX> year ago"
+msgid_plural "%<PRIuMAX> years ago"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "Propagating island marks"
+msgstr ""
+
+#, c-format
+msgid "bad tree object %s"
+msgstr "невірний обʼєкт дерева %s"
+
+#, c-format
+msgid "failed to load island regex for '%s': %s"
+msgstr "не вдалося завантажити island регвир для \"%s\": %s"
+
+#, c-format
+msgid "island regex from config has too many capture groups (max=%d)"
+msgstr ""
+
+#, c-format
+msgid "Marked %d islands, done.\n"
+msgstr ""
+
+#, c-format
+msgid "invalid --%s value '%s'"
+msgstr "неприпустиме --%s значення \"%s\""
+
+#, c-format
+msgid "could not archive missing directory '%s'"
+msgstr "не вдалося заархівувати відсутню директорію \"%s\""
+
+#, c-format
+msgid "could not open directory '%s'"
+msgstr "не вдалося відкрити директорію \"%s\""
+
+#, c-format
+msgid "skipping '%s', which is neither file nor directory"
+msgstr ""
+
+msgid "could not duplicate stdout"
+msgstr "не вдалося продублювати stdout"
+
+#, c-format
+msgid "could not add directory '%s' to archiver"
+msgstr "не вдалося додати директорію \"%s\" до архіватора"
+
+msgid "failed to write archive"
+msgstr "не вдалося записати архів"
+
+msgid "--merge-base does not work with ranges"
+msgstr ""
+
+msgid "--merge-base only works with commits"
+msgstr ""
+
+msgid "unable to get HEAD"
+msgstr "не вдалося отримати HEAD"
+
+msgid "no merge base found"
+msgstr ""
+
+msgid "multiple merge bases found"
+msgstr ""
+
+msgid "git diff --no-index [<options>] <path> <path>"
+msgstr "git diff --no-index [<опції>] <шлях> <шлях>"
+
+msgid ""
+"Not a git repository. Use --no-index to compare two paths outside a working "
+"tree"
+msgstr ""
+
+#, c-format
+msgid "  Failed to parse dirstat cut-off percentage '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "  Unknown dirstat parameter '%s'\n"
+msgstr ""
+
+msgid ""
+"color moved setting must be one of 'no', 'default', 'blocks', 'zebra', "
+"'dimmed-zebra', 'plain'"
+msgstr ""
+
+#, c-format
+msgid ""
+"unknown color-moved-ws mode '%s', possible values are 'ignore-space-change', "
+"'ignore-space-at-eol', 'ignore-all-space', 'allow-indentation-change'"
+msgstr ""
+
+msgid ""
+"color-moved-ws: allow-indentation-change cannot be combined with other "
+"whitespace modes"
+msgstr ""
+
+#, c-format
+msgid "Unknown value for 'diff.submodule' config variable: '%s'"
+msgstr ""
+
+#, c-format
+msgid ""
+"Found errors in 'diff.dirstat' config variable:\n"
+"%s"
+msgstr ""
+
+#, c-format
+msgid "external diff died, stopping at %s"
+msgstr ""
+
+#, c-format
+msgid "options '%s', '%s', '%s', and '%s' cannot be used together"
+msgstr "опції \"%s\", \"%s\", \"%s\" та \"%s\" неможливо використовувати разом"
+
+#, c-format
+msgid "options '%s' and '%s' cannot be used together, use '%s' with '%s'"
+msgstr ""
+"опції \"%s\" і \"%s\" неможливо використати разом, використовуйте \"%s\" з "
+"\"%s\""
+
+#, c-format
+msgid ""
+"options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"
+msgstr ""
+"опції \"%s\" і \"%s\" неможливо використати разом, використовуйте \"%s\" з "
+"\"%s\" та \"%s\""
+
+msgid "--follow requires exactly one pathspec"
+msgstr ""
+
+#, c-format
+msgid "invalid --stat value: %s"
+msgstr "неприпустиме --stat значення: %s"
+
+#, c-format
+msgid "%s expects a numerical value"
+msgstr ""
+
+#, c-format
+msgid ""
+"Failed to parse --dirstat/-X option parameter:\n"
+"%s"
+msgstr ""
+
+#, c-format
+msgid "unknown change class '%c' in --diff-filter=%s"
+msgstr ""
+
+#, c-format
+msgid "unknown value after ws-error-highlight=%.*s"
+msgstr ""
+
+#, c-format
+msgid "unable to resolve '%s'"
+msgstr "не вдалося розпізнати \"%s\""
+
+#, c-format
+msgid "%s expects <n>/<m> form"
+msgstr ""
+
+#, c-format
+msgid "%s expects a character, got '%s'"
+msgstr "%s очікує символ, отримано \"%s\""
+
+#, c-format
+msgid "bad --color-moved argument: %s"
+msgstr ""
+
+#, c-format
+msgid "invalid mode '%s' in --color-moved-ws"
+msgstr ""
+
+msgid ""
+"option diff-algorithm accepts \"myers\", \"minimal\", \"patience\" and "
+"\"histogram\""
+msgstr ""
+
+#, c-format
+msgid "invalid argument to %s"
+msgstr "неприпустимий аргумент до %s"
+
+#, c-format
+msgid "invalid regex given to -I: '%s'"
+msgstr "неприпустимий regex, переданий до -I: \"%s\""
+
+#, c-format
+msgid "failed to parse --submodule option parameter: '%s'"
+msgstr "не вдалося розібрати параметр опції --submodule: \"%s\""
+
+#, c-format
+msgid "bad --word-diff argument: %s"
+msgstr ""
+
+msgid "Diff output format options"
+msgstr ""
+
+msgid "generate patch"
+msgstr "згенерувати латку"
+
+msgid "<n>"
+msgstr ""
+
+msgid "generate diffs with <n> lines context"
+msgstr ""
+
+msgid "generate the diff in raw format"
+msgstr ""
+
+msgid "synonym for '-p --raw'"
+msgstr ""
+
+msgid "synonym for '-p --stat'"
+msgstr ""
+
+msgid "machine friendly --stat"
+msgstr "машинний вивід --stat"
+
+msgid "output only the last line of --stat"
+msgstr ""
+
+msgid "<param1,param2>..."
+msgstr ""
+
+msgid ""
+"output the distribution of relative amount of changes for each sub-directory"
+msgstr ""
+
+msgid "synonym for --dirstat=cumulative"
+msgstr ""
+
+msgid "synonym for --dirstat=files,param1,param2..."
+msgstr ""
+
+msgid "warn if changes introduce conflict markers or whitespace errors"
+msgstr ""
+
+msgid "condensed summary such as creations, renames and mode changes"
+msgstr ""
+
+msgid "show only names of changed files"
+msgstr ""
+
+msgid "show only names and status of changed files"
+msgstr ""
+
+msgid "<width>[,<name-width>[,<count>]]"
+msgstr ""
+
+msgid "generate diffstat"
+msgstr ""
+
+msgid "<width>"
+msgstr ""
+
+msgid "generate diffstat with a given width"
+msgstr ""
+
+msgid "generate diffstat with a given name width"
+msgstr ""
+
+msgid "generate diffstat with a given graph width"
+msgstr ""
+
+msgid "<count>"
+msgstr ""
+
+msgid "generate diffstat with limited lines"
+msgstr ""
+
+msgid "generate compact summary in diffstat"
+msgstr ""
+
+msgid "output a binary diff that can be applied"
+msgstr ""
+
+msgid "show full pre- and post-image object names on the \"index\" lines"
+msgstr ""
+
+msgid "show colored diff"
+msgstr ""
+
+msgid "<kind>"
+msgstr ""
+
+msgid ""
+"highlight whitespace errors in the 'context', 'old' or 'new' lines in the "
+"diff"
+msgstr ""
+
+msgid ""
+"do not munge pathnames and use NULs as output field terminators in --raw or "
+"--numstat"
+msgstr ""
+
+msgid "<prefix>"
+msgstr ""
+
+msgid "show the given source prefix instead of \"a/\""
+msgstr ""
+
+msgid "show the given destination prefix instead of \"b/\""
+msgstr ""
+
+msgid "prepend an additional prefix to every line of output"
+msgstr ""
+
+msgid "do not show any source or destination prefix"
+msgstr ""
+
+msgid "use default prefixes a/ and b/"
+msgstr ""
+
+msgid "show context between diff hunks up to the specified number of lines"
+msgstr ""
+
+msgid "<char>"
+msgstr ""
+
+msgid "specify the character to indicate a new line instead of '+'"
+msgstr ""
+
+msgid "specify the character to indicate an old line instead of '-'"
+msgstr ""
+
+msgid "specify the character to indicate a context instead of ' '"
+msgstr ""
+
+msgid "Diff rename options"
+msgstr ""
+
+msgid "<n>[/<m>]"
+msgstr ""
+
+msgid "break complete rewrite changes into pairs of delete and create"
+msgstr ""
+
+msgid "detect renames"
+msgstr ""
+
+msgid "omit the preimage for deletes"
+msgstr ""
+
+msgid "detect copies"
+msgstr ""
+
+msgid "use unmodified files as source to find copies"
+msgstr ""
+
+msgid "disable rename detection"
+msgstr ""
+
+msgid "use empty blobs as rename source"
+msgstr ""
+
+msgid "continue listing the history of a file beyond renames"
+msgstr ""
+
+msgid ""
+"prevent rename/copy detection if the number of rename/copy targets exceeds "
+"given limit"
+msgstr ""
+
+msgid "Diff algorithm options"
+msgstr ""
+
+msgid "produce the smallest possible diff"
+msgstr ""
+
+msgid "ignore whitespace when comparing lines"
+msgstr ""
+
+msgid "ignore changes in amount of whitespace"
+msgstr ""
+
+msgid "ignore changes in whitespace at EOL"
+msgstr ""
+
+msgid "ignore carrier-return at the end of line"
+msgstr ""
+
+msgid "ignore changes whose lines are all blank"
+msgstr ""
+
+msgid "<regex>"
+msgstr ""
+
+msgid "ignore changes whose all lines match <regex>"
+msgstr ""
+
+msgid "heuristic to shift diff hunk boundaries for easy reading"
+msgstr ""
+
+msgid "generate diff using the \"patience diff\" algorithm"
+msgstr ""
+
+msgid "generate diff using the \"histogram diff\" algorithm"
+msgstr ""
+
+msgid "<algorithm>"
+msgstr ""
+
+msgid "choose a diff algorithm"
+msgstr ""
+
+msgid "<text>"
+msgstr ""
+
+msgid "generate diff using the \"anchored diff\" algorithm"
+msgstr ""
+
+msgid "<mode>"
+msgstr ""
+
+msgid "show word diff, using <mode> to delimit changed words"
+msgstr ""
+
+msgid "use <regex> to decide what a word is"
+msgstr ""
+
+msgid "equivalent to --word-diff=color --word-diff-regex=<regex>"
+msgstr ""
+
+msgid "moved lines of code are colored differently"
+msgstr ""
+
+msgid "how white spaces are ignored in --color-moved"
+msgstr ""
+
+msgid "Other diff options"
+msgstr ""
+
+msgid "when run from subdir, exclude changes outside and show relative paths"
+msgstr ""
+
+msgid "treat all files as text"
+msgstr ""
+
+msgid "swap two inputs, reverse the diff"
+msgstr ""
+
+msgid "exit with 1 if there were differences, 0 otherwise"
+msgstr ""
+
+msgid "disable all output of the program"
+msgstr ""
+
+msgid "allow an external diff helper to be executed"
+msgstr ""
+
+msgid "run external text conversion filters when comparing binary files"
+msgstr ""
+
+msgid "<when>"
+msgstr ""
+
+msgid "ignore changes to submodules in the diff generation"
+msgstr ""
+
+msgid "<format>"
+msgstr ""
+
+msgid "specify how differences in submodules are shown"
+msgstr ""
+
+msgid "hide 'git add -N' entries from the index"
+msgstr "приховати записи \"git add -N\" з індексу"
+
+msgid "treat 'git add -N' entries as real in the index"
+msgstr ""
+
+msgid "<string>"
+msgstr ""
+
+msgid ""
+"look for differences that change the number of occurrences of the specified "
+"string"
+msgstr ""
+
+msgid ""
+"look for differences that change the number of occurrences of the specified "
+"regex"
+msgstr ""
+
+msgid "show all changes in the changeset with -S or -G"
+msgstr ""
+
+msgid "treat <string> in -S as extended POSIX regular expression"
+msgstr ""
+
+msgid "control the order in which files appear in the output"
+msgstr ""
+
+msgid "<path>"
+msgstr "<шлях>"
+
+msgid "show the change in the specified path first"
+msgstr ""
+
+msgid "skip the output to the specified path"
+msgstr ""
+
+msgid "<object-id>"
+msgstr ""
+
+msgid ""
+"look for differences that change the number of occurrences of the specified "
+"object"
+msgstr ""
+
+msgid "[(A|C|D|M|R|T|U|X|B)...[*]]"
+msgstr ""
+
+msgid "select files by diff type"
+msgstr ""
+
+msgid "<file>"
+msgstr ""
+
+msgid "output to a specific file"
+msgstr ""
+
+msgid "exhaustive rename detection was skipped due to too many files."
+msgstr ""
+
+msgid "only found copies from modified paths due to too many files."
+msgstr ""
+
+#, c-format
+msgid ""
+"you may want to set your %s variable to at least %d and retry the command."
+msgstr ""
+
+#, c-format
+msgid "failed to read orderfile '%s'"
+msgstr "не вдалося прочитати orderfile \"%s\""
+
+msgid "Performing inexact rename detection"
+msgstr ""
+
+#, c-format
+msgid "No such path '%s' in the diff"
+msgstr ""
+
+#, c-format
+msgid "pathspec '%s' did not match any file(s) known to git"
+msgstr ""
+
+#, c-format
+msgid "unrecognized pattern: '%s'"
+msgstr "нерозпізнаний шаблон: \"%s\""
+
+#, c-format
+msgid "unrecognized negative pattern: '%s'"
+msgstr "нерозпізнаний негативний шаблон: \"%s\""
+
+#, c-format
+msgid "your sparse-checkout file may have issues: pattern '%s' is repeated"
+msgstr ""
+
+msgid "disabling cone pattern matching"
+msgstr ""
+
+#, c-format
+msgid "cannot use %s as an exclude file"
+msgstr "неможливо використовувати %s як файл виключення"
+
+msgid "failed to get kernel name and information"
+msgstr ""
+
+msgid "untracked cache is disabled on this system or location"
+msgstr ""
+
+msgid ""
+"No directory name could be guessed.\n"
+"Please specify a directory on the command line"
+msgstr ""
+
+#, c-format
+msgid "index file corrupt in repo %s"
+msgstr "пошкоджено індексний файл у сховищі %s"
+
+#, c-format
+msgid "could not create directories for %s"
+msgstr "не вдалося створити директорії для %s"
+
+#, c-format
+msgid "could not migrate git directory from '%s' to '%s'"
+msgstr "не вдалося перенести git директорію з \"%s\" до \"%s\""
+
+#, c-format
+msgid "hint: Waiting for your editor to close the file...%c"
+msgstr ""
+
+#, c-format
+msgid "could not write to '%s'"
+msgstr "не вдалося записати в \"%s\""
+
+#, c-format
+msgid "could not edit '%s'"
+msgstr "не вдалося відредагувати \"%s\""
+
+msgid "Filtering content"
+msgstr ""
+
+#, c-format
+msgid "could not stat file '%s'"
+msgstr "не вдалося виконати stat для %s"
+
+#, c-format
+msgid "bad git namespace path \"%s\""
+msgstr ""
+
+#, c-format
+msgid "too many args to run %s"
+msgstr "забагато аргументів для запуску %s"
+
+msgid "git fetch-pack: expected shallow list"
+msgstr ""
+
+msgid "git fetch-pack: expected a flush packet after shallow list"
+msgstr ""
+
+msgid "git fetch-pack: expected ACK/NAK, got a flush packet"
+msgstr ""
+
+#, c-format
+msgid "git fetch-pack: expected ACK/NAK, got '%s'"
+msgstr "git fetch-pack: очікувалось ACK/NAK, отримано \"%s\""
+
+msgid "unable to write to remote"
+msgstr "не вдалося записати до віддаленого сховища"
+
+msgid "Server supports filter"
+msgstr ""
+
+#, c-format
+msgid "invalid shallow line: %s"
+msgstr "неприпустимий shallow рядок: %s"
+
+#, c-format
+msgid "invalid unshallow line: %s"
+msgstr "неприпустимий unshallow рядок: %s"
+
+#, c-format
+msgid "object not found: %s"
+msgstr ""
+
+#, c-format
+msgid "error in object: %s"
+msgstr "помилка в обʼєкті: %s"
+
+#, c-format
+msgid "no shallow found: %s"
+msgstr ""
+
+#, c-format
+msgid "expected shallow/unshallow, got %s"
+msgstr ""
+
+#, c-format
+msgid "got %s %d %s"
+msgstr ""
+
+#, c-format
+msgid "invalid commit %s"
+msgstr "неприпустимий коміт %s"
+
+msgid "giving up"
+msgstr ""
+
+msgid "done"
+msgstr "готово"
+
+#, c-format
+msgid "got %s (%d) %s"
+msgstr ""
+
+#, c-format
+msgid "Marking %s as complete"
+msgstr ""
+
+#, c-format
+msgid "already have %s (%s)"
+msgstr ""
+
+msgid "fetch-pack: unable to fork off sideband demultiplexer"
+msgstr ""
+
+msgid "protocol error: bad pack header"
+msgstr ""
+
+#, c-format
+msgid "fetch-pack: unable to fork off %s"
+msgstr ""
+
+msgid "fetch-pack: invalid index-pack output"
+msgstr ""
+
+#, c-format
+msgid "%s failed"
+msgstr ""
+
+msgid "error in sideband demultiplexer"
+msgstr ""
+
+#, c-format
+msgid "Server version is %.*s"
+msgstr ""
+
+#, c-format
+msgid "Server supports %s"
+msgstr ""
+
+msgid "Server does not support shallow clients"
+msgstr ""
+
+msgid "Server does not support --shallow-since"
+msgstr ""
+
+msgid "Server does not support --shallow-exclude"
+msgstr ""
+
+msgid "Server does not support --deepen"
+msgstr ""
+
+msgid "Server does not support this repository's object format"
+msgstr ""
+
+msgid "no common commits"
+msgstr "немає спільних комітів"
+
+msgid "git fetch-pack: fetch failed."
+msgstr ""
+
+#, c-format
+msgid "mismatched algorithms: client %s; server %s"
+msgstr ""
+
+#, c-format
+msgid "the server does not support algorithm '%s'"
+msgstr "сервер не підтримує алгоритм \"%s\""
+
+msgid "Server does not support shallow requests"
+msgstr ""
+
+msgid "unable to write request to remote"
+msgstr "не вдалося записати запит до віддаленого сховища"
+
+#, c-format
+msgid "expected '%s', received '%s'"
+msgstr "очікувалось \"%s\", отримано \"%s\""
+
+#, c-format
+msgid "expected '%s'"
+msgstr "очікувалось \"%s\""
+
+#, c-format
+msgid "unexpected acknowledgment line: '%s'"
+msgstr ""
+
+#, c-format
+msgid "error processing acks: %d"
+msgstr ""
+
+#. TRANSLATORS: The parameter will be 'ready', a protocol
+#. keyword.
+#.
+
+#, c-format
+msgid "expected packfile to be sent after '%s'"
+msgstr ""
+
+#. TRANSLATORS: The parameter will be 'ready', a protocol
+#. keyword.
+#.
+
+#, c-format
+msgid "expected no other sections to be sent after no '%s'"
+msgstr ""
+
+#, c-format
+msgid "error processing shallow info: %d"
+msgstr ""
+
+#, c-format
+msgid "expected wanted-ref, got '%s'"
+msgstr "очікувалося wanted-ref, отримано \"%s\""
+
+#, c-format
+msgid "unexpected wanted-ref: '%s'"
+msgstr ""
+
+#, c-format
+msgid "error processing wanted refs: %d"
+msgstr ""
+
+msgid "git fetch-pack: expected response end packet"
+msgstr ""
+
+msgid "no matching remote head"
+msgstr ""
+
+msgid "unexpected 'ready' from remote"
+msgstr ""
+
+#, c-format
+msgid "no such remote ref %s"
+msgstr "немає такого віддаленного посилання %s"
+
+#, c-format
+msgid "Server does not allow request for unadvertised object %s"
+msgstr ""
+
+#, c-format
+msgid "fsmonitor_ipc__send_query: invalid path '%s'"
+msgstr ""
+
+#, c-format
+msgid "fsmonitor_ipc__send_query: unspecified error on '%s'"
+msgstr ""
+
+msgid "fsmonitor--daemon is not running"
+msgstr ""
+
+#, c-format
+msgid "could not send '%s' command to fsmonitor--daemon"
+msgstr ""
+
+#, c-format
+msgid "bare repository '%s' is incompatible with fsmonitor"
+msgstr "порожнє сховище \"%s\" несумісне з fsmonitor"
+
+#, c-format
+msgid "repository '%s' is incompatible with fsmonitor due to errors"
+msgstr ""
+
+#, c-format
+msgid "remote repository '%s' is incompatible with fsmonitor"
+msgstr "віддалене сховище \"%s\" несумісне з fsmonitor"
+
+#, c-format
+msgid "virtual repository '%s' is incompatible with fsmonitor"
+msgstr ""
+
+#, c-format
+msgid ""
+"socket directory '%s' is incompatible with fsmonitor due to lack of Unix "
+"sockets support"
+msgstr ""
+
+msgid ""
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
+"           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
+"           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
+"bare]\n"
+"           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
+"           [--config-env=<name>=<envvar>] <command> [<args>]"
+msgstr ""
+
+msgid ""
+"'git help -a' and 'git help -g' list available subcommands and some\n"
+"concept guides. See 'git help <command>' or 'git help <concept>'\n"
+"to read about a specific subcommand or concept.\n"
+"See 'git help git' for an overview of the system."
+msgstr ""
+
+#, c-format
+msgid "unsupported command listing type '%s'"
+msgstr ""
+
+#, c-format
+msgid "no directory given for '%s' option\n"
+msgstr ""
+
+#, c-format
+msgid "no namespace given for --namespace\n"
+msgstr ""
+
+#, c-format
+msgid "-c expects a configuration string\n"
+msgstr ""
+
+#, c-format
+msgid "no config key given for --config-env\n"
+msgstr ""
+
+#, c-format
+msgid "unknown option: %s\n"
+msgstr ""
+
+#, c-format
+msgid "while expanding alias '%s': '%s'"
+msgstr ""
+
+#, c-format
+msgid ""
+"alias '%s' changes environment variables.\n"
+"You can use '!git' in the alias to do this"
+msgstr ""
+
+#, c-format
+msgid "empty alias for %s"
+msgstr ""
+
+#, c-format
+msgid "recursive alias: %s"
+msgstr ""
+
+msgid "write failure on standard output"
+msgstr ""
+
+msgid "unknown write failure on standard output"
+msgstr ""
+
+msgid "close failed on standard output"
+msgstr ""
+
+#, c-format
+msgid "alias loop detected: expansion of '%s' does not terminate:%s"
+msgstr ""
+
+#, c-format
+msgid "cannot handle %s as a builtin"
+msgstr ""
+
+#, c-format
+msgid ""
+"usage: %s\n"
+"\n"
+msgstr ""
+
+#, c-format
+msgid "expansion of alias '%s' failed; '%s' is not a git command\n"
+msgstr ""
+
+#, c-format
+msgid "failed to run command '%s': %s\n"
+msgstr "не вдалося виконати команду \"%s\": %s\n"
+
+msgid "could not create temporary file"
+msgstr "не вдалося створити тимчасовий файл"
+
+#, c-format
+msgid "failed writing detached signature to '%s'"
+msgstr "не вдалося записати відʼєднаний підпис до \"%s\""
+
+msgid ""
+"gpg.ssh.allowedSignersFile needs to be configured and exist for ssh "
+"signature verification"
+msgstr ""
+
+msgid ""
+"ssh-keygen -Y find-principals/verify is needed for ssh signature "
+"verification (available in openssh version 8.2p1+)"
+msgstr ""
+
+#, c-format
+msgid "ssh signing revocation file configured but not found: %s"
+msgstr ""
+
+#, c-format
+msgid "bad/incompatible signature '%s'"
+msgstr ""
+
+#, c-format
+msgid "failed to get the ssh fingerprint for key '%s'"
+msgstr "не вдалося отримати ssh відбиток для ключа \"%s\""
+
+msgid ""
+"either user.signingkey or gpg.ssh.defaultKeyCommand needs to be configured"
+msgstr ""
+
+#, c-format
+msgid "gpg.ssh.defaultKeyCommand succeeded but returned no keys: %s %s"
+msgstr ""
+
+#, c-format
+msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg не вдалося підписати дані:\n"
+"%s"
+
+msgid "user.signingKey needs to be set for ssh signing"
+msgstr ""
+
+#, c-format
+msgid "failed writing ssh signing key to '%s'"
+msgstr "не вдалося записати ssh ключ підпису до \"%s\""
+
+#, c-format
+msgid "failed writing ssh signing key buffer to '%s'"
+msgstr "не вдалося записати буфер ssh ключа підпису в \"%s\""
+
+msgid ""
+"ssh-keygen -Y sign is needed for ssh signing (available in openssh version "
+"8.2p1+)"
+msgstr ""
+
+#, c-format
+msgid "failed reading ssh signing data buffer from '%s'"
+msgstr ""
+
+#, c-format
+msgid "ignored invalid color '%.*s' in log.graphColors"
+msgstr ""
+
+msgid ""
+"given pattern contains NULL byte (via -f <file>). This is only supported "
+"with -P under PCRE v2"
+msgstr ""
+
+#, c-format
+msgid "'%s': unable to read %s"
+msgstr "\"%s\": не вдалося прочитати %s"
+
+#, c-format
+msgid "'%s': short read"
+msgstr ""
+
+msgid "start a working area (see also: git help tutorial)"
+msgstr ""
+
+msgid "work on the current change (see also: git help everyday)"
+msgstr ""
+
+msgid "examine the history and state (see also: git help revisions)"
+msgstr ""
+
+msgid "grow, mark and tweak your common history"
+msgstr ""
+
+msgid "collaborate (see also: git help workflows)"
+msgstr ""
+
+msgid "Main Porcelain Commands"
+msgstr ""
+
+msgid "Ancillary Commands / Manipulators"
+msgstr ""
+
+msgid "Ancillary Commands / Interrogators"
+msgstr ""
+
+msgid "Interacting with Others"
+msgstr ""
+
+msgid "Low-level Commands / Manipulators"
+msgstr ""
+
+msgid "Low-level Commands / Interrogators"
+msgstr ""
+
+msgid "Low-level Commands / Syncing Repositories"
+msgstr ""
+
+msgid "Low-level Commands / Internal Helpers"
+msgstr ""
+
+msgid "User-facing repository, command and file interfaces"
+msgstr ""
+
+msgid "Developer-facing file formats, protocols and other interfaces"
+msgstr ""
+
+#, c-format
+msgid "available git commands in '%s'"
+msgstr "доступні команди git в \"%s\""
+
+msgid "git commands available from elsewhere on your $PATH"
+msgstr ""
+
+msgid "These are common Git commands used in various situations:"
+msgstr ""
+
+msgid "The Git concept guides are:"
+msgstr ""
+
+msgid "User-facing repository, command and file interfaces:"
+msgstr ""
+
+msgid "File formats, protocols and other developer interfaces:"
+msgstr ""
+
+msgid "External commands"
+msgstr ""
+
+msgid "Command aliases"
+msgstr ""
+
+msgid "See 'git help <command>' to read about a specific subcommand"
+msgstr ""
+
+#, c-format
+msgid ""
+"'%s' appears to be a git command, but we were not\n"
+"able to execute it. Maybe git-%s is broken?"
+msgstr ""
+
+#, c-format
+msgid "git: '%s' is not a git command. See 'git --help'."
+msgstr ""
+
+msgid "Uh oh. Your system reports no Git commands at all."
+msgstr ""
+
+#, c-format
+msgid "WARNING: You called a Git command named '%s', which does not exist."
+msgstr ""
+
+#, c-format
+msgid "Continuing under the assumption that you meant '%s'."
+msgstr ""
+
+#, c-format
+msgid "Run '%s' instead [y/N]? "
+msgstr ""
+
+#, c-format
+msgid "Continuing in %0.1f seconds, assuming that you meant '%s'."
+msgstr ""
+
+msgid ""
+"\n"
+"The most similar command is"
+msgid_plural ""
+"\n"
+"The most similar commands are"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "git version [--build-options]"
+msgstr ""
+
+#, c-format
+msgid "%s: %s - %s"
+msgstr ""
+
+msgid ""
+"\n"
+"Did you mean this?"
+msgid_plural ""
+"\n"
+"Did you mean one of these?"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+#, c-format
+msgid ""
+"The '%s' hook was ignored because it's not set as executable.\n"
+"You can disable this warning with `git config advice.ignoredHook false`."
+msgstr ""
+
+#, c-format
+msgid "argument to --packfile must be a valid hash (got '%s')"
+msgstr ""
+
+msgid "not a git repository"
+msgstr "не є git сховищем"
+
+#, c-format
+msgid "negative value for http.postBuffer; defaulting to %d"
+msgstr ""
+
+msgid "Delegation control is not supported with cURL < 7.22.0"
+msgstr ""
+
+msgid "Public key pinning not supported with cURL < 7.39.0"
+msgstr ""
+
+msgid "CURLSSLOPT_NO_REVOKE not supported with cURL < 7.44.0"
+msgstr ""
+
+#, c-format
+msgid "Unsupported SSL backend '%s'. Supported SSL backends:"
+msgstr ""
+
+#, c-format
+msgid "Could not set SSL backend to '%s': cURL was built without SSL backends"
+msgstr ""
+
+#, c-format
+msgid "Could not set SSL backend to '%s': already set"
+msgstr ""
+
+#, c-format
+msgid ""
+"unable to update url base from redirection:\n"
+"  asked for: %s\n"
+"   redirect: %s"
+msgstr ""
+
+msgid "Author identity unknown\n"
+msgstr ""
+
+msgid "Committer identity unknown\n"
+msgstr ""
+
+msgid ""
+"\n"
+"*** Please tell me who you are.\n"
+"\n"
+"Run\n"
+"\n"
+"  git config --global user.email \"you@example.com\"\n"
+"  git config --global user.name \"Your Name\"\n"
+"\n"
+"to set your account's default identity.\n"
+"Omit --global to set the identity only in this repository.\n"
+"\n"
+msgstr ""
+
+msgid "no email was given and auto-detection is disabled"
+msgstr ""
+
+#, c-format
+msgid "unable to auto-detect email address (got '%s')"
+msgstr ""
+
+msgid "no name was given and auto-detection is disabled"
+msgstr ""
+
+#, c-format
+msgid "unable to auto-detect name (got '%s')"
+msgstr "не вдалося автоматично визначити назву (отримано \"%s\")"
+
+#, c-format
+msgid "empty ident name (for <%s>) not allowed"
+msgstr ""
+
+#, c-format
+msgid "name consists only of disallowed characters: %s"
+msgstr ""
+
+msgid "expected 'tree:<depth>'"
+msgstr ""
+
+msgid "sparse:path filters support has been dropped"
+msgstr ""
+
+#, c-format
+msgid "'%s' for 'object:type=<type>' is not a valid object type"
+msgstr ""
+
+#, c-format
+msgid "invalid filter-spec '%s'"
+msgstr "неприпустимий визначник фільтра \"%s\""
+
+#, c-format
+msgid "must escape char in sub-filter-spec: '%c'"
+msgstr ""
+
+msgid "expected something after combine:"
+msgstr ""
+
+msgid "multiple filter-specs cannot be combined"
+msgstr ""
+
+msgid "unable to upgrade repository format to support partial clone"
+msgstr ""
+
+msgid "args"
+msgstr ""
+
+msgid "object filtering"
+msgstr ""
+
+#, c-format
+msgid "unable to access sparse blob in '%s'"
+msgstr "не вдалося отримати доступ до часткового blob в \"%s\""
+
+#, c-format
+msgid "unable to parse sparse filter data in %s"
+msgstr "не вдалося розібрати дані часткового фільтра в %s"
+
+#, c-format
+msgid "entry '%s' in tree %s has tree mode, but is not a tree"
+msgstr ""
+
+#, c-format
+msgid "entry '%s' in tree %s has blob mode, but is not a blob"
+msgstr ""
+
+#, c-format
+msgid "unable to load root tree for commit %s"
+msgstr "не вдалося завантажити кореневе дерево для коміту %s"
+
+#, c-format
+msgid ""
+"Unable to create '%s.lock': %s.\n"
+"\n"
+"Another git process seems to be running in this repository, e.g.\n"
+"an editor opened by 'git commit'. Please make sure all processes\n"
+"are terminated then try again. If it still fails, a git process\n"
+"may have crashed in this repository earlier:\n"
+"remove the file manually to continue."
+msgstr ""
+
+#, c-format
+msgid "Unable to create '%s.lock': %s"
+msgstr "Не вдалося створити \"%s.lock\": %s"
+
+#, c-format
+msgid "unexpected line: '%s'"
+msgstr ""
+
+msgid "expected flush after ls-refs arguments"
+msgstr ""
+
+msgid "quoted CRLF detected"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s (not checked out)"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s (no merge base)"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s (commits not present)"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s (commits don't follow merge-base)"
+msgstr ""
+
+#, c-format
+msgid "Note: Fast-forwarding submodule %s to %s"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s"
+msgstr "Не вдалося злити підмодуль %s"
+
+#, c-format
+msgid ""
+"Failed to merge submodule %s, but a possible merge resolution exists: %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"Failed to merge submodule %s, but multiple possible merges exist:\n"
+"%s"
+msgstr ""
+
+msgid "Failed to execute internal merge"
+msgstr ""
+
+#, c-format
+msgid "Unable to add %s to database"
+msgstr "Не вдалося додати %s до бази даних"
+
+#, c-format
+msgid "Auto-merging %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (implicit dir rename): Existing file/dir at %s in the way of "
+"implicit directory rename(s) putting the following path(s) there: %s."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (implicit dir rename): Cannot map more than one path to %s; "
+"implicit directory renames tried to put these paths there: %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (directory rename split): Unclear where to rename %s to; it was "
+"renamed to multiple other directories, with no destination getting a "
+"majority of the files."
+msgstr ""
+
+#, c-format
+msgid ""
+"WARNING: Avoiding applying %s -> %s rename to %s, because %s itself was "
+"renamed."
+msgstr ""
+
+#, c-format
+msgid ""
+"Path updated: %s added in %s inside a directory that was renamed in %s; "
+"moving it to %s."
+msgstr ""
+
+#, c-format
+msgid ""
+"Path updated: %s renamed to %s in %s, inside a directory that was renamed in "
+"%s; moving it to %s."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (file location): %s added in %s inside a directory that was renamed "
+"in %s, suggesting it should perhaps be moved to %s."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (file location): %s renamed to %s in %s, inside a directory that "
+"was renamed in %s, suggesting it should perhaps be moved to %s."
+msgstr ""
+
+#, c-format
+msgid "CONFLICT (rename/rename): %s renamed to %s in %s and to %s in %s."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (rename involved in collision): rename of %s -> %s has content "
+"conflicts AND collides with another path; this may result in nested conflict "
+"markers."
+msgstr ""
+
+#, c-format
+msgid "CONFLICT (rename/delete): %s renamed to %s in %s, but deleted in %s."
+msgstr ""
+
+#, c-format
+msgid "cannot read object %s"
+msgstr "неможливо прочитати обʼєкт %s"
+
+#, c-format
+msgid "object %s is not a blob"
+msgstr "обʼєкт %s не є blob"
+
+#, c-format
+msgid ""
+"CONFLICT (file/directory): directory in the way of %s from %s; moving it to "
+"%s instead."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (distinct types): %s had different types on each side; renamed both "
+"of them so each can be recorded somewhere."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (distinct types): %s had different types on each side; renamed one "
+"of them so each can be recorded somewhere."
+msgstr ""
+
+msgid "content"
+msgstr ""
+
+msgid "add/add"
+msgstr ""
+
+msgid "submodule"
+msgstr ""
+
+#, c-format
+msgid "CONFLICT (%s): Merge conflict in %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (modify/delete): %s deleted in %s and modified in %s.  Version %s "
+"of %s left in tree."
+msgstr ""
+
+#. TRANSLATORS: This is a line of advice to resolve a merge
+#. conflict in a submodule. The first argument is the submodule
+#. name, and the second argument is the abbreviated id of the
+#. commit that needs to be merged.  For example:
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
+#.
+
+#, c-format
+msgid ""
+" - go to submodule (%s), and either merge commit %s\n"
+"   or update to an existing commit which has merged those changes\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Recursive merging with submodules currently only supports trivial cases.\n"
+"Please manually handle the merging of each conflicted submodule.\n"
+"This can be accomplished with the following steps:\n"
+"%s - come back to superproject and run:\n"
+"\n"
+"      git add %s\n"
+"\n"
+"   to record the above merge or update\n"
+" - resolve any other conflicts in the superproject\n"
+" - commit the resulting index in the superproject\n"
+msgstr ""
+
+#. TRANSLATORS: The %s arguments are: 1) tree hash of a merge
+#. base, and 2-3) the trees for the two trees we're merging.
+#.
+
+#, c-format
+msgid "collecting merge info failed for trees %s, %s, %s"
+msgstr ""
+
+msgid "(bad commit)\n"
+msgstr ""
+
+#, c-format
+msgid "add_cacheinfo failed for path '%s'; merge aborting."
+msgstr "невдала спроба add_cacheinfo для шляху \"%s\"; переривання злиття."
+
+#, c-format
+msgid "add_cacheinfo failed to refresh for path '%s'; merge aborting."
+msgstr ""
+
+#, c-format
+msgid "failed to create path '%s'%s"
+msgstr "не вдалося створити шлях \"%s\"%s"
+
+#, c-format
+msgid "Removing %s to make room for subdirectory\n"
+msgstr ""
+
+msgid ": perhaps a D/F conflict?"
+msgstr ""
+
+#, c-format
+msgid "refusing to lose untracked file at '%s'"
+msgstr "відмова від втрати невідстежуваного файла \"%s\""
+
+#, c-format
+msgid "blob expected for %s '%s'"
+msgstr "blob очікується для %s \"%s\""
+
+#, c-format
+msgid "failed to open '%s': %s"
+msgstr "не вдалося відкрити \"%s\": %s"
+
+#, c-format
+msgid "failed to symlink '%s': %s"
+msgstr "не вдалося зробити символьне посилання \"%s\": %s"
+
+#, c-format
+msgid "do not know what to do with %06o %s '%s'"
+msgstr ""
+
+#, c-format
+msgid "Fast-forwarding submodule %s to the following commit:"
+msgstr ""
+
+#, c-format
+msgid "Fast-forwarding submodule %s"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s (merge following commits not found)"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s (not fast-forward)"
+msgstr ""
+
+msgid "Found a possible merge resolution for the submodule:\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"If this is correct simply add it to the index for example\n"
+"by using:\n"
+"\n"
+"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"\n"
+"which will accept this suggestion.\n"
+msgstr ""
+
+#, c-format
+msgid "Failed to merge submodule %s (multiple merges found)"
+msgstr ""
+
+#, c-format
+msgid "Error: Refusing to lose untracked file at %s; writing to %s instead."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s in %s. Version %s of %s left "
+"in tree."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s to %s in %s. Version %s of %s "
+"left in tree."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s in %s. Version %s of %s left "
+"in tree at %s."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (%s/delete): %s deleted in %s and %s to %s in %s. Version %s of %s "
+"left in tree at %s."
+msgstr ""
+
+msgid "rename"
+msgstr "перейменувати"
+
+msgid "renamed"
+msgstr "перейменовано"
+
+#, c-format
+msgid "Refusing to lose dirty file at %s"
+msgstr "Відмова від втрати брудного файла %s"
+
+#, c-format
+msgid "Refusing to lose untracked file at %s, even though it's in the way."
+msgstr ""
+
+#, c-format
+msgid "CONFLICT (rename/add): Rename %s->%s in %s.  Added %s in %s"
+msgstr ""
+
+#, c-format
+msgid "%s is a directory in %s adding as %s instead"
+msgstr ""
+
+#, c-format
+msgid "Refusing to lose untracked file at %s; adding as %s instead"
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename "
+"\"%s\"->\"%s\" in \"%s\"%s"
+msgstr ""
+
+msgid " (left unresolved)"
+msgstr ""
+
+#, c-format
+msgid "CONFLICT (rename/rename): Rename %s->%s in %s. Rename %s->%s in %s"
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (directory rename split): Unclear where to place %s because "
+"directory %s was renamed to multiple other directories, with no destination "
+"getting a majority of the files."
+msgstr ""
+
+#, c-format
+msgid ""
+"CONFLICT (rename/rename): Rename directory %s->%s in %s. Rename directory %s-"
+">%s in %s"
+msgstr ""
+
+msgid "modify"
+msgstr "змінити"
+
+msgid "modified"
+msgstr "змінено"
+
+#, c-format
+msgid "Skipped %s (merged same as existing)"
+msgstr ""
+
+#, c-format
+msgid "Adding as %s instead"
+msgstr ""
+
+#, c-format
+msgid "Removing %s"
+msgstr "Видалення %s"
+
+msgid "file/directory"
+msgstr "файл/директорія"
+
+msgid "directory/file"
+msgstr ""
+
+#, c-format
+msgid "CONFLICT (%s): There is a directory with name %s in %s. Adding %s as %s"
+msgstr ""
+
+#, c-format
+msgid "Adding %s"
+msgstr ""
+
+#, c-format
+msgid "CONFLICT (add/add): Merge conflict in %s"
+msgstr ""
+
+#, c-format
+msgid "merging of trees %s and %s failed"
+msgstr ""
+
+msgid "Merging:"
+msgstr ""
+
+#, c-format
+msgid "found %u common ancestor:"
+msgid_plural "found %u common ancestors:"
+msgstr[0] ""
+msgstr[1] ""
+msgstr[2] ""
+
+msgid "merge returned no commit"
+msgstr ""
+
+#, c-format
+msgid "Could not parse object '%s'"
+msgstr "Не вдалося розібрати обʼєкт \"%s\""
+
+msgid "failed to read the cache"
+msgstr "не вдалося прочитати кеш"
+
+msgid "multi-pack-index OID fanout is of the wrong size"
+msgstr ""
+
+#, c-format
+msgid "multi-pack-index file %s is too small"
+msgstr ""
+
+#, c-format
+msgid "multi-pack-index signature 0x%08x does not match signature 0x%08x"
+msgstr ""
+
+#, c-format
+msgid "multi-pack-index version %d not recognized"
+msgstr ""
+
+#, c-format
+msgid "multi-pack-index hash version %u does not match version %u"
+msgstr ""
+
+msgid "multi-pack-index missing required pack-name chunk"
+msgstr ""
+
+msgid "multi-pack-index missing required OID fanout chunk"
+msgstr ""
+
+msgid "multi-pack-index missing required OID lookup chunk"
+msgstr ""
+
+msgid "multi-pack-index missing required object offsets chunk"
+msgstr ""
+
+#, c-format
+msgid "multi-pack-index pack names out of order: '%s' before '%s'"
+msgstr ""
+
+#, c-format
+msgid "bad pack-int-id: %u (%u total packs)"
+msgstr ""
+
+msgid "multi-pack-index stores a 64-bit offset, but off_t is too small"
+msgstr ""
+
+#, c-format
+msgid "failed to add packfile '%s'"
+msgstr "не вдалося додати packfile \"%s\""
+
+#, c-format
+msgid "failed to open pack-index '%s'"
+msgstr "не вдалося відкрити pack-index \"%s\""
+
+#, c-format
+msgid "failed to locate object %d in packfile"
+msgstr ""
+
+msgid "cannot store reverse index file"
+msgstr "неможливо зберегти файл зворотнього індексу"
+
+#, c-format
+msgid "could not parse line: %s"
+msgstr "не вдалося розібрати рядок: %s"
+
+#, c-format
+msgid "malformed line: %s"
+msgstr ""
+
+msgid "ignoring existing multi-pack-index; checksum mismatch"
+msgstr ""
+
+msgid "could not load pack"
+msgstr "не вдалося завантажити пакет"
+
+#, c-format
+msgid "could not open index for %s"
+msgstr "не вдалося відкрити індекс для %s"
+
+msgid "Adding packfiles to multi-pack-index"
+msgstr ""
+
+#, c-format
+msgid "unknown preferred pack: '%s'"
+msgstr ""
+
+#, c-format
+msgid "cannot select preferred pack %s with no objects"
+msgstr ""
+
+#, c-format
+msgid "did not see pack-file %s to drop"
+msgstr ""
+
+#, c-format
+msgid "preferred pack '%s' is expired"
+msgstr ""
+
+msgid "no pack files to index."
+msgstr ""
+
+msgid "refusing to write multi-pack .bitmap without any objects"
+msgstr ""
+
+msgid "could not write multi-pack bitmap"
+msgstr ""
+
+msgid "could not write multi-pack-index"
+msgstr "не вдалося записати multi-pack-index"
+
+#, c-format
+msgid "failed to clear multi-pack-index at %s"
+msgstr "не вдалося очистити multi-pack-index при %s"
+
+msgid "multi-pack-index file exists, but failed to parse"
+msgstr ""
+
+msgid "incorrect checksum"
+msgstr ""
+
+msgid "Looking for referenced packfiles"
+msgstr "Пошук файлів пакунків, на які є посилання"
+
+#, c-format
+msgid ""
+"oid fanout out of order: fanout[%d] = %<PRIx32> > %<PRIx32> = fanout[%d]"
+msgstr ""
+
+msgid "the midx contains no oid"
+msgstr ""
+
+msgid "Verifying OID order in multi-pack-index"
+msgstr ""
+
+#, c-format
+msgid "oid lookup out of order: oid[%d] = %s >= %s = oid[%d]"
+msgstr ""
+
+msgid "Sorting objects by packfile"
+msgstr ""
+
+msgid "Verifying object offsets"
+msgstr "Перевірка зміщень обʼєкта"
+
+#, c-format
+msgid "failed to load pack entry for oid[%d] = %s"
+msgstr ""
+
+#, c-format
+msgid "failed to load pack-index for packfile %s"
+msgstr ""
+
+#, c-format
+msgid "incorrect object offset for oid[%d] = %s: %<PRIx64> != %<PRIx64>"
+msgstr ""
+
+msgid "Counting referenced objects"
+msgstr "Підрахунок обʼєктів, на які є посилання"
+
+msgid "Finding and deleting unreferenced packfiles"
+msgstr ""
+
+msgid "could not start pack-objects"
+msgstr "не вдалося розпочати pack-objects"
+
+msgid "could not finish pack-objects"
+msgstr "не вдалося завершити pack-objects"
+
+#, c-format
+msgid "unable to create lazy_dir thread: %s"
+msgstr "не вдалося створити lazy_dir потік: %s"
+
+#, c-format
+msgid "unable to create lazy_name thread: %s"
+msgstr "не вдалося створити lazy_name потік: %s"
+
+#, c-format
+msgid "unable to join lazy_name thread: %s"
+msgstr "не вдалося приєднатися до lazy_name потоку: %s"
+
+#, c-format
+msgid ""
+"You have not concluded your previous notes merge (%s exists).\n"
+"Please, use 'git notes merge --commit' or 'git notes merge --abort' to "
+"commit/abort the previous merge before you start a new notes merge."
+msgstr ""
+
+#, c-format
+msgid "You have not concluded your notes merge (%s exists)."
+msgstr ""
+
+msgid "Cannot commit uninitialized/unreferenced notes tree"
+msgstr ""
+
+#, c-format
+msgid "Bad notes.rewriteMode value: '%s'"
+msgstr ""
+
+#, c-format
+msgid "Refusing to rewrite notes in %s (outside of refs/notes/)"
+msgstr ""
+
+#. TRANSLATORS: The first %s is the name of
+#. the environment variable, the second %s is
+#. its value.
+#.
+
+#, c-format
+msgid "Bad %s value: '%s'"
+msgstr "Невірне %s значення: \"%s\""
+
+#, c-format
+msgid "object directory %s does not exist; check .git/objects/info/alternates"
+msgstr ""
+
+#, c-format
+msgid "unable to normalize alternate object path: %s"
+msgstr "не вдалося нормалізувати шлях альтернативного обʼєкта: %s"
+
+#, c-format
+msgid "%s: ignoring alternate object stores, nesting too deep"
+msgstr ""
+
+msgid "unable to fdopen alternates lockfile"
+msgstr "не вдалося виконати fdopen для файла блокування спільних обʼєктів"
+
+msgid "unable to read alternates file"
+msgstr "не вдалося прочитати файл спільних обʼєктів"
+
+msgid "unable to move new alternates file into place"
+msgstr "не вдалося перемістити файл нових спільних обʼєктів на місце"
+
+#, c-format
+msgid "path '%s' does not exist"
+msgstr "шлях \"%s\" не існує"
+
+#, c-format
+msgid "reference repository '%s' as a linked checkout is not supported yet."
+msgstr ""
+
+#, c-format
+msgid "reference repository '%s' is not a local repository."
+msgstr "сховище посилання \"%s\" не є локальним сховищем."
+
+#, c-format
+msgid "reference repository '%s' is shallow"
+msgstr "сховище посилання \"%s\" є поверхневим"
+
+#, c-format
+msgid "reference repository '%s' is grafted"
+msgstr "сховище посилання \"%s\" прищеплено"
+
+#, c-format
+msgid "could not find object directory matching %s"
+msgstr "не вдалося знайти директорію обʼєктів, що відповідає %s"
+
+#, c-format
+msgid "invalid line while parsing alternate refs: %s"
+msgstr ""
+
+#, c-format
+msgid "attempting to mmap %<PRIuMAX> over limit %<PRIuMAX>"
+msgstr ""
+
+#, c-format
+msgid "mmap failed%s"
+msgstr ""
+
+#, c-format
+msgid "object file %s is empty"
+msgstr "обʼєктний файл %s порожній"
+
+#, c-format
+msgid "corrupt loose object '%s'"
+msgstr "пошкоджено вільний обʼєкт \"%s\""
+
+#, c-format
+msgid "garbage at end of loose object '%s'"
+msgstr ""
+
+#, c-format
+msgid "unable to open loose object %s"
+msgstr "не вдалося відкрити вільний обʼєкт %s"
+
+#, c-format
+msgid "unable to parse %s header"
+msgstr "не вдалося розібрати заголовок %s"
+
+msgid "invalid object type"
+msgstr "неприпустимий тип обʼєкта"
+
+#, c-format
+msgid "unable to unpack %s header"
+msgstr "не вдалося розпакувати %s заголовок"
+
+#, c-format
+msgid "header for %s too long, exceeds %d bytes"
+msgstr ""
+
+#, c-format
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "вільний обʼєкт %s (що зберігається у %s) пошкоджено"
+
+#, c-format
+msgid "replacement %s not found for %s"
+msgstr "заміна %s не знайдена для %s"
+
+#, c-format
+msgid "packed object %s (stored in %s) is corrupt"
+msgstr "упакований обʼєкт %s (що зберігається у %s) пошкоджено"
+
+#, c-format
+msgid "unable to write file %s"
+msgstr "не вдалося записати файл %s"
+
+#, c-format
+msgid "unable to set permission to '%s'"
+msgstr "не вдалося встановити права доступу до \"%s\""
+
+msgid "error when closing loose object file"
+msgstr "помилка при закритті файла вільного об’єкта"
+
+#, c-format
+msgid "insufficient permission for adding an object to repository database %s"
+msgstr ""
+
+msgid "unable to create temporary file"
+msgstr "не вдалося створити тимчасовий файл"
+
+msgid "unable to write loose object file"
+msgstr "не вдалося записати файл вільного об’єкта"
+
+#, c-format
+msgid "unable to deflate new object %s (%d)"
+msgstr "не вдалося запакувати новий обʼєкт %s (%d)"
+
+#, c-format
+msgid "deflateEnd on object %s failed (%d)"
+msgstr ""
+
+#, c-format
+msgid "confused by unstable object source data for %s"
+msgstr ""
+
+#, c-format
+msgid "write stream object %ld != %<PRIuMAX>"
+msgstr ""
+
+#, c-format
+msgid "unable to stream deflate new object (%d)"
+msgstr "не вдалося запакувати новий обʼєкт (%d) при передачі"
+
+#, c-format
+msgid "deflateEnd on stream object failed (%d)"
+msgstr ""
+
+#, c-format
+msgid "unable to create directory %s"
+msgstr "не вдалося створити директорію %s"
+
+#, c-format
+msgid "cannot read object for %s"
+msgstr "неможливо прочитати обʼєкт для %s"
+
+#, c-format
+msgid "object fails fsck: %s"
+msgstr ""
+
+msgid "refusing to create malformed object"
+msgstr ""
+
+#, c-format
+msgid "read error while indexing %s"
+msgstr ""
+
+#, c-format
+msgid "short read while indexing %s"
+msgstr ""
+
+#, c-format
+msgid "%s: failed to insert into database"
+msgstr ""
+
+#, c-format
+msgid "%s: unsupported file type"
+msgstr ""
+
+#, c-format
+msgid "%s is not a valid '%s' object"
+msgstr "%s не є допустимим \"%s\" обʼєктом"
+
+#, c-format
+msgid "unable to open %s"
+msgstr "не вдалося відкрити %s"
+
+#, c-format
+msgid "hash mismatch for %s (expected %s)"
+msgstr ""
+
+#, c-format
+msgid "unable to mmap %s"
+msgstr "не вдалося виконати mmap %s"
+
+#, c-format
+msgid "unable to unpack header of %s"
+msgstr "не вдалося розпакувати заголовок %s"
+
+#, c-format
+msgid "unable to parse header of %s"
+msgstr "не вдалося розібрати заголовок %s"
+
+#, c-format
+msgid "unable to unpack contents of %s"
+msgstr "не вдалося розпакувати вміст %s"
+
+#. TRANSLATORS: This is a line of ambiguous object
+#. output shown when we cannot look up or parse the
+#. object in question. E.g. "deadbeef [bad object]".
+#.
+
+#, c-format
+msgid "%s [bad object]"
+msgstr ""
+
+#. TRANSLATORS: This is a line of ambiguous commit
+#. object output. E.g.:
+#. *
+#. "deadbeef commit 2021-01-01 - Some Commit Message"
+#.
+
+#, c-format
+msgid "%s commit %s - %s"
+msgstr "%s коміт %s - %s"
+
+#. TRANSLATORS: This is a line of ambiguous
+#. tag object output. E.g.:
+#. *
+#. "deadbeef tag 2022-01-01 - Some Tag Message"
+#. *
+#. The second argument is the YYYY-MM-DD found
+#. in the tag.
+#. *
+#. The third argument is the "tag" string
+#. from object.c.
+#.
+
+#, c-format
+msgid "%s tag %s - %s"
+msgstr "%s тег %s - %s"
+
+#. TRANSLATORS: This is a line of ambiguous
+#. tag object output where we couldn't parse
+#. the tag itself. E.g.:
+#. *
+#. "deadbeef [bad tag, could not parse it]"
+#.
+
+#, c-format
+msgid "%s [bad tag, could not parse it]"
+msgstr ""
+
+#. TRANSLATORS: This is a line of ambiguous <type>
+#. object output. E.g. "deadbeef tree".
+#.
+
+#, c-format
+msgid "%s tree"
+msgstr ""
+
+#. TRANSLATORS: This is a line of ambiguous <type>
+#. object output. E.g. "deadbeef blob".
+#.
+
+#, c-format
+msgid "%s blob"
+msgstr ""
+
+#, c-format
+msgid "short object ID %s is ambiguous"
+msgstr ""
+
+#. TRANSLATORS: The argument is the list of ambiguous
+#. objects composed in show_ambiguous_object(). See
+#. its "TRANSLATORS" comments for details.
+#.
+
+#, c-format
+msgid ""
+"The candidates are:\n"
+"%s"
+msgstr ""
+
+msgid ""
+"Git normally never creates a ref that ends with 40 hex characters\n"
+"because it will be ignored when you just specify 40-hex. These refs\n"
+"may be created by mistake. For example,\n"
+"\n"
+"  git switch -c $br $(git rev-parse ...)\n"
+"\n"
+"where \"$br\" is somehow empty and a 40-hex ref is created. Please\n"
+"examine these refs and maybe delete them. Turn this message off by\n"
+"running \"git config advice.objectNameWarning false\""
+msgstr ""
+
+#, c-format
+msgid "log for '%.*s' only goes back to %s"
+msgstr "лог для \"%.*s\" містить записи тільки до %s"
+
+#, c-format
+msgid "log for '%.*s' only has %d entries"
+msgstr "лог для \"%.*s\" містить лише %d записів"
+
+#, c-format
+msgid "path '%s' exists on disk, but not in '%.*s'"
+msgstr "шлях \"%s\" існує на диску, але не в \"%.*s\""
+
+#, c-format
+msgid ""
+"path '%s' exists, but not '%s'\n"
+"hint: Did you mean '%.*s:%s' aka '%.*s:./%s'?"
+msgstr ""
+"шлях \"%s\" існує, але не \"%s\"\n"
+"підказка: ви мали на увазі \"%.*s:%s\" або \"%.*s:./%s\"?"
+
+#, c-format
+msgid "path '%s' does not exist in '%.*s'"
+msgstr "шлях \"%s\" не існує в \"%.*s\""
+
+#, c-format
+msgid ""
+"path '%s' is in the index, but not at stage %d\n"
+"hint: Did you mean ':%d:%s'?"
+msgstr ""
+"шлях \"%s\" є в індексі, але відсутній на стадії %d\n"
+"підказка: ви мали на увазі \":%d:%s\"?"
+
+#, c-format
+msgid ""
+"path '%s' is in the index, but not '%s'\n"
+"hint: Did you mean ':%d:%s' aka ':%d:./%s'?"
+msgstr ""
+"шлях \"%s\" є в індексі, але не \"%s\"\n"
+"підказка: ви мали на увазі \"%d:%s\" або \"%d:./%s\"?"
+
+#, c-format
+msgid "path '%s' exists on disk, but not in the index"
+msgstr "шлях \"%s\" існує на диску, але відсутній в індексі"
+
+#, c-format
+msgid "path '%s' does not exist (neither on disk nor in the index)"
+msgstr "шлях \"%s\" не існує (ні на диску, ні в індексі)"
+
+msgid "relative path syntax can't be used outside working tree"
+msgstr ""
+"синтаксис відносного шляху не можна використовувати поза робочим деревом"
+
+#, c-format
+msgid "<object>:<path> required, only <object> '%s' given"
+msgstr "потрібно <обʼєкт>:<шлях>, надано лише <обʼєкт> \"%s\""
+
+#, c-format
+msgid "invalid object name '%.*s'."
+msgstr "неприпустима назва обʼєкта \"%.*s\"."
+
+#, c-format
+msgid "invalid object type \"%s\""
+msgstr "неприпустимий тип обʼєкту \"%s\""
+
+#, c-format
+msgid "object %s is a %s, not a %s"
+msgstr "обʼєкт %s є %s, а не %s"
+
+#, c-format
+msgid "object %s has unknown type id %d"
+msgstr "обʼєкт %s має невідомий тип ідентифікатора %d"
+
+#, c-format
+msgid "unable to parse object: %s"
+msgstr "не вдалося розібрати обʼєкт: %s"
+
+#, c-format
+msgid "hash mismatch %s"
+msgstr "невідповідність хешу %s"
+
+msgid "trying to write commit not in index"
+msgstr "спроба записати коміт, якого немає в індексі"
+
+msgid "failed to load bitmap index (corrupted?)"
+msgstr "не вдалося завантажити bitmap індекс (пошкоджено?)"
+
+msgid "corrupted bitmap index (too small)"
+msgstr "пошкоджений bitmap індекс (занадто малий)"
+
+msgid "corrupted bitmap index file (wrong header)"
+msgstr "пошкоджений файл bitmap індексу (занадто малий)"
+
+#, c-format
+msgid "unsupported version '%d' for bitmap index file"
+msgstr "непідтримувана версія \"%d\" для файлу bitmap індексу"
+
+msgid "corrupted bitmap index file (too short to fit hash cache)"
+msgstr ""
+"пошкоджений файл bitmap індексу (занадто короткий щоб умістити кеш хеша)"
+
+msgid "corrupted bitmap index file (too short to fit lookup table)"
+msgstr ""
+"пошкоджений файл bitmap індексу (занадто короткий, щоб вмістити таблицю "
+"пошуку)"
+
+#, c-format
+msgid "duplicate entry in bitmap index: '%s'"
+msgstr "дубльований запис в bitmap індексі: \"%s\""
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for entry %d"
+msgstr "пошкоджений ewah bitmap: урізаний заголовок для запису %d"
+
+#, c-format
+msgid "corrupt ewah bitmap: commit index %u out of range"
+msgstr "пошкоджений ewah bitmap: індекс коміту %u поза межами діапазону"
+
+msgid "corrupted bitmap pack index"
+msgstr "пошкоджений bitmap індекс пакунка"
+
+msgid "invalid XOR offset in bitmap pack index"
+msgstr "невірне XOR зміщення в bitmap індексі пакунка"
+
+msgid "cannot fstat bitmap file"
+msgstr "неможливо виконати fstat для bitmap файла"
+
+msgid "checksum doesn't match in MIDX and bitmap"
+msgstr "контрольна сума не збігається в MIDX і bitmap"
+
+msgid "multi-pack bitmap is missing required reverse index"
+msgstr "у мультіпакунковому bitmap відсутній необхідний зворотний індекс"
+
+#, c-format
+msgid "could not open pack %s"
+msgstr "не вдалося відкрити пакунок %s"
+
+#, c-format
+msgid "preferred pack (%s) is invalid"
+msgstr "бажаний пакунок (%s) є неприпустимим"
+
+msgid "corrupt bitmap lookup table: triplet position out of index"
+msgstr "пошкоджена bitmap таблиця пошуку: триплетна позиція поза індексом"
+
+msgid "corrupt bitmap lookup table: xor chain exceeds entry count"
+msgstr ""
+"пошкоджена bitmap таблиця пошуку: xor ланцюжок перевищує кількість записів"
+
+#, c-format
+msgid "corrupt bitmap lookup table: commit index %u out of range"
+msgstr ""
+"пошкоджена bitmap таблиця пошуку: індекс коміту %u поза межами діапазону"
+
+#, c-format
+msgid "corrupt ewah bitmap: truncated header for bitmap of commit \"%s\""
+msgstr "пошкоджений ewah bitmap: урізаний заголовок для bitmap коміту \"%s\""
+
+#, c-format
+msgid "object '%s' not found in type bitmaps"
+msgstr "обʼєкт \"%s\" не знайдено в типах bitmap"
+
+#, c-format
+msgid "object '%s' does not have a unique type"
+msgstr "обʼєкт \"%s\" не має унікального типу"
+
+#, c-format
+msgid "object '%s': real type '%s', expected: '%s'"
+msgstr "обʼєкт \"%s\": дійсний тип \"%s\", очікуваний: \"%s\""
+
+#, c-format
+msgid "object not in bitmap: '%s'"
+msgstr "обʼєкт не у bitmap: \"%s\""
+
+msgid "failed to load bitmap indexes"
+msgstr "не вдалося завантажити bitmap індекси"
+
+msgid "you must specify exactly one commit to test"
+msgstr "ви маєте вказати тільки один коміт для тестування"
+
+#, c-format
+msgid "commit '%s' doesn't have an indexed bitmap"
+msgstr "коміт \"%s\" не має індексованого bitmap"
+
+msgid "mismatch in bitmap results"
+msgstr "розбіжність в bitmap результатах"
+
+#, c-format
+msgid "could not find '%s' in pack '%s' at offset %<PRIuMAX>"
+msgstr "не вдалося знайти \"%s\" у пакунку \"%s\" зі зміщенням %<PRIuMAX>"
+
+#, c-format
+msgid "unable to get disk usage of '%s'"
+msgstr ""
+"не вдалося отримати дані про використання дискового простору для \"%s\""
+
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "bitmap файл \"%s\" має невірну контрольну суму"
+
+#, c-format
+msgid "mtimes file %s is too small"
+msgstr "mtimes файл %s занадто малий"
+
+#, c-format
+msgid "mtimes file %s has unknown signature"
+msgstr "mtimes файл %s має невідомий підпис"
+
+#, c-format
+msgid "mtimes file %s has unsupported version %<PRIu32>"
+msgstr "mtimes файл %s має непідтримувану версію %<PRIu32>."
+
+#, c-format
+msgid "mtimes file %s has unsupported hash id %<PRIu32>"
+msgstr "mtimes файл %s має непідтримуваний хеш-ідентифікатор %<PRIu32>"
+
+#, c-format
+msgid "mtimes file %s is corrupt"
+msgstr "mtimes файл %s пошкоджено"
+
+#, c-format
+msgid "reverse-index file %s is too small"
+msgstr "файл зворотного індексу %s занадто малий"
+
+#, c-format
+msgid "reverse-index file %s is corrupt"
+msgstr "файл зворотнього індексу %s пошкоджено"
+
+#, c-format
+msgid "reverse-index file %s has unknown signature"
+msgstr "файл зворотного індексу %s має невідомий підпис"
+
+#, c-format
+msgid "reverse-index file %s has unsupported version %<PRIu32>"
+msgstr "файл зворотного індексу %s має непідтримувану версію %<PRIu32>"
+
+#, c-format
+msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
+msgstr ""
+"файл зворотного індексу %s має непідтримуваний хеш-ідентифікатор %<PRIu32>"
+
+msgid "invalid checksum"
+msgstr "невірна контрольна сума"
+
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr ""
+"невірна позиція зворортного індексу у %<PRIu64>: %<PRIu32> != %<PRIu32>"
+
+msgid "cannot both write and verify reverse index"
+msgstr "неможливо одночасно записувати та звіряти зворотний індекс"
+
+#, c-format
+msgid "could not stat: %s"
+msgstr "не вдалося виконати stat: %s"
+
+#, c-format
+msgid "failed to make %s readable"
+msgstr "не вдалося зробити %s читабельним"
+
+#, c-format
+msgid "could not write '%s' promisor file"
+msgstr "не вдалося записати promisor файл \"%s\""
+
+msgid "offset before end of packfile (broken .idx?)"
+msgstr "зміщення перед кінцем файла пакунка (пошкоджений .idx?)"
+
+#, c-format
+msgid "packfile %s cannot be mapped%s"
+msgstr "файл пакунка %s не може бути mapped%s"
+
+#, c-format
+msgid "offset before start of pack index for %s (corrupt index?)"
+msgstr "зміщення перед початком індекса пакунка для %s (пошкоджений індекс?)"
+
+#, c-format
+msgid "offset beyond end of pack index for %s (truncated index?)"
+msgstr "зміщення за межою кінця індекса пакунка для %s (зрізаний індекс?)"
+
+#, c-format
+msgid "malformed expiration date '%s'"
+msgstr "неправильно сформована дата закінчення терміну дії \"%s\""
+
+#, c-format
+msgid "option `%s' expects \"always\", \"auto\", or \"never\""
+msgstr "опція \"%s\" очікує \"always\", \"auto\" або \"never\""
+
+#, c-format
+msgid "malformed object name '%s'"
+msgstr "неправильно сформована назва обʼєкта \"%s\""
+
+#, c-format
+msgid "option `%s' expects \"%s\" or \"%s\""
+msgstr "опція \"%s\" очікує \"%s\" або \"%s\""
+
+#, c-format
+msgid "%s requires a value"
+msgstr "%s потребує значення"
+
+#, c-format
+msgid "%s is incompatible with %s"
+msgstr "%s несумісний з %s"
+
+#, c-format
+msgid "%s : incompatible with something else"
+msgstr "%s : несумісний з чимось іншим"
+
+#, c-format
+msgid "%s takes no value"
+msgstr "%s не приймає значення"
+
+#, c-format
+msgid "%s isn't available"
+msgstr "%s недоступний"
+
+#, c-format
+msgid "%s expects a non-negative integer value with an optional k/m/g suffix"
+msgstr "%s очікує невід'ємне ціле значення з опціональним суфіксом k/m/g"
+
+#, c-format
+msgid "ambiguous option: %s (could be --%s%s or --%s%s)"
+msgstr "неоднозначна опція: %s (може бути --%s%s або --%s%s)"
+
+#, c-format
+msgid "did you mean `--%s` (with two dashes)?"
+msgstr "ви мали на увазі \"--%s\" (з двома рисками)?"
+
+#, c-format
+msgid "alias of --%s"
+msgstr "псевдонім --%s"
+
+msgid "need a subcommand"
+msgstr "потрібна підкоманда"
+
+#, c-format
+msgid "unknown option `%s'"
+msgstr "невідома опція \"%s\""
+
+#, c-format
+msgid "unknown switch `%c'"
+msgstr "невідомий перемикач \"%c\""
+
+#, c-format
+msgid "unknown non-ascii option in string: `%s'"
+msgstr "невідомий non-ascii параметр у рядку: \"%s\""
+
+msgid "..."
+msgstr "..."
+
+#, c-format
+msgid "usage: %s"
+msgstr "використання: %s"
+
+#. TRANSLATORS: the colon here should align with the
+#. one in "usage: %s" translation.
+#.
+
+#, c-format
+msgid "   or: %s"
+msgstr "         або: %s"
+
+#. TRANSLATORS: You should only need to translate this format
+#. string if your language is a RTL language (e.g. Arabic,
+#. Hebrew etc.), not if it's a LTR language (e.g. German,
+#. Russian, Chinese etc.).
+#. *
+#. When a translated usage string has an embedded "\n" it's
+#. because options have wrapped to the next line. The line
+#. after the "\n" will then be padded to align with the
+#. command name, such as N_("git cmd [opt]\n<8
+#. spaces>[opt2]"), where the 8 spaces are the same length as
+#. "git cmd ".
+#. *
+#. This format string prints out that already-translated
+#. line. The "%*s" is whitespace padding to account for the
+#. padding at the start of the line that we add in this
+#. function. The "%s" is a line in the (hopefully already
+#. translated) N_() usage string, which contained embedded
+#. newlines before we split it up.
+#.
+
+#, c-format
+msgid "%*s%s"
+msgstr "%*s%s"
+
+#, c-format
+msgid "    %s"
+msgstr "    %s"
+
+msgid "-NUM"
+msgstr "-NUM"
+
+msgid "expiry-date"
+msgstr "закінчення строку дії"
+
+msgid "no-op (backward compatibility)"
+msgstr "не працює (зворотна сумісність)"
+
+msgid "be more verbose"
+msgstr "надавати більш розгорнутий вивід"
+
+msgid "be more quiet"
+msgstr "надавати менш розгорнутий вивід"
+
+msgid "use <n> digits to display object names"
+msgstr "використовувати <n> цифр для відображення назв обʼєктів"
+
+msgid "prefixed path to initial superproject"
+msgstr "префіксний шлях до початкового суперпроекту"
+
+msgid "how to strip spaces and #comments from message"
+msgstr "як прибирати пробіли та #коментарі з допису"
+
+msgid "read pathspec from file"
+msgstr "прочитати визначник шляху з файлу"
+
+msgid ""
+"with --pathspec-from-file, pathspec elements are separated with NUL character"
+msgstr ""
+"за допомогою --pathspec-from-file елементи визначника шляху відокремлюються "
+"символом NUL"
+
+#, c-format
+msgid "Could not make %s writable by group"
+msgstr "Не вдалося зробити %s доступним для запису групою"
+
+msgid "Escape character '\\' not allowed as last character in attr value"
+msgstr ""
+"Символ екранування \"\\\" не дозволяється як останній символ у значенні "
+"атрибута"
+
+msgid "Only one 'attr:' specification is allowed."
+msgstr "Дозволений лише один визначник \"attr:\"."
+
+msgid "attr spec must not be empty"
+msgstr "визначник атрибута повинен бути не порожнім"
+
+#, c-format
+msgid "invalid attribute name %s"
+msgstr "невірна назва атрибуту %s"
+
+msgid "global 'glob' and 'noglob' pathspec settings are incompatible"
+msgstr "глобальні параметри визначника шляху \"glob\" та \"noglob\" несумісні"
+
+msgid ""
+"global 'literal' pathspec setting is incompatible with all other global "
+"pathspec settings"
+msgstr ""
+"глобальний параметр \"literal\" визначника шляху несумісний з усіма іншими "
+"глобальними параметрами визначника шляху"
+
+msgid "invalid parameter for pathspec magic 'prefix'"
+msgstr ""
+"неприпустимий параметр для магічного значення \"prefix\" визначника шляху"
+
+#, c-format
+msgid "Invalid pathspec magic '%.*s' in '%s'"
+msgstr "Неприпустиме магічне значення \"%.*s\" для визначника шляху в \"%s\""
+
+#, c-format
+msgid "Missing ')' at the end of pathspec magic in '%s'"
+msgstr ""
+"Пропущено \")\" наприкінці магічного значення для визначника шляху в \"%s\""
+
+#, c-format
+msgid "Unimplemented pathspec magic '%c' in '%s'"
+msgstr "Нереалізоване магічне значення \"%c\" для визначника шляху в \"%s\""
+
+#, c-format
+msgid "%s: 'literal' and 'glob' are incompatible"
+msgstr "%s: \"literal\" та \"glob\" несумісні"
+
+#, c-format
+msgid "%s: '%s' is outside repository at '%s'"
+msgstr "%s: \"%s\" знаходиться за межами сховища за адресою \"%s\""
+
+#, c-format
+msgid "'%s' (mnemonic: '%c')"
+msgstr "\"%s\" (мнемонічно: \"%c\")"
+
+#, c-format
+msgid "%s: pathspec magic not supported by this command: %s"
+msgstr ""
+"%s: магічне значення для визначника шляху не підтримується цією командою: %s"
+
+#, c-format
+msgid "pathspec '%s' is beyond a symbolic link"
+msgstr "визначник шляху \"%s\" знаходиться за межами символьного посилання"
+
+#, c-format
+msgid "line is badly quoted: %s"
+msgstr "рядок взято в лапки невірно: %s"
+
+msgid "unable to write flush packet"
+msgstr "не вдалося записати flush пакет"
+
+msgid "unable to write delim packet"
+msgstr "не вдалося записати delim пакет"
+
+msgid "unable to write response end packet"
+msgstr "не вдалося записати response end пакет"
+
+msgid "flush packet write failed"
+msgstr "не вдалося записати flush пакет"
+
+msgid "protocol error: impossibly long line"
+msgstr "помилка протоколу: неймовірно довгий рядок"
+
+msgid "packet write with format failed"
+msgstr "не вдалося записати пакет з форматуванням"
+
+msgid "packet write failed - data exceeds max packet size"
+msgstr ""
+"не вдалося записати пакет - дані перевищують максимальний розмір пакета"
+
+#, c-format
+msgid "packet write failed: %s"
+msgstr "не вдалося записати пакет: %s"
+
+msgid "read error"
+msgstr "помилка зчитування"
+
+msgid "the remote end hung up unexpectedly"
+msgstr "віддалене призначення несподівано відключилося"
+
+#, c-format
+msgid "protocol error: bad line length character: %.4s"
+msgstr "помилка протоколу: невірний символ довжини рядка: %.4s"
+
+#, c-format
+msgid "protocol error: bad line length %d"
+msgstr "помилка протоколу: невірна довжина рядка %d"
+
+#, c-format
+msgid "remote error: %s"
+msgstr "помилка віддаленого призначення: %s"
+
+msgid "Refreshing index"
+msgstr "Оновлення індекса"
+
+#, c-format
+msgid "unable to create threaded lstat: %s"
+msgstr "не вдалося створити потоковий lstat: %s"
+
+msgid "unable to parse --pretty format"
+msgstr "не вдалося розібрати --pretty формат"
+
+msgid "promisor-remote: unable to fork off fetch subprocess"
+msgstr "promisor-remote: не вдалося розгалужити підпроцес отримання"
+
+msgid "promisor-remote: could not write to fetch subprocess"
+msgstr "promisor-remote: не вдалося записати до підпроцесу отримання"
+
+msgid "promisor-remote: could not close stdin to fetch subprocess"
+msgstr "promisor-remote: не вдалося закрити stdin для підпроцесу отримання"
+
+#, c-format
+msgid "promisor remote name cannot begin with '/': %s"
+msgstr "назва віддаленого promisor не може починатися з \"/\": %s"
+
+#, c-format
+msgid "could not fetch %s from promisor remote"
+msgstr "не вдалося отримати %s з віддаленого promisor"
+
+msgid "object-info: expected flush after arguments"
+msgstr "object-info: очікувався flush після аргументів"
+
+msgid "Removing duplicate objects"
+msgstr "Видалення дублікатів обʼєктів"
+
+msgid "could not start `log`"
+msgstr "не вдалося розпочати \"log\""
+
+msgid "could not read `log` output"
+msgstr "не вдалося прочитати \"log\" вивід"
+
+#, c-format
+msgid "could not parse commit '%s'"
+msgstr "не вдалося розібрати коміт \"%s\""
+
+#, c-format
+msgid ""
+"could not parse first line of `log` output: did not start with 'commit ': "
+"'%s'"
+msgstr ""
+"не вдалося розібрати перший рядок \"log\" виводу: не починався з \"commit "
+"\"': \"%s\""
+
+#, c-format
+msgid "could not parse git header '%.*s'"
+msgstr "не вдалося розібрати git заголовок \"%.*s\""
+
+msgid "failed to generate diff"
+msgstr "не вдалося згенерувати різницю"
+
+#, c-format
+msgid "could not parse log for '%s'"
+msgstr "не вдалося розібрати лог для \"%s\""
+
+#, c-format
+msgid "will not add file alias '%s' ('%s' already exists in index)"
+msgstr "не додаємо псевдонім файлу \"%s\" (\"%s\" вже існує в індексі)"
+
+msgid "cannot create an empty blob in the object database"
+msgstr "неможливо створити порожній blob в базі даних обʼєктів"
+
+#, c-format
+msgid "%s: can only add regular files, symbolic links or git-directories"
+msgstr ""
+"%s: може додавати лише звичайні файли, символьні посилання або git-директорії"
+
+#, c-format
+msgid "unable to index file '%s'"
+msgstr "не вдалося проіндексувати файл \"%s\""
+
+#, c-format
+msgid "unable to add '%s' to index"
+msgstr "не вдалося додати \"%s\" до індексу"
+
+#, c-format
+msgid "unable to stat '%s'"
+msgstr "не вдалося виконати stat для \"%s\""
+
+#, c-format
+msgid "'%s' appears as both a file and as a directory"
+msgstr "\"%s\" відображається як файл і як каталог"
+
+msgid "Refresh index"
+msgstr "Оновити індекс"
+
+#, c-format
+msgid ""
+"index.version set, but the value is invalid.\n"
+"Using version %i"
+msgstr ""
+"index.version встановлено, але значення неприпустиме.\n"
+"Використання версії %i"
+
+#, c-format
+msgid ""
+"GIT_INDEX_VERSION set, but the value is invalid.\n"
+"Using version %i"
+msgstr ""
+"GIT_INDEX_VERSION встановлено, але значення неприпустиме.\n"
+"Використання версії %i"
+
+#, c-format
+msgid "bad signature 0x%08x"
+msgstr "невірний підпис 0x%08x"
+
+#, c-format
+msgid "bad index version %d"
+msgstr "невірна версія індексу %d"
+
+msgid "bad index file sha1 signature"
+msgstr "невірний sha1 підпис індексного файлу"
+
+#, c-format
+msgid "index uses %.4s extension, which we do not understand"
+msgstr "індекс використовує %.4s розширення, яке ми не розуміємо"
+
+#, c-format
+msgid "ignoring %.4s extension"
+msgstr "ігнорування %.4s розширення"
+
+#, c-format
+msgid "unknown index entry format 0x%08x"
+msgstr "невідомий формат запису індексу 0x%08x"
+
+#, c-format
+msgid "malformed name field in the index, near path '%s'"
+msgstr "невірно сформоване поле назви в індексі біля шляху \"%s\""
+
+msgid "unordered stage entries in index"
+msgstr "невпорядковані записи в індексі"
+
+#, c-format
+msgid "multiple stage entries for merged file '%s'"
+msgstr "багатоступеневі записи для злитого файлу \"%s\""
+
+#, c-format
+msgid "unordered stage entries for '%s'"
+msgstr "невпорядковані записи індексу для '%s'"
+
+#, c-format
+msgid "unable to create load_cache_entries thread: %s"
+msgstr "не вдалося створити потік load_cache_entries: %s"
+
+#, c-format
+msgid "unable to join load_cache_entries thread: %s"
+msgstr "не вдалося приєднатися до потоку load_cache_entries: %s"
+
+#, c-format
+msgid "%s: index file open failed"
+msgstr "%s: не вдалося відкрити індексний файл"
+
+#, c-format
+msgid "%s: cannot stat the open index"
+msgstr "%s: не вдалося виконати stat відкритого індексу"
+
+#, c-format
+msgid "%s: index file smaller than expected"
+msgstr "%s: індексний файл менший, ніж очікувалося"
+
+#, c-format
+msgid "%s: unable to map index file%s"
+msgstr "%s: не вдалося зіставити індексний файл%s"
+
+#, c-format
+msgid "unable to create load_index_extensions thread: %s"
+msgstr "не вдалося створити потік load_index_extensions: %s"
+
+#, c-format
+msgid "unable to join load_index_extensions thread: %s"
+msgstr "не вдалося приєднатися до потоку load_index_extensions: %s"
+
+#, c-format
+msgid "could not freshen shared index '%s'"
+msgstr "не вдалося оновити спільний індекс \"%s\""
+
+#, c-format
+msgid "broken index, expect %s in %s, got %s"
+msgstr "пошкоджений індекс, очікувався %s у %s, отримано %s"
+
+msgid "cannot write split index for a sparse index"
+msgstr "неможливо записати розділений індекс для часткового індексу"
+
+msgid "failed to convert to a sparse-index"
+msgstr "не вдалося перетворити в sparse-index"
+
+#, c-format
+msgid "could not stat '%s'"
+msgstr "не вдалося виконати stat '%s'"
+
+#, c-format
+msgid "unable to open git dir: %s"
+msgstr "не вдалося відкрити git-директорію: %s"
+
+#, c-format
+msgid "unable to unlink: %s"
+msgstr "не вдалося відʼєднати: %s"
+
+#, c-format
+msgid "cannot fix permission bits on '%s'"
+msgstr "неможливо виправити біти дозволу на \"%s\""
+
+#, c-format
+msgid "%s: cannot drop to stage #0"
+msgstr "%s: неможливо скинути індекс до стану #0"
+
+msgid ""
+"You can fix this with 'git rebase --edit-todo' and then run 'git rebase --"
+"continue'.\n"
+"Or you can abort the rebase with 'git rebase --abort'.\n"
+msgstr ""
+"Ви можете виправити це командою \"git rebase --edit-todo\", а потім "
+"запустити \"git rebase --continue\".\n"
+"Або ви можете перервати перебазування за допомогою \"git rebase --abort\".\n"
+
+#, c-format
+msgid ""
+"unrecognized setting %s for option rebase.missingCommitsCheck. Ignoring."
+msgstr ""
+"нерозпізнане значення %s для опції rebase.missingCommitsCheck. Ігнорується."
+
+msgid ""
+"\n"
+"Commands:\n"
+"p, pick <commit> = use commit\n"
+"r, reword <commit> = use commit, but edit the commit message\n"
+"e, edit <commit> = use commit, but stop for amending\n"
+"s, squash <commit> = use commit, but meld into previous commit\n"
+"f, fixup [-C | -c] <commit> = like \"squash\" but keep only the previous\n"
+"                   commit's log message, unless -C is used, in which case\n"
+"                   keep only this commit's message; -c is same as -C but\n"
+"                   opens the editor\n"
+"x, exec <command> = run command (the rest of the line) using shell\n"
+"b, break = stop here (continue rebase later with 'git rebase --continue')\n"
+"d, drop <commit> = remove commit\n"
+"l, label <label> = label current HEAD with a name\n"
+"t, reset <label> = reset HEAD to a label\n"
+"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
+"        create a merge commit using the original merge commit's\n"
+"        message (or the oneline, if no original merge commit was\n"
+"        specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+"                      to this position in the new commits. The <ref> is\n"
+"                      updated at the end of the rebase\n"
+"\n"
+"These lines can be re-ordered; they are executed from top to bottom.\n"
+msgstr ""
+"\n"
+"Команди:\n"
+"p, pick <коміт> = використати коміт\n"
+"r, reword <коміт> = використати коміт, але відредагувати допис до коміту\n"
+"e, edit <коміт> = використати коміт, але зупинитись для внесення поправок\n"
+"s, squash <коміт> = використати коміт, але обʼєднати з попереднім комітом\n"
+"f, fixup [-C | -c] <коміт> = як \"squash\", але зберігає лише попередній\n"
+"                   допис до коміту, якщо тільки не вказана опція -С, у якому "
+"разі\n"
+"                   зберігається лише допис до цього коміту; -c - те саме, що "
+"й -C, але\n"
+"                   відкриває редактор\n"
+"x, exec <команда> = виконати команду (решту рядка) за допомогою shell\n"
+"b, break = зупинитись тут (продовжити перебазування пізніше за допомогою "
+"'git rebase --continue')\n"
+"d, drop <коміт> = видалити коміт\n"
+"l, label <мітка> = помітити поточний HEAD назвою\n"
+"t, reset <мітка> = скинути HEAD до мітки\n"
+"m, merge [-C <коміт> | -c <коміт>] <мітка> [# <однорядковий допис>]\n"
+"        створити коміт злиття, використовуючи допис до початкового коміту\n"
+"        злиття (або однорядковий допис, якщо не було вказано коміт\n"
+"        злиття); використовуйте -c <коміт>, щоб перефразувати допис до "
+"коміту\n"
+"u, update-ref <посилання> = відстежити заповнювач для <посилання>, яке "
+"потрібно оновити\n"
+"                      до цієї позиції у нових комітах. <посилання>\n"
+"                      оновлюється в кінці перебазування\n"
+"\n"
+"Ці рядки можна переупорядкувати; вони виконуються зверху вниз.\n"
+
+#, c-format
+msgid "Rebase %s onto %s (%d command)"
+msgid_plural "Rebase %s onto %s (%d commands)"
+msgstr[0] "Перебазування %s на %s (%d команда)"
+msgstr[1] "Перебазування %s на %s (%d команди)"
+msgstr[2] "Перебазування %s на %s (%d команд)"
+
+msgid ""
+"\n"
+"Do not remove any line. Use 'drop' explicitly to remove a commit.\n"
+msgstr ""
+"\n"
+"Не видаляйте жодного рядка. Використовуйте \"drop\", щоб явно видалити "
+"коміт.\n"
+
+msgid ""
+"\n"
+"If you remove a line here THAT COMMIT WILL BE LOST.\n"
+msgstr ""
+"\n"
+"Якщо ви видалите тут рядок, ЦЕЙ КОМІТ БУДЕ ВТРАЧЕНО.\n"
+
+msgid ""
+"\n"
+"You are editing the todo file of an ongoing interactive rebase.\n"
+"To continue rebase after editing, run:\n"
+"    git rebase --continue\n"
+"\n"
+msgstr ""
+"\n"
+"Ви редагуєте файл todo поточного інтерактивного перебазування.\n"
+"Щоб продовжити перебазування після редагування, виконайте:\n"
+"    git rebase --continue\n"
+
+msgid ""
+"\n"
+"However, if you remove everything, the rebase will be aborted.\n"
+"\n"
+msgstr ""
+"\n"
+"Однак, якщо ви видалите все, перебазування буде перервано.\n"
+"\n"
+
+#, c-format
+msgid "could not write '%s'."
+msgstr "не вдалося записати \"%s\"."
+
+#, c-format
+msgid ""
+"Warning: some commits may have been dropped accidentally.\n"
+"Dropped commits (newer to older):\n"
+msgstr ""
+"Попередження: деякі коміти могли бути видалені випадково.\n"
+"Скинуті коміти (від новіших до старіших):\n"
+
+#, c-format
+msgid ""
+"To avoid this message, use \"drop\" to explicitly remove a commit.\n"
+"\n"
+"Use 'git config rebase.missingCommitsCheck' to change the level of "
+"warnings.\n"
+"The possible behaviours are: ignore, warn, error.\n"
+"\n"
+msgstr ""
+"Щоб уникнути цього повідомлення, використовуйте \"drop\" для явного "
+"видалення коміту.\n"
+"\n"
+"Використовуйте \"git config rebase.missingCommitsCheck\" для зміни рівня "
+"попереджень.\n"
+"Можливі варіанти поведінки: ignore, warn, error.\n"
+
+#, c-format
+msgid "%s: 'preserve' superseded by 'merges'"
+msgstr "%s: \"preserve\" замінено на \"merges\""
+
+msgid "gone"
+msgstr "відсутнє"
+
+#, c-format
+msgid "ahead %d"
+msgstr "попереду %d"
+
+#, c-format
+msgid "behind %d"
+msgstr "позаду %d"
+
+#, c-format
+msgid "ahead %d, behind %d"
+msgstr "попереду %d, позаду %d"
+
+#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) не приймає аргументів"
+
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "нерозпізнаний %%(%.*s) аргумент: %s"
+
+#, c-format
+msgid "expected format: %%(color:<color>)"
+msgstr "очікуваний формат: %%(color:<колір>)"
+
+#, c-format
+msgid "unrecognized color: %%(color:%s)"
+msgstr "нерозпізнаний колір: %%(color:%s)"
+
+#, c-format
+msgid "Integer value expected refname:lstrip=%s"
+msgstr "Очікувалось ціле число refname:lstrip=%s"
+
+#, c-format
+msgid "Integer value expected refname:rstrip=%s"
+msgstr "Очікувалось ціле число refname:rstrip=%s"
+
+#, c-format
+msgid "expected %%(trailers:key=<value>)"
+msgstr "очікувалось %%(trailers:key=<значення>)"
+
+#, c-format
+msgid "unknown %%(trailers) argument: %s"
+msgstr "невідомий %%(trailers) аргумент: %s"
+
+#, c-format
+msgid "positive value expected contents:lines=%s"
+msgstr "очікувалось додатне значення contents:lines=%s"
+
+#, c-format
+msgid "positive value expected '%s' in %%(%s)"
+msgstr "очікувалось додатне значення \"%s\" у %%(%s)"
+
+#, c-format
+msgid "expected format: %%(align:<width>,<position>)"
+msgstr "очікуваний формат: %%(align:<ширина>,<позиція>)"
+
+#, c-format
+msgid "unrecognized position:%s"
+msgstr "нерозпізнана позиція:%s"
+
+#, c-format
+msgid "unrecognized width:%s"
+msgstr "нерозпізнана ширина:%s"
+
+#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "нерозпізнаний %%(%s) аргумент: %s"
+
+#, c-format
+msgid "positive width expected with the %%(align) atom"
+msgstr "очікувалась додатна ширина з %%(align) часткою"
+
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "очікуваний формат: %%(ahead-behind:<комітоподібне>)"
+
+#, c-format
+msgid "malformed field name: %.*s"
+msgstr "неправильно сформована назва поля: %.*s"
+
+#, c-format
+msgid "unknown field name: %.*s"
+msgstr "невідома назва поля: %.*s"
+
+#, c-format
+msgid ""
+"not a git repository, but the field '%.*s' requires access to object data"
+msgstr "не git сховище, але поле \"%.*s\" потребує доступу до даних обʼєкта"
+
+#, c-format
+msgid "format: %%(%s) atom used without a %%(%s) atom"
+msgstr "формат: частка %%(%s) використано без частки %%(%s)"
+
+#, c-format
+msgid "format: %%(then) atom used more than once"
+msgstr "формат: %%(then) частка використана більше одного разу"
+
+#, c-format
+msgid "format: %%(then) atom used after %%(else)"
+msgstr "формат: %%(then) частка використана після %%(else)"
+
+#, c-format
+msgid "format: %%(else) atom used more than once"
+msgstr "формат: %%(else) частка використана більше одного разу"
+
+#, c-format
+msgid "format: %%(end) atom used without corresponding atom"
+msgstr "формат: %%(end) частка використана без відповідної частки"
+
+#, c-format
+msgid "malformed format string %s"
+msgstr "неправильно сформований рядок форматування %s"
+
+#, c-format
+msgid "this command reject atom %%(%.*s)"
+msgstr "ця команда відхиляє частку %%(%.*s)"
+
+#, c-format
+msgid "--format=%.*s cannot be used with --python, --shell, --tcl"
+msgstr "--format=%.*s не може бути використаний з --python, --shell, --tcl"
+
+#, c-format
+msgid "(no branch, rebasing %s)"
+msgstr "(немає гілки, перебазування %s)"
+
+#, c-format
+msgid "(no branch, rebasing detached HEAD %s)"
+msgstr "(немає гілки, перебазування відокремленого HEAD %s)"
+
+#, c-format
+msgid "(no branch, bisect started on %s)"
+msgstr "(немає гілки, бісекцію розпочато на %s)"
+
+#, c-format
+msgid "(HEAD detached at %s)"
+msgstr "(HEAD відʼєднано на %s)"
+
+#, c-format
+msgid "(HEAD detached from %s)"
+msgstr "(HEAD відʼєднано від %s)"
+
+msgid "(no branch)"
+msgstr "(немає гілки)"
+
+#, c-format
+msgid "missing object %s for %s"
+msgstr "відсутній обʼєкт %s для %s"
+
+#, c-format
+msgid "parse_object_buffer failed on %s for %s"
+msgstr "parse_object_buffer завершився невдало на %s для %s"
+
+#, c-format
+msgid "malformed object at '%s'"
+msgstr "неправильно сформований обʼєкт за адресою \"%s\""
+
+#, c-format
+msgid "ignoring ref with broken name %s"
+msgstr "ігнорування посилання з пошкодженою назвою %s"
+
+#, c-format
+msgid "ignoring broken ref %s"
+msgstr "ігнорування пошкоджених посилань %s"
+
+#, c-format
+msgid "format: %%(end) atom missing"
+msgstr "формат: %%(end) частка відсутня"
+
+#, c-format
+msgid "malformed object name %s"
+msgstr "неправильно сформована назва обʼєкта %s"
+
+#, c-format
+msgid "option `%s' must point to a commit"
+msgstr "опція \"%s\" повинна вказувати на коміт"
+
+msgid "key"
+msgstr "ключ"
+
+msgid "field name to sort on"
+msgstr "назва поля для сортування"
+
+#, c-format
+msgid "not a reflog: %s"
+msgstr "не reflog: %s"
+
+#, c-format
+msgid "no reflog for '%s'"
+msgstr "немає reflog для \"%s\""
+
+#, c-format
+msgid "%s does not point to a valid object!"
+msgstr "%s не вказує на допустимий обʼєкт!"
+
+#, c-format
+msgid ""
+"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"
+msgstr ""
+"Використання \"%s\" як назви початкової гілки. Назву гілки за замовчуванням\n"
+"може бути змінено. Щоб налаштувати назву початкової гілки для використання у "
+"всіх\n"
+"ваших нових сховищах, що приховуватиме це попередження, викличте\n"
+"\n"
+"\tgit config --global init.defaultBranch <назва>.\n"
+"\n"
+"Замість \"master\" зазвичай використовують такі назви, як \"main\", "
+"\"trunk\" та\n"
+"\"development\". Щойно створену гілку можна перейменувати за допомогою цієї "
+"команди:\n"
+"\n"
+"\tgit branch -m <назва>\n"
+
+#, c-format
+msgid "could not retrieve `%s`"
+msgstr "не вдалося отримати \"%s\""
+
+#, c-format
+msgid "invalid branch name: %s = %s"
+msgstr "неприпустима назва гілки: %s = %s"
+
+#, c-format
+msgid "ignoring dangling symref %s"
+msgstr "ігнорування висячих symref %s"
+
+#, c-format
+msgid "log for ref %s has gap after %s"
+msgstr "лог для посилання %s має пропуск після %s"
+
+#, c-format
+msgid "log for ref %s unexpectedly ended on %s"
+msgstr "лог для посилання %s несподівано завершився на %s"
+
+#, c-format
+msgid "log for %s is empty"
+msgstr "лог для %s порожній"
+
+#, c-format
+msgid "refusing to update ref with bad name '%s'"
+msgstr "відмова оновлення посилання з невірною назвою \"%s\""
+
+#, c-format
+msgid "update_ref failed for ref '%s': %s"
+msgstr "update_ref завершився невдало для посилання \"%s\": %s"
+
+#, c-format
+msgid "multiple updates for ref '%s' not allowed"
+msgstr "багатократні оновлення для посилання \"%s\" заборонені"
+
+msgid "ref updates forbidden inside quarantine environment"
+msgstr "оновлення посилань заборонено у карантинному середовищі"
+
+msgid "ref updates aborted by hook"
+msgstr "оновлення посилань перервано гачком"
+
+#, c-format
+msgid "'%s' exists; cannot create '%s'"
+msgstr "\"%s\" існує; неможливо створити \"%s\""
+
+#, c-format
+msgid "cannot process '%s' and '%s' at the same time"
+msgstr "неможливо обробити \"%s\" і \"%s\" одночасно"
+
+#, c-format
+msgid "could not remove reference %s"
+msgstr "не вдалося видалити посилання %s"
+
+#, c-format
+msgid "could not delete reference %s: %s"
+msgstr "не вдалося видалити посилання %s: %s"
+
+#, c-format
+msgid "could not delete references: %s"
+msgstr "не вдалося видалити посилання: %s"
+
+#, c-format
+msgid "invalid refspec '%s'"
+msgstr "неприпустимий визначник посилання \"%s\""
+
+#, c-format
+msgid "invalid quoting in push-option value: '%s'"
+msgstr "неприпустимі лапки у значенні push-опції: \"%s\""
+
+#, c-format
+msgid "%sinfo/refs not valid: is this a git repository?"
+msgstr "%sinfo/refs не дійсні: це git сховище?"
+
+msgid "invalid server response; expected service, got flush packet"
+msgstr ""
+"неприпустима відповідь сервера; очікувався service, отримано flush пакет"
+
+#, c-format
+msgid "invalid server response; got '%s'"
+msgstr "неприпустима відповідь сервера; отримано \"%s\""
+
+#, c-format
+msgid "repository '%s' not found"
+msgstr "сховище \"%s\" не знайдено"
+
+#, c-format
+msgid "Authentication failed for '%s'"
+msgstr "Невдала аутентифікація для \"%s\""
+
+#, c-format
+msgid "unable to access '%s' with http.pinnedPubkey configuration: %s"
+msgstr ""
+"не вдалося отримати доступ до \"%s\" з конфігурацією http.pinnedPubkey: %s"
+
+#, c-format
+msgid "unable to access '%s': %s"
+msgstr "не вдалося отримати доступ до \"%s\": %s"
+
+#, c-format
+msgid "redirecting to %s"
+msgstr "перенаправлення на %s"
+
+msgid "shouldn't have EOF when not gentle on EOF"
+msgstr "не повинен мати EOF, якщо не є обережним з EOF"
+
+msgid "remote server sent unexpected response end packet"
+msgstr "віддалений сервер надіслав неочікуваний response end пакет"
+
+msgid "unable to rewind rpc post data - try increasing http.postBuffer"
+msgstr ""
+"не вдалося перемотати rpc post дані - спробуйте збільшити http.postBuffer"
+
+#, c-format
+msgid "remote-curl: bad line length character: %.4s"
+msgstr "remote-curl: невірний символ довжини рядка: %.4s"
+
+msgid "remote-curl: unexpected response end packet"
+msgstr "remote-curl: неочікуваний response end пакет"
+
+#, c-format
+msgid "RPC failed; %s"
+msgstr "RPC завершився невдало; %s"
+
+msgid "cannot handle pushes this big"
+msgstr "неможливо впоратися з такими великими надсиланнями"
+
+#, c-format
+msgid "cannot deflate request; zlib deflate error %d"
+msgstr "неможливо запакувати запит; zlib помилка пакування %d"
+
+#, c-format
+msgid "cannot deflate request; zlib end error %d"
+msgstr "неможливо запакувати запит; zlib помилка завершення %d"
+
+#, c-format
+msgid "%d bytes of length header were received"
+msgstr "%d байтів заголовку було отримано"
+
+#, c-format
+msgid "%d bytes of body are still expected"
+msgstr "%d байтів тіла все ще очікуються"
+
+msgid "dumb http transport does not support shallow capabilities"
+msgstr "засіб передачі dumb http не підтримує shallow здібності"
+
+msgid "fetch failed."
+msgstr "отримання завершилось невдало."
+
+msgid "cannot fetch by sha1 over smart http"
+msgstr "неможливо отримати дані за допомогою sha1 через smart http"
+
+#, c-format
+msgid "protocol error: expected sha/ref, got '%s'"
+msgstr "помилка протоколу: очікувалося sha/ref, отримано \"%s\""
+
+#, c-format
+msgid "http transport does not support %s"
+msgstr "http засіб передачі не підтримує %s"
+
+msgid "protocol error: expected '<url> <path>', missing space"
+msgstr "помилка протоколу: очікувалося \"<url> <шлях>\", пропущено пробіл"
+
+#, c-format
+msgid "failed to download file at URL '%s'"
+msgstr "не вдалося завантажити файл за URL-адресою \"%s\""
+
+msgid "git-http-push failed"
+msgstr "git-http-push завершився невдало"
+
+msgid "remote-curl: usage: git remote-curl <remote> [<url>]"
+msgstr ""
+"remote-curl: використання: git remote-curl <віддаленe-призначення> [<url>]"
+
+msgid "remote-curl: error reading command stream from git"
+msgstr "remote-curl: помилка зчитування потоку команд з git"
+
+msgid "remote-curl: fetch attempted without a local repo"
+msgstr "remote-curl: спроба отримання без локального сховища"
+
+#, c-format
+msgid "remote-curl: unknown command '%s' from git"
+msgstr "remote-curl: невідома команда \"%s\" з git"
+
+#, c-format
+msgid "config remote shorthand cannot begin with '/': %s"
+msgstr "скорочення віддаленної конфігураціі не може починатися з '/': %s"
+
+msgid "more than one receivepack given, using the first"
+msgstr "надано більше одного пакунка для отримання, використано перший"
+
+msgid "more than one uploadpack given, using the first"
+msgstr "надано більше одного пакунка для завантаження, використано перший"
+
+#, c-format
+msgid "unrecognized value transfer.credentialsInUrl: '%s'"
+msgstr "нерозпізнане значення transfer.credentialsInUrl: '%s'"
+
+#, c-format
+msgid "URL '%s' uses plaintext credentials"
+msgstr "URL-адреса '%s' використовує облікові дані у відкритому тексті"
+
+#, c-format
+msgid "Cannot fetch both %s and %s to %s"
+msgstr "Неможливо отримати як %s, так і %s до %s"
+
+#, c-format
+msgid "%s usually tracks %s, not %s"
+msgstr "%s зазвичай відстежує %s, а не %s"
+
+#, c-format
+msgid "%s tracks both %s and %s"
+msgstr "%s відстежує як %s, так і %s"
+
+#, c-format
+msgid "key '%s' of pattern had no '*'"
+msgstr "ключ '%s' шаблону не містив '*'"
+
+#, c-format
+msgid "value '%s' of pattern has no '*'"
+msgstr "значення '%s' шаблону не містить '*'"
+
+#, c-format
+msgid "src refspec %s does not match any"
+msgstr "визначник посилання джерела %s не збігається з жодним"
+
+#, c-format
+msgid "src refspec %s matches more than one"
+msgstr "визначник посилання джерела %s збігається з більш ніж одним"
+
+#. TRANSLATORS: "matches '%s'%" is the <dst> part of "git push
+#. <remote> <src>:<dst>" push, and "being pushed ('%s')" is
+#. the <src>.
+#.
+
+#, c-format
+msgid ""
+"The destination you provided is not a full refname (i.e.,\n"
+"starting with \"refs/\"). We tried to guess what you meant by:\n"
+"\n"
+"- Looking for a ref that matches '%s' on the remote side.\n"
+"- Checking if the <src> being pushed ('%s')\n"
+"  is a ref in \"refs/{heads,tags}/\". If so we add a corresponding\n"
+"  refs/{heads,tags}/ prefix on the remote side.\n"
+"\n"
+"Neither worked, so we gave up. You must fully qualify the ref."
+msgstr ""
+"Призначення, що ви вказали, не є повною назвою посилання (такою,\n"
+"що починається з \"refs/\"). Ми спробували вгадати, що ви мали на увазі "
+"через:\n"
+"\n"
+"- Пошук посилання, яке відповідає '%s' на віддаленій стороні.\n"
+"- Перевірку, чи є <джерело> надсилання, ('%s')\n"
+"  посиланням у \"refs/{heads,tags}/\". Якщо так, то ми додаємо відповідний\n"
+"  refs/{heads,tags}/ префікс на віддаленій стороні.\n"
+"\n"
+"Ні те, ні інше не спрацювало, тому ми здалися. Ви повинні повністю "
+"кваліфікувати посилання."
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a commit object.\n"
+"Did you mean to create a new branch by pushing to\n"
+"'%s:refs/heads/%s'?"
+msgstr ""
+"Частина <джерело> визаначника посилання є об’єктом коміту.\n"
+"Ви хотіли створити нову гілку, надіславши зміни до\n"
+"'%s:refs/heads/%s'?"
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a tag object.\n"
+"Did you mean to create a new tag by pushing to\n"
+"'%s:refs/tags/%s'?"
+msgstr ""
+"Частина <джерело> визаначника посилання є об’єктом тегу.\n"
+"Ви хотіли створити новий тег, надіславши зміни до\n"
+"'%s:refs/tags/%s'?"
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a tree object.\n"
+"Did you mean to tag a new tree by pushing to\n"
+"'%s:refs/tags/%s'?"
+msgstr ""
+"Частина <джерело> визаначника посилання є об’єктом дерева.\n"
+"Ви хотіли позначити нове дерево, надіславши зміни до\n"
+"'%s:refs/tags/%s'?"
+
+#, c-format
+msgid ""
+"The <src> part of the refspec is a blob object.\n"
+"Did you mean to tag a new blob by pushing to\n"
+"'%s:refs/tags/%s'?"
+msgstr ""
+"Частина <джерело> визаначника посилання є об’єктом blob.\n"
+"Ви хотіли позначити новий blob, надіславши зміни до\n"
+"'%s:refs/tags/%s'?"
+
+#, c-format
+msgid "%s cannot be resolved to branch"
+msgstr "%s неможливо розвʼязати в гілку"
+
+#, c-format
+msgid "unable to delete '%s': remote ref does not exist"
+msgstr "не вдалося видалити '%s': віддалене посилання не існує"
+
+#, c-format
+msgid "dst refspec %s matches more than one"
+msgstr "визаначник посилання призначення %s збігається з більш ніж одним"
+
+#, c-format
+msgid "dst ref %s receives from more than one src"
+msgstr "посилання призначення %s отримує з більш ніж одного src"
+
+msgid "HEAD does not point to a branch"
+msgstr "HEAD не вказує на гілку"
+
+#, c-format
+msgid "no such branch: '%s'"
+msgstr "немає такої гілки: '%s'"
+
+#, c-format
+msgid "no upstream configured for branch '%s'"
+msgstr "першоджерельне сховище не налаштовано для гілки '%s'"
+
+#, c-format
+msgid "upstream branch '%s' not stored as a remote-tracking branch"
+msgstr ""
+"гілка '%s' першоджерельного сховища не збережена як віддалено відстежувана "
+"гілка"
+
+#, c-format
+msgid "push destination '%s' on remote '%s' has no local tracking branch"
+msgstr ""
+"шлях призначення надсилання '%s' на віддаленому '%s' не має гілки локального "
+"відстежування"
+
+#, c-format
+msgid "branch '%s' has no remote for pushing"
+msgstr "гілка '%s' не має віддаленого призначення для надсилання"
+
+#, c-format
+msgid "push refspecs for '%s' do not include '%s'"
+msgstr "надіслані визначники посилань для \"%s\" не включають \"%s\""
+
+msgid "push has no destination (push.default is 'nothing')"
+msgstr "надсилання не має призначення (push.default дорівнює 'nothing')"
+
+msgid "cannot resolve 'simple' push to a single destination"
+msgstr ""
+"неможливо розвʼязати \"simple\" надсилання до одного пункту призначення"
+
+#, c-format
+msgid "couldn't find remote ref %s"
+msgstr "не вдалося знайти віддалене посилання %s"
+
+#, c-format
+msgid "* Ignoring funny ref '%s' locally"
+msgstr "* Ігнорування кумедних рефів '%s' локально"
+
+#, c-format
+msgid "Your branch is based on '%s', but the upstream is gone.\n"
+msgstr "Ваша гілка базується на '%s', але першоджерельне сховище зникло.\n"
+
+msgid "  (use \"git branch --unset-upstream\" to fixup)\n"
+msgstr ""
+"  (використовуйте команду \"git branch --unset-upstream\", щоб виправити)\n"
+
+#, c-format
+msgid "Your branch is up to date with '%s'.\n"
+msgstr "Ваша гілка не відрізняється від '%s'.\n"
+
+#, c-format
+msgid "Your branch and '%s' refer to different commits.\n"
+msgstr "Ваша гілка та гілка '%s' посилаються до різних комітів.\n"
+
+#, c-format
+msgid "  (use \"%s\" for details)\n"
+msgstr "  (використовуйте \"%s\" для отримання детальної інформації)\n"
+
+#, c-format
+msgid "Your branch is ahead of '%s' by %d commit.\n"
+msgid_plural "Your branch is ahead of '%s' by %d commits.\n"
+msgstr[0] "Ваша гілка випереджає '%s' на %d коміт.\n"
+msgstr[1] "Ваша гілка випереджає '%s' на %d коміти.\n"
+msgstr[2] "Ваша гілка випереджає '%s' на %d комітів.\n"
+
+msgid "  (use \"git push\" to publish your local commits)\n"
+msgstr "  (використовуйте \"git push\" для публікації локальних комітів)\n"
+
+#, c-format
+msgid "Your branch is behind '%s' by %d commit, and can be fast-forwarded.\n"
+msgid_plural ""
+"Your branch is behind '%s' by %d commits, and can be fast-forwarded.\n"
+msgstr[0] ""
+"Ваша гілка відстає від \"%s\" на %d коміт, і її можна перемотати вперед.\n"
+msgstr[1] ""
+"Ваша гілка відстає від \"%s\" на %d коміти, і її можна перемотати вперед.\n"
+msgstr[2] ""
+"Ваша гілка відстає від гілки '%s' на %d комітів, і її можна перемотати "
+"вперед.\n"
+
+msgid "  (use \"git pull\" to update your local branch)\n"
+msgstr "  (використовуйте \"git pull\", щоб оновити вашу локальну гілку)\n"
+
+#, c-format
+msgid ""
+"Your branch and '%s' have diverged,\n"
+"and have %d and %d different commit each, respectively.\n"
+msgid_plural ""
+"Your branch and '%s' have diverged,\n"
+"and have %d and %d different commits each, respectively.\n"
+msgstr[0] ""
+"Ваша гілка і гілка '%s' розійшлися,\n"
+"і мають %d і %d різний коміт відповідно.\n"
+msgstr[1] ""
+"Ваша гілка і гілка '%s' розійшлися,\n"
+"і мають %d і %d різних коміта відповідно.\n"
+msgstr[2] ""
+"Ваша гілка і гілка '%s' розійшлися,\n"
+"і мають %d і %d різних комітів відповідно.\n"
+
+msgid "  (use \"git pull\" to merge the remote branch into yours)\n"
+msgstr "  (використовуйте \"git pull\", щоб злити віддалену гілку з вашою)\n"
+
+#, c-format
+msgid "cannot parse expected object name '%s'"
+msgstr "неможливо розібрати очікувану назву обʼєкту \"%s\""
+
+#, c-format
+msgid "cannot strip one component off url '%s'"
+msgstr "неможливо вилучити один компонент з url '%s'"
+
+#, c-format
+msgid "bad replace ref name: %s"
+msgstr "неприпустима назва змінного посилання: %s"
+
+#, c-format
+msgid "duplicate replace ref: %s"
+msgstr "дубльована заміна посилання: %s"
+
+#, c-format
+msgid "replace depth too high for object %s"
+msgstr "глибина заміни занадто висока для обʼєкта %s"
+
+msgid "corrupt MERGE_RR"
+msgstr "пошкоджений MERGE_RR"
+
+msgid "unable to write rerere record"
+msgstr "неможливо зробити rerere запис"
+
+#, c-format
+msgid "there were errors while writing '%s' (%s)"
+msgstr "виникли помилки під час запису \"%s\" (%s)"
+
+#, c-format
+msgid "could not parse conflict hunks in '%s'"
+msgstr "не вдалося розібрати конфліктні шматки в \"%s\""
+
+#, c-format
+msgid "failed utime() on '%s'"
+msgstr "невдалий utime() на \"%s\""
+
+#, c-format
+msgid "writing '%s' failed"
+msgstr "запис \"%s\" завершився невдало"
+
+#, c-format
+msgid "Staged '%s' using previous resolution."
+msgstr "Індексовано \"%s\" з використанням попереднього розвʼязання."
+
+#, c-format
+msgid "Recorded resolution for '%s'."
+msgstr "Записано розвʼязання для \"%s\"."
+
+#, c-format
+msgid "Resolved '%s' using previous resolution."
+msgstr "Розвʼязано \"%s\" з використанням попереднього розвʼязання."
+
+#, c-format
+msgid "cannot unlink stray '%s'"
+msgstr "неможливо відʼєднати блукаючий \"%s\""
+
+#, c-format
+msgid "Recorded preimage for '%s'"
+msgstr "Записано попереднє зображення для \"%s\""
+
+#, c-format
+msgid "failed to update conflicted state in '%s'"
+msgstr "не вдалося оновити конфліктний стан у \"%s\""
+
+#, c-format
+msgid "no remembered resolution for '%s'"
+msgstr "немає записаного вирішення для \"%s\""
+
+#, c-format
+msgid "Updated preimage for '%s'"
+msgstr "Оновлено попереднє зображення для \"%s\""
+
+#, c-format
+msgid "Forgot resolution for '%s'\n"
+msgstr "Забуто розвʼязання для \"%s\"\n"
+
+msgid "unable to open rr-cache directory"
+msgstr "неможливо відкрити rr-cache директорію"
+
+msgid "update the index with reused conflict resolution if possible"
+msgstr ""
+"оновити індекс з повторним використанням розвʼязання конфліктів, якщо це "
+"можливо"
+
+msgid "could not determine HEAD revision"
+msgstr "не вдалося визначити ревізію HEAD"
+
+#, c-format
+msgid "failed to find tree of %s"
+msgstr "не вдалося знайти дерево %s"
+
+#, c-format
+msgid "unsupported section for hidden refs: %s"
+msgstr "непідтримувана секція для прихованих посилань: %s"
+
+msgid "--exclude-hidden= passed more than once"
+msgstr "--exclude-hidden= передано більше одного разу"
+
+#, c-format
+msgid "resolve-undo records `%s` which is missing"
+msgstr ""
+
+#, c-format
+msgid "could not get commit for ancestry-path argument %s"
+msgstr ""
+
+msgid "--unpacked=<packfile> no longer supported"
+msgstr "--unpacked=<файл пакунка> більше не підтримується"
+
+msgid "your current branch appears to be broken"
+msgstr "ваша поточна гілка виглядає зламаною"
+
+#, c-format
+msgid "your current branch '%s' does not have any commits yet"
+msgstr "ваша поточна гілка \"%s\" ще не має жодних комітів"
+
+msgid "object filtering requires --objects"
+msgstr "для фільтрації обʼєктів потрібен параметр --objects"
+
+msgid "-L does not yet support diff formats besides -p and -s"
+msgstr "-L поки що не підтримує diff формати, окрім -p та -s"
+
+#, c-format
+msgid "cannot create async thread: %s"
+msgstr "неможливо створити асинхронний потік: %s"
+
+#, c-format
+msgid "'%s' does not exist"
+msgstr "\"%s\" не існує"
+
+#, c-format
+msgid "could not switch to '%s'"
+msgstr "не вдалося переключитися на \"%s\""
+
+msgid "need a working directory"
+msgstr "потрібна робоча директорія"
+
+msgid "Scalar enlistments require a worktree"
+msgstr ""
+
+#, c-format
+msgid "could not configure %s=%s"
+msgstr "не вдалося налаштувати %s=%s"
+
+msgid "could not configure log.excludeDecoration"
+msgstr "не вдалося налаштувати log.excludeDecoration"
+
+msgid "could not add enlistment"
+msgstr "не вдалося додати кореневу директорію проекту"
+
+msgid "could not set recommended config"
+msgstr "не вдалося встановити рекомендовану конфігурацію"
+
+msgid "could not turn on maintenance"
+msgstr "не вдалося ввімкнути технічне обслуговування"
+
+msgid "could not start the FSMonitor daemon"
+msgstr "не вдалося запустити FSMonitor демон"
+
+msgid "could not turn off maintenance"
+msgstr "не вдалося вимкнути технічне обслуговування"
+
+msgid "could not remove enlistment"
+msgstr "не вдалося видалити директорію верхнього рівня"
+
+#, c-format
+msgid "remote HEAD is not a branch: '%.*s'"
+msgstr "віддалений HEAD не є гілкою: \"%.*s\""
+
+msgid "failed to get default branch name from remote; using local default"
+msgstr ""
+"не вдалося отримати назву гілки за замовчуванням з віддаленого сховища; "
+"використано локальне значення за замовчуванням"
+
+msgid "failed to get default branch name"
+msgstr "не вдалося отримати назву гілки за замовчуванням"
+
+msgid "failed to unregister repository"
+msgstr "не вдалося скасувати реєстрацію сховища"
+
+msgid "failed to stop the FSMonitor daemon"
+msgstr "не вдалося зупинити FSMonitor демон"
+
+msgid "failed to delete enlistment directory"
+msgstr "не вдалося видалити директорію верхнього рівня"
+
+msgid "branch to checkout after clone"
+msgstr "гілка, на яку перейти після клонування"
+
+msgid "when cloning, create full working directory"
+msgstr "при клонуванні створювати повну робочу директорію"
+
+msgid "only download metadata for the branch that will be checked out"
+msgstr ""
+"завантажити метадані тільки для гілки, на яку буде здійснюватися перехід"
+
+msgid "scalar clone [<options>] [--] <repo> [<dir>]"
+msgstr "скалярний клон [<опції>] [--] <сховище> [<директорія>]"
+
+#, c-format
+msgid "cannot deduce worktree name from '%s'"
+msgstr "неможливо вивести назву робочого дерева з \"%s\""
+
+#, c-format
+msgid "directory '%s' exists already"
+msgstr "директорія \"%s\" вже існує"
+
+#, c-format
+msgid "failed to get default branch for '%s'"
+msgstr "не вдалося отримати гілку за замовчуванням для \"%s\""
+
+#, c-format
+msgid "could not configure remote in '%s'"
+msgstr "не вдалося налаштувати віддалене сховище в \"%s\""
+
+#, c-format
+msgid "could not configure '%s'"
+msgstr "не вдалося налаштувати \"%s\""
+
+msgid "partial clone failed; attempting full clone"
+msgstr "не вдалося зробити частковий клон; спроба зробити повний клон"
+
+msgid "could not configure for full clone"
+msgstr "не вдалося налаштувати для повного клона"
+
+msgid "scalar diagnose [<enlistment>]"
+msgstr "scalar diagnose [<коренева-директорія-проекту>]"
+
+msgid "`scalar list` does not take arguments"
+msgstr "\"scalar list\" не приймає аргументів"
+
+msgid "scalar register [<enlistment>]"
+msgstr "scalar register [<коренева-директорія-проекту>]"
+
+msgid "reconfigure all registered enlistments"
+msgstr "переналаштувати всі зареєстровані кореневі директорії проекту"
+
+msgid "scalar reconfigure [--all | <enlistment>]"
+msgstr "scalar reconfigure [--all | <коренева-директорія-проекту>]"
+
+msgid "--all or <enlistment>, but not both"
+msgstr "--all або <коренева-директорія-проекту>, але не обидва"
+
+#, c-format
+msgid "could not remove stale scalar.repo '%s'"
+msgstr "неможливо видалити застаріле scalar.repo \"%s\""
+
+#, c-format
+msgid "removing stale scalar.repo '%s'"
+msgstr "видалення застарілого scalar.repo \"%s\""
+
+#, c-format
+msgid "git repository gone in '%s'"
+msgstr "git сховище зникло у \"%s\""
+
+msgid ""
+"scalar run <task> [<enlistment>]\n"
+"Tasks:\n"
+msgstr ""
+"scalar run <завдання> [<коренева-директорія-проекту>]\n"
+"Завдання:\n"
+
+#, c-format
+msgid "no such task: '%s'"
+msgstr "немає такого завдання: \"%s\""
+
+msgid "scalar unregister [<enlistment>]"
+msgstr "scalar unregister [<коренева-директорія-проекту>]"
+
+msgid "scalar delete <enlistment>"
+msgstr "scalar delete <коренева-директорія-проекту>"
+
+msgid "refusing to delete current working directory"
+msgstr "відмова видалення поточної робочої директорії"
+
+msgid "include Git version"
+msgstr "включити версію Git"
+
+msgid "include Git's build options"
+msgstr "включити опції збірки Git"
+
+msgid "scalar verbose [-v | --verbose] [--build-options]"
+msgstr ""
+
+msgid "-C requires a <directory>"
+msgstr "-C потребує наявності <директорії>"
+
+#, c-format
+msgid "could not change to '%s'"
+msgstr "не вдалося змінити на \"%s\""
+
+msgid "-c requires a <key>=<value> argument"
+msgstr "-c потребує <ключ>=<значення> аргумент"
+
+msgid ""
+"scalar [-C <directory>] [-c <key>=<value>] <command> [<options>]\n"
+"\n"
+"Commands:\n"
+msgstr ""
+"scalar [-C <директорія>] [-c <ключ>=<значення>] <команда> [<опції>]\n"
+"\n"
+"Команди:\n"
+
+msgid "unexpected flush packet while reading remote unpack status"
+msgstr ""
+"несподіваний flush пакет під час зчитування статусу віддаленого розпакування"
+
+#, c-format
+msgid "unable to parse remote unpack status: %s"
+msgstr "не вдалося розібрати стан розпакування віддаленого сховища: %s"
+
+#, c-format
+msgid "remote unpack failed: %s"
+msgstr "віддалене розпакування не вдалося: %s"
+
+msgid "failed to sign the push certificate"
+msgstr "не вдалося підписати сертифікат надсилання"
+
+msgid "send-pack: unable to fork off fetch subprocess"
+msgstr "send-pack: не вдалося розгалужити підпроцес отримання"
+
+msgid "push negotiation failed; proceeding anyway with push"
+msgstr "переговори з надсилання не вдалися; все одно продовжуємо надсилання"
+
+msgid "the receiving end does not support this repository's hash algorithm"
+msgstr "отримуюча сторона не підтримує хеш-алгоритм цього сховища"
+
+msgid "the receiving end does not support --signed push"
+msgstr "отримуюча сторона не підтримує --signed push"
+
+msgid ""
+"not sending a push certificate since the receiving end does not support --"
+"signed push"
+msgstr ""
+"сертифікат надсилання не відправлено, оскільки отримуюча сторона не "
+"підтримує --signed push"
+
+msgid "the receiving end does not support --atomic push"
+msgstr "отримуюча сторона не підтримує --atomic push"
+
+msgid "the receiving end does not support push options"
+msgstr "отримуюча сторона не підтримує опції push"
+
+#, c-format
+msgid "invalid commit message cleanup mode '%s'"
+msgstr "неприпустимий режим очищення дописів до коміту \"%s\""
+
+#, c-format
+msgid "could not delete '%s'"
+msgstr "не вдалося видалити \"%s\""
+
+msgid "revert"
+msgstr "вивертання"
+
+msgid "cherry-pick"
+msgstr "висмикування"
+
+msgid "rebase"
+msgstr "перебазування"
+
+#, c-format
+msgid "unknown action: %d"
+msgstr "невідома дія: %d"
+
+msgid ""
+"after resolving the conflicts, mark the corrected paths\n"
+"with 'git add <paths>' or 'git rm <paths>'"
+msgstr ""
+"після розвʼязання конфліктів позначте виправлені шляхи\n"
+"за допомогою \"git add <шляхи>\" або \"git rm <шляхи>\""
+
+msgid ""
+"After resolving the conflicts, mark them with\n"
+"\"git add/rm <pathspec>\", then run\n"
+"\"git cherry-pick --continue\".\n"
+"You can instead skip this commit with \"git cherry-pick --skip\".\n"
+"To abort and get back to the state before \"git cherry-pick\",\n"
+"run \"git cherry-pick --abort\"."
+msgstr ""
+"Після розвʼязання конфліктів позначте їх за допомогою\n"
+"\"git add/rm <визначник шляху>\", а потім виконайте\n"
+"\"git cherry-pick --continue\".\n"
+"Замість цього ви можете пропустити цей комміт за допомогою \"git cherry-pick "
+"--skip\".\n"
+"Щоб перервати процес і повернутися до стану перед \"git cherry-pick\",\n"
+"виконайте \"git cherry-pick --abort\"."
+
+msgid ""
+"After resolving the conflicts, mark them with\n"
+"\"git add/rm <pathspec>\", then run\n"
+"\"git revert --continue\".\n"
+"You can instead skip this commit with \"git revert --skip\".\n"
+"To abort and get back to the state before \"git revert\",\n"
+"run \"git revert --abort\"."
+msgstr ""
+"Після розвʼязання конфліктів позначте їх за допомогою\n"
+"\"git add/rm <визначник шляху>\", а потім виконайте\n"
+"\"git revert --continue\".\n"
+"Замість цього ви можете пропустити цей коміт за допомогою \"git revert --"
+"skip\".\n"
+"Щоб перервати і повернутися до стану перед \"git revert\",\n"
+"виконайте \"git revert --abort\"."
+
+#, c-format
+msgid "could not lock '%s'"
+msgstr "не вдалося зафіксувати \"%s\""
+
+#, c-format
+msgid "could not write eol to '%s'"
+msgstr "не вдалося записати eol в \"%s\""
+
+#, c-format
+msgid "failed to finalize '%s'"
+msgstr "не вдалося завершити \"%s\""
+
+#, c-format
+msgid "your local changes would be overwritten by %s."
+msgstr "ваші локальні зміни будуть перезаписані %s."
+
+msgid "commit your changes or stash them to proceed."
+msgstr "зробіть коміт або додайте ваші зміни до схову, щоб продовжити."
+
+#. TRANSLATORS: %s will be "revert", "cherry-pick" or
+#. "rebase".
+#.
+
+#, c-format
+msgid "%s: Unable to write new index file"
+msgstr "%s: Не вдалося записати новий індексний файл"
+
+msgid "unable to update cache tree"
+msgstr "не вдалося оновити дерево кешу"
+
+msgid "could not resolve HEAD commit"
+msgstr "не вдалося розпізнати HEAD коміт"
+
+#, c-format
+msgid "no key present in '%.*s'"
+msgstr "немає ключа у \"%.*s\""
+
+#, c-format
+msgid "unable to dequote value of '%s'"
+msgstr "не вдалося вилучити лапки зі значення \"%s\""
+
+msgid "'GIT_AUTHOR_NAME' already given"
+msgstr "\"GIT_AUTHOR_NAME\" вже надано"
+
+msgid "'GIT_AUTHOR_EMAIL' already given"
+msgstr "\"GIT_AUTHOR_EMAIL\" вже надано"
+
+msgid "'GIT_AUTHOR_DATE' already given"
+msgstr "\"GIT_AUTHOR_DATE\" вже надано"
+
+#, c-format
+msgid "unknown variable '%s'"
+msgstr "невідома змінна \"%s\""
+
+msgid "missing 'GIT_AUTHOR_NAME'"
+msgstr "бракує \"GIT_AUTHOR_NAME\""
+
+msgid "missing 'GIT_AUTHOR_EMAIL'"
+msgstr "бракує \"GIT_AUTHOR_EMAIL\""
+
+msgid "missing 'GIT_AUTHOR_DATE'"
+msgstr "бракує \"GIT_AUTHOR_DATE\""
+
+#, c-format
+msgid ""
+"you have staged changes in your working tree\n"
+"If these changes are meant to be squashed into the previous commit, run:\n"
+"\n"
+"  git commit --amend %s\n"
+"\n"
+"If they are meant to go into a new commit, run:\n"
+"\n"
+"  git commit %s\n"
+"\n"
+"In both cases, once you're done, continue with:\n"
+"\n"
+"  git rebase --continue\n"
+msgstr ""
+"ви маєте індексовані зміни у вашому робочому дереві\n"
+"Якщо ці зміни мають бути стиснуті у попередній коміт, запустіть:\n"
+"\n"
+"  git commit --amend %s\n"
+"\n"
+"Якщо вони мають потрапити до нового коміту, виконайте:\n"
+"\n"
+"  git commit %s\n"
+"\n"
+"В обох випадках, як тільки ви закінчите, продовжуйте за допомогою:\n"
+"\n"
+"  git rebase --continue\n"
+
+msgid "'prepare-commit-msg' hook failed"
+msgstr "\"prepare-commit-msg\" гачок завершився невдало"
+
+msgid ""
+"Your name and email address were configured automatically based\n"
+"on your username and hostname. Please check that they are accurate.\n"
+"You can suppress this message by setting them explicitly. Run the\n"
+"following command and follow the instructions in your editor to edit\n"
+"your configuration file:\n"
+"\n"
+"    git config --global --edit\n"
+"\n"
+"After doing this, you may fix the identity used for this commit with:\n"
+"\n"
+"    git commit --amend --reset-author\n"
+msgstr ""
+"Ваше імʼя та адреса електронної пошти були налаштовані автоматично на "
+"основі\n"
+"вашого імені користувача та назви хосту. Будь ласка, перевірте їх "
+"правильність.\n"
+"Ви можете приховати це повідомлення, встановивши їх явно. Запустіть\n"
+"наступну команду і дотримуйтесь інструкцій у вашому редакторі, щоб "
+"відредагувати\n"
+"ваш конфігураційний файл:\n"
+"\n"
+"    git config --global --edit\n"
+"\n"
+"Після цього ви можете виправити особистість автора, використану для цього "
+"коміту, за допомогою\n"
+"\n"
+"    git commit --amend --reset-author\n"
+
+msgid ""
+"Your name and email address were configured automatically based\n"
+"on your username and hostname. Please check that they are accurate.\n"
+"You can suppress this message by setting them explicitly:\n"
+"\n"
+"    git config --global user.name \"Your Name\"\n"
+"    git config --global user.email you@example.com\n"
+"\n"
+"After doing this, you may fix the identity used for this commit with:\n"
+"\n"
+"    git commit --amend --reset-author\n"
+msgstr ""
+"Ваше імʼя та адреса електронної пошти були налаштовані автоматично на "
+"основі\n"
+"вашого імені користувача та назви хосту. Будь ласка, перевірте їх "
+"правильність.\n"
+"Ви можете приховати це повідомлення, вказавши їх явно:\n"
+"\n"
+"    git config --global user.name \"Ваше імʼя\"\n"
+"    git config --global user.email you@example.com\n"
+"\n"
+"Після цього ви можете виправити особистість автора, використану для цього "
+"коміту, за допомогою\n"
+"\n"
+"    git commit --amend --reset-author\n"
+
+msgid "couldn't look up newly created commit"
+msgstr "не вдалося знайти новостворений коміт"
+
+msgid "could not parse newly created commit"
+msgstr "не вдалося розібрати новостворений коміт"
+
+msgid "unable to resolve HEAD after creating commit"
+msgstr "не вдалося розвʼязати HEAD після створення коміту"
+
+msgid "detached HEAD"
+msgstr "відʼєднаний HEAD"
+
+msgid " (root-commit)"
+msgstr " (кореневий комміт)"
+
+msgid "could not parse HEAD"
+msgstr "неможливо розібрати HEAD"
+
+#, c-format
+msgid "HEAD %s is not a commit!"
+msgstr "HEAD %s не є комітом!"
+
+msgid "unable to parse commit author"
+msgstr "не вдалося розібрати автора коміту"
+
+#, c-format
+msgid "unable to read commit message from '%s'"
+msgstr "не вдалося прочитати допис до коміта від \"%s\""
+
+#, c-format
+msgid "invalid author identity '%s'"
+msgstr "неприпустима ідентичність автора \"%s\""
+
+msgid "corrupt author: missing date information"
+msgstr "пошкоджені дані про автора: відсутня інформація про дату"
+
+#, c-format
+msgid "could not update %s"
+msgstr "не вдалося оновити %s"
+
+#, c-format
+msgid "could not parse commit %s"
+msgstr "не вдалося розібрати коміт %s"
+
+#, c-format
+msgid "could not parse parent commit %s"
+msgstr "не вдалося розібрати джерельний коміт %s"
+
+#, c-format
+msgid "unknown command: %d"
+msgstr "невідома команда: %d"
+
+msgid "This is the 1st commit message:"
+msgstr "Це перший допис до коміта:"
+
+#, c-format
+msgid "This is the commit message #%d:"
+msgstr "Це допис до коміта #%d:"
+
+msgid "The 1st commit message will be skipped:"
+msgstr "Перший допис до коміта буде пропущено:"
+
+#, c-format
+msgid "The commit message #%d will be skipped:"
+msgstr "Допис до коміта #%d буде пропущено:"
+
+#, c-format
+msgid "This is a combination of %d commits."
+msgstr "Це комбінація %d комітів."
+
+#, c-format
+msgid "cannot write '%s'"
+msgstr "неможливо записати \"%s\""
+
+msgid "need a HEAD to fixup"
+msgstr "потрібен HEAD, щоб виправити"
+
+msgid "could not read HEAD"
+msgstr "не вдалося прочитати HEAD"
+
+msgid "could not read HEAD's commit message"
+msgstr "не вдалося прочитати допис до коміта HEAD"
+
+#, c-format
+msgid "could not read commit message of %s"
+msgstr "не вдалося прочитати допис до коміта %s"
+
+msgid "your index file is unmerged."
+msgstr "ваш індексний файл не злитий."
+
+msgid "cannot fixup root commit"
+msgstr "не вдалося виправити кореневий коміт"
+
+#, c-format
+msgid "commit %s is a merge but no -m option was given."
+msgstr "коміт %s - це злиття, але опція -m не була вказана."
+
+#, c-format
+msgid "commit %s does not have parent %d"
+msgstr "коміт %s не має джерела %d"
+
+#, c-format
+msgid "cannot get commit message for %s"
+msgstr "неможливо отримати допис до коміта для %s"
+
+#. TRANSLATORS: The first %s will be a "todo" command like
+#. "revert" or "pick", the second %s a SHA1.
+
+#, c-format
+msgid "%s: cannot parse parent commit %s"
+msgstr "%s: не вдалося розібрати джерельний коміт %s"
+
+#, c-format
+msgid "could not rename '%s' to '%s'"
+msgstr "не вдалося перейменувати \"%s\" на \"%s\""
+
+#, c-format
+msgid "could not revert %s... %s"
+msgstr "не вдалося зробити вивертання %s... %s"
+
+#, c-format
+msgid "could not apply %s... %s"
+msgstr "не вдалося застосувати %s... %s"
+
+#, c-format
+msgid "dropping %s %s -- patch contents already upstream\n"
+msgstr ""
+"скидання %s %s -- вміст латки вже знаходиться у першоджерельному сховищі\n"
+
+#, c-format
+msgid "git %s: failed to read the index"
+msgstr "git %s: не вдалося прочитати індекс"
+
+#, c-format
+msgid "git %s: failed to refresh the index"
+msgstr "git %s: не вдалося оновити індекс"
+
+#, c-format
+msgid "'%s' is not a valid label"
+msgstr "\"%s\" не є припустимою міткою"
+
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "\"%s\" не є припустимою назвою посилання"
+
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr "update-ref потребує повної назви посилання, наприклад, refs/heads/%s"
+
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "неприпустима команда \"%.*s\""
+
+#, c-format
+msgid "%s does not accept arguments: '%s'"
+msgstr "%s не приймає аргументи: \"%s\""
+
+#, c-format
+msgid "missing arguments for %s"
+msgstr "відсутні аргументи для %s"
+
+#, c-format
+msgid "could not parse '%s'"
+msgstr "не вдалося розібрати \"%s\""
+
+#, c-format
+msgid "invalid line %d: %.*s"
+msgstr "невірний рядок %d: %.*s"
+
+#, c-format
+msgid "cannot '%s' without a previous commit"
+msgstr "неможливо зробити \"%s\" без попереднього коміту"
+
+msgid "cancelling a cherry picking in progress"
+msgstr "скасування поточного висмикування"
+
+msgid "cancelling a revert in progress"
+msgstr "наразі йде скасування вивертання"
+
+msgid "please fix this using 'git rebase --edit-todo'."
+msgstr "будь ласка, виправте це за допомогою \"git rebase --edit-todo\"."
+
+#, c-format
+msgid "unusable instruction sheet: '%s'"
+msgstr "непридатна інструкція: \"%s\""
+
+msgid "no commits parsed."
+msgstr "не розібрано жодного коміту."
+
+msgid "cannot cherry-pick during a revert."
+msgstr "неможливо зробити висмикування під час вивертання."
+
+msgid "cannot revert during a cherry-pick."
+msgstr "неможливо зробити вивертання під час висмикування."
+
+msgid "unusable squash-onto"
+msgstr "непридатний squash-onto"
+
+#, c-format
+msgid "malformed options sheet: '%s'"
+msgstr "невірно сформований список опцій: \"%s\""
+
+msgid "empty commit set passed"
+msgstr "передано порожній набір комітів"
+
+msgid "revert is already in progress"
+msgstr "наразі виконується операція вивертання"
+
+#, c-format
+msgid "try \"git revert (--continue | %s--abort | --quit)\""
+msgstr "спробуйте \"git revert (--continue | %s--abort | --quit)\""
+
+msgid "cherry-pick is already in progress"
+msgstr "наразі вже триває висмикування"
+
+#, c-format
+msgid "try \"git cherry-pick (--continue | %s--abort | --quit)\""
+msgstr "спробуйте \"git cherry-pick (--continue | %s--abort | --quit)\""
+
+#, c-format
+msgid "could not create sequencer directory '%s'"
+msgstr "не вдалося створити директорію секвенсора \"%s\""
+
+msgid "no cherry-pick or revert in progress"
+msgstr "наразі не триває ні скасування, ні висмикування"
+
+msgid "cannot resolve HEAD"
+msgstr "неможливо розпізнати HEAD"
+
+msgid "cannot abort from a branch yet to be born"
+msgstr "неможливо перервати з гілки, яка ще не народилася"
+
+#, c-format
+msgid "cannot read '%s': %s"
+msgstr "неможливо прочитати \"%s\": %s"
+
+msgid "unexpected end of file"
+msgstr "несподіваний кінець файлу"
+
+#, c-format
+msgid "stored pre-cherry-pick HEAD file '%s' is corrupt"
+msgstr "збережений pre-cherry-pick HEAD файл \"%s\" пошкоджено"
+
+msgid "You seem to have moved HEAD. Not rewinding, check your HEAD!"
+msgstr ""
+"Здається, ви пересунули HEAD. Перемотування не виконується, перевірте свій "
+"HEAD!"
+
+msgid "no revert in progress"
+msgstr "наразі операція вивертання не виконується"
+
+msgid "no cherry-pick in progress"
+msgstr "наразі висмикування не виконується"
+
+msgid "failed to skip the commit"
+msgstr "не вдалося пропустити коміт"
+
+msgid "there is nothing to skip"
+msgstr "немає чого пропускати"
+
+#, c-format
+msgid ""
+"have you committed already?\n"
+"try \"git %s --continue\""
+msgstr ""
+"ви вже зробили коміт?\n"
+"спробуйте \"git %s --continue\""
+
+msgid "cannot read HEAD"
+msgstr "неможливо прочитати HEAD"
+
+#, c-format
+msgid "unable to copy '%s' to '%s'"
+msgstr "не вдалося скопіювати \"%s\" в \"%s\""
+
+#, c-format
+msgid ""
+"You can amend the commit now, with\n"
+"\n"
+"  git commit --amend %s\n"
+"\n"
+"Once you are satisfied with your changes, run\n"
+"\n"
+"  git rebase --continue\n"
+msgstr ""
+"Ви можете внести зміни до коміту зараз за допомогою\n"
+"\n"
+"  git commit --amend %s\n"
+"\n"
+"Після того, як ви будете задоволені своїми змінами, виконайте\n"
+"\n"
+"  git rebase --continue\n"
+
+#, c-format
+msgid "Could not apply %s... %.*s"
+msgstr "Не вдалося застосувати %s... %.*s"
+
+#, c-format
+msgid "Could not merge %.*s"
+msgstr "Не вдалося злити %.*s"
+
+#, c-format
+msgid "Executing: %s\n"
+msgstr "Виконання: %s\n"
+
+#, c-format
+msgid ""
+"execution failed: %s\n"
+"%sYou can fix the problem, and then run\n"
+"\n"
+"  git rebase --continue\n"
+"\n"
+msgstr ""
+"не вдалося виконати : %s\n"
+"%sВи можете виправити проблему, а потім виконати\n"
+"\n"
+"  git rebase --continue\n"
+
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "та внесли зміни до індексу та/або робочого дерева\n"
+
+#, c-format
+msgid ""
+"execution succeeded: %s\n"
+"but left changes to the index and/or the working tree.\n"
+"Commit or stash your changes, and then run\n"
+"\n"
+"  git rebase --continue\n"
+"\n"
+msgstr ""
+"виконання пройшло успішно: %s\n"
+"але залишило зміни в індексі та/або робочому дереві.\n"
+"Зробіть коміт або додайте зміни до схову, а потім запустіть\n"
+"\n"
+"  git rebase --continue\n"
+"\n"
+
+#, c-format
+msgid "illegal label name: '%.*s'"
+msgstr "неприпустима назва мітки: \"%.*s\""
+
+#, c-format
+msgid "could not resolve '%s'"
+msgstr "не вдалося розпізнати \"%s\""
+
+msgid "writing fake root commit"
+msgstr "написання підробленого кореневого коміту"
+
+msgid "writing squash-onto"
+msgstr "запис squash-onto"
+
+msgid "cannot merge without a current revision"
+msgstr "неможливо злити без поточної ревізії"
+
+#, c-format
+msgid "unable to parse '%.*s'"
+msgstr "не вдалося розібрати \"%.*s\""
+
+#, c-format
+msgid "nothing to merge: '%.*s'"
+msgstr "нічого зливати: \"%.*s\""
+
+msgid "octopus merge cannot be executed on top of a [new root]"
+msgstr "octopus злиття неможливо виконати поверх [new root]"
+
+#, c-format
+msgid "could not get commit message of '%s'"
+msgstr "не вдалося отримати допис до коміта \"%s\""
+
+#, c-format
+msgid "could not even attempt to merge '%.*s'"
+msgstr "не вдалося навіть спробувати злити \"%.*s\""
+
+msgid "merge: Unable to write new index file"
+msgstr "злиття: Не вдалося записати новий файл індексу"
+
+#, c-format
+msgid ""
+"another 'rebase' process appears to be running; '%s.lock' already exists"
+msgstr "здається, запущено інший процес \"rebase\"; \"%s.lock\" вже існує"
+
+#, c-format
+msgid ""
+"Updated the following refs with %s:\n"
+"%s"
+msgstr ""
+"Оновлені наступні посилання з %s:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Failed to update the following refs with %s:\n"
+"%s"
+msgstr ""
+"Не вдалося оновити наступні посилання з %s:\n"
+"%s"
+
+msgid "Cannot autostash"
+msgstr "Неможливо зробити автосхов"
+
+#, c-format
+msgid "Unexpected stash response: '%s'"
+msgstr "Неочікувана відповідь схову: \"%s\""
+
+#, c-format
+msgid "Could not create directory for '%s'"
+msgstr "Не вдалося створити директорію для \"%s\""
+
+#, c-format
+msgid "Created autostash: %s\n"
+msgstr "Створено автосхов: %s\n"
+
+msgid "could not reset --hard"
+msgstr "не вдалося виконати скидання з --hard"
+
+#, c-format
+msgid "Applied autostash.\n"
+msgstr "Застосовано автосхов.\n"
+
+#, c-format
+msgid "cannot store %s"
+msgstr "неможливо зберегти %s"
+
+#, c-format
+msgid ""
+"%s\n"
+"Your changes are safe in the stash.\n"
+"You can run \"git stash pop\" or \"git stash drop\" at any time.\n"
+msgstr ""
+"%s\n"
+"Ваші зміни в безпеці у схову.\n"
+"Ви можете запустити \"git stash pop\" або \"git stash drop\" у будь-який "
+"час.\n"
+
+msgid "Applying autostash resulted in conflicts."
+msgstr "Застосування автосхову призвело до конфліктів."
+
+msgid "Autostash exists; creating a new stash entry."
+msgstr "Автосхов існує; створення нового запису схову."
+
+msgid "could not detach HEAD"
+msgstr "не вдалося відʼєднати HEAD"
+
+#, c-format
+msgid "Stopped at HEAD\n"
+msgstr "Зупинено на HEAD\n"
+
+#, c-format
+msgid "Stopped at %s\n"
+msgstr "Зупинено на %s\n"
+
+#, c-format
+msgid ""
+"Could not execute the todo command\n"
+"\n"
+"    %.*s\n"
+"It has been rescheduled; To edit the command before continuing, please\n"
+"edit the todo list first:\n"
+"\n"
+"    git rebase --edit-todo\n"
+"    git rebase --continue\n"
+msgstr ""
+"Не вдалося виконати команду todo\n"
+"\n"
+"    %.*s\n"
+"Її було перенесено; Щоб відредагувати команду перед продовженням, будь "
+"ласка\n"
+"спочатку відредагуйте список справ:\n"
+"\n"
+"    git rebase --edit-todo\n"
+"    git rebase --continue\n"
+
+#, c-format
+msgid "Rebasing (%d/%d)%s"
+msgstr "Перебазування (%d/%d)%s"
+
+#, c-format
+msgid "Stopped at %s...  %.*s\n"
+msgstr "Зупинено на %s... %.*s\n"
+
+#, c-format
+msgid "unknown command %d"
+msgstr "невідома команда %d"
+
+msgid "could not read orig-head"
+msgstr "не вдалося прочитати orig-head"
+
+msgid "could not read 'onto'"
+msgstr "не вдалося прочитати  \"onto\""
+
+#, c-format
+msgid "could not update HEAD to %s"
+msgstr "не вдалося оновити HEAD до %s"
+
+#, c-format
+msgid "Successfully rebased and updated %s.\n"
+msgstr "Успішно перебазовано та оновлено %s.\n"
+
+msgid "cannot rebase: You have unstaged changes."
+msgstr "неможливо перебазувати: у вас є неіндексовані зміни."
+
+msgid "cannot amend non-existing commit"
+msgstr "неможливо виправити неіснуючий коміт"
+
+#, c-format
+msgid "invalid file: '%s'"
+msgstr "неприпустимий файл: \"%s\""
+
+#, c-format
+msgid "invalid contents: '%s'"
+msgstr "неприпустимий вміст: \"%s\""
+
+msgid ""
+"\n"
+"You have uncommitted changes in your working tree. Please, commit them\n"
+"first and then run 'git rebase --continue' again."
+msgstr ""
+"\n"
+"У вас є незакомічені зміни у вашому робочому дереві. Будь ласка, спочатку "
+"зробіть коміт,\n"
+"а потім знову виконайте \"git rebase --continue\"."
+
+#, c-format
+msgid "could not write file: '%s'"
+msgstr "не вдалося записати файл: \"%s\""
+
+msgid "could not remove CHERRY_PICK_HEAD"
+msgstr "не вдалося видалити CHERRY_PICK_HEAD"
+
+msgid "could not commit staged changes."
+msgstr "не вдалося записати індексовані зміни."
+
+#, c-format
+msgid "%s: can't cherry-pick a %s"
+msgstr "%s: неможливо зробити висмикування %s"
+
+#, c-format
+msgid "%s: bad revision"
+msgstr "%s: невірна ревізія"
+
+msgid "can't revert as initial commit"
+msgstr "неможливо зробити вивертання як початковий коміт"
+
+#, c-format
+msgid "skipped previously applied commit %s"
+msgstr "пропущено попередньо застосований коміт %s"
+
+msgid "use --reapply-cherry-picks to include skipped commits"
+msgstr "використовуйте --reapply-cherry-picks, щоб включити пропущені коміти"
+
+msgid "make_script: unhandled options"
+msgstr "make_script: необроблені опції"
+
+msgid "make_script: error preparing revisions"
+msgstr "make_script: помилка при підготовці ревізій"
+
+msgid "nothing to do"
+msgstr "нічого робити"
+
+msgid "could not skip unnecessary pick commands"
+msgstr "не вдалося пропустити непотрібні команди вибору"
+
+msgid "the script was already rearranged."
+msgstr "скрипт вже був перероблений."
+
+#, c-format
+msgid "update-refs file at '%s' is invalid"
+msgstr "файл update-refs за адресою \"%s\" є неприпустимим"
+
+#, c-format
+msgid "'%s' is outside repository at '%s'"
+msgstr "\"%s\" зовнішнє сховище в \"%s\""
+
+#, c-format
+msgid ""
+"%s: no such path in the working tree.\n"
+"Use 'git <command> -- <path>...' to specify paths that do not exist locally."
+msgstr ""
+"%s: немає такого шляху у робочому дереві.\n"
+"Використовуйте \"git <команда> -- <шлях>...\", щоб вказати шляхи, які не "
+"існують локально."
+
+#, c-format
+msgid ""
+"ambiguous argument '%s': unknown revision or path not in the working tree.\n"
+"Use '--' to separate paths from revisions, like this:\n"
+"'git <command> [<revision>...] -- [<file>...]'"
+msgstr ""
+"неоднозначний аргумент \"%s\": невідома ревізія або шлях не у робочому "
+"дереві.\n"
+"Використовуйте \"--\", щоб відокремити шлях від ревізій, наприклад, так:\n"
+"\"git <команда> [<ревізія>...] -- [<файл>...]\""
+
+#, c-format
+msgid "option '%s' must come before non-option arguments"
+msgstr "опція \"%s\" повинна стояти перед аргументами без опцій"
+
+#, c-format
+msgid ""
+"ambiguous argument '%s': both revision and filename\n"
+"Use '--' to separate paths from revisions, like this:\n"
+"'git <command> [<revision>...] -- [<file>...]'"
+msgstr ""
+"неоднозначний аргумент \"%s\": і ревізія, і назва файлу\n"
+"Використовуйте \"--\", щоб відокремити шляхи від ревізій, наприклад, так:\n"
+"\"git <команда> [<ревізія>...] -- [<файл>...]\""
+
+msgid "unable to set up work tree using invalid config"
+msgstr ""
+"не вдалося налаштувати робоче дерево, використовуючи неприпустиму "
+"конфігурацію"
+
+#, c-format
+msgid "Expected git repo version <= %d, found %d"
+msgstr "Очікувалось git сховищe версії <= %d, знайдено %d"
+
+msgid "unknown repository extension found:"
+msgid_plural "unknown repository extensions found:"
+msgstr[0] "знайдено невідомих розширень сховища:"
+msgstr[1] "знайдено невідомих розширень сховища:"
+msgstr[2] "знайдено невідомих розширень сховища:"
+
+msgid "repo version is 0, but v1-only extension found:"
+msgid_plural "repo version is 0, but v1-only extensions found:"
+msgstr[0] "версія сховища дорівнює 0, але знайдено v1-only розширень:"
+msgstr[1] "версія сховища дорівнює 0, але знайдено v1-only розширень:"
+msgstr[2] "версія сховища дорівнює 0, але знайдено v1-only розширень:"
+
+#, c-format
+msgid "error opening '%s'"
+msgstr "помилка при відкритті \"%s\""
+
+#, c-format
+msgid "too large to be a .git file: '%s'"
+msgstr "занадто великий для .git-файлу: \"%s\""
+
+#, c-format
+msgid "error reading %s"
+msgstr "помилка зчитування %s"
+
+#, c-format
+msgid "invalid gitfile format: %s"
+msgstr "неприпустимий формат git файлу: %s"
+
+#, c-format
+msgid "no path in gitfile: %s"
+msgstr "немає шляху в gitfile: %s"
+
+#, c-format
+msgid "not a git repository: %s"
+msgstr "не є git сховищем: %s"
+
+#, c-format
+msgid "'$%s' too big"
+msgstr "\"$%s\" занадто великий"
+
+#, c-format
+msgid "not a git repository: '%s'"
+msgstr "не є git сховищем: \"%s\""
+
+#, c-format
+msgid "cannot chdir to '%s'"
+msgstr "неможливо змінити директорію на \"%s\""
+
+msgid "cannot come back to cwd"
+msgstr "неможливо повернутися до поточної робочої директорії"
+
+#, c-format
+msgid "failed to stat '%*s%s%s'"
+msgstr "не вдалося записати \"%*s%s%s\""
+
+msgid "Unable to read current working directory"
+msgstr "Не вдалося прочитати поточну робочу директорію"
+
+#, c-format
+msgid "cannot change to '%s'"
+msgstr "неможливо змінити на \"%s\""
+
+#, c-format
+msgid "not a git repository (or any of the parent directories): %s"
+msgstr "не є git сховищем (як і жодна з батьківських директорій): %s"
+
+#, c-format
+msgid ""
+"not a git repository (or any parent up to mount point %s)\n"
+"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)."
+msgstr ""
+"не є git сховищем (як і жодна з батьківських директорій до місця монтування "
+"%s)\n"
+"Зупинка на межі файлової системи (GIT_DISCOVERY_ACROSS_FILESYSTEM не "
+"встановлено)."
+
+#, c-format
+msgid ""
+"detected dubious ownership in repository at '%s'\n"
+"%sTo add an exception for this directory, call:\n"
+"\n"
+"\tgit config --global --add safe.directory %s"
+msgstr ""
+"виявлено сумнівне право власності у сховищі за адресою \"%s\"\n"
+"%sЩоб додати виняток для цієї директорії, виконайте:\n"
+"\n"
+"\tgit config --global --add safe.directory %s"
+
+#, c-format
+msgid "cannot use bare repository '%s' (safe.bareRepository is '%s')"
+msgstr ""
+"неможливо використати порожнє сховище \"%s\" (safe.bareRepository "
+"встановлено в \"%s\")"
+
+#, c-format
+msgid ""
+"problem with core.sharedRepository filemode value (0%.3o).\n"
+"The owner of files must always have read and write permissions."
+msgstr ""
+"проблема зі значенням файлового режиму core.sharedRepository (0%.3o).\n"
+"Власник файлів завжди повинен мати права на читання та запис."
+
+msgid "fork failed"
+msgstr "fork завершився невдало"
+
+msgid "setsid failed"
+msgstr "setsid завершився невдало"
+
+#, c-format
+msgid "index entry is a directory, but not sparse (%08x)"
+msgstr "індексний запис є директорією, але не є частковим (%08x)"
+
+msgid "cannot use split index with a sparse index"
+msgstr "не можна використовувати розділений індекс з частковим індексом"
+
+#, c-format
+msgid "%u.%2.2u GiB"
+msgstr "%u.%2.2u ГіБ"
+
+#, c-format
+msgid "%u.%2.2u GiB/s"
+msgstr "%u.%2.2u ГіБ/с"
+
+#, c-format
+msgid "%u.%2.2u MiB"
+msgstr "%u.%2.2u МіБ"
+
+#, c-format
+msgid "%u.%2.2u MiB/s"
+msgstr "%u.%2.2u МіБ/с"
+
+#, c-format
+msgid "%u.%2.2u KiB"
+msgstr "%u.%2.2u КіБ"
+
+#, c-format
+msgid "%u.%2.2u KiB/s"
+msgstr "%u.%2.2u КіБ/с"
+
+#, c-format
+msgid "%u byte"
+msgid_plural "%u bytes"
+msgstr[0] "%u байт"
+msgstr[1] "%u байти"
+msgstr[2] "%u байтів"
+
+#, c-format
+msgid "%u byte/s"
+msgid_plural "%u bytes/s"
+msgstr[0] "%u байт/s"
+msgstr[1] "%u байти/s"
+msgstr[2] "%u байтів/s"
+
+#, c-format
+msgid "ignoring suspicious submodule name: %s"
+msgstr "ігнорування підозрілої назви підмодуля: %s"
+
+msgid "negative values not allowed for submodule.fetchJobs"
+msgstr "негативні значення не дозволені для submodule.fetchJobs"
+
+#, c-format
+msgid "ignoring '%s' which may be interpreted as a command-line option: %s"
+msgstr ""
+"ігнорування \"%s\", який може бути інтерпретований як параметр командного "
+"рядка: %s"
+
+#, c-format
+msgid "Could not update .gitmodules entry %s"
+msgstr "Не вдалося оновити запис %s у .gitmodules"
+
+msgid "Cannot change unmerged .gitmodules, resolve merge conflicts first"
+msgstr ""
+"Неможливо змінити незлиті .gitmodules, спочатку розвʼяжіть конфлікти злиття"
+
+#, c-format
+msgid "Could not find section in .gitmodules where path=%s"
+msgstr "Не вдалося знайти розділ у .gitmodules де path=%s"
+
+#, c-format
+msgid "Could not remove .gitmodules entry for %s"
+msgstr "Не вдалося видалити запис .gitmodules для %s"
+
+msgid "staging updated .gitmodules failed"
+msgstr "індексація оновленого .gitmodules завершилася невдало"
+
+#, c-format
+msgid "in unpopulated submodule '%s'"
+msgstr "у незаповненому підмодулі \"%s\""
+
+#, c-format
+msgid "Pathspec '%s' is in submodule '%.*s'"
+msgstr "Визначник шляху \"%s\" знаходиться у підмодулі \"%.*s\""
+
+#, c-format
+msgid "bad --ignore-submodules argument: %s"
+msgstr "невірний --ignore-submodules аргумент: %s"
+
+#, c-format
+msgid ""
+"Submodule in commit %s at path: '%s' collides with a submodule named the "
+"same. Skipping it."
+msgstr ""
+"Підмодуль у коміті %s за шляхом \"%s\" зіткнувся з підмодулем з такою самою "
+"назвою. Пропускаємо його."
+
+#, c-format
+msgid "submodule entry '%s' (%s) is a %s, not a commit"
+msgstr "запис підмодуля \"%s\" (%s) є %s, а не комітом"
+
+#, c-format
+msgid ""
+"Could not run 'git rev-list <commits> --not --remotes -n 1' command in "
+"submodule %s"
+msgstr ""
+"Не вдалося виконати команду \"git rev-list <коміти> --not --remotes -n 1\" у "
+"підмодулі %s"
+
+#, c-format
+msgid "process for submodule '%s' failed"
+msgstr "процес для підмодуля \"%s\" завершився невдало"
+
+#, c-format
+msgid "Pushing submodule '%s'\n"
+msgstr "Надсилання підмодуля \"%s\"\n"
+
+#, c-format
+msgid "Unable to push submodule '%s'\n"
+msgstr "Не вдалося надіслати підмодуль \"%s\"\n"
+
+#, c-format
+msgid "Fetching submodule %s%s\n"
+msgstr "Отримання підмодуля %s%s\n"
+
+#, c-format
+msgid "Could not access submodule '%s'\n"
+msgstr "Не вдалося отримати доступ до підмодуля \"%s\"\n"
+
+#, c-format
+msgid "Could not access submodule '%s' at commit %s\n"
+msgstr "Не вдалося отримати доступ до підмодуля \"%s\" для коміта %s\n"
+
+#, c-format
+msgid "Fetching submodule %s%s at commit %s\n"
+msgstr "Отримання підмодуля %s%s для коміта %s\n"
+
+#, c-format
+msgid ""
+"Errors during submodule fetch:\n"
+"%s"
+msgstr ""
+"Помилки під час отримання підмодуля:\n"
+"%s"
+
+#, c-format
+msgid "'%s' not recognized as a git repository"
+msgstr "\"%s\" не розпізнано як git сховище"
+
+#, c-format
+msgid "Could not run 'git status --porcelain=2' in submodule %s"
+msgstr ""
+"Не вдалося виконати команду \"git status --porcelain=2\" у підмодулі %s"
+
+#, c-format
+msgid "'git status --porcelain=2' failed in submodule %s"
+msgstr "\"git status --porcelain=2\" завершився невдало у підмодулі %s"
+
+#, c-format
+msgid "could not start 'git status' in submodule '%s'"
+msgstr "не вдалося запустити \"git status\" у підмодулі \"%s\""
+
+#, c-format
+msgid "could not run 'git status' in submodule '%s'"
+msgstr "не вдалося запустити \"git status\" у підмодулі \"%s\""
+
+#, c-format
+msgid "Could not unset core.worktree setting in submodule '%s'"
+msgstr "Не вдалося скинути налаштування core.worktree у підмодулі \"%s\""
+
+#, c-format
+msgid "could not recurse into submodule '%s'"
+msgstr "не вдалося рекурсивно перейти в підмодуль \"%s\""
+
+msgid "could not reset submodule index"
+msgstr "не вдалося скинути індекс підмодуля"
+
+#, c-format
+msgid "submodule '%s' has dirty index"
+msgstr "підмодуль \"%s\" має брудний індекс"
+
+#, c-format
+msgid "Submodule '%s' could not be updated."
+msgstr "Не вдалося оновити підмодуль \"%s\"."
+
+#, c-format
+msgid "submodule git dir '%s' is inside git dir '%.*s'"
+msgstr "підмодуль git dir \"%s\" знаходиться всередині git директорії \"%.*s\""
+
+#, c-format
+msgid ""
+"relocate_gitdir for submodule '%s' with more than one worktree not supported"
+msgstr ""
+"relocate_gitdir для підмодуля \"%s\" з більш ніж одним робочим деревом не "
+"підтримується"
+
+#, c-format
+msgid "could not lookup name for submodule '%s'"
+msgstr "не вдалося знайти назву для підмодуля \"%s\""
+
+#, c-format
+msgid "refusing to move '%s' into an existing git dir"
+msgstr "відмова переміщення \"%s\" до існуючої git директорії"
+
+#, c-format
+msgid ""
+"Migrating git directory of '%s%s' from\n"
+"'%s' to\n"
+"'%s'\n"
+msgstr ""
+"Міграція git-директорії \"%s%s\" з\n"
+"\"%s\" до\n"
+"\"%s\"\n"
+
+msgid "could not start ls-files in .."
+msgstr "не вдалося запустити ls-файли в .."
+
+#, c-format
+msgid "ls-tree returned unexpected return code %d"
+msgstr "ls-tree повернув неочікуваний код повернення %d"
+
+#, c-format
+msgid "failed to lstat '%s'"
+msgstr "не вдалося виконати lstat для \"%s\""
+
+msgid "no remote configured to get bundle URIs from"
+msgstr ""
+"немає налаштованого віддаленого призначення для отримання URI пакунків з "
+"нього"
+
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "віддалений \"%s\" не має налаштованої URL-адреси"
+
+msgid "could not get the bundle-uri list"
+msgstr "не вдалося отримати список bundle-uri"
+
+msgid "test-tool cache-tree <options> (control|prime|update)"
+msgstr "test-tool cache-tree <опції> (control|prime|update)"
+
+msgid "clear the cache tree before each iteration"
+msgstr "очищати дерево кешу перед кожною ітерацією"
+
+msgid "number of entries in the cache tree to invalidate (default 0)"
+msgstr ""
+"кількість записів у дереві кешу, які потрібно анулювати (за замовчуванням 0)"
+
+msgid "unhandled options"
+msgstr "необроблені опції"
+
+msgid "error preparing revisions"
+msgstr "помилка при підготовці ревізій"
+
+#, c-format
+msgid "commit %s is not marked reachable"
+msgstr "коміт %s не позначений як досяжний"
+
+msgid "too many commits marked reachable"
+msgstr "забагато комітів позначено як досяжні"
+
+msgid "test-tool serve-v2 [<options>]"
+msgstr "test-tool serve-v2 [<опції>]"
+
+msgid "exit immediately after advertising capabilities"
+msgstr "вихід відразу після показу здібностей"
+
+msgid "test-helper simple-ipc is-active    [<name>] [<options>]"
+msgstr "test-helper simple-ipc is-active    [<назва>] [<опції>]"
+
+msgid "test-helper simple-ipc run-daemon   [<name>] [<threads>]"
+msgstr "test-helper simple-ipc run-daemon   [<назва>] [<потоки>]"
+
+msgid "test-helper simple-ipc start-daemon [<name>] [<threads>] [<max-wait>]"
+msgstr ""
+"test-helper simple-ipc start-daemon [<назва>] [<потоки>] [<максимальний час "
+"очікування>]"
+
+msgid "test-helper simple-ipc stop-daemon  [<name>] [<max-wait>]"
+msgstr ""
+"test-helper simple-ipc stop-daemon  [<назва>] [<максимальний час очікування>]"
+
+msgid "test-helper simple-ipc send         [<name>] [<token>]"
+msgstr "test-helper simple-ipc send         [<назва>] [<токен>]"
+
+msgid "test-helper simple-ipc sendbytes    [<name>] [<bytecount>] [<byte>]"
+msgstr ""
+"test-helper simple-ipc sendbytes    [<назва>] [<кількість байт>] [<байт>]"
+
+msgid ""
+"test-helper simple-ipc multiple     [<name>] [<threads>] [<bytecount>] "
+"[<batchsize>]"
+msgstr ""
+"test-helper simple-ipc multiple     [<назва>] [<потоки>] [<кількість байт>] "
+"[<розмір пакетів>]"
+
+msgid "name or pathname of unix domain socket"
+msgstr "назва або назва шляху сокета домену unix"
+
+msgid "named-pipe name"
+msgstr ""
+
+msgid "number of threads in server thread pool"
+msgstr "кількість потоків у пулі потоків сервера"
+
+msgid "seconds to wait for daemon to start or stop"
+msgstr "секунд чекати на запуск або зупинку демона"
+
+msgid "number of bytes"
+msgstr "кількість байтів"
+
+msgid "number of requests per thread"
+msgstr "кількість запитів на потік"
+
+msgid "byte"
+msgstr "байт"
+
+msgid "ballast character"
+msgstr "баластний символ"
+
+msgid "token"
+msgstr "токен"
+
+msgid "command token to send to the server"
+msgstr "токен команди для відправки на сервер"
+
+#, c-format
+msgid "running trailer command '%s' failed"
+msgstr "не вдалося виконати команду трейлера \"%s\""
+
+#, c-format
+msgid "unknown value '%s' for key '%s'"
+msgstr "невідоме значення \"%s\" для ключа \"%s\""
+
+#, c-format
+msgid "empty trailer token in trailer '%.*s'"
+msgstr "порожній токен трейлера в трейлері \"%.*s\""
+
+#, c-format
+msgid "could not read input file '%s'"
+msgstr "не вдалося прочитати вхідний файл \"%s\""
+
+#, c-format
+msgid "could not stat %s"
+msgstr "не вдалося прочитати %s"
+
+#, c-format
+msgid "file %s is not a regular file"
+msgstr "файл %s не є звичайним файлом"
+
+#, c-format
+msgid "file %s is not writable by user"
+msgstr "файл %s не доступний для запису користувачем"
+
+msgid "could not open temporary file"
+msgstr "не вдалося відкрити тимчасовий файл"
+
+#, c-format
+msgid "could not rename temporary file to %s"
+msgstr "не вдалося перейменувати тимчасовий файл на %s"
+
+msgid "full write to remote helper failed"
+msgstr "не вдалося виконати повний запис до віддаленого помічника"
+
+#, c-format
+msgid "unable to find remote helper for '%s'"
+msgstr "не вдалося знайти віддаленого помічника для \"%s\""
+
+msgid "can't dup helper output fd"
+msgstr "неможливо зробити копію дескриптора файла виводу помічника"
+
+#, c-format
+msgid ""
+"unknown mandatory capability %s; this remote helper probably needs newer "
+"version of Git"
+msgstr ""
+"невідома обовʼязкова здібність %s; цей віддалений помічник напевно потребує "
+"новішої версії Git"
+
+msgid "this remote helper should implement refspec capability"
+msgstr "цей віддалений помічник має реалізовувати здібність refspec"
+
+#, c-format
+msgid "%s unexpectedly said: '%s'"
+msgstr "%s несподівано сказав: \"%s\""
+
+#, c-format
+msgid "%s also locked %s"
+msgstr "%s також заблокувало %s"
+
+msgid "couldn't run fast-import"
+msgstr "не вдалося запустити fast-import"
+
+msgid "error while running fast-import"
+msgstr "помилка під час виконання швидкого імпорту"
+
+#, c-format
+msgid "could not read ref %s"
+msgstr "не вдалося прочитати посилання %s"
+
+#, c-format
+msgid "unknown response to connect: %s"
+msgstr "невідома відповідь на зʼєднання: %s"
+
+msgid "setting remote service path not supported by protocol"
+msgstr "встановлення шляху до віддаленого сервісу не підтримується протоколом"
+
+msgid "invalid remote service path"
+msgstr "неприпустимий шлях до віддаленої служби"
+
+msgid "operation not supported by protocol"
+msgstr "операція не підтримується протоколом"
+
+#, c-format
+msgid "can't connect to subservice %s"
+msgstr "неможливо підключитися до підсервісу %s"
+
+msgid "--negotiate-only requires protocol v2"
+msgstr "--negotiate-only потребує протоколу v2"
+
+msgid "'option' without a matching 'ok/error' directive"
+msgstr "\"option\" без відповідної директиви \"ok/error\""
+
+#, c-format
+msgid "expected ok/error, helper said '%s'"
+msgstr "очікувалося ok/error, помічник сказав \"%s\""
+
+#, c-format
+msgid "helper reported unexpected status of %s"
+msgstr "helper повідомив про неочікуваний статус %s"
+
+#, c-format
+msgid "helper %s does not support dry-run"
+msgstr "помічник %s не підтримує dry-run"
+
+#, c-format
+msgid "helper %s does not support --signed"
+msgstr "помічник %s не підтримує --signed"
+
+#, c-format
+msgid "helper %s does not support --signed=if-asked"
+msgstr "помічник %s не підтримує --signed=if-asked"
+
+#, c-format
+msgid "helper %s does not support --atomic"
+msgstr "помічник %s не підтримує --atomic"
+
+#, c-format
+msgid "helper %s does not support --%s"
+msgstr "помічник %s не підтримує --%s"
+
+#, c-format
+msgid "helper %s does not support 'push-option'"
+msgstr "помічник %s не підтримує \"push-option\""
+
+msgid "remote-helper doesn't support push; refspec needed"
+msgstr "remote-helper не підтримує push; потрібен refspec"
+
+#, c-format
+msgid "helper %s does not support 'force'"
+msgstr "помічник %s не підтримує \"force\""
+
+msgid "couldn't run fast-export"
+msgstr "не вдалося запустити fast-export"
+
+msgid "error while running fast-export"
+msgstr "помилка під час виконання швидкого експорту"
+
+#, c-format
+msgid ""
+"No refs in common and none specified; doing nothing.\n"
+"Perhaps you should specify a branch.\n"
+msgstr ""
+"Немає спільних посилань і жодного не вказано; нічого не робиться.\n"
+"Можливо, вам слід вказати гілку.\n"
+
+#, c-format
+msgid "unsupported object format '%s'"
+msgstr "непідтримуваний обʼєкт формата \"%s\""
+
+#, c-format
+msgid "malformed response in ref list: %s"
+msgstr "неправильно сформована відповідь у списку посилань: %s"
+
+#, c-format
+msgid "read(%s) failed"
+msgstr "read(%s) завершився невдало"
+
+#, c-format
+msgid "write(%s) failed"
+msgstr "write(%s) завершився невдало"
+
+#, c-format
+msgid "%s thread failed"
+msgstr "%s потік завершився невдало"
+
+#, c-format
+msgid "%s thread failed to join: %s"
+msgstr "%s потік не зміг приєднатись: %s"
+
+#, c-format
+msgid "can't start thread for copying data: %s"
+msgstr "неможливо запустити потік для копіювання даних: %s"
+
+#, c-format
+msgid "%s process failed to wait"
+msgstr "%s процес не зміг дочекатися"
+
+#, c-format
+msgid "%s process failed"
+msgstr "%s процес завершився невдало"
+
+msgid "can't start thread for copying data"
+msgstr "неможливо запустити потік для копіювання даних"
+
+#, c-format
+msgid "Would set upstream of '%s' to '%s' of '%s'\n"
+msgstr "Встановить першоджерельне сховище для \"%s\" на \"%s\" в \"%s\"\n"
+
+#, c-format
+msgid "could not read bundle '%s'"
+msgstr "не вдалося прочитати пакет \"%s\""
+
+#, c-format
+msgid "transport: invalid depth option '%s'"
+msgstr "transport: неприпустимий параметр глибини \"%s\""
+
+msgid "see protocol.version in 'git help config' for more details"
+msgstr ""
+"дивіться protocol.version у \"git help config\" для більш детальної "
+"інформації"
+
+msgid "server options require protocol version 2 or later"
+msgstr "опції сервера вимагають протокол версії 2 або пізнішої"
+
+msgid "server does not support wait-for-done"
+msgstr "сервер не підтримує wait-for-done"
+
+msgid "could not parse transport.color.* config"
+msgstr "не вдалося розібрати конфігурацію transport.color.*"
+
+msgid "support for protocol v2 not implemented yet"
+msgstr "підтримка протоколу v2 ще не запроваджена"
+
+#, c-format
+msgid "unknown value for config '%s': %s"
+msgstr "невідоме значення для конфігурації \"%s\": %s"
+
+#, c-format
+msgid "transport '%s' not allowed"
+msgstr "засіб передачі \"%s\" не дозволений"
+
+msgid "git-over-rsync is no longer supported"
+msgstr "git-over-rsync більше не підтримується"
+
+#, c-format
+msgid ""
+"The following submodule paths contain changes that can\n"
+"not be found on any remote:\n"
+msgstr ""
+"Наступні шляхи до підмодулів містять зміни, які неможливо\n"
+"знайти в жодному віддаленому призначенні:\n"
+
+#, c-format
+msgid ""
+"\n"
+"Please try\n"
+"\n"
+"\tgit push --recurse-submodules=on-demand\n"
+"\n"
+"or cd to the path and use\n"
+"\n"
+"\tgit push\n"
+"\n"
+"to push them to a remote.\n"
+"\n"
+msgstr ""
+"\n"
+"Будь ласка, спробуйте\n"
+"\n"
+"\tgit push --recurse-submodules=on-demand\n"
+"\n"
+"або перейдіть до директорії та використайте\n"
+"\n"
+"\tgit push\n"
+"\n"
+"щоб надіслати їх до віддаленого призначення.\n"
+
+msgid "Aborting."
+msgstr "Відміна."
+
+msgid "failed to push all needed submodules"
+msgstr "не вдалося надіслати всі необхідні підмодулі"
+
+msgid "bundle-uri operation not supported by protocol"
+msgstr "bundle-uri операція не підтримується протоколом"
+
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "не вдалося отримати список адрес пакетів, оголошений сервером"
+
+msgid "too-short tree object"
+msgstr "занадто короткий обʼєкт дерева"
+
+msgid "malformed mode in tree entry"
+msgstr "невірно визначений режим у записі дерева"
+
+msgid "empty filename in tree entry"
+msgstr "порожня назва файлу у записі дерева"
+
+msgid "too-short tree file"
+msgstr "занадто короткий файл дерева"
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by checkout:\n"
+"%%sPlease commit your changes or stash them before you switch branches."
+msgstr ""
+"Ваші локальні зміни в наступних файлах будуть перезаписані при переключенні "
+"стану:\n"
+"%%sБудь ласка, зробіть коміт або додайте їх до схову перед переходом до "
+"іншої гілки."
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by checkout:\n"
+"%%s"
+msgstr ""
+"Ваші локальні зміни в наступних файлах будуть перезаписані при переключенні "
+"стану:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+"%%sPlease commit your changes or stash them before you merge."
+msgstr ""
+"Ваші локальні зміни у наступних файлах будуть перезаписані під час злиття:\n"
+"%%sБудь ласка, зробіть коміт або додайте їх до схову перед злиттям."
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by merge:\n"
+"%%s"
+msgstr ""
+"Ваші локальні зміни у наступних файлах будуть перезаписані під час злиття:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by %s:\n"
+"%%sPlease commit your changes or stash them before you %s."
+msgstr ""
+"Ваші локальні зміни у наступних файлах будуть перезаписані %s:\n"
+"%%sБудь ласка, зробіть коміт або додайте їх до схову перед %s."
+
+#, c-format
+msgid ""
+"Your local changes to the following files would be overwritten by %s:\n"
+"%%s"
+msgstr ""
+"Ваші локальні зміни у наступних файлах будуть перезаписані %s:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"Updating the following directories would lose untracked files in them:\n"
+"%s"
+msgstr ""
+"Оновлення наступних директорій призведе до втрати невідстежуваних файлів у "
+"цих директоріях:\n"
+"%s"
+
+#, c-format
+msgid ""
+"Refusing to remove the current working directory:\n"
+"%s"
+msgstr ""
+"Відмова видалення поточної робочої директорії:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by checkout:\n"
+"%%sPlease move or remove them before you switch branches."
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть видалені під час "
+"переключення:\n"
+"%%sБудь ласка, перемістіть або видаліть їх перед переходом до іншої гілки."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by checkout:\n"
+"%%s"
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть видалені під час "
+"переключення:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by merge:\n"
+"%%sPlease move or remove them before you merge."
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть видалені при виконанні "
+"злиття:\n"
+"%%sБудь ласка, перемістіть або видаліть їх перед злиттям."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by merge:\n"
+"%%s"
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть видалені при виконанні "
+"злиття:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by %s:\n"
+"%%sPlease move or remove them before you %s."
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть видалені при виконанні "
+"%s:\n"
+"%%sБудь ласка, перемістіть або видаліть їх перед %s."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be removed by %s:\n"
+"%%s"
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть видалені при виконанні "
+"%s:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by "
+"checkout:\n"
+"%%sPlease move or remove them before you switch branches."
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть перезаписані при "
+"переключенні стану\n"
+"%%sБудь ласка, перемістіть або видаліть їх перед переходом до іншої гілки."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by "
+"checkout:\n"
+"%%s"
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть перезаписані при "
+"переключенні стану:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by merge:\n"
+"%%sPlease move or remove them before you merge."
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть перезаписані при "
+"злитті:\n"
+"%%sБудь ласка, перемістіть або видаліть їх перед злиттям."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by merge:\n"
+"%%s"
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть перезаписані при "
+"виконанні злиття:\n"
+"%%s"
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by %s:\n"
+"%%sPlease move or remove them before you %s."
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть перезаписані %s:\n"
+"%%sБудь ласка, перемістіть або видаліть їх перед %s."
+
+#, c-format
+msgid ""
+"The following untracked working tree files would be overwritten by %s:\n"
+"%%s"
+msgstr ""
+"Наступні невідстежувані файли робочого дерева будуть перезаписані %s:\n"
+"%%s"
+
+#, c-format
+msgid "Entry '%s' overlaps with '%s'.  Cannot bind."
+msgstr "Запис \"%s\" перетинається з \"%s\".  Неможливо звʼязати."
+
+#, c-format
+msgid ""
+"Cannot update submodule:\n"
+"%s"
+msgstr ""
+"Не вдалося оновити підмодуль:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following paths are not up to date and were left despite sparse "
+"patterns:\n"
+"%s"
+msgstr ""
+"Наступні шляхи не є актуальними і були залишені, незважаючи на часткові "
+"шаблони:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following paths are unmerged and were left despite sparse patterns:\n"
+"%s"
+msgstr ""
+"Наступні шляхи не злиті і були залишені, незважаючи на часткові шаблони:\n"
+"%s"
+
+#, c-format
+msgid ""
+"The following paths were already present and thus not updated despite sparse "
+"patterns:\n"
+"%s"
+msgstr ""
+"Наступні шляхи вже існували і тому не були оновлені, незважаючи на часткові "
+"шаблони:\n"
+"%s"
+
+#, c-format
+msgid "Aborting\n"
+msgstr "Переривання\n"
+
+#, c-format
+msgid ""
+"After fixing the above paths, you may want to run `git sparse-checkout "
+"reapply`.\n"
+msgstr ""
+"Після виправлення наведених вище шляхів можливо ви забажаєте виконати \"git "
+"sparse-checkout reapply\".\n"
+
+msgid "Updating files"
+msgstr "Оновлення файлів"
+
+msgid ""
+"the following paths have collided (e.g. case-sensitive paths\n"
+"on a case-insensitive filesystem) and only one from the same\n"
+"colliding group is in the working tree:\n"
+msgstr ""
+"зіткнулися наступні шляхи (наприклад, шляхи, чутливі до регістру\n"
+"у файловій системі, не чутливій до регістру) і лише один шлях з тієї \n"
+"групи, що зіткнулися, знаходиться у робочому дереві:\n"
+
+msgid "Updating index flags"
+msgstr "Оновлення прапорців індексу"
+
+#, c-format
+msgid "worktree and untracked commit have duplicate entries: %s"
+msgstr "робоче дерево та невідстежуваний коміт мають дубльовані записи: %s"
+
+msgid "expected flush after fetch arguments"
+msgstr "очікувалось flush після аргументів отримання"
+
+msgid "invalid URL scheme name or missing '://' suffix"
+msgstr "неприпустима назва схеми URL-адреси або відсутній \"://\" суфікс"
+
+#, c-format
+msgid "invalid %XX escape sequence"
+msgstr "неприпустима %XX екрануюча послідовність"
+
+msgid "missing host and scheme is not 'file:'"
+msgstr "відсутній хост і схема не \"file:\""
+
+msgid "a 'file:' URL may not have a port number"
+msgstr "\"file:\" URL-адреса не може мати номера порту"
+
+msgid "invalid characters in host name"
+msgstr "неприпустимі символи в назві хоста"
+
+msgid "invalid port number"
+msgstr "неприпустимий номер порту"
+
+msgid "invalid '..' path segment"
+msgstr "неприпустимий \"..\" сегмент шляху"
+
+msgid "usage: "
+msgstr "використання: "
+
+msgid "fatal: "
+msgstr "збій: "
+
+msgid "error: "
+msgstr "помилка: "
+
+msgid "warning: "
+msgstr "попередження: "
+
+msgid "Fetching objects"
+msgstr "Отримання обʼєктів"
+
+#, c-format
+msgid "'%s' at main working tree is not the repository directory"
+msgstr "\"%s\" у головному робочому дереві не є директорією сховища"
+
+#, c-format
+msgid "'%s' file does not contain absolute path to the working tree location"
+msgstr ""
+"\"%s\" файл не містить абсолютного шляху до розташування робочого дерева"
+
+#, c-format
+msgid "'%s' is not a .git file, error code %d"
+msgstr "\"%s\" не є .git-файлом, код помилки %d"
+
+#, c-format
+msgid "'%s' does not point back to '%s'"
+msgstr "\"%s\" не вказує назад на \"%s\""
+
+msgid "not a directory"
+msgstr "не є директорією"
+
+msgid ".git is not a file"
+msgstr ".git не є файлом"
+
+msgid ".git file broken"
+msgstr ".git файл пошкоджено"
+
+msgid ".git file incorrect"
+msgstr "Неправильний файл .git"
+
+msgid "not a valid path"
+msgstr "неприпустимий шлях"
+
+msgid "unable to locate repository; .git is not a file"
+msgstr "не вдалося знайти сховище; .git не є файлом"
+
+msgid "unable to locate repository; .git file does not reference a repository"
+msgstr "не вдалося знайти сховище; .git-файл не посилається на сховище"
+
+msgid "unable to locate repository; .git file broken"
+msgstr "не вдалося знайти сховище; файл .git пошкоджено"
+
+msgid "gitdir unreadable"
+msgstr "git-директорія нечитабельна"
+
+msgid "gitdir incorrect"
+msgstr "git-директорія неправильна"
+
+msgid "not a valid directory"
+msgstr "неприпустима директорія"
+
+msgid "gitdir file does not exist"
+msgstr "файл git директорії не існує"
+
+#, c-format
+msgid "unable to read gitdir file (%s)"
+msgstr "не вдалося прочитати файл git директорії (%s)"
+
+#, c-format
+msgid "short read (expected %<PRIuMAX> bytes, read %<PRIuMAX>)"
+msgstr ""
+"помилка при зчитуванні (очікувалось %<PRIuMAX> байтів, прочитано %<PRIuMAX>)"
+
+msgid "invalid gitdir file"
+msgstr "неприпустимий файл git-директорії"
+
+msgid "gitdir file points to non-existent location"
+msgstr "файл git-директорії вказує на неіснуюче розташування"
+
+#, c-format
+msgid "unable to set %s in '%s'"
+msgstr "не вдалося задати %s в \"%s\""
+
+#, c-format
+msgid "unable to unset %s in '%s'"
+msgstr "не вдалося скинути %s в \"%s\""
+
+msgid "failed to set extensions.worktreeConfig setting"
+msgstr "не вдалося встановити extensions.worktreeConfig параметр"
+
+#, c-format
+msgid "could not setenv '%s'"
+msgstr "не вдалося встановити оточення \"%s\""
+
+#, c-format
+msgid "unable to create '%s'"
+msgstr "не вдалося створити \"%s\""
+
+#, c-format
+msgid "could not open '%s' for reading and writing"
+msgstr "не вдалося відкрити \"%s\" для читання та запису"
+
+#, c-format
+msgid "unable to access '%s'"
+msgstr "не вдалося отримати доступ до \"%s\""
+
+msgid "unable to get current working directory"
+msgstr "не вдалося завантажити поточну робочу директорію"
+
+msgid "Unmerged paths:"
+msgstr "Не злиті шляхи:"
+
+msgid "  (use \"git restore --staged <file>...\" to unstage)"
+msgstr ""
+"  (використовуйте \"git restore --staged <файл>...\", щоб вилучити з індексу)"
+
+#, c-format
+msgid "  (use \"git restore --source=%s --staged <file>...\" to unstage)"
+msgstr ""
+"  (використовуйте \"git restore --source=%s --staged <file>...\", щоб "
+"видалити з індексу)"
+
+msgid "  (use \"git rm --cached <file>...\" to unstage)"
+msgstr ""
+"  (використовуйте \"git rm --cached <file>...\", щоб вилучити з індексу)"
+
+msgid "  (use \"git add <file>...\" to mark resolution)"
+msgstr "  (використовуйте \"git add <файл>...\", щоб позначити як вирішене)"
+
+msgid "  (use \"git add/rm <file>...\" as appropriate to mark resolution)"
+msgstr ""
+"  (використовуйте \"git add/rm <файл>...\" за потребою, щоб позначити як "
+"вирішене)"
+
+msgid "  (use \"git rm <file>...\" to mark resolution)"
+msgstr "  (використовуйте \"git rm <файл>...\", щоб позначити як вирішене)"
+
+msgid "Changes to be committed:"
+msgstr "Зміни, що будуть додані до коміту:"
+
+msgid "Changes not staged for commit:"
+msgstr "Зміни, що не будуть додані до коміту:"
+
+msgid "  (use \"git add <file>...\" to update what will be committed)"
+msgstr ""
+"  (використовуйте \"git add <файл>...\", для оновлення того, що буде "
+"закомічено)"
+
+msgid "  (use \"git add/rm <file>...\" to update what will be committed)"
+msgstr ""
+"  (використовуйте \"git add/rm <файл>...\" для оновлення того, що буде "
+"закомічено)"
+
+msgid ""
+"  (use \"git restore <file>...\" to discard changes in working directory)"
+msgstr ""
+"  (використовуйте \"git restore <файл>...\", щоб скасувати зміни в робочій "
+"директорії)"
+
+msgid "  (commit or discard the untracked or modified content in submodules)"
+msgstr ""
+"  (зробіть коміт або скасуйте невідстежуваний або змінений контент у "
+"підмодулях)"
+
+#, c-format
+msgid "  (use \"git %s <file>...\" to include in what will be committed)"
+msgstr ""
+"  (використовуйте \"git %s <файл>...\" для включення до того, що буде "
+"закомічено)"
+
+msgid "both deleted:"
+msgstr "видалено обома:"
+
+msgid "added by us:"
+msgstr "додано нами:"
+
+msgid "deleted by them:"
+msgstr "видалено ними:"
+
+msgid "added by them:"
+msgstr "додано ними:"
+
+msgid "deleted by us:"
+msgstr "видалено нами:"
+
+msgid "both added:"
+msgstr "додано обома:"
+
+msgid "both modified:"
+msgstr "змінено обома:"
+
+msgid "new file:"
+msgstr "новий файл:"
+
+msgid "copied:"
+msgstr "скопійовано:"
+
+msgid "deleted:"
+msgstr "видалено:"
+
+msgid "modified:"
+msgstr "змінено:"
+
+msgid "renamed:"
+msgstr "перейменовано:"
+
+msgid "typechange:"
+msgstr "змінено тип:"
+
+msgid "unknown:"
+msgstr "невідомо:"
+
+msgid "unmerged:"
+msgstr "не злито:"
+
+msgid "new commits, "
+msgstr "нові коміти, "
+
+msgid "modified content, "
+msgstr "змінений контент, "
+
+msgid "untracked content, "
+msgstr "невідстежуваний контент, "
+
+#, c-format
+msgid "Your stash currently has %d entry"
+msgid_plural "Your stash currently has %d entries"
+msgstr[0] "У вашій схованці наразі є %d запис"
+msgstr[1] "У вашій схованці наразі є %d записи"
+msgstr[2] "У вашій схованці наразі є %d записів"
+
+msgid "Submodules changed but not updated:"
+msgstr "Підмодулі змінено, але не оновлено:"
+
+msgid "Submodule changes to be committed:"
+msgstr "Зміни в підмодулі, які будуть закомічені:"
+
+msgid ""
+"Do not modify or remove the line above.\n"
+"Everything below it will be ignored."
+msgstr ""
+"Не змінюйте та не видаляйте рядок вище.\n"
+"Все, що нижче, буде проігноровано."
+
+#, c-format
+msgid ""
+"\n"
+"It took %.2f seconds to compute the branch ahead/behind values.\n"
+"You can use '--no-ahead-behind' to avoid this.\n"
+msgstr ""
+"\n"
+"Обчислення значень попереду/позаду для гілки зайняло %.2f секунд.\n"
+"Ви можете використати параметр '--no-ahead-behind', щоб уникнути цього.\n"
+
+msgid "You have unmerged paths."
+msgstr "У вас є не злиті шляхи."
+
+msgid "  (fix conflicts and run \"git commit\")"
+msgstr "  (виправте конфлікти та виконайте \"git commit\")"
+
+msgid "  (use \"git merge --abort\" to abort the merge)"
+msgstr ""
+"  (використовуйте команду \"git merge --abort\", щоб перервати злиття)."
+
+msgid "All conflicts fixed but you are still merging."
+msgstr "Усі конфлікти виправлено, але ви все ще продовжуєте злиття."
+
+msgid "  (use \"git commit\" to conclude merge)"
+msgstr "  (використовуйте \"git commit\" для завершення злиття)"
+
+msgid "You are in the middle of an am session."
+msgstr "Ви всередині am сеансу."
+
+msgid "The current patch is empty."
+msgstr "Поточна латка порожня."
+
+msgid "  (fix conflicts and then run \"git am --continue\")"
+msgstr "  (виправте конфлікти, а потім виконайте \"git am --continue\")"
+
+msgid "  (use \"git am --skip\" to skip this patch)"
+msgstr "  (використовуйте команду \"git am --skip\", щоб пропустити цю латку)"
+
+msgid ""
+"  (use \"git am --allow-empty\" to record this patch as an empty commit)"
+msgstr ""
+"  (використовуйте \"git am --allow-empty\", щоб записати цю латку як "
+"порожній коміт)"
+
+msgid "  (use \"git am --abort\" to restore the original branch)"
+msgstr "  (використовуйте \"git am --abort\", щоб відновити початкову гілку)"
+
+msgid "git-rebase-todo is missing."
+msgstr "git-rebase-todo відсутній."
+
+msgid "No commands done."
+msgstr "Не виконано жодної команди."
+
+#, c-format
+msgid "Last command done (%<PRIuMAX> command done):"
+msgid_plural "Last commands done (%<PRIuMAX> commands done):"
+msgstr[0] "Останню команду виконано (%<PRIuMAX> команду виконано):"
+msgstr[1] "Останні команди виконано (%<PRIuMAX> команди виконано):"
+msgstr[2] "Останніх команд виконано (%<PRIuMAX> команд виконано):"
+
+#, c-format
+msgid "  (see more in file %s)"
+msgstr "  (дивіться більше у файлі %s)"
+
+msgid "No commands remaining."
+msgstr "Не залишилось команд."
+
+#, c-format
+msgid "Next command to do (%<PRIuMAX> remaining command):"
+msgid_plural "Next commands to do (%<PRIuMAX> remaining commands):"
+msgstr[0] "Наступна команда для виконання (залишилась %<PRIuMAX> команда):"
+msgstr[1] "Наступні команди для виконання (залишилось %<PRIuMAX> команди):"
+msgstr[2] "Наступні команди для виконання (залишилось %<PRIuMAX> команд):"
+
+msgid "  (use \"git rebase --edit-todo\" to view and edit)"
+msgstr ""
+"  (використовуйте \"git rebase --edit-todo\" для перегляду та редагування)"
+
+#, c-format
+msgid "You are currently rebasing branch '%s' on '%s'."
+msgstr "Наразі ви перебазовуєте гілку '%s' на '%s'."
+
+msgid "You are currently rebasing."
+msgstr "Наразі йде перебазування."
+
+msgid "  (fix conflicts and then run \"git rebase --continue\")"
+msgstr "  (виправте конфлікти, а потім виконайте \"git rebase --continue\")"
+
+msgid "  (use \"git rebase --skip\" to skip this patch)"
+msgstr "  (використовуйте \"git rebase --skip\", щоб пропустити цю латку)"
+
+msgid "  (use \"git rebase --abort\" to check out the original branch)"
+msgstr ""
+"  (використовуйте \"git rebase --abort\", щоб перейти до початкової гілки)"
+
+msgid "  (all conflicts fixed: run \"git rebase --continue\")"
+msgstr "  (усі конфлікти виправлено: виконайте \"git rebase --continue\")"
+
+#, c-format
+msgid ""
+"You are currently splitting a commit while rebasing branch '%s' on '%s'."
+msgstr ""
+"Наразі виконується розділення коміту під час перебазування гілки \"%s\" на "
+"\"%s\"."
+
+msgid "You are currently splitting a commit during a rebase."
+msgstr "Ви розбиваєте коміт під час перебазування."
+
+msgid "  (Once your working directory is clean, run \"git rebase --continue\")"
+msgstr ""
+"  (Після очищення робочої директорії виконайте \"git rebase --continue\")"
+
+#, c-format
+msgid "You are currently editing a commit while rebasing branch '%s' on '%s'."
+msgstr "Ви редагуєте комміт під час перебазування гілки '%s' на '%s'."
+
+msgid "You are currently editing a commit during a rebase."
+msgstr "Ви редагуєте коміт під час перебазування."
+
+msgid "  (use \"git commit --amend\" to amend the current commit)"
+msgstr ""
+"  (використовуйте \"git commit --amend\" для внесення змін до поточного "
+"коміту)"
+
+msgid ""
+"  (use \"git rebase --continue\" once you are satisfied with your changes)"
+msgstr ""
+"  (скористайтесь командою \"git rebase --continue\", коли ви будете "
+"задоволені своїми змінами)"
+
+msgid "Cherry-pick currently in progress."
+msgstr "Наразі триває висмикування."
+
+#, c-format
+msgid "You are currently cherry-picking commit %s."
+msgstr "Наразі ви висмикуєте коміт %s."
+
+msgid "  (fix conflicts and run \"git cherry-pick --continue\")"
+msgstr "  (виправте конфлікти і виконайте \"git cherry-pick --continue\")"
+
+msgid "  (run \"git cherry-pick --continue\" to continue)"
+msgstr "  (виконайте \"git cherry-pick --continue\", щоб продовжити)"
+
+msgid "  (all conflicts fixed: run \"git cherry-pick --continue\")"
+msgstr "  (усі конфлікти виправлено: виконайте \"git cherry-pick --continue\")"
+
+msgid "  (use \"git cherry-pick --skip\" to skip this patch)"
+msgstr ""
+"  (скористайтесь командою \"git cherry-pick --skip\", щоб пропустити цю "
+"латку)"
+
+msgid "  (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"
+msgstr ""
+" (скористайтесь командою \"git cherry-pick --abort\", щоб скасувати операцію "
+"висмикування)"
+
+msgid "Revert currently in progress."
+msgstr "Наразі виконується операція вивертання."
+
+#, c-format
+msgid "You are currently reverting commit %s."
+msgstr "Наразі ви вивертаєте коміт %s."
+
+msgid "  (fix conflicts and run \"git revert --continue\")"
+msgstr "  (виправте конфлікти і виконайте \"git revert --continue\")"
+
+msgid "  (run \"git revert --continue\" to continue)"
+msgstr "  (виконайте \"git revert --continue\", щоб продовжити)"
+
+msgid "  (all conflicts fixed: run \"git revert --continue\")"
+msgstr "  (усі конфлікти виправлено: виконайте \"git revert --continue\")"
+
+msgid "  (use \"git revert --skip\" to skip this patch)"
+msgstr "  (використовуйте \"git revert --skip\", щоб пропустити цю латку)"
+
+msgid "  (use \"git revert --abort\" to cancel the revert operation)"
+msgstr ""
+"  (використовуйте \"git revert --abort\", щоб скасувати операцію повернення)"
+
+#, c-format
+msgid "You are currently bisecting, started from branch '%s'."
+msgstr "Наразі ви робите бісекцію, починаючи з гілки '%s'."
+
+msgid "You are currently bisecting."
+msgstr "Наразі ви робите бісекцію."
+
+msgid "  (use \"git bisect reset\" to get back to the original branch)"
+msgstr ""
+"  (використовуйте \"git bisect reset\", щоб повернутись до початкової гілки)"
+
+msgid "You are in a sparse checkout."
+msgstr "Ви перебуваєте в частковому переході до гілки."
+
+#, c-format
+msgid "You are in a sparse checkout with %d%% of tracked files present."
+msgstr ""
+"Ви перебуваєте в частковому переході до гілки з %d%% відстежуваних файлів."
+
+msgid "On branch "
+msgstr "На гілці "
+
+msgid "interactive rebase in progress; onto "
+msgstr "інтерактивне перебазовування в процесі; на "
+
+msgid "rebase in progress; onto "
+msgstr "перебазовування в процесі; на "
+
+msgid "HEAD detached at "
+msgstr "HEAD відʼєднано на "
+
+msgid "HEAD detached from "
+msgstr "HEAD відʼєднано від "
+
+msgid "Not currently on any branch."
+msgstr "Наразі не знаходитесь в жодній гілці."
+
+msgid "Initial commit"
+msgstr "Початковий коміт"
+
+msgid "No commits yet"
+msgstr "Поки що немає комітів"
+
+msgid "Untracked files"
+msgstr "Невідстежувані файли"
+
+msgid "Ignored files"
+msgstr "Ігноровані файли"
+
+#, c-format
+msgid ""
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
+msgstr ""
+"На перерахування невідстежуваних файлів пішло %.2f секунд,\n"
+"але результат було додано у кеш, тому наступні запуски можуть бути швидшими."
+
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "На перерахування невідстежуваних файлів пішло %.2f секунд."
+
+msgid "See 'git help status' for information on how to improve this."
+msgstr "Дивіться 'git help status' для інформаціі з того, як це покращити."
+
+#, c-format
+msgid "Untracked files not listed%s"
+msgstr "Невідстежувані файли не вказано%s"
+
+msgid " (use -u option to show untracked files)"
+msgstr " (використовуйте опцію -u для відображення невідстежуваних файлів)"
+
+msgid "No changes"
+msgstr "Немає змін"
+
+#, c-format
+msgid "no changes added to commit (use \"git add\" and/or \"git commit -a\")\n"
+msgstr ""
+"не додано жодних змін до коміту (використовуйте \"git add\" та/або \"git "
+"commit -a\")\n"
+
+#, c-format
+msgid "no changes added to commit\n"
+msgstr "нічого не додано до коміту\n"
+
+#, c-format
+msgid ""
+"nothing added to commit but untracked files present (use \"git add\" to "
+"track)\n"
+msgstr ""
+"нічого не додано до коміту, але присутні невідстежувані файли (скористайтесь "
+"\"git add\" щоб почати відстежувати)\n"
+
+#, c-format
+msgid "nothing added to commit but untracked files present\n"
+msgstr "нічого не додано до коміту, але присутні невідстежувані файли\n"
+
+#, c-format
+msgid "nothing to commit (create/copy files and use \"git add\" to track)\n"
+msgstr ""
+"нічого комітити (створіть/скопіюйте файли та скористайтесь \"git add\" для "
+"відстежування)\n"
+
+#, c-format
+msgid "nothing to commit\n"
+msgstr "нічого комітити\n"
+
+#, c-format
+msgid "nothing to commit (use -u to show untracked files)\n"
+msgstr ""
+"нічого комітити (скористайтесь -u щоб подивитись невідстежувані файли)\n"
+
+#, c-format
+msgid "nothing to commit, working tree clean\n"
+msgstr "нічого комітити, робоче дерево чисте\n"
+
+msgid "No commits yet on "
+msgstr "Наразі немає комітів на "
+
+msgid "HEAD (no branch)"
+msgstr "HEAD (немає гілки)"
+
+msgid "different"
+msgstr "різниться"
+
+msgid "behind "
+msgstr "позаду "
+
+msgid "ahead "
+msgstr "попереду "
+
+#. TRANSLATORS: the action is e.g. "pull with rebase"
+
+#, c-format
+msgid "cannot %s: You have unstaged changes."
+msgstr "не можливо %s: У вас є не індексовані зміни."
+
+msgid "additionally, your index contains uncommitted changes."
+msgstr "крім того, ваш індекс містить не закомічені зміни."
+
+#, c-format
+msgid "cannot %s: Your index contains uncommitted changes."
+msgstr "не можливо %s: Ваш індекс містить не закомічені зміни."
+
+msgid ""
+"Error: Your local changes to the following files would be overwritten by "
+"merge"
+msgstr ""
+"Помилка: Ваші локальні зміни в наступних файлах буде перезаписано під час "
+"злиття"
+
+msgid "Automated merge did not work."
+msgstr "Автоматичне злиття не спрацювало."
+
+msgid "Should not be doing an octopus."
+msgstr "Не варто робити octopus злиття."
+
+#, sh-format
+msgid "Unable to find common commit with $pretty_name"
+msgstr "Не вдалося знайти спільний коміт з $pretty_name"
+
+#, sh-format
+msgid "Already up to date with $pretty_name"
+msgstr "Вже в актуальному стані з $pretty_name"
+
+#, sh-format
+msgid "Fast-forwarding to: $pretty_name"
+msgstr "Перемотування вперед до: $pretty_name"
+
+#, sh-format
+msgid "Trying simple merge with $pretty_name"
+msgstr "Спроба простого злиття з $pretty_name"
+
+msgid "Simple merge did not work, trying automatic merge."
+msgstr "Просте злиття не спрацювало, спроба автоматичного злиття."
+
+#, sh-format
+msgid "usage: $dashless $USAGE"
+msgstr "використання: $dashless $USAGE"
+
+#, sh-format
+msgid "Cannot chdir to $cdup, the toplevel of the working tree"
+msgstr "Неможливо chdir до $cdup, верхнього рівня робочого дерева"
+
+#, sh-format
+msgid "fatal: $program_name cannot be used without a working tree."
+msgstr "збій: $program_name неможливо використовувати без робочого дерева."
+
+msgid "Cannot rewrite branches: You have unstaged changes."
+msgstr "Неможливо переписати гілку: у вас є неіндексовані зміни."
+
+#, sh-format
+msgid "Cannot $action: You have unstaged changes."
+msgstr "Неможливо $action: у вас є неіндексовані зміни."
+
+#, sh-format
+msgid "Cannot $action: Your index contains uncommitted changes."
+msgstr "Неможливо $action: ваш індекс містить незакомічені зміни."
+
+msgid "Additionally, your index contains uncommitted changes."
+msgstr "Крім того, ваш індекс містить незакомічені зміни."
+
+msgid "You need to run this command from the toplevel of the working tree."
+msgstr "Цю команду потрібно запускати з верхнього рівня робочого дерева."
+
+msgid "Unable to determine absolute path of git directory"
+msgstr "Не вдалося визначити абсолютний шлях git директорії"
+
+msgid "local zone differs from GMT by a non-minute interval\n"
+msgstr "місцева зона відрізняється від GMT на нехвилинний інтервал\n"
+
+msgid "local time offset greater than or equal to 24 hours\n"
+msgstr "зміщення місцевого часу більше або дорівнює 24 годинам\n"
+
+#, perl-format
+msgid "fatal: command '%s' died with exit code %d"
+msgstr "збій: команда \"%s\" завершилася невдало з кодом виходу %d"
+
+msgid "the editor exited uncleanly, aborting everything"
+msgstr "редактор вийшов неналежним чином, перервано всі процеси"
+
+#, perl-format
+msgid ""
+"'%s' contains an intermediate version of the email you were composing.\n"
+msgstr "\"%s\" містить проміжну версію листа, який ви створювали.\n"
+
+#, perl-format
+msgid "'%s.final' contains the composed email.\n"
+msgstr "\"%s.final\" містить створений лист.\n"
+
+msgid "--dump-aliases incompatible with other options\n"
+msgstr "--dump-aliases несумісна з іншими опціями\n"
+
+msgid ""
+"fatal: found configuration options for 'sendmail'\n"
+"git-send-email is configured with the sendemail.* options - note the 'e'.\n"
+"Set sendemail.forbidSendmailVariables to false to disable this check.\n"
+msgstr ""
+"збій: знайдено опції конфігурації для \"sendmail\"\n"
+"git-send-email налаштовано з параметрами sendemail.* options - зверніть "
+"увагу на \"e\".\n"
+"Встановіть sendemail.forbidSendmailVariables у false, щоб вимкнути цю "
+"перевірку.\n"
+
+msgid "Cannot run git format-patch from outside a repository\n"
+msgstr "Неможливо запустити git format-patch за межами сховища\n"
+
+msgid ""
+"`batch-size` and `relogin` must be specified together (via command-line or "
+"configuration option)\n"
+msgstr ""
+"\"batch-size\" і \"relogin\" повинні бути вказані разом (через командний "
+"рядок або опції конфігурації)\n"
+
+#, perl-format
+msgid "Unknown --suppress-cc field: '%s'\n"
+msgstr "Невідоме --suppress-cc поле: \"%s\"\n"
+
+#, perl-format
+msgid "Unknown --confirm setting: '%s'\n"
+msgstr "Невідомий --confirm параметр: \"%s\"\n"
+
+#, perl-format
+msgid "warning: sendmail alias with quotes is not supported: %s\n"
+msgstr "попередження: sendmail аліас у лапках не підтримується: %s\n"
+
+#, perl-format
+msgid "warning: `:include:` not supported: %s\n"
+msgstr "попередження: \":include:\" не підтримується: %s\n"
+
+#, perl-format
+msgid "warning: `/file` or `|pipe` redirection not supported: %s\n"
+msgstr ""
+"попередження: \"/file\" або \"|pipe\" перенаправлення не підтримуються: %s\n"
+
+#, perl-format
+msgid "warning: sendmail line is not recognized: %s\n"
+msgstr "попередження: рядок sendmail не розпізнано: %s\n"
+
+#, perl-format
+msgid ""
+"File '%s' exists but it could also be the range of commits\n"
+"to produce patches for.  Please disambiguate by...\n"
+"\n"
+"    * Saying \"./%s\" if you mean a file; or\n"
+"    * Giving --format-patch option if you mean a range.\n"
+msgstr ""
+"Файл \"%s\" існує, але це також може бути діапазон комітів\n"
+"для яких випускаються латки.  Будь ласка, розтлумачте...\n"
+"\n"
+"    * Вказавши \"./%s\", якщо на увазі мається файл або\n"
+"    * Додавши --format-patch, якщо на увазі мається діапазон.\n"
+
+#, perl-format
+msgid "Failed to opendir %s: %s"
+msgstr "Не вдалося відкрити директорію %s: %s"
+
+msgid ""
+"\n"
+"No patch files specified!\n"
+"\n"
+msgstr ""
+"\n"
+"Файли латок не вказано!\n"
+"\n"
+
+#, perl-format
+msgid "No subject line in %s?"
+msgstr "Немає рядка теми в %s?"
+
+#, perl-format
+msgid "Failed to open for writing %s: %s"
+msgstr "Не вдалося відкрити для запису %s: %s"
+
+msgid ""
+"Lines beginning in \"GIT:\" will be removed.\n"
+"Consider including an overall diffstat or table of contents\n"
+"for the patch you are writing.\n"
+"\n"
+"Clear the body content if you don't wish to send a summary.\n"
+msgstr ""
+"Рядки, що починаються з \"GIT:\", будуть вилучені.\n"
+"Подумайте про те, щоб додати загальний diffstat або зміст\n"
+"для латки, яку ви пишете.\n"
+"\n"
+"Очистіть вміст тіла, якщо ви не бажаєте надсилати підсумок.\n"
+
+#, perl-format
+msgid "Failed to open %s: %s"
+msgstr "Не вдалося відкрити %s: %s"
+
+#, perl-format
+msgid "Failed to open %s.final: %s"
+msgstr "Не вдалося відкрити %s.final: %s"
+
+msgid "Summary email is empty, skipping it\n"
+msgstr "Підсумковий лист порожній, перескочено\n"
+
+#. TRANSLATORS: please keep [y/N] as is.
+
+#, perl-format
+msgid "Are you sure you want to use <%s> [y/N]? "
+msgstr "Ви впевнені, що хочете використати <%s> [y/N]? "
+
+msgid ""
+"The following files are 8bit, but do not declare a Content-Transfer-"
+"Encoding.\n"
+msgstr ""
+
+msgid "Which 8bit encoding should I declare [UTF-8]? "
+msgstr "Яке 8-бітне кодування слід оголосити [UTF-8]? "
+
+#, perl-format
+msgid ""
+"Refusing to send because the patch\n"
+"\t%s\n"
+"has the template subject '*** SUBJECT HERE ***'. Pass --force if you really "
+"want to send.\n"
+msgstr ""
+"Відмова у надсиланні, тому що латка\n"
+"\t%s\n"
+"має шаблонну тему \"*** SUBJECT HERE ***\". Додайте --force, якщо ви дійсно "
+"хочете відправити.\n"
+
+msgid "To whom should the emails be sent (if anyone)?"
+msgstr "Кому слід надсилати електронні листи (якщо комусь)?"
+
+#, perl-format
+msgid "fatal: alias '%s' expands to itself\n"
+msgstr "збій: аліас \"%s\" розгортається на самого себе\n"
+
+msgid "Message-ID to be used as In-Reply-To for the first email (if any)? "
+msgstr ""
+
+#, perl-format
+msgid "error: unable to extract a valid address from: %s\n"
+msgstr "помилка: не вдалося витягти дійсну адресу з: %s\n"
+
+#. TRANSLATORS: Make sure to include [q] [d] [e] in your
+#. translation. The program will only accept English input
+#. at this point.
+
+msgid "What to do with this address? ([q]uit|[d]rop|[e]dit): "
+msgstr "Що робити з цією адресою? ([q]uit|[d]rop|[e]dit): "
+
+#, perl-format
+msgid "CA path \"%s\" does not exist"
+msgstr "Шлях до ЦВС \"%s\" не існує"
+
+msgid ""
+"    The Cc list above has been expanded by additional\n"
+"    addresses found in the patch commit message. By default\n"
+"    send-email prompts before sending whenever this occurs.\n"
+"    This behavior is controlled by the sendemail.confirm\n"
+"    configuration setting.\n"
+"\n"
+"    For additional information, run 'git send-email --help'.\n"
+"    To retain the current behavior, but squelch this message,\n"
+"    run 'git config --global sendemail.confirm auto'.\n"
+"\n"
+msgstr ""
+"    Наведений вище список копій було розширено додатковими\n"
+"    адресами, знайденими у повідомленні коміта латки. Зазвичай\n"
+"    send-email запитує перед надсиланням, коли це трапляється.\n"
+"    Цю поведінку можна контролювати за допомогою параметра sendemail."
+"confirm\n"
+"    налаштування конфігурації.\n"
+"\n"
+"    Для отримання додаткової інформації виконайте команду \"git send-email --"
+"help\".\n"
+"Для утримання поточної поведінки, але без цього повідомлення,\n"
+"    виконайте \"git config --global sendemail.confirm auto\".\n"
+
+#. TRANSLATORS: Make sure to include [y] [n] [e] [q] [a] in your
+#. translation. The program will only accept English input
+#. at this point.
+
+msgid "Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): "
+msgstr "Надіслати цей лист? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): "
+
+msgid "Send this email reply required"
+msgstr ""
+
+msgid "The required SMTP server is not properly defined."
+msgstr "Потрібний SMTP-сервер не визначено належним чином."
+
+#, perl-format
+msgid "Server does not support STARTTLS! %s"
+msgstr "Сервер не підтримує STARTTLS! %s"
+
+#, perl-format
+msgid "STARTTLS failed! %s"
+msgstr ""
+
+msgid "Unable to initialize SMTP properly. Check config and use --smtp-debug."
+msgstr ""
+"Не вдалося правильно ініціалізувати SMTP. Перевірте конфігурацію і "
+"скористайтеся --smtp-debug."
+
+#, perl-format
+msgid "Failed to send %s\n"
+msgstr "Не вдалося надіслати %s\n"
+
+#, perl-format
+msgid "Dry-Sent %s\n"
+msgstr "Пробно відправлено %s\n"
+
+#, perl-format
+msgid "Sent %s\n"
+msgstr "Відправлено %s\n"
+
+msgid "Dry-OK. Log says:\n"
+msgstr ""
+
+msgid "OK. Log says:\n"
+msgstr "ОК. Лог каже:\n"
+
+msgid "Result: "
+msgstr "Результат: "
+
+msgid "Result: OK\n"
+msgstr "Результат: OK\n"
+
+#, perl-format
+msgid "can't open file %s"
+msgstr "неможливо відкрити файл %s"
+
+#, perl-format
+msgid "(mbox) Adding cc: %s from line '%s'\n"
+msgstr "(mbox) Додавання cc: %s з рядка \"%s\"\n"
+
+#, perl-format
+msgid "(mbox) Adding to: %s from line '%s'\n"
+msgstr "(mbox) Додавання до: %s з рядка \"%s\"\n"
+
+#, perl-format
+msgid "(non-mbox) Adding cc: %s from line '%s'\n"
+msgstr "(non-mbox) Додавання cc: %s з рядка \"%s\"\n"
+
+#, perl-format
+msgid "(body) Adding cc: %s from line '%s'\n"
+msgstr "(тіло) Додавання cc: %s з рядка \"%s\"\n"
+
+#, perl-format
+msgid "(%s) Could not execute '%s'"
+msgstr "(%s) Не вдалося виконати \"%s\""
+
+#, perl-format
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) Невірно сформований рядок виводу з \"%s\"."
+
+#, perl-format
+msgid "(%s) failed to close pipe to '%s'"
+msgstr "(%s) не вдалося закрити канал до \"%s\""
+
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) Додавання %s: %s з: \"%s\"\n"
+
+msgid "cannot send message as 7bit"
+msgstr "неможливо надіслати повідомлення як 7bit"
+
+msgid "invalid transfer encoding"
+msgstr "неприпустиме кодування передачі"
+
+#, perl-format
+msgid ""
+"fatal: %s: rejected by %s hook\n"
+"%s\n"
+"warning: no patches were sent\n"
+msgstr ""
+"збій: %s: відхилено %s хуком\n"
+"%s\n"
+"попередження: не було надіслано жодних латок\n"
+
+#, perl-format
+msgid "unable to open %s: %s\n"
+msgstr "не вдалося відкрити %s: %s\n"
+
+#, perl-format
+msgid ""
+"fatal: %s:%d is longer than 998 characters\n"
+"warning: no patches were sent\n"
+msgstr ""
+"збій: %s:%d довше ніж 998 символів\n"
+"попередження: не було надіслано жодних латок\n"
+
+#, perl-format
+msgid "Skipping %s with backup suffix '%s'.\n"
+msgstr "Пропуск %s з резервним суфіксом \"%s\".\n"
+
+#. TRANSLATORS: please keep "[y|N]" as is.
+
+#, perl-format
+msgid "Do you really want to send %s? [y|N]: "
+msgstr "Ви дійсно хочете відправити %s? [y|N]: "
index 2b88f9b78146c7097d193af0092db9d33443916d..aa25e9a1593ac21a1bb84174184312b283226d89 100644 (file)
 #   3-way merge                      |  三方合并
 #   abbreviate                       |  简写(的 SHA-1 值)
 #   alternate object database        |  备用对象库
+#   attribute source                 |  属性来源
 #   amend                            |  修补
 #   ancestor                         |  祖先,祖先提交
 #   annotated tag                    |  附注标签
 #   bare repository                  |  纯仓库
 #   bisect                           |  二分查找
+#   bitmap                           |  位图
 #   blob object                      |  数据对象
 #   bloom filter                     |  布隆过滤器
 #   branch                           |  分支
 #   rebase                           |  变基
 #   ref                              |  引用
 #   reflog                           |  引用日志
+#   refmap                           |  引用映射
 #   refspec                          |  引用规格
 #   remote                           |  远程,远程仓库
 #   remote-tracking branch           |  远程跟踪分支
@@ -145,10 +148,10 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Git\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2023-03-07 23:37+0000\n"
-"PO-Revision-Date: 2023-03-07 23:40+0000\n"
-"Last-Translator: Fangyi Zhou <me@fangyi.io>\n"
-"Language-Team: GitHub <https://github.com/fangyi-zhou/git-po/>\n"
+"POT-Creation-Date: 2023-05-20 12:27+0800\n"
+"PO-Revision-Date: 2023-05-20 12:38+0800\n"
+"Last-Translator: Teng Long <dyroneteng@gmail.com>\n"
+"Language-Team: GitHub <https://github.com/dyrone/git/>\n"
 "Language: zh_CN\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -916,6 +919,24 @@ msgstr "请在合并前先提交您的修改。"
 msgid "Exiting because of unfinished merge."
 msgstr "因为存在未完成的合并而退出。"
 
+#: advice.c
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"无法在偏离的分支上进行快进操作,您需要:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"或者:\n"
+"\n"
+"\tgit rebase\n"
+
 #: advice.c
 msgid "Not possible to fast-forward, aborting."
 msgstr "无法快进,终止。"
@@ -1444,6 +1465,11 @@ msgstr "截短 .rej 文件名为 %.*s.rej"
 msgid "cannot open %s"
 msgstr "不能打开 %s"
 
+#: apply.c rerere.c
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "不能删除 '%s'"
+
 #: apply.c
 #, c-format
 msgid "Hunk #%d applied cleanly."
@@ -1681,6 +1707,11 @@ msgstr "git archive --remote <仓库> [--exec <命令>] --list"
 msgid "cannot read '%s'"
 msgstr "不能读取 '%s'"
 
+#: archive.c
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "路径规格 '%s' 匹配了当前目录外的文件'"
+
 #: archive.c builtin/add.c builtin/rm.c
 #, c-format
 msgid "pathspec '%s' did not match any files"
@@ -1701,10 +1732,6 @@ msgstr "不是一个有效的对象名:%s"
 msgid "not a tree object: %s"
 msgstr "不是一个树对象:%s"
 
-#: archive.c
-msgid "current working directory is untracked"
-msgstr "当前工作目录未被跟踪"
-
 #: archive.c
 #, c-format
 msgid "File not found: %s"
@@ -1873,6 +1900,10 @@ msgstr "忽略过大的 gitattributes 文件 '%s'"
 msgid "ignoring overly large gitattributes blob '%s'"
 msgstr "忽略过大的 gitattributes 数据对象 '%s'"
 
+#: attr.c
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "错误的 --attr-source 或 GIT_ATTR_SOURCE"
+
 #: bisect.c
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
@@ -1996,17 +2027,13 @@ msgstr[1] "二分查找中:在此之后,还剩 %d 个版本待测试 %s\n"
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents 和 --reverse 不能混用。"
 
-#: blame.c
-msgid "cannot use --contents with final commit object name"
-msgstr "不能将 --contents 和最终的提交对象名共用"
-
 #: blame.c
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr "--reverse 和 --first-parent 共用,需要指定最新的提交"
 
 #: blame.c builtin/commit.c builtin/log.c builtin/merge.c
-#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c ref-filter.c
-#: remote.c sequencer.c submodule.c
+#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c remote.c
+#: sequencer.c submodule.c
 msgid "revision walk setup failed"
 msgstr "版本遍历初始化失败"
 
@@ -2200,11 +2227,6 @@ msgstr "子模组 '%s':不能创建分支 '%s'"
 msgid "'%s' is already checked out at '%s'"
 msgstr "'%s' 已经检出到 '%s'"
 
-#: branch.c
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "工作区 %s 的 HEAD 指向没有被更新"
-
 #: builtin/add.c
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<选项>] [--] <路径规格>..."
@@ -2472,7 +2494,7 @@ msgstr "fseek 失败"
 msgid "could not open '%s' for reading"
 msgstr "无法打开 '%s' 进行读取"
 
-#: builtin/am.c builtin/rebase.c sequencer.c strbuf.c wrapper.c
+#: builtin/am.c builtin/rebase.c editor.c sequencer.c wrapper.c
 #, c-format
 msgid "could not open '%s' for writing"
 msgstr "无法打开 '%s' 进行写入"
@@ -3494,6 +3516,15 @@ msgstr "无法删除检出于 '%2$s' 的分支 '%1$s'。"
 msgid "remote-tracking branch '%s' not found."
 msgstr "未能找到远程跟踪分支 '%s'。"
 
+#: builtin/branch.c
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"分支 '%s' 未找到。\n"
+"是否忘记指定 --remote 选项?"
+
 #: builtin/branch.c
 #, c-format
 msgid "branch '%s' not found."
@@ -3532,6 +3563,11 @@ msgstr "分支 %s 正被变基到 %s"
 msgid "Branch %s is being bisected at %s"
 msgstr "分支 %s 正被二分查找于 %s"
 
+#: builtin/branch.c
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "工作区 %s 的 HEAD 指向没有被更新"
+
 #: builtin/branch.c
 #, c-format
 msgid "Invalid branch name: '%s'"
@@ -3661,6 +3697,10 @@ msgstr "移动/重命名一个分支,以及它的引用日志"
 msgid "move/rename a branch, even if target exists"
 msgstr "移动/重命名一个分支,即使目标已存在"
 
+#: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
+msgid "do not output a newline after empty formatted refs"
+msgstr "在格式化引用结果为空之后,不输出换行符"
+
 #: builtin/branch.c
 msgid "copy a branch and its reflog"
 msgstr "拷贝一个分支和它的引用日志"
@@ -3928,12 +3968,10 @@ msgstr "在 '%s' 创建了新报告。\n"
 
 #: builtin/bundle.c
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<版本>] <文件> <git-rev-list-参数>"
 
 #: builtin/bundle.c
@@ -3960,13 +3998,13 @@ msgstr "不显示进度表"
 msgid "show progress meter"
 msgstr "显示进度表"
 
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "show progress meter during object writing phase"
-msgstr "在对象写入阶段显示进度表"
+#: builtin/bundle.c
+msgid "historical; same as --progress"
+msgstr "老的参数;等同于 --progress"
 
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "当进度表显示时类似于 --all-progress"
+#: builtin/bundle.c
+msgid "historical; does nothing"
+msgstr "老的参数;无作用"
 
 #: builtin/bundle.c
 msgid "specify bundle format version"
@@ -5214,6 +5252,11 @@ msgstr "无法对 '%s' 调用 stat"
 msgid "%s exists and is not a directory"
 msgstr "%s 存在且不是一个目录"
 
+#: builtin/clone.c
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "'%s' 为符号链接,拒绝用 --local 克隆"
+
 #: builtin/clone.c
 #, c-format
 msgid "failed to start iterator over '%s'"
@@ -6001,7 +6044,7 @@ msgstr "计算完整的领先/落后值"
 msgid "version"
 msgstr "版本"
 
-#: builtin/commit.c builtin/push.c builtin/worktree.c
+#: builtin/commit.c builtin/fetch.c builtin/push.c builtin/worktree.c
 msgid "machine-readable output"
 msgstr "机器可读的输出"
 
@@ -7076,145 +7119,15 @@ msgstr "git fetch --all [<选项>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel 不能为负数"
 
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch from all remotes"
-msgstr "从所有的远程抓取"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "set upstream for git pull/fetch"
-msgstr "为 git pull/fetch 设置上游"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "追加到 .git/FETCH_HEAD 而不是覆盖它"
-
-#: builtin/fetch.c
-msgid "use atomic transaction to update references"
-msgstr "使用原子事务更新引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "path to upload pack on remote end"
-msgstr "上传包到远程的路径"
-
-#: builtin/fetch.c
-msgid "force overwrite of local reference"
-msgstr "强制覆盖本地引用"
-
-#: builtin/fetch.c
-msgid "fetch from multiple remotes"
-msgstr "从多个远程抓取"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch all tags and associated objects"
-msgstr "抓取所有的标签和关联对象"
-
-#: builtin/fetch.c
-msgid "do not fetch all tags (--no-tags)"
-msgstr "不抓取任何标签(--no-tags)"
-
-#: builtin/fetch.c
-msgid "number of submodules fetched in parallel"
-msgstr "子模组获取的并发数"
-
-#: builtin/fetch.c
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr "修改引用规格以将所有引用放入 refs/prefetch/"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "清除远程已经不存在的分支的跟踪分支"
-
-#: builtin/fetch.c
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr "清除远程不存在的本地标签,并且替换变更标签"
-
-#  译者:可选值,不能翻译
-#: builtin/fetch.c builtin/pull.c
-msgid "on-demand"
-msgstr "on-demand"
-
-#: builtin/fetch.c
-msgid "control recursive fetching of submodules"
-msgstr "控制子模组的递归抓取"
-
-#: builtin/fetch.c
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "将获取到的引用写入 FETCH_HEAD 文件"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "keep downloaded pack"
-msgstr "保持下载包"
-
-#: builtin/fetch.c
-msgid "allow updating of HEAD ref"
-msgstr "允许更新 HEAD 引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone"
-msgstr "深化浅克隆的历史"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow repository based on time"
-msgstr "基于时间来深化浅克隆的历史"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "convert to a complete repository"
-msgstr "转换为一个完整的仓库"
-
-#: builtin/fetch.c
-msgid "re-fetch without negotiating common commits"
-msgstr "不协商共有提交重新获取"
-
-#: builtin/fetch.c
-msgid "prepend this to submodule path output"
-msgstr "在子模组路径输出的前面加上此目录"
-
-#: builtin/fetch.c
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr "递归获取子模组的缺省值(比配置文件优先级低)"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "accept refs that update .git/shallow"
-msgstr "接受更新 .git/shallow 的引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "refmap"
-msgstr "引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "specify fetch refmap"
-msgstr "指定获取操作的引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "report that we have only objects reachable from this object"
-msgstr "报告我们只拥有从该对象开始可达的对象"
-
-#: builtin/fetch.c
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr "不获取包文件;而是打印协商的祖先提交"
-
-#: builtin/fetch.c
-msgid "run 'maintenance --auto' after fetching"
-msgstr "获取后执行 'maintenance --auto'"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "check for forced-updates on all updated branches"
-msgstr "在所有更新分支上检查强制更新"
-
-#: builtin/fetch.c
-msgid "write the commit-graph after fetching"
-msgstr "抓取后写提交图"
-
-#: builtin/fetch.c
-msgid "accept refspecs from stdin"
-msgstr "从标准输入获取引用规格"
-
 #: builtin/fetch.c
 msgid "couldn't find remote ref HEAD"
 msgstr "无法发现远程 HEAD 引用"
 
+#: builtin/fetch.c
+#, c-format
+msgid "From %.*s\n"
+msgstr "来自 %.*s\n"
+
 #: builtin/fetch.c
 #, c-format
 msgid "object %s not found"
@@ -7300,11 +7213,6 @@ msgstr "%s 未发送所有必需的对象\n"
 msgid "rejected %s because shallow roots are not allowed to be updated"
 msgstr "拒绝 %s 因为浅克隆的根不允许被更新"
 
-#: builtin/fetch.c
-#, c-format
-msgid "From %.*s\n"
-msgstr "来自 %.*s\n"
-
 #: builtin/fetch.c
 #, c-format
 msgid ""
@@ -7415,6 +7323,141 @@ msgstr "未指定远程仓库;请指定一个用于获取新版本的 URL 或
 msgid "you need to specify a tag name"
 msgstr "您需要指定一个标签名称"
 
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch from all remotes"
+msgstr "从所有远程抓取"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "set upstream for git pull/fetch"
+msgstr "为 git pull/fetch 设置上游"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "追加到 .git/FETCH_HEAD 而不是覆盖它"
+
+#: builtin/fetch.c
+msgid "use atomic transaction to update references"
+msgstr "使用原子事务更新引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "path to upload pack on remote end"
+msgstr "上传包到远程的路径"
+
+#: builtin/fetch.c
+msgid "force overwrite of local reference"
+msgstr "强制覆盖本地引用"
+
+#: builtin/fetch.c
+msgid "fetch from multiple remotes"
+msgstr "从多个远程抓取"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch all tags and associated objects"
+msgstr "抓取所有的标签和关联对象"
+
+#: builtin/fetch.c
+msgid "do not fetch all tags (--no-tags)"
+msgstr "不抓取任何标签(--no-tags)"
+
+#: builtin/fetch.c
+msgid "number of submodules fetched in parallel"
+msgstr "获取子模组的并发数"
+
+#: builtin/fetch.c
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr "修改引用规格以将所有引用放入 refs/prefetch/"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "清除远程已经不存在的分支的跟踪分支"
+
+#: builtin/fetch.c
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr "清除远程不存在的本地标签,并且替换变更标签"
+
+#  译者:可选值,不能翻译
+#: builtin/fetch.c builtin/pull.c
+msgid "on-demand"
+msgstr "on-demand"
+
+#: builtin/fetch.c
+msgid "control recursive fetching of submodules"
+msgstr "控制子模组的递归抓取"
+
+#: builtin/fetch.c
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "将获取到的引用写入 FETCH_HEAD 文件"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "keep downloaded pack"
+msgstr "保持已下载的包"
+
+#: builtin/fetch.c
+msgid "allow updating of HEAD ref"
+msgstr "允许更新 HEAD 引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow clone"
+msgstr "深化浅克隆的历史"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow repository based on time"
+msgstr "基于时间来深化浅克隆的历史"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "convert to a complete repository"
+msgstr "转换为一个完整的仓库"
+
+#: builtin/fetch.c
+msgid "re-fetch without negotiating common commits"
+msgstr "重新获取而不协商共同提交"
+
+#: builtin/fetch.c
+msgid "prepend this to submodule path output"
+msgstr "在子模组路径输出的前面加上此目录"
+
+#: builtin/fetch.c
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr "递归获取子模组的缺省值(比配置文件优先级低)"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "accept refs that update .git/shallow"
+msgstr "接受更新 .git/shallow 的引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "refmap"
+msgstr "引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "specify fetch refmap"
+msgstr "指定获取操作的引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "report that we have only objects reachable from this object"
+msgstr "报告我们只拥有从该对象开始可达的对象"
+
+#: builtin/fetch.c
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr "不获取包文件;而是打印协商的祖先提交"
+
+#: builtin/fetch.c
+msgid "run 'maintenance --auto' after fetching"
+msgstr "获取后执行 'maintenance --auto'"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "check for forced-updates on all updated branches"
+msgstr "在所有更新分支上检查强制更新"
+
+#: builtin/fetch.c
+msgid "write the commit-graph after fetching"
+msgstr "抓取后写提交图"
+
+#: builtin/fetch.c
+msgid "accept refspecs from stdin"
+msgstr "从标准输入获取引用规格"
+
 #: builtin/fetch.c
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only 需要一个或多个 --negotiation-tip=*"
@@ -7560,6 +7603,14 @@ msgstr "只打印包含该提交的引用"
 msgid "print only refs which don't contain the commit"
 msgstr "只打印不包含该提交的引用"
 
+#: builtin/for-each-ref.c
+msgid "read reference patterns from stdin"
+msgstr "从标准输入读取引用的模式"
+
+#: builtin/for-each-ref.c
+msgid "unknown arguments supplied with --stdin"
+msgstr "为 --stdin 提供了未知的命令参数"
+
 #: builtin/for-each-repo.c
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<配置> [--] <命令参数>"
@@ -7576,6 +7627,11 @@ msgstr "存储着仓库路径列表的配置项键名"
 msgid "missing --config=<config>"
 msgstr "缺少 --config=<配置>"
 
+#: builtin/for-each-repo.c
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "发现错误的配置行 --config=%s"
+
 #: builtin/fsck.c
 msgid "unknown"
 msgstr "未知"
@@ -7761,13 +7817,14 @@ msgid "notice: %s points to an unborn branch (%s)"
 msgstr "注意:%s 指向一个尚未诞生的分支(%s)"
 
 #: builtin/fsck.c
-msgid "Checking cache tree"
-msgstr "正在检查缓存树"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "正在检查缓存树 %s"
 
 #: builtin/fsck.c
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s:cache-tree 无效的 sha1 指针"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s:cache-tree %s 中存在无效的 sha1 指针"
 
 #: builtin/fsck.c
 msgid "non-tree in cache-tree"
@@ -7775,8 +7832,18 @@ msgstr "cache-tree 中非树对象"
 
 #: builtin/fsck.c
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s:resolve-undo 中无效的 sha1 指针"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s:resolve-undo %s 中存在无效的 sha1 指针"
+
+#: builtin/fsck.c
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "无法为包文件 %s 加载反向索引"
+
+#: builtin/fsck.c
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "包文件 '%s' 的反向索引文件无效"
 
 #: builtin/fsck.c
 msgid ""
@@ -10371,7 +10438,7 @@ msgstr "对于 %s 没有来自 %s 的远程跟踪分支"
 msgid "Bad value '%s' in environment '%s'"
 msgstr "环境 '%2$s' 中存在坏的取值 '%1$s'"
 
-#: builtin/merge.c read-cache.c strbuf.c wrapper.c
+#: builtin/merge.c editor.c read-cache.c wrapper.c
 #, c-format
 msgid "could not close '%s'"
 msgstr "不能关闭 '%s'"
@@ -11204,7 +11271,7 @@ msgstr "无法写入位图索引"
 msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
 msgstr "写入 %<PRIu32> 个对象而预期 %<PRIu32> 个"
 
-#: builtin/pack-objects.c
+#: builtin/pack-objects.c builtin/repack.c
 msgid "disabling bitmap writing, as some objects are not being packed"
 msgstr "禁用 bitmap 写入,因为一些对象将不会被打包"
 
@@ -11370,6 +11437,14 @@ msgstr "不支持的索引版本 %s"
 msgid "bad index version '%s'"
 msgstr "坏的索引版本 '%s'"
 
+#: builtin/pack-objects.c
+msgid "show progress meter during object writing phase"
+msgstr "在对象写入阶段显示进度表"
+
+#: builtin/pack-objects.c
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "当进度表显示时类似于 --all-progress"
+
 #: builtin/pack-objects.c
 msgid "<version>[,<offset>]"
 msgstr "<版本>[,<偏移>]"
@@ -11611,6 +11686,10 @@ msgstr ""
 "并通过发送邮件到 <git@vger.kernel.org> 让我们知道您仍旧\n"
 "使用它。 谢谢。\n"
 
+#: builtin/pack-redundant.c
+msgid "refusing to run without --i-still-use-this"
+msgstr "拒绝在未指定 --i-still-use-this 选项时运行"
+
 #: builtin/pack-refs.c
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
@@ -11812,9 +11891,9 @@ msgstr "更新尚未诞生的分支,变更添加至索引。"
 msgid "pull with rebase"
 msgstr "变基式拉取"
 
-#: builtin/pull.c
-msgid "please commit or stash them."
-msgstr "请提交或贮藏它们。"
+#: builtin/pull.c builtin/rebase.c
+msgid "Please commit or stash them."
+msgstr "请提交或贮藏修改。"
 
 #: builtin/pull.c
 #, c-format
@@ -12061,9 +12140,9 @@ msgstr "'%s' 的值无效"
 msgid "repository"
 msgstr "仓库"
 
-#: builtin/push.c builtin/send-pack.c
-msgid "push all refs"
-msgstr "æ\8e¨é\80\81æ\89\80æ\9c\89å¼\95ç\94¨"
+#: builtin/push.c
+msgid "push all branches"
+msgstr "æ\8e¨é\80\81æ\89\80æ\9c\89å\88\86æ\94¯"
 
 #: builtin/push.c builtin/send-pack.c
 msgid "mirror all refs"
@@ -12074,8 +12153,8 @@ msgid "delete refs"
 msgstr "删除引用"
 
 #: builtin/push.c
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "推送标签(不能使用 --all or --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "推送标签(不能使用 --all or --branches or --mirror)"
 
 #: builtin/push.c builtin/send-pack.c
 msgid "force updates"
@@ -12397,6 +12476,11 @@ msgstr ""
 "\n"
 "因此 git 无法对其变基。"
 
+#: builtin/rebase.c
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "未知的变基合并模式:%s"
+
 #: builtin/rebase.c
 #, c-format
 msgid "could not switch to %s"
@@ -12413,6 +12497,16 @@ msgid ""
 "\"ask\"."
 msgstr "无法识别的空类型 '%s';有效值有 \"drop\"、\"keep\" 和 \"ask\"。"
 
+#: builtin/rebase.c
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"为 --rebase-merges 指定空值参数的方式已经被废弃并且在 Git 未来\n"
+"的版本中将不再支持。 支持使用无参数 --rebase-merges 的方式进行替\n"
+"代,它们具有相同的作用。"
+
 #: builtin/rebase.c
 #, c-format
 msgid ""
@@ -12675,20 +12769,21 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "开关 `C' 期望一个数字值"
 
-#: builtin/rebase.c
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "未知模式:%s"
-
 #: builtin/rebase.c
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy 需要 --merge 或 --interactive"
 
 #: builtin/rebase.c
 msgid ""
-"apply options are incompatible with rebase.autosquash.  Consider adding --no-"
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
 "autosquash"
-msgstr "应用的选项与 rebase.autosquash 不兼容。考虑加上 --no-autosquash"
+msgstr "应用的选项与 rebase.autoSquash 不兼容。考虑加上 --no-autosquash"
+
+#: builtin/rebase.c
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr "应用的选项与 rebase.rebaseMerges 不兼容。考虑加上 --no-rebase-merges"
 
 #: builtin/rebase.c
 msgid ""
@@ -12743,10 +12838,6 @@ msgstr "'%s':只需要一个合并基线"
 msgid "Does not point to a valid commit '%s'"
 msgstr "没有指向一个有效的提交 '%s'"
 
-#: builtin/rebase.c
-msgid "Please commit or stash them."
-msgstr "请提交或贮藏修改。"
-
 #: builtin/rebase.c
 msgid "HEAD is up to date."
 msgstr "HEAD 是最新的。"
@@ -13549,8 +13640,8 @@ msgid "approxidate"
 msgstr "近似日期"
 
 #: builtin/repack.c
-msgid "with -C, expire objects older than this"
-msgstr "使用 -C,使早于给定时间的对象过期"
+msgid "with --cruft, expire objects older than this"
+msgstr "使用 --cruft,使早于给定时间的对象过期"
 
 #: builtin/repack.c
 msgid "remove redundant packs, and run git-prune-packed"
@@ -14381,6 +14472,10 @@ msgstr ""
 msgid "remote name"
 msgstr "远程名称"
 
+#: builtin/send-pack.c
+msgid "push all refs"
+msgstr "推送所有引用"
+
 #: builtin/send-pack.c
 msgid "use stateless RPC protocol"
 msgstr "使用无状态的 RPC 协议"
@@ -14638,9 +14733,11 @@ msgstr "显示从标准输入中读入的不在本地仓库中的引用"
 
 #: builtin/sparse-checkout.c
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<选项>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check\n"
+"-rules) [<选项>]"
 
 #: builtin/sparse-checkout.c
 msgid "this worktree is not sparse"
@@ -14780,6 +14877,26 @@ msgstr "必须在稀疏检出中重应用稀疏模式"
 msgid "error while refreshing working directory"
 msgstr "刷新工作目录时出错"
 
+#: builtin/sparse-checkout.c
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <文件>]"
+
+#: builtin/sparse-checkout.c
+msgid "terminate input and output files by a NUL character"
+msgstr "输入和输出的文件使用 NUL 字符终结"
+
+#: builtin/sparse-checkout.c
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr "通过 --rules-file 选项传递的模型将被作为锥形(稀疏检出模型)进行解析"
+
+#: builtin/sparse-checkout.c
+msgid "use patterns in <file> instead of the current ones."
+msgstr "从 <文件> 参数中读取模式,而不是从标准输入"
+
 #: builtin/stash.c
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<日志选项>]"
@@ -18313,8 +18430,8 @@ msgid "bad zlib compression level %d"
 msgstr "错误的 zlib 压缩级别 %d"
 
 #: config.c
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar 应该是一个字符"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar 应该是一个 ASCII 编码的字符"
 
 #: config.c
 #, c-format
@@ -18452,6 +18569,11 @@ msgstr "不能设置 '%s' 为 '%s'"
 msgid "invalid section name: %s"
 msgstr "无效的小节名称:%s"
 
+#: config.c
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "拒绝支持内容过长的行,位于文件 '%s' 中的第 %<PRIuMAX> 行"
+
 #: config.c
 #, c-format
 msgid "missing value for '%s'"
@@ -19262,6 +19384,10 @@ msgstr "输出的每一行附加前缀"
 msgid "do not show any source or destination prefix"
 msgstr "不显示任何源和目标前缀"
 
+#: diff.c
+msgid "use default prefixes a/ and b/"
+msgstr "使用 a/ 和 b/ 作为默认前缀"
+
 #: diff.c
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr "显示指定行数的差异块间的上下文"
@@ -19631,6 +19757,16 @@ msgstr "不能从 '%s' 迁移 git 目录到 '%s'"
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "提示:等待您的编辑器关闭文件...%c"
 
+#: editor.c sequencer.c wrapper.c
+#, c-format
+msgid "could not write to '%s'"
+msgstr "不能写入 '%s'"
+
+#: editor.c
+#, c-format
+msgid "could not edit '%s'"
+msgstr "不能编辑 '%s'"
+
 #: entry.c
 msgid "Filtering content"
 msgstr "过滤内容"
@@ -19997,6 +20133,11 @@ msgstr "应为 -c 提供一个配置字符串\n"
 msgid "no config key given for --config-env\n"
 msgstr "没有为 --config-env 提供配置名称\n"
 
+#: git.c
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "没有为 --attr-source 提供属性来源\n"
+
 #: git.c
 #, c-format
 msgid "unknown option: %s\n"
@@ -21978,6 +22119,11 @@ msgstr "无法在包 '%2$s' 偏移 %3$<PRIuMAX> 中找到 '%1$s'"
 msgid "unable to get disk usage of '%s'"
 msgstr "无法得到 '%s' 的磁盘使用量"
 
+#: pack-bitmap.c
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "位图文件 '%s' 有无效的校验码"
+
 #: pack-mtimes.c
 #, c-format
 msgid "mtimes file %s is too small"
@@ -22028,6 +22174,15 @@ msgstr "反向索引文件 %s 不支持的版本 %<PRIu32>"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "反向索引文件 %s 有不支持的哈希 ID %<PRIu32>"
 
+#: pack-revindex.c
+msgid "invalid checksum"
+msgstr "无效的校验码 %s"
+
+#: pack-revindex.c
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "位于 %<PRIu64> 的无效的反向索引:%<PRIu32> != %<PRIu32>"
+
 #: pack-write.c
 msgid "cannot both write and verify reverse index"
 msgstr "无法同时写入和校验反向索引"
@@ -22882,6 +23037,11 @@ msgstr "未能识别的 %%(%s) 参数:%s"
 msgid "positive width expected with the %%(align) atom"
 msgstr "元素 %%(align) 需要一个正数的宽度"
 
+#: ref-filter.c
+#, c-format
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "期望的格式:%%(ahead-behind:<提交号>)"
+
 #: ref-filter.c
 #, c-format
 msgid "malformed field name: %.*s"
@@ -23635,11 +23795,6 @@ msgstr "无法更新 '%s' 中的冲突状态"
 msgid "no remembered resolution for '%s'"
 msgstr "没有为 '%s' 记忆的解决方案"
 
-#: rerere.c
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "不能删除 '%s'"
-
 #: rerere.c
 #, c-format
 msgid "Updated preimage for '%s'"
@@ -24052,11 +24207,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "不能锁定 '%s'"
 
-#: sequencer.c strbuf.c wrapper.c
-#, c-format
-msgid "could not write to '%s'"
-msgstr "不能写入 '%s'"
-
 #: sequencer.c
 #, c-format
 msgid "could not write eol to '%s'"
@@ -24494,10 +24644,6 @@ msgstr "尝试 \"git cherry-pick (--continue | %s--abort | --quit)\""
 msgid "could not create sequencer directory '%s'"
 msgstr "不能创建序列目录 '%s'"
 
-#: sequencer.c
-msgid "could not lock HEAD"
-msgstr "不能锁定 HEAD"
-
 #: sequencer.c
 msgid "no cherry-pick or revert in progress"
 msgstr "拣选或还原操作并未进行"
@@ -24612,21 +24758,21 @@ msgstr ""
 "\n"
 
 #: sequencer.c
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "并且修改索引和/或工作区\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "并且修改索引和/或工作区\n"
 
 #: sequencer.c
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
 msgstr ""
 "执行成功:%s\n"
-"但是在索引和/或工作区中存在变更\n"
+"但是在索引和/或工作区中存在变更\n"
 "提交或贮藏修改,然后运行\n"
 "\n"
 "  git rebase --continue\n"
@@ -25148,11 +25294,6 @@ msgid_plural "%u bytes/s"
 msgstr[0] "%u 字节/秒"
 msgstr[1] "%u 字节/秒"
 
-#: strbuf.c
-#, c-format
-msgid "could not edit '%s'"
-msgstr "不能编辑 '%s'"
-
 #: submodule-config.c
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
@@ -27244,14 +27385,19 @@ msgstr "(%s) 不能执行 '%s'"
 
 #: git-send-email.perl
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) 添加 %s: %s 自:'%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) 非法的输出信息,来自于: '%s'"
 
 #: git-send-email.perl
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) 无法关闭管道至 '%s'"
 
+#: git-send-email.perl
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) 添加 %s: %s 自:'%s'\n"
+
 #: git-send-email.perl
 msgid "cannot send message as 7bit"
 msgstr "不能以 7bit 形式发送信息"
index aa59a8e93334a8c9060646569404af2191304d8f..1c549b868fa3c4c54073e8400457e3a06433ceb0 100644 (file)
 # - Yichao Yu <yyc1992 AT gmail.com>
 # - Zhuang Ya <zhuangya AT me.com>
 #
-# Yi-Jyun Pan <pan93412@gmail.com>, 2021, 2022.
+# Yi-Jyun Pan <pan93412@gmail.com>, 2021, 2022, 2023.
 # Kaiyang Wu <self@origincode.me>, 2022.
 msgid ""
 msgstr ""
 "Project-Id-Version: Git\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n"
-"POT-Creation-Date: 2022-12-11 00:28+0800\n"
-"PO-Revision-Date: 2022-12-10 17:12+0000\n"
+"POT-Creation-Date: 2023-05-19 19:57+0000\n"
+"PO-Revision-Date: 2023-05-31 23:41+0800\n"
 "Last-Translator: Yi-Jyun Pan <pan93412@gmail.com>\n"
 "Language-Team: Chinese (Traditional) <http://weblate.slat.org/projects/git-"
 "po/git-cli/zh_Hant/>\n"
@@ -35,7 +35,7 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 4.14.2\n"
+"X-Generator: Poedit 3.3.1\n"
 "X-ZhConverter: 繁化姬 dict-f4bc617e-r910 @ 2019/11/16 20:23:12 | https://"
 "zhconvert.org\n"
 
@@ -48,19 +48,19 @@ msgstr "嗯(%s)?"
 msgid "could not read index"
 msgstr "無法讀取索引"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "binary"
 msgstr "二進位"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "nothing"
 msgstr "無"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "unchanged"
 msgstr "未變更"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "Update"
 msgstr "更新"
 
@@ -73,14 +73,14 @@ msgstr "無法暫存 “%s”"
 msgid "could not write index"
 msgstr "無法寫入索引"
 
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
 msgid "updated %d path\n"
 msgid_plural "updated %d paths\n"
 msgstr[0] "已更新 %d 個路徑\n"
 
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
 msgid "note: %s is untracked now.\n"
 msgstr "註:現已不再追蹤 %s。\n"
 
@@ -89,7 +89,7 @@ msgstr "註:現已不再追蹤 %s。\n"
 msgid "make_cache_entry failed for path '%s'"
 msgstr "對 “%s” 路徑執行 make_cache_entry 失敗"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "Revert"
 msgstr "還原"
 
@@ -97,23 +97,23 @@ msgstr "還原"
 msgid "Could not parse HEAD^{tree}"
 msgstr "無法解析 HEAD^{tree}"
 
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
 msgid "reverted %d path\n"
 msgid_plural "reverted %d paths\n"
 msgstr[0] "已還原 %d 個路徑\n"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 #, c-format
 msgid "No untracked files.\n"
 msgstr "沒有未追蹤的檔案。\n"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "Add untracked"
 msgstr "加入未追蹤項目"
 
-#: add-interactive.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-interactive.c
+#, c-format
 msgid "added %d path\n"
 msgid_plural "added %d paths\n"
 msgstr[0] "已加入 %d 個路徑\n"
@@ -123,21 +123,21 @@ msgstr[0] "已加入 %d 個路徑\n"
 msgid "ignoring unmerged: %s"
 msgstr "忽略未合併項目:%s"
 
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
 #, c-format
 msgid "Only binary files changed.\n"
 msgstr "只變更二進位檔案。\n"
 
-#: add-interactive.c add-patch.c git-add--interactive.perl
+#: add-interactive.c add-patch.c
 #, c-format
 msgid "No changes.\n"
 msgstr "沒有更動。\n"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "Patch update"
 msgstr "修補檔更新"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "Review diff"
 msgstr "檢閱差異"
 
@@ -205,25 +205,25 @@ msgstr "選取編號過的項目"
 msgid "(empty) select nothing"
 msgstr "(空)全部不選取"
 
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
 msgid "*** Commands ***"
 msgstr "*** 命令 ***"
 
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
 msgid "What now"
 msgstr "請選擇"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "staged"
 msgstr "已暫存"
 
-#: add-interactive.c git-add--interactive.perl
+#: add-interactive.c
 msgid "unstaged"
 msgstr "未暫存"
 
 #: add-interactive.c apply.c builtin/am.c builtin/bugreport.c builtin/clone.c
-#: builtin/diagnose.c builtin/fetch.c builtin/merge.c builtin/pull.c
-#: builtin/submodule--helper.c git-add--interactive.perl
+#: builtin/diagnose.c builtin/fetch.c builtin/hook.c builtin/merge.c
+#: builtin/pull.c builtin/submodule--helper.c
 msgid "path"
 msgstr "路徑"
 
@@ -231,28 +231,28 @@ msgstr "路徑"
 msgid "could not refresh index"
 msgstr "無法重新整理索引"
 
-#: add-interactive.c builtin/clean.c git-add--interactive.perl
+#: add-interactive.c builtin/clean.c
 #, c-format
 msgid "Bye.\n"
 msgstr "再見。\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stage mode change [y,n,q,a,d%s,?]? "
 msgstr "暫存模式更動 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stage deletion [y,n,q,a,d%s,?]? "
 msgstr "暫存刪除動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stage addition [y,n,q,a,d%s,?]? "
 msgstr "暫存加入動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stage this hunk [y,n,q,a,d%s,?]? "
 msgstr "暫存此區塊 [y,n,q,a,d%s,?]? "
 
@@ -276,23 +276,23 @@ msgstr ""
 "a - 暫存此區塊和本檔案中後面的全部區塊\n"
 "d - 不暫存此區塊和本檔案中後面的全部區塊\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stash mode change [y,n,q,a,d%s,?]? "
 msgstr "貯存模式更動 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stash deletion [y,n,q,a,d%s,?]? "
 msgstr "貯存刪除動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stash addition [y,n,q,a,d%s,?]? "
 msgstr "貯存加入動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Stash this hunk [y,n,q,a,d%s,?]? "
 msgstr "貯存此區塊 [y,n,q,a,d%s,?]? "
 
@@ -316,23 +316,23 @@ msgstr ""
 "a - 貯存此區塊和本檔案中後面的全部區塊\n"
 "d - 不貯存此區塊和本檔案中後面的全部區塊\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Unstage mode change [y,n,q,a,d%s,?]? "
 msgstr "取消暫存模式更動 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Unstage deletion [y,n,q,a,d%s,?]? "
 msgstr "取消暫存刪除動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Unstage addition [y,n,q,a,d%s,?]? "
 msgstr "取消暫存加入動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Unstage this hunk [y,n,q,a,d%s,?]? "
 msgstr "取消暫存此區塊 [y,n,q,a,d%s,?]? "
 
@@ -356,23 +356,23 @@ msgstr ""
 "a - 不暫存此區塊和本檔案中後面的全部區塊\n"
 "d - 不要不暫存此區塊和本檔案中後面的全部區塊\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply mode change to index [y,n,q,a,d%s,?]? "
 msgstr "將模式更動套用到索引 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply deletion to index [y,n,q,a,d%s,?]? "
 msgstr "將刪除動作套用至索引 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply addition to index [y,n,q,a,d%s,?]? "
 msgstr "將加入動作套用至索引 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply this hunk to index [y,n,q,a,d%s,?]? "
 msgstr "將此區塊套用到索引 [y,n,q,a,d%s,?]? "
 
@@ -396,23 +396,23 @@ msgstr ""
 "a - 套用此區塊和本檔案中後面的全部區塊\n"
 "d - 不要套用此區塊和本檔案中後面的全部區塊\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard mode change from worktree [y,n,q,a,d%s,?]? "
 msgstr "從工作區捨棄模式更動 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard deletion from worktree [y,n,q,a,d%s,?]? "
 msgstr "從工作區捨棄刪除動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard addition from worktree [y,n,q,a,d%s,?]? "
 msgstr "從工作區捨棄加入動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard this hunk from worktree [y,n,q,a,d%s,?]? "
 msgstr "從工作區捨棄此區塊 [y,n,q,a,d%s,?]? "
 
@@ -436,23 +436,23 @@ msgstr ""
 "a - 捨棄此區塊和本檔案中後面的全部區塊\n"
 "d - 不要捨棄此區塊和本檔案中後面的全部區塊\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard mode change from index and worktree [y,n,q,a,d%s,?]? "
 msgstr "從索引和工作區捨棄模式更動 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard deletion from index and worktree [y,n,q,a,d%s,?]? "
 msgstr "從索引和工作區捨棄刪除 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard addition from index and worktree [y,n,q,a,d%s,?]? "
 msgstr "從索引和工作區捨棄加入動作 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Discard this hunk from index and worktree [y,n,q,a,d%s,?]? "
 msgstr "從索引和工作區捨棄此區塊 [y,n,q,a,d%s,?]? "
 
@@ -470,23 +470,23 @@ msgstr ""
 "a - 捨棄此區塊和本檔案中後面的全部區塊\n"
 "d - 不要捨棄此區塊和本檔案中後面的全部區塊\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply mode change to index and worktree [y,n,q,a,d%s,?]? "
 msgstr "將模式更動套用到索引和工作區 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply deletion to index and worktree [y,n,q,a,d%s,?]? "
 msgstr "將刪除動作套用到索引和工作區 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply addition to index and worktree [y,n,q,a,d%s,?]? "
 msgstr "將加入動作套用到索引和工作區 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply this hunk to index and worktree [y,n,q,a,d%s,?]? "
 msgstr "將此區塊套用到索引和工作區 [y,n,q,a,d%s,?]? "
 
@@ -504,23 +504,23 @@ msgstr ""
 "a - 套用此區塊和本檔案中後面的全部區塊\n"
 "d - 不要套用此區塊和本檔案中後面的全部區塊\n"
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply mode change to worktree [y,n,q,a,d%s,?]? "
 msgstr "將模式更動套用到工作區 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply deletion to worktree [y,n,q,a,d%s,?]? "
 msgstr "將刪除動作套用到工作區 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply addition to worktree [y,n,q,a,d%s,?]? "
 msgstr "將加入動作套用到工作區 [y,n,q,a,d%s,?]? "
 
-#: add-patch.c git-add--interactive.perl
-#, c-format, perl-format
+#: add-patch.c
+#, c-format
 msgid "Apply this hunk to worktree [y,n,q,a,d%s,?]? "
 msgstr "將此區塊套用到工作區 [y,n,q,a,d%s,?]? "
 
@@ -590,7 +590,7 @@ msgstr ""
 "\t結尾不是:\n"
 "%.*s"
 
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid "Manual hunk edit mode -- see bottom for a quick guide.\n"
 msgstr "手動區塊編輯模式——檢視底部的快速指引。\n"
 
@@ -607,9 +607,7 @@ msgstr ""
 "要刪除 “%c” 開頭的列,請直接刪除。\n"
 "開頭是 %c 的列將會被移除。\n"
 
-#. #-#-#-#-#  git-add--interactive.perl.po  #-#-#-#-#
-#. TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid ""
 "If it does not apply cleanly, you will be given an opportunity to\n"
 "edit again.  If all lines of the hunk are removed, then the edit is\n"
@@ -627,21 +625,13 @@ msgstr "無法解析區塊標頭"
 msgid "'git apply --cached' failed"
 msgstr "“git apply --cached” 失敗"
 
-#. #-#-#-#-#  add-patch.c.po  #-#-#-#-#
 #. TRANSLATORS: do not translate [y/n]
 #. The program will only accept that input at this point.
 #. Consider translating (saying "no" discards!) as
 #. (saying "n" for "no" discards!) if the translation
 #. of the word "no" does not start with n.
 #.
-#. #-#-#-#-#  git-add--interactive.perl.po  #-#-#-#-#
-#. TRANSLATORS: do not translate [y/n]
-#. The program will only accept that input
-#. at this point.
-#. Consider translating (saying "no" discards!) as
-#. (saying "n" for "no" discards!) if the translation
-#. of the word "no" does not start with n.
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid ""
 "Your edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]? "
 msgstr "未套用您編輯的區塊。是否重新編輯(輸入 “no” 捨棄!) [y/n]? "
@@ -650,11 +640,11 @@ msgstr "未套用您編輯的區塊。是否重新編輯(輸入 “no” 捨
 msgid "The selected hunks do not apply to the index!"
 msgstr "選取的區塊無法套用至索引!"
 
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid "Apply them to the worktree anyway? "
 msgstr "無論如何都要套用到工作區嗎? "
 
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid "Nothing was applied.\n"
 msgstr "未套用。\n"
 
@@ -692,11 +682,11 @@ msgstr "沒有下一個區塊"
 msgid "No other hunks to goto"
 msgstr "沒有其它可以跳轉的區塊"
 
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid "go to which hunk (<ret> to see more)? "
 msgstr "要跳轉到哪個區塊(<ret> 檢視更多)? "
 
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid "go to which hunk? "
 msgstr "跳轉到哪個區塊? "
 
@@ -715,7 +705,7 @@ msgstr[0] "對不起,只有 %d 個可用區塊。"
 msgid "No other hunks to search"
 msgstr "沒有其它可以尋找的區塊"
 
-#: add-patch.c git-add--interactive.perl
+#: add-patch.c
 msgid "search for regex? "
 msgstr "使用常規表示式搜尋? "
 
@@ -808,6 +798,24 @@ msgstr "請在合併前先提交您的更動。"
 msgid "Exiting because of unfinished merge."
 msgstr "存在未完成的合併,離開。"
 
+#: advice.c
+msgid ""
+"Diverging branches can't be fast-forwarded, you need to either:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"or:\n"
+"\n"
+"\tgit rebase\n"
+msgstr ""
+"岔開的分支不能快轉,您得執行:\n"
+"\n"
+"\tgit merge --no-ff\n"
+"\n"
+"或者:\n"
+"\n"
+"\tgit rebase\n"
+
 #: advice.c
 msgid "Not possible to fast-forward, aborting."
 msgstr "無法快轉,中止。"
@@ -1295,7 +1303,7 @@ msgstr "無法對剛建立的檔案 %s 建立後端儲存"
 msgid "unable to add cache entry for %s"
 msgstr "無法為 %s 加入快取項目"
 
-#: apply.c builtin/bisect--helper.c builtin/gc.c
+#: apply.c builtin/bisect.c builtin/gc.c
 #, c-format
 msgid "failed to write to '%s'"
 msgstr "無法寫入 “%s”"
@@ -1335,6 +1343,11 @@ msgstr "正在將 .rej 檔案名稱截短為 %.*s.rej"
 msgid "cannot open %s"
 msgstr "無法開啟 %s"
 
+#: apply.c rerere.c
+#, c-format
+msgid "cannot unlink '%s'"
+msgstr "無法刪除 “%s”"
+
 #: apply.c
 #, c-format
 msgid "Hunk #%d applied cleanly."
@@ -1569,6 +1582,11 @@ msgstr "git archive --remote <repo> [--exec <cmd>] --list"
 msgid "cannot read '%s'"
 msgstr "無法讀取 “%s”"
 
+#: archive.c
+#, c-format
+msgid "pathspec '%s' matches files outside the current directory"
+msgstr "符合路徑規格「%s」的檔案在目前目錄之外"
+
 #: archive.c builtin/add.c builtin/rm.c
 #, c-format
 msgid "pathspec '%s' did not match any files"
@@ -1589,10 +1607,6 @@ msgstr "非有效物件名稱:%s"
 msgid "not a tree object: %s"
 msgstr "非樹狀物件:%s"
 
-#: archive.c
-msgid "current working directory is untracked"
-msgstr "尚未追蹤目前的工作目錄"
-
 #: archive.c
 #, c-format
 msgid "File not found: %s"
@@ -1626,7 +1640,7 @@ msgstr "fmt"
 msgid "archive format"
 msgstr "封存格式"
 
-#: archive.c builtin/log.c
+#: archive.c builtin/log.c parse-options.h
 msgid "prefix"
 msgstr "前綴"
 
@@ -1660,6 +1674,15 @@ msgstr "讀取工作目錄中的 .gitattributes"
 msgid "report archived files on stderr"
 msgstr "在 stderr 上回報封存的檔案"
 
+#: archive.c builtin/clone.c builtin/fetch.c builtin/pack-objects.c
+#: builtin/pull.c
+msgid "time"
+msgstr "time"
+
+#: archive.c
+msgid "set modification time of archive entries"
+msgstr "設定封存項目的修改時間"
+
 #: archive.c
 msgid "set compression level"
 msgstr "設定壓縮級別"
@@ -1715,6 +1738,15 @@ msgstr "引數不支援 “%s” 格式:-%d"
 msgid "%.*s is not a valid attribute name"
 msgstr "%.*s 不是有效的屬性名稱"
 
+#: attr.c
+msgid "unable to add additional attribute"
+msgstr "無法加入其他屬性"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly long attributes line %d"
+msgstr "忽略過長的屬性列 (第 %d 列)"
+
 #: attr.c
 #, c-format
 msgid "%s not allowed: %s:%d"
@@ -1728,6 +1760,25 @@ msgstr ""
 "git attributes 會忽略反向模式\n"
 "當字串確定要以驚嘆號開始時,請使用 “\\!”。"
 
+#: attr.c
+#, c-format
+msgid "cannot fstat gitattributes file '%s'"
+msgstr "無法 fstat gitattributes 檔案 “%s”"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes file '%s'"
+msgstr "忽略過大的 gitattributes 檔案 “%s”"
+
+#: attr.c
+#, c-format
+msgid "ignoring overly large gitattributes blob '%s'"
+msgstr "忽略過大的 gitattributes 資料物件 “%s”"
+
+#: attr.c
+msgid "bad --attr-source or GIT_ATTR_SOURCE"
+msgstr "無效的 --attr-source 或 GIT_ATTR_SOURCE"
+
 #: bisect.c
 #, c-format
 msgid "Badly quoted content in file '%s': %s"
@@ -1849,17 +1900,13 @@ msgstr[0] "二分搜尋中:在此 (%2$s) 之後,尚餘 %1$d 個版本待測
 msgid "--contents and --reverse do not blend well."
 msgstr "--contents 和 --reverse 不能混用。"
 
-#: blame.c
-msgid "cannot use --contents with final commit object name"
-msgstr "無法將 --contents 與最終的提交物件名稱共用"
-
 #: blame.c
 msgid "--reverse and --first-parent together require specified latest commit"
 msgstr "--reverse 和 --first-parent 共用,需要指定最新的提交"
 
 #: blame.c builtin/commit.c builtin/log.c builtin/merge.c
-#: builtin/pack-objects.c builtin/shortlog.c bundle.c midx.c pack-bitmap.c
-#: ref-filter.c remote.c sequencer.c submodule.c
+#: builtin/pack-objects.c builtin/shortlog.c midx.c pack-bitmap.c remote.c
+#: sequencer.c submodule.c
 msgid "revision walk setup failed"
 msgstr "修訂版遍歷設定失敗"
 
@@ -1934,12 +1981,10 @@ msgid "not tracking: ambiguous information for ref '%s'"
 msgstr "未追蹤:“%s” 引用有歧義"
 
 #  譯者:為保證在輸出中對齊,注意調整句中空格!
-#. #-#-#-#-#  branch.c.po  #-#-#-#-#
 #. TRANSLATORS: This is a line listing a remote with duplicate
 #. refspecs in the advice message below. For RTL languages you'll
 #. probably want to swap the "%s" and leading "  " space around.
 #.
-#. #-#-#-#-#  object-name.c.po  #-#-#-#-#
 #. TRANSLATORS: This is line item of ambiguous object output
 #. from describe_ambiguous_object() above. For RTL languages
 #. you'll probably want to swap the "%s" and leading " " space
@@ -2040,11 +2085,11 @@ msgstr "“%s” 子模組:找不到子模組"
 #: branch.c
 #, c-format
 msgid ""
-"You may try updating the submodules using 'git checkout %s && git submodule "
-"update --init'"
+"You may try updating the submodules using 'git checkout --no-recurse-"
+"submodules %s && git submodule update --init'"
 msgstr ""
-"您可以嘗試使用 “git checkout %s && git submodule update --init” 命令,更新子"
-"模組"
+"您可以使用 “git checkout --no-recurse-submodules %s && git submodule update "
+"--init” 命令嘗試更新子模組"
 
 #: branch.c
 #, c-format
@@ -2056,11 +2101,6 @@ msgstr "“%s” 子模組:無法建立 “%s” 分支"
 msgid "'%s' is already checked out at '%s'"
 msgstr "“%s” 已在 “%s” 點簽出"
 
-#: branch.c
-#, c-format
-msgid "HEAD of working tree %s is not updated"
-msgstr "%s 工作區的 HEAD 指針未被更新"
-
 #: builtin/add.c
 msgid "git add [<options>] [--] <pathspec>..."
 msgstr "git add [<options>] [--] <pathspec>..."
@@ -2088,6 +2128,14 @@ msgstr "移除 “%s”\n"
 msgid "Unstaged changes after refreshing the index:"
 msgstr "重新整理索引之後,尚未被暫存的更動:"
 
+#: builtin/add.c
+msgid ""
+"the add.interactive.useBuiltin setting has been removed!\n"
+"See its entry in 'git help config' for details."
+msgstr ""
+"add.interactive.useBuiltin 設定已被移除!\n"
+"深入了解請參閱 “git help config” 中的對應條目。"
+
 #: builtin/add.c builtin/rev-parse.c
 msgid "Could not read the index"
 msgstr "無法讀取索引"
@@ -2323,7 +2371,7 @@ msgstr "fseek 失敗"
 msgid "could not open '%s' for reading"
 msgstr "無法開啟 “%s” 進行讀取"
 
-#: builtin/am.c builtin/rebase.c sequencer.c strbuf.c wrapper.c
+#: builtin/am.c builtin/rebase.c editor.c sequencer.c wrapper.c
 #, c-format
 msgid "could not open '%s' for writing"
 msgstr "無法開啟 “%s” 進行寫入"
@@ -2545,7 +2593,7 @@ msgstr ""
 "您似乎在上一次 “am” 失敗後移動了 HEAD。\n"
 "未倒轉回 ORIG_HEAD"
 
-#: builtin/am.c builtin/bisect--helper.c worktree.c
+#: builtin/am.c builtin/bisect.c worktree.c
 #, c-format
 msgid "failed to read '%s'"
 msgstr "無法讀取 “%s”"
@@ -2567,6 +2615,10 @@ msgstr "git am [<options>] (--continue | --skip | --abort)"
 msgid "run interactively"
 msgstr "互動式執行"
 
+#: builtin/am.c
+msgid "bypass pre-applypatch and applypatch-msg hooks"
+msgstr "繞過 pre-applypatch 和 applypatch-msg 掛鉤"
+
 #: builtin/am.c
 msgid "historical option -- no-op"
 msgstr "歷史遺留選項——無作用"
@@ -2586,7 +2638,7 @@ msgstr "在提交說明結尾處加入 Signed-off-by"
 
 #: builtin/am.c
 msgid "recode into utf8 (default)"
-msgstr "使用 utf8 字元集(預設)"
+msgstr "使用 utf8 字元集(預設)"
 
 #: builtin/am.c
 msgid "pass -k flag to git-mailinfo"
@@ -2756,111 +2808,105 @@ msgstr "git archive:通訊協定錯誤"
 msgid "git archive: expected a flush"
 msgstr "git archive:預期收到 flush 封包"
 
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-reset [<commit>]"
-msgstr "git bisect--helper --bisect-reset [<commit>]"
-
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]    [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--]    [<pathspec>...]"
 msgstr ""
-"git bisect--helper --bisect-start [--term-{new,bad}=<term> --term-{old,good}"
-"=<term>] [--no-checkout] [--first-parent] [<bad> [<good>...]] [--] "
-"[<paths>...]"
+"git bisect start [--term-{new,bad}=<term> --term-{old,good}=<term>]    [--no-"
+"checkout] [--first-parent] [<bad> [<good>...]] [--]    [<pathspec>...]"
 
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
-msgstr "git bisect--helper --bisect-state (bad|new) [<rev>]"
+#: builtin/bisect.c
+msgid "git bisect (good|bad) [<rev>...]"
+msgstr "git bisect (good|bad) [<rev>...]"
 
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-state (good|old) [<rev>...]"
-msgstr "git bisect--helper --bisect-state (good|old) [<rev>...]"
+#: builtin/bisect.c
+msgid "git bisect skip [(<rev>|<range>)...]"
+msgstr "git bisect skip [(<rev>|<range>)...]"
 
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-replay <filename>"
-msgstr "git bisect--helper --bisect-replay <filename>"
+#: builtin/bisect.c
+msgid "git bisect reset [<commit>]"
+msgstr "git bisect reset [<commit>]"
 
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
-msgstr "git bisect--helper --bisect-skip [(<rev>|<range>)...]"
+#: builtin/bisect.c
+msgid "git bisect replay <logfile>"
+msgstr "git bisect replay <logfile>"
 
-#: builtin/bisect--helper.c
-msgid "git bisect--helper --bisect-run <cmd>..."
-msgstr "git bisect--helper --bisect-run <cmd>..."
+#: builtin/bisect.c
+msgid "git bisect run <cmd>..."
+msgstr "git bisect run <cmd>..."
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "cannot open file '%s' in mode '%s'"
 msgstr "無法以 “%2$s” 模式開啟 “%1$s” 檔案"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "could not write to file '%s'"
 msgstr "無法寫入 “%s” 檔案"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "cannot open file '%s' for reading"
 msgstr "無法開啟 “%s” 檔案進行讀取"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "'%s' is not a valid term"
 msgstr "“%s” 不是有效術語"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "can't use the builtin command '%s' as a term"
 msgstr "不能將內建命令 “%s” 當作術語使用"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "can't change the meaning of the term '%s'"
 msgstr "不能變更術語 “%s” 的含義"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "please use two different terms"
 msgstr "請使用兩個不同的術語"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "We are not bisecting.\n"
 msgstr "我們沒有在二分搜尋。\n"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "'%s' is not a valid commit"
 msgstr "“%s” 不是有效的提交"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid ""
 "could not check out original HEAD '%s'. Try 'git bisect reset <commit>'."
 msgstr "不能簽出原始 HEAD “%s”。請嘗試 “git bisect reset <commit>”。"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "Bad bisect_write argument: %s"
 msgstr "bisect_write 引數無效:%s"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "couldn't get the oid of the rev '%s'"
 msgstr "無法取得修訂版 “%s” 的物件 ID"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "couldn't open the file '%s'"
 msgstr "無法開啟檔案 “%s”"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "Invalid command: you're currently in a %s/%s bisect"
 msgstr "命令無效:您目前正處於二分搜尋 %s/%s 的狀態"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid ""
 "You need to give me at least one %s and %s revision.\n"
@@ -2869,7 +2915,7 @@ msgstr ""
 "需指定至少一個 %s 和一個 %s 修訂版。\n"
 "為此您可以用 “git bisect %s” 和 “git bisect %s”。"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid ""
 "You need to start by \"git bisect start\".\n"
@@ -2880,7 +2926,7 @@ msgstr ""
 "接著提供至少一個 %s 和一個 %s 修訂版。\n"
 "為此您可以用 “git bisect %s” 和 “git bisect %s”。"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "bisecting only with a %s commit"
 msgstr "在只有一個 %s 提交的情況下二分搜尋"
@@ -2890,29 +2936,29 @@ msgstr "在只有一個 %s 提交的情況下二分搜尋"
 #. translation. The program will only accept English input
 #. at this point.
 #.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "Are you sure [Y/n]? "
 msgstr "是否確定 [Y/n]? "
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "status: waiting for both good and bad commits\n"
 msgstr "狀態:正在等待好和壞的提交\n"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "status: waiting for bad commit, %d good commit known\n"
 msgid_plural "status: waiting for bad commit, %d good commits known\n"
 msgstr[0] "狀態:正在等待壞的提交,已知有 %d 個好的提交\n"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "status: waiting for good commit(s), bad commit known\n"
 msgstr "狀態:正在等待好的提交,已知有壞的提交\n"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "no terms defined"
 msgstr "未定義術語"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid ""
 "Your current terms are %s for the old state\n"
@@ -2921,7 +2967,7 @@ msgstr ""
 "您目前針對舊狀態的術語是 %s;\n"
 "對新狀態的術語是 %s。\n"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid ""
 "invalid argument %s for 'git bisect terms'.\n"
@@ -2930,52 +2976,48 @@ msgstr ""
 "傳入 “git bisect terms” 的 %s 引數無效。\n"
 "支援的選項有:--term-good|--term-old 和 --term-bad|--term-new。"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "revision walk setup failed\n"
 msgstr "修訂版遍歷設定失敗\n"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "could not open '%s' for appending"
 msgstr "無法開啟 “%s” 進行附加"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "'' is not a valid term"
 msgstr "“ ” 不是有效術語"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "unrecognized option: '%s'"
 msgstr "無法識別選項:“%s”"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "'%s' does not appear to be a valid revision"
 msgstr "“%s” 似乎不是有效修訂版"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "bad HEAD - I need a HEAD"
 msgstr "HEAD 無效 — 需要一個 HEAD"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "checking out '%s' failed. Try 'git bisect start <valid-branch>'."
 msgstr "簽出 “%s” 失敗。請嘗試 “git bisect start <valid-branch>”。"
 
-#: builtin/bisect--helper.c
-msgid "won't bisect on cg-seek'ed tree"
-msgstr "不會在做了 cg-seek 的樹狀物件上進行二分搜尋"
-
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "bad HEAD - strange symbolic ref"
 msgstr "HEAD 無效 — 異常符號引用"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "invalid ref: '%s'"
 msgstr "引用無效:“%s”"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "You need to start by \"git bisect start\"\n"
 msgstr "要開始,請執行 “git bisect start”\n"
 
@@ -2984,151 +3026,159 @@ msgstr "要開始,請執行 “git bisect start”\n"
 #. translation. The program will only accept English input
 #. at this point.
 #.
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "Do you want me to do it for you [Y/n]? "
 msgstr "是否要這麼做 [Y/n]? "
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "Please call `--bisect-state` with at least one argument"
 msgstr "要呼叫 `--bisect-state`,請傳入一個以上的引數"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "'git bisect %s' can take only one argument."
 msgstr "“git bisect %s” 只取一個引數。"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "Bad rev input: %s"
 msgstr "rev 輸入格式錯誤:%s"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "Bad rev input (not a commit): %s"
 msgstr "rev 輸入有誤(不是提交):%s"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "We are not bisecting."
 msgstr "我們沒有在二分搜尋。"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "'%s'?? what are you talking about?"
 msgstr "「%s」??您在說什麼?"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "cannot read file '%s' for replaying"
 msgstr "無法讀取「%s」檔案進行重放"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "running %s\n"
 msgstr "正在執行 %s\n"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "bisect run failed: no command provided."
 msgstr "二分搜尋執行失敗:沒有提供命令。"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
-msgid "unable to verify '%s' on good revision"
-msgstr "無法在好的修訂版上驗證 “%s”"
+msgid "unable to verify %s on good revision"
+msgstr "無法在好的修訂版上驗證 %s"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "bogus exit code %d for good revision"
 msgstr "好的修訂版回傳偽造的錯誤碼 %d"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
-msgid "bisect run failed: exit code %d from '%s' is < 0 or >= 128"
-msgstr "二分搜尋執行失敗:“%2$s” 回傳的離開碼 %1$d 小於 0 或 >= 128"
+msgid "bisect run failed: exit code %d from %s is < 0 or >= 128"
+msgstr "二分搜尋執行失敗:%2$s 回傳的離開碼 %1$d 小於 0 或大於 128"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
 msgid "cannot open file '%s' for writing"
 msgstr "無法開啟 “%s” 檔案進行寫入"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "bisect run cannot continue any more"
 msgstr "二分搜尋不能繼續執行"
 
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
 msgid "bisect run success"
 msgstr "二分搜尋執行成功"
 
-#: builtin/bisect--helper.c
-#, c-format
+#: builtin/bisect.c
 msgid "bisect found first bad commit"
 msgstr "二分搜尋發現到第一個有問題的提交"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 #, c-format
-msgid ""
-"bisect run failed: 'git bisect--helper --bisect-state %s' exited with error "
-"code %d"
-msgstr ""
-"二分搜尋執行失敗:“git bisect--helper --bisect-state %s” 以錯誤碼 %d 離開"
+msgid "bisect run failed: 'git bisect %s' exited with error code %d"
+msgstr "二分搜尋執行失敗:“git bisect %s” 以錯誤碼 %d 離開"
 
-#: builtin/bisect--helper.c
-msgid "--bisect-reset requires either no argument or a commit"
-msgstr "--bisect-reset 可以不需要引數,或者得傳入一個提交"
-
-#: builtin/bisect--helper.c
-msgid "--bisect-terms requires 0 or 1 argument"
-msgstr "--bisect-terms 需要 0 或 1 個引數"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires either no argument or a commit"
+msgstr "“%s” 不需要引數,或者得傳入一個提交"
 
-#: builtin/bisect--helper.c
-msgid "--bisect-next requires 0 arguments"
-msgstr "--bisect-next 需要 0 個引數"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 or 1 argument"
+msgstr "“%s” 需要 0 或 1 個引數"
 
-#: builtin/bisect--helper.c
-msgid "--bisect-log requires 0 arguments"
-msgstr "--bisect-log 需要 0 個引數"
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' requires 0 arguments"
+msgstr "“%s” 不需引數"
 
-#: builtin/bisect--helper.c
+#: builtin/bisect.c
 msgid "no logfile given"
 msgstr "未提供日誌檔案"
 
+#: builtin/bisect.c
+#, c-format
+msgid "'%s' failed: no command provided."
+msgstr "“%s” 失敗:沒有提供命令。"
+
+#: builtin/bisect.c
+msgid "need a command"
+msgstr "需要提供命令"
+
+#: builtin/bisect.c builtin/cat-file.c
+#, c-format
+msgid "unknown command: '%s'"
+msgstr "未知命令:“%s”"
+
 #: builtin/blame.c
 msgid "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
-msgstr "git blame [<選項>] [<版本選項>] [<版本>] [--] <檔案>"
+msgstr "git blame [<options>] [<rev-opts>] [<rev>] [--] <file>"
 
 #: builtin/blame.c
 msgid "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
-msgstr "git annotate [<選項>] [<版本選項>] [<版本>] [--] <檔案>"
+msgstr "git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>"
 
 #: builtin/blame.c
 msgid "<rev-opts> are documented in git-rev-list(1)"
-msgstr "<版本選項> 的檔案記錄在 git-rev-list(1) 中"
+msgstr "<rev-opts> 的文件在 git-rev-list(1)"
 
 #: builtin/blame.c
 #, c-format
 msgid "expecting a color: %s"
-msgstr "期望一個顏色:%s"
+msgstr "預期是個顏色:%s"
 
 #: builtin/blame.c
 msgid "must end with a color"
-msgstr "必須以一個顏色結尾"
+msgstr "結尾必須是一個顏色"
 
 #: builtin/blame.c
 #, c-format
 msgid "cannot find revision %s to ignore"
-msgstr "不能找到要忽略的版本 %s"
+msgstr "不能找到要忽略的 %s 修訂版"
 
 #: builtin/blame.c
 msgid "show blame entries as we find them, incrementally"
-msgstr "增量式顯示發現的 blame 條目"
+msgstr "漸進式顯示發現的溯源項目"
 
 #: builtin/blame.c
 msgid "do not show object names of boundary commits (Default: off)"
-msgstr "不要顯示邊界提交的物件名稱(預設值off)"
+msgstr "不要顯示邊界提交的物件名稱(預設值off)"
 
 #: builtin/blame.c
 msgid "do not treat root commits as boundaries (Default: off)"
-msgstr "不將根提交看作邊界(預設值:off)"
+msgstr "不把根提交當作邊界(預設值:off)"
 
 #: builtin/blame.c
 msgid "show work cost statistics"
@@ -3142,7 +3192,7 @@ msgstr "強制顯示進度報告"
 
 #: builtin/blame.c
 msgid "show output score for blame entries"
-msgstr "顯示判斷 blame 條目位移的得分診斷訊息"
+msgstr "顯示溯源項目的輸出得分"
 
 #: builtin/blame.c
 msgid "show original filename (Default: auto)"
@@ -3150,7 +3200,7 @@ msgstr "顯示原始檔案名稱(預設值:auto)"
 
 #: builtin/blame.c
 msgid "show original linenumber (Default: off)"
-msgstr "顯示原始檔案名稱(預設值:off)"
+msgstr "顯示原始列碼(預設值:off)"
 
 #: builtin/blame.c
 msgid "show in a format designed for machine consumption"
@@ -3158,7 +3208,7 @@ msgstr "顯示成適合機器讀取的格式"
 
 #: builtin/blame.c
 msgid "show porcelain format with per-line commit information"
-msgstr "顯示每一列適合機器的提交說明"
+msgstr "顯示包含每一列提交資訊,適合機器讀取的格式"
 
 #: builtin/blame.c
 msgid "use the same output mode as git-annotate (Default: off)"
@@ -3186,15 +3236,15 @@ msgstr "忽略空白差異"
 
 #: builtin/blame.c builtin/log.c
 msgid "rev"
-msgstr "版本"
+msgstr "rev"
 
 #: builtin/blame.c
 msgid "ignore <rev> when blaming"
-msgstr "在執行 blame 動作時忽略 <修訂版>"
+msgstr "在執行溯源動作時忽略 <rev>"
 
 #: builtin/blame.c
 msgid "ignore revisions from <file>"
-msgstr "忽略 <檔案> 中的修訂版"
+msgstr "忽略 <file> 中的修訂版"
 
 #: builtin/blame.c
 msgid "color redundant metadata from previous line differently"
@@ -3202,31 +3252,31 @@ msgstr "使用顏色間隔輸出與前一行不同的重複中介資料"
 
 #: builtin/blame.c
 msgid "color lines by age"
-msgstr "據時間著色"
+msgstr "據時間著色"
 
 #: builtin/blame.c
 msgid "spend extra cycles to find better match"
-msgstr "循ç\92°æ\9b´å¤\9a次以æ\89¾å\88°æ\9b´ä½³ç¬¦å\90\88"
+msgstr "循ç\92°æ\9b´å¤\9a次ä¾\86æ\89¾å\88°æ\9b´ä½³ç¬¦å\90\88é \85ç\9b®"
 
 #: builtin/blame.c
 msgid "use revisions from <file> instead of calling git-rev-list"
-msgstr "使用來自 <檔案> 的修訂集而不是呼叫 git-rev-list"
+msgstr "使用來自 <file> 的修訂集而不是呼叫 git-rev-list"
 
 #: builtin/blame.c
 msgid "use <file>'s contents as the final image"
-msgstr "將 <檔案> 的內容當成是最終 image"
+msgstr "將 <file> 的內容當成是最終印象"
 
 #: builtin/blame.c
 msgid "score"
-msgstr "得分"
+msgstr "score"
 
 #: builtin/blame.c
 msgid "find line copies within and across files"
-msgstr "找到檔案內及跨檔案的複製列"
+msgstr "找到檔案內及跨檔案的列拷貝動作"
 
 #: builtin/blame.c
 msgid "find line movements within and across files"
-msgstr "找到檔案內及跨檔案的移動列"
+msgstr "找到檔案內及跨檔案的列移動動作"
 
 #: builtin/blame.c
 msgid "range"
@@ -3256,45 +3306,47 @@ msgstr "4 年 11 個月前"
 #, c-format
 msgid "file %s has only %lu line"
 msgid_plural "file %s has only %lu lines"
-msgstr[0] "檔案 %s 只有 %lu "
+msgstr[0] "檔案 %s 只有 %lu "
 
 #: builtin/blame.c
 msgid "Blaming lines"
-msgstr "追蹤程式碼行"
+msgstr "溯源文字列"
 
 #: builtin/branch.c
 msgid "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
-msgstr "git branch [<選項>] [-r | -a] [--merged] [--no-merged]"
+msgstr "git branch [<options>] [-r | -a] [--merged] [--no-merged]"
 
 #: builtin/branch.c
 msgid ""
 "git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
 "point>]"
-msgstr "git branch [<選項>] [-f] [--recurse-submodules] <分支名> [<起始點>]"
+msgstr ""
+"git branch [<options>] [-f] [--recurse-submodules] <branch-name> [<start-"
+"point>]"
 
 #: builtin/branch.c
 msgid "git branch [<options>] [-l] [<pattern>...]"
-msgstr "git branch [<選項>] [-l] [<模式>...]"
+msgstr "git branch [<options>] [-l] [<pattern>...]"
 
 #: builtin/branch.c
 msgid "git branch [<options>] [-r] (-d | -D) <branch-name>..."
-msgstr "git branch [<選項>] [-r] (-d | -D) <分支名>..."
+msgstr "git branch [<options>] [-r] (-d | -D) <branch-name>..."
 
 #: builtin/branch.c
 msgid "git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"
-msgstr "git branch [<選項>] (-m | -M) [<舊分支>] <新分支>"
+msgstr "git branch [<options>] (-m | -M) [<old-branch>] <new-branch>"
 
 #: builtin/branch.c
 msgid "git branch [<options>] (-c | -C) [<old-branch>] <new-branch>"
-msgstr "git branch [<選項>] (-c | -C) [<老分支>] <新分支>"
+msgstr "git branch [<options>] (-c | -C) [<old-branch>] <new-branch>"
 
 #: builtin/branch.c
 msgid "git branch [<options>] [-r | -a] [--points-at]"
-msgstr "git branch [<選項>] [-r | -a] [--points-at]"
+msgstr "git branch [<options>] [-r | -a] [--points-at]"
 
 #: builtin/branch.c
 msgid "git branch [<options>] [-r | -a] [--format]"
-msgstr "git branch [<選項>] [-r | -a] [--format]"
+msgstr "git branch [<options>] [-r | -a] [--format]"
 
 #  譯者:保持原換行格式,在輸出時 %s 的替代內容會讓字串變長
 #: builtin/branch.c
@@ -3303,8 +3355,8 @@ msgid ""
 "deleting branch '%s' that has been merged to\n"
 "         '%s', but not yet merged to HEAD."
 msgstr ""
-"將要刪除的分支 '%s' 已經被合併到\n"
-"         '%s',但未合併到 HEAD。"
+"將要刪除的 “%s” 分支已經被合併到\n"
+"         “%s”,但尚未合併到 HEAD。"
 
 #  譯者:保持原換行格式,在輸出時 %s 的替代內容會讓字串變長
 #: builtin/branch.c
@@ -3313,13 +3365,13 @@ msgid ""
 "not deleting branch '%s' that is not yet merged to\n"
 "         '%s', even though it is merged to HEAD."
 msgstr ""
-"並未刪除分支 '%s', 雖然它已經合併到 HEAD,\n"
-"         然而卻尚未被合併到分支 '%s' 。"
+"並未刪除分支 “%s”, 雖然已經合併到 HEAD,\n"
+"         卻尚未被合併至 “%s” 分支。"
 
 #: builtin/branch.c
 #, c-format
 msgid "Couldn't look up commit object for '%s'"
-msgstr "無法查詢 '%s' 指向的提交物件"
+msgstr "無法查詢 “%s” 指向的提交物件"
 
 #: builtin/branch.c
 #, c-format
@@ -3327,12 +3379,12 @@ msgid ""
 "The branch '%s' is not fully merged.\n"
 "If you are sure you want to delete it, run 'git branch -D %s'."
 msgstr ""
-"分支 '%s' 沒有完全合併。\n"
-"如果您確認要刪除它,執行 'git branch -D %s'。"
+"分支 “%s” 沒有完全合併。\n"
+"如果確定要刪除它,請執行 “git branch -D %s”。"
 
 #: builtin/branch.c
 msgid "Update of config-file failed"
-msgstr "更新設定檔案失敗"
+msgstr "更新組態檔案失敗"
 
 #: builtin/branch.c
 msgid "cannot use -a with -d"
@@ -3341,17 +3393,26 @@ msgstr "不能將 -a 和 -d 同時使用"
 #: builtin/branch.c
 #, c-format
 msgid "Cannot delete branch '%s' checked out at '%s'"
-msgstr "無法刪除在「%2$s」簽出的「%1$s」分支"
+msgstr "無法刪除在 “%2$s” 簽出的 “%1$s” 分支"
 
 #: builtin/branch.c
 #, c-format
 msgid "remote-tracking branch '%s' not found."
-msgstr "未能找到遠端追蹤分支 '%s'。"
+msgstr "找不到 “%s” 遠端追蹤分支。"
+
+#: builtin/branch.c
+#, c-format
+msgid ""
+"branch '%s' not found.\n"
+"Did you forget --remote?"
+msgstr ""
+"找不到 “%s” 分支。\n"
+"您可能要加上 --remote?"
 
 #: builtin/branch.c
 #, c-format
 msgid "branch '%s' not found."
-msgstr "分支 '%s' 未發現。"
+msgstr "找不到 “%s” 分支。"
 
 #: builtin/branch.c
 #, c-format
@@ -3365,41 +3426,46 @@ msgstr "已刪除分支 %s(曾為 %s)。\n"
 
 #: builtin/branch.c builtin/tag.c
 msgid "unable to parse format string"
-msgstr "不能解析格式化字串"
+msgstr "無法解析格式化字串"
 
 #: builtin/branch.c
 msgid "could not resolve HEAD"
-msgstr "不能解析 HEAD 提交"
+msgstr "無法解析 HEAD 指針"
 
 #: builtin/branch.c
 #, c-format
 msgid "HEAD (%s) points outside of refs/heads/"
-msgstr "HEAD (%s) 指向 refs/heads/ 之外"
+msgstr "HEAD 指針 (%s) 指向 refs/heads/ 之外"
 
 #: builtin/branch.c
 #, c-format
 msgid "Branch %s is being rebased at %s"
-msgstr "分支 %s 正被重定基底到 %s"
+msgstr "%s 分支正在重定基底至 %s"
 
 #: builtin/branch.c
 #, c-format
 msgid "Branch %s is being bisected at %s"
-msgstr "分支 %s 正被二分搜尋於 %s"
+msgstr "%s 分支正於 %s 進行二分搜尋"
+
+#: builtin/branch.c
+#, c-format
+msgid "HEAD of working tree %s is not updated"
+msgstr "%s 工作區的 HEAD 指針未被更新"
 
 #: builtin/branch.c
 #, c-format
 msgid "Invalid branch name: '%s'"
-msgstr "無效的分支名:'%s'"
+msgstr "分支名稱無效:“%s”"
 
 #: builtin/branch.c
 #, c-format
 msgid "No commit on branch '%s' yet."
-msgstr "分支 '%s' 尚無提交。"
+msgstr "分支 “%s” 尚無提交。"
 
 #: builtin/branch.c
 #, c-format
 msgid "No branch named '%s'."
-msgstr "æ²\92æ\9c\89å\88\86æ\94¯ '%s'。"
+msgstr "æ²\92æ\9c\89å\90\8dç\82º â\80\9c%sâ\80\9d ç\9a\84å\88\86æ\94¯。"
 
 #: builtin/branch.c
 msgid "Branch rename failed"
@@ -3407,30 +3473,30 @@ msgstr "分支重新命名失敗"
 
 #: builtin/branch.c
 msgid "Branch copy failed"
-msgstr "分支複製失敗"
+msgstr "分支拷貝失敗"
 
 #: builtin/branch.c
 #, c-format
 msgid "Created a copy of a misnamed branch '%s'"
-msgstr "已為錯誤命名的分支 '%s' 建立了一個副本"
+msgstr "已為誤命名的 “%s” 分支建立拷貝"
 
 #: builtin/branch.c
 #, c-format
 msgid "Renamed a misnamed branch '%s' away"
-msgstr "已將錯誤命名的分支 '%s' 重新命名"
+msgstr "已更改誤命名的 “%s” 分支的名稱"
 
 #: builtin/branch.c
 #, c-format
 msgid "Branch renamed to %s, but HEAD is not updated!"
-msgstr "分支重新命名為 %s,但 HEAD 沒有更新!"
+msgstr "分支已重新命名為 %s,但 HEAD 指針尚未更新!"
 
 #: builtin/branch.c
 msgid "Branch is renamed, but update of config-file failed"
-msgstr "分支被重新命名,但更新設定檔案失敗"
+msgstr "分支已重新命名,但無法更新組態檔案"
 
 #: builtin/branch.c
 msgid "Branch is copied, but update of config-file failed"
-msgstr "分支已複製,但更新設定檔案失敗"
+msgstr "分支已拷貝,但無法更新組態檔案"
 
 #: builtin/branch.c
 #, c-format
@@ -3439,41 +3505,41 @@ msgid ""
 "  %s\n"
 "Lines starting with '%c' will be stripped.\n"
 msgstr ""
-"請編輯分支的描述\n"
+"請編輯下述分支的描述\n"
 "  %s\n"
-"以 '%c' 開頭的行將被過濾。\n"
+"開頭是 “%c” 的列將被刪除。\n"
 
 #: builtin/branch.c
 msgid "Generic options"
-msgstr "通用選項"
+msgstr "一般性選項"
 
 #: builtin/branch.c
 msgid "show hash and subject, give twice for upstream branch"
-msgstr "顯示雜湊值和主題,若參數出現兩次則顯示上游分支"
+msgstr "顯示雜湊值和主旨,若傳入兩次則顯示上游分支"
 
 #: builtin/branch.c
 msgid "suppress informational messages"
-msgstr "不顯示訊息"
+msgstr "ä¸\8d顯示è³\87è¨\8aè¨\8aæ\81¯"
 
 #: builtin/branch.c builtin/checkout.c builtin/submodule--helper.c
 msgid "set branch tracking configuration"
-msgstr "設定分支追蹤設定"
+msgstr "設定分支追蹤組態"
 
 #: builtin/branch.c
 msgid "do not use"
-msgstr "不要使用"
+msgstr "請勿使用"
 
 #: builtin/branch.c
 msgid "upstream"
-msgstr "上游"
+msgstr "upstream"
 
 #: builtin/branch.c
 msgid "change the upstream info"
-msgstr "改變上游訊息"
+msgstr "變更上游資訊"
 
 #: builtin/branch.c
 msgid "unset the upstream info"
-msgstr "取消上游資訊設定"
+msgstr "取消設定上游資訊"
 
 #: builtin/branch.c
 msgid "use colored output"
@@ -3485,19 +3551,19 @@ msgstr "作用於遠端追蹤分支"
 
 #: builtin/branch.c
 msgid "print only branches that contain the commit"
-msgstr "只列印包含該提交的分支"
+msgstr "只輸出包含此提交的分支"
 
 #: builtin/branch.c
 msgid "print only branches that don't contain the commit"
-msgstr "只列印不包含該提交的分支"
+msgstr "只輸出不包含此提交的分支"
 
 #: builtin/branch.c
 msgid "Specific git-branch actions:"
-msgstr "具體的 git-branch 動作:"
+msgstr "特定的 git-branch 動作:"
 
 #: builtin/branch.c
 msgid "list both remote-tracking and local branches"
-msgstr "å\88\97å\87ºé\81 ç«¯è¿½è¹¤å\8f\8a本機分支"
+msgstr "å\88\97å\87ºé\81 ç«¯è¿½è¹¤å\92\8c本機分支"
 
 #: builtin/branch.c
 msgid "delete fully merged branch"
@@ -3505,31 +3571,35 @@ msgstr "刪除完全合併的分支"
 
 #: builtin/branch.c
 msgid "delete branch (even if not merged)"
-msgstr "刪除分支(即使沒有合併)"
+msgstr "刪除分支(即使尚未合併)"
 
 #: builtin/branch.c
 msgid "move/rename a branch and its reflog"
-msgstr "移動/重新命名一個分支,以及它的引用日誌"
+msgstr "移動或重新命名分支及其引用日誌"
 
 #: builtin/branch.c
 msgid "move/rename a branch, even if target exists"
-msgstr "移動/重新命名一個分支,即使目標已存在"
+msgstr "即使目標已存在,仍移動或重新命名分支"
+
+#: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
+msgid "do not output a newline after empty formatted refs"
+msgstr "在格式化引用結果為空之後,不要輸出換列符號"
 
 #: builtin/branch.c
 msgid "copy a branch and its reflog"
-msgstr "複製分支及其引用日誌"
+msgstr "拷貝分支及其引用日誌"
 
 #: builtin/branch.c
 msgid "copy a branch, even if target exists"
-msgstr "複製一個分支,即使目標已存在"
+msgstr "即使目標已存在仍拷貝分支"
 
 #: builtin/branch.c
 msgid "list branch names"
-msgstr "列出分支名"
+msgstr "列出分支名"
 
 #: builtin/branch.c
 msgid "show current branch name"
-msgstr "顯示目前分支名"
+msgstr "顯示目前分支名"
 
 #: builtin/branch.c builtin/submodule--helper.c
 msgid "create the branch's reflog"
@@ -3537,7 +3607,7 @@ msgstr "建立分支的引用日誌"
 
 #: builtin/branch.c
 msgid "edit the description for the branch"
-msgstr "標記分支的描述"
+msgstr "編輯分支的描述"
 
 #: builtin/branch.c
 msgid "force creation, move/rename, deletion"
@@ -3545,27 +3615,27 @@ msgstr "強制建立、移動/重新命名、刪除"
 
 #: builtin/branch.c
 msgid "print only branches that are merged"
-msgstr "只列印已經合併的分支"
+msgstr "只輸出已經合併的分支"
 
 #: builtin/branch.c
 msgid "print only branches that are not merged"
-msgstr "只列印尚未合併的分支"
+msgstr "只輸出尚未合併的分支"
 
 #: builtin/branch.c
 msgid "list branches in columns"
-msgstr "以å\88\97ç\9a\84æ\96¹å¼\8f顯示å\88\86æ\94¯"
+msgstr "以è¡\8cç\9a\84å½¢å¼\8få\88\97å\87ºå\88\86æ\94¯"
 
 #: builtin/branch.c builtin/for-each-ref.c builtin/notes.c builtin/tag.c
 msgid "object"
-msgstr "物件"
+msgstr "object"
 
 #: builtin/branch.c
 msgid "print only branches of the object"
-msgstr "只列印指向該物件的分支"
+msgstr "只輸出指向此物件的分支"
 
 #: builtin/branch.c builtin/for-each-ref.c builtin/tag.c
 msgid "sorting and filtering are case insensitive"
-msgstr "排序和過濾屬於大小寫不敏感"
+msgstr "排序和過濾不區分大小寫"
 
 #: builtin/branch.c builtin/ls-files.c
 msgid "recurse through submodules"
@@ -3582,14 +3652,14 @@ msgstr "無法將 HEAD 解析為有效引用。"
 
 #: builtin/branch.c builtin/clone.c
 msgid "HEAD not found below refs/heads!"
-msgstr "HEAD æ²\92æ\9c\89ä½\8dæ\96¼ /refs/heads ä¹\8bä¸\8b!"
+msgstr "HEAD æ\8c\87é\87\9dä¸\8då\9c¨ /refs/heads ä¸­!"
 
 #: builtin/branch.c
 msgid ""
 "branch with --recurse-submodules can only be used if submodule."
 "propagateBranches is enabled"
 msgstr ""
-"有 --recurse-submodules 的分支只能在啟用 submodule.propagateBranches 時使用"
+"有 --recurse-submodules 的分支只能在啟用 submodule.propagateBranches 時使用"
 
 #: builtin/branch.c
 msgid "--recurse-submodules can only be used to create branches"
@@ -3597,79 +3667,79 @@ msgstr "--recurse-submodules 只能用來建立分支"
 
 #: builtin/branch.c
 msgid "branch name required"
-msgstr "必須提供分支名"
+msgstr "必須提供分支名"
 
 #: builtin/branch.c
 msgid "Cannot give description to detached HEAD"
-msgstr "不能向分離開頭指標提供描述"
+msgstr "無法向分離 HEAD 指針提供描述"
 
 #: builtin/branch.c
 msgid "cannot edit description of more than one branch"
-msgstr "不能為一個以上的分支編輯描述"
+msgstr "無法編輯超過一個分支的描述"
 
 #: builtin/branch.c
 msgid "cannot copy the current branch while not on any."
-msgstr "無法複製目前分支因為不處於任何分支上。"
+msgstr "不在任何分支上,無法拷貝目前分支。"
 
 #: builtin/branch.c
 msgid "cannot rename the current branch while not on any."
-msgstr "無法重新命名目前分支因為不處於任何分支上。"
+msgstr "不在任何分支上,無法重新命名目前分支。"
 
 #: builtin/branch.c
 msgid "too many branches for a copy operation"
-msgstr "為複製動作提供了太多的分支名"
+msgstr "要進行拷貝動作的分支太多"
 
 #: builtin/branch.c
 msgid "too many arguments for a rename operation"
-msgstr "為重新命名動作提供了太多的參數"
+msgstr "傳入重新命名動作的引數太多"
 
 #: builtin/branch.c
 msgid "too many arguments to set new upstream"
-msgstr "為設定新上游提供了太多的參數"
+msgstr "要設定新上游的引數太多"
 
 #: builtin/branch.c
 #, c-format
 msgid ""
 "could not set upstream of HEAD to %s when it does not point to any branch."
-msgstr "無法設定 HEAD 的上游為 %s,因為 HEAD 沒有指向任何分支。"
+msgstr "無法將 HEAD 的上游設為 %s:其未指向任何分支。"
 
 #: builtin/branch.c
 #, c-format
 msgid "no such branch '%s'"
-msgstr "沒有此分支 '%s'"
+msgstr "無 “%s” 分支"
 
 #: builtin/branch.c
 #, c-format
 msgid "branch '%s' does not exist"
-msgstr "分支 '%s' 不存在"
+msgstr "沒有 “%s” 分支"
 
 #: builtin/branch.c
 msgid "too many arguments to unset upstream"
-msgstr "為取消上游設定動作提供了太多的參數"
+msgstr "要取消設定上游的引數太多"
 
 #: builtin/branch.c
 msgid "could not unset upstream of HEAD when it does not point to any branch."
-msgstr "在 HEAD 的上游未指向任何分支時無法取消設定。"
+msgstr "無法取消設定 HEAD 的上游:其未指向任何分支。"
 
 #: builtin/branch.c
 #, c-format
 msgid "Branch '%s' has no upstream information"
-msgstr "分支 '%s' 沒有上游訊息"
+msgstr "分支 “%s” 沒有上游資訊"
 
 #: builtin/branch.c
 msgid ""
 "The -a, and -r, options to 'git branch' do not take a branch name.\n"
 "Did you mean to use: -a|-r --list <pattern>?"
 msgstr ""
-"'git branch' 的 -a 和 -r 選項不帶一個分支名。\n"
-"您是否想要使用:-a|-r --list <模式>?"
+"“git branch” 的 -a 和 -r 選項不取分支名稱。\n"
+"您是想使用:-a|-r --list <pattern> 嗎?"
 
 #: builtin/branch.c
 msgid ""
 "the '--set-upstream' option is no longer supported. Please use '--track' or "
 "'--set-upstream-to' instead."
 msgstr ""
-"不再支援選項 '--set-upstream'。請使用 '--track' 或 '--set-upstream-to'。"
+"不再支援選項 “--set-upstream”。請改用 “--track” 或 “--set-upstream-to”。"
 
 #: builtin/bugreport.c
 msgid "git version:\n"
@@ -3678,7 +3748,7 @@ msgstr "git 版本:\n"
 #: builtin/bugreport.c
 #, c-format
 msgid "uname() failed with error '%s' (%d)\n"
-msgstr "uname() 失敗,錯誤:「%s」(%d)\n"
+msgstr "uname() 失敗,錯誤:“%s” (%d)\n"
 
 #: builtin/bugreport.c
 msgid "compiler info: "
@@ -3690,7 +3760,7 @@ msgstr "libc 資訊: "
 
 #: builtin/bugreport.c
 msgid "not run from a git repository - no hooks to show\n"
-msgstr "ä¸\8dæ\98¯å¾\9e git ç\89\88æ\9c¬åº«å\9f·è¡\8c - 沒有可顯示的掛鉤\n"
+msgstr "ä¸\8dæ\98¯å\9c¨ git ç\89\88æ\9c¬åº«å\9f·è¡\8c â\80\94 沒有可顯示的掛鉤\n"
 
 #: builtin/bugreport.c
 msgid ""
@@ -3719,15 +3789,15 @@ msgid ""
 "You can delete any lines you don't wish to share.\n"
 msgstr ""
 "感謝您填寫 Git 臭蟲報告!\n"
-"請回答下列問題,以讓我們能夠了解您的問題。\n"
+"請回答下列詢問,協助我們了解您的問題。\n"
 "\n"
 "臭蟲發生前,您做了什麼?(重現問題的步驟)\n"
 "\n"
-"你原本期望發生什麼?(期望行為)\n"
+"原本您預期發生什麼?(預期行為)\n"
 "\n"
 "那實際上發生了什麼?(實際行為)\n"
 "\n"
-"期望行為跟實際發生的行為有什麼不同?\n"
+"預期發生的行為,跟實際發生的行為有什麼不同?\n"
 "\n"
 "其他您想加入的:\n"
 "\n"
@@ -3737,25 +3807,25 @@ msgstr ""
 #: builtin/bugreport.c builtin/commit.c builtin/fast-export.c builtin/rebase.c
 #: parse-options.h
 msgid "mode"
-msgstr "模式"
+msgstr "mode"
 
 #: builtin/bugreport.c
 msgid ""
 "create an additional zip archive of detailed diagnostics (default 'stats')"
-msgstr "建ç«\8b詳細診æ\96·è³\87è¨\8aç\9a\84é¡\8då¤\96 zip å°\81å­\98æª\94æ¡\88ï¼\88é \90設å\80¼æ\98¯ “stats”)"
+msgstr "å\8f¦å¤\96建ç«\8bæ\9c\89詳細診æ\96·è³\87è¨\8aç\9a\84 ZIP å°\81å­\98æª\94ï¼\88é \90設å\80¼ “stats”)"
 
 #: builtin/bugreport.c
 msgid "specify a destination for the bugreport file(s)"
-msgstr "指定臭蟲報告檔案的目的地"
+msgstr "指定臭蟲報告檔案的目的地"
 
 #: builtin/bugreport.c
 msgid "specify a strftime format suffix for the filename(s)"
-msgstr "指定檔名,strftime 格式的後綴"
+msgstr "指定用於檔名的 strftime 格式後綴"
 
 #: builtin/bugreport.c builtin/diagnose.c
 #, c-format
 msgid "could not create leading directories for '%s'"
-msgstr "無法建立 '%s' 的前置目錄"
+msgstr "無法建立 “%s” 的前置目錄"
 
 #: builtin/bugreport.c builtin/diagnose.c
 #, c-format
@@ -3778,16 +3848,14 @@ msgstr "無法寫入 %s"
 #: builtin/bugreport.c
 #, c-format
 msgid "Created new report at '%s'.\n"
-msgstr "已在「%s」建立新報告。\n"
+msgstr "已在 “%s” 建立新報告。\n"
 
 #: builtin/bundle.c
 msgid ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 msgstr ""
-"git bundle create [-q | --quiet | --progress | --all-progress] [--all-"
-"progress-implied]\n"
+"git bundle create [-q | --quiet | --progress]\n"
 "                  [--version=<version>] <file> <git-rev-list-args>"
 
 #: builtin/bundle.c
@@ -3796,27 +3864,31 @@ msgstr "git bundle verify [-q | --quiet] <file>"
 
 #: builtin/bundle.c
 msgid "git bundle list-heads <file> [<refname>...]"
-msgstr "git bundle list-heads <檔案> [<引用名稱>...]"
+msgstr "git bundle list-heads <file> [<refname>...]"
 
 #: builtin/bundle.c
 msgid "git bundle unbundle [--progress] <file> [<refname>...]"
 msgstr "git bundle unbundle [--progress] <file> [<refname>...]"
 
+#: builtin/bundle.c
+msgid "need a <file> argument"
+msgstr "需要提供 <file> 引數"
+
 #: builtin/bundle.c builtin/pack-objects.c
 msgid "do not show progress meter"
-msgstr "不顯示進度"
+msgstr "不顯示進度"
 
 #: builtin/bundle.c builtin/pack-objects.c
 msgid "show progress meter"
-msgstr "顯示進度"
+msgstr "顯示進度"
 
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "show progress meter during object writing phase"
-msgstr "在物件寫入階段顯示進度表"
+#: builtin/bundle.c
+msgid "historical; same as --progress"
+msgstr "歷史遺留選項;和 --progress 相同"
 
-#: builtin/bundle.c builtin/pack-objects.c
-msgid "similar to --all-progress when progress meter is shown"
-msgstr "當進度表顯示時類似於 --all-progress"
+#: builtin/bundle.c
+msgid "historical; does nothing"
+msgstr "歷史遺留選項;沒有作用"
 
 #: builtin/bundle.c
 msgid "specify bundle format version"
@@ -3841,12 +3913,12 @@ msgstr "需要版本庫才能拆分套件包。"
 
 #: builtin/bundle.c
 msgid "Unbundling objects"
-msgstr "正在解包物件"
+msgstr "正在拆分物件"
 
 #: builtin/cat-file.c merge-recursive.c
 #, c-format
 msgid "cannot read object %s '%s'"
-msgstr "不能讀取物件 %s '%s'"
+msgstr "無法讀取物件 %s “%s”"
 
 #: builtin/cat-file.c
 msgid "flush is only for --buffer mode"
@@ -3859,7 +3931,7 @@ msgstr "輸入中沒有命令"
 #: builtin/cat-file.c
 #, c-format
 msgid "whitespace before command: '%s'"
-msgstr "命令前空格:「%s」"
+msgstr "命令前有空格:“%s”"
 
 #: builtin/cat-file.c
 #, c-format
@@ -3871,11 +3943,6 @@ msgstr "%s 需要引數"
 msgid "%s takes no arguments"
 msgstr "%s 不取引數"
 
-#: builtin/cat-file.c
-#, c-format
-msgid "unknown command: '%s'"
-msgstr "未知命令:「%s」"
-
 #: builtin/cat-file.c
 msgid "only one batch option may be specified"
 msgstr "只能指定一個批次處理選項"
@@ -3926,7 +3993,7 @@ msgstr "美化輸出 <object> 的內容"
 
 #: builtin/cat-file.c
 msgid "Emit [broken] object attributes"
-msgstr "輸出 [損壞的] 物件屬性"
+msgstr "輸出 [損壞的] ([broken]) 物件屬性"
 
 #: builtin/cat-file.c
 msgid "show object type (one of 'blob', 'tree', 'commit', 'tag', ...)"
@@ -3958,15 +4025,15 @@ msgstr "類似 --batch 但不輸出 <contents>"
 
 #: builtin/cat-file.c
 msgid "stdin is NUL-terminated"
-msgstr "標準輸入以 NUL 字元終止"
+msgstr "stdin 以 NUL 字元終止"
 
 #: builtin/cat-file.c
 msgid "read commands from stdin"
-msgstr "從標準輸入讀取命令"
+msgstr "從 stdin 讀取命令"
 
 #: builtin/cat-file.c
 msgid "with --batch[-check]: ignores stdin, batches all known objects"
-msgstr "傳入 --batch[-check]:忽略標準輸入,批次處理所有已知物件"
+msgstr "傳入 --batch[-check]:忽略 stdin,批次處理所有已知物件"
 
 #: builtin/cat-file.c
 msgid "Change or optimize batch output"
@@ -3978,21 +4045,21 @@ msgstr "緩衝 --batch 的輸出"
 
 #: builtin/cat-file.c
 msgid "follow in-tree symlinks"
-msgstr "追蹤樹中的符號連結"
+msgstr "追蹤樹狀物件中的符號連結"
 
 #: builtin/cat-file.c
 msgid "do not order objects before emitting them"
-msgstr "不要在輸出物件前排序"
+msgstr "不要在輸出前排序物件"
 
 #: builtin/cat-file.c
 msgid ""
 "Emit object (blob or tree) with conversion or filter (stand-alone, or with "
 "batch)"
-msgstr "轉換或過濾後輸出物件(blob 或樹)(單獨或批次處理)"
+msgstr "轉換或過濾後輸出物件 (blob 或 tree)(單獨或批次處理)"
 
 #: builtin/cat-file.c
 msgid "run textconv on object's content"
-msgstr "å\9c¨ç\89©ä»¶å\85§å®¹å\9f·è¡\8c textconv"
+msgstr "å°\8dç\89©ä»¶å\85§å®¹é\80²è¡\8cæ\96\87å­\97è½\89æ\8f\9b (textconv)"
 
 #: builtin/cat-file.c
 msgid "run filters on object's content"
@@ -4009,7 +4076,7 @@ msgstr "請在 (--textconv | --filters) 使用 <path>,而非 “batch”"
 #: builtin/cat-file.c
 #, c-format
 msgid "'%s=<%s>' needs '%s' or '%s'"
-msgstr "「%s=<%s>」需要「%s」或「%s」"
+msgstr "“%s=<%s>” 需要 “%s” 或 “%s”"
 
 #: builtin/cat-file.c
 msgid "path|tree-ish"
@@ -4018,12 +4085,12 @@ msgstr "path|tree-ish"
 #: builtin/cat-file.c
 #, c-format
 msgid "'%s' requires a batch mode"
-msgstr "「%s」需要批次處理模式"
+msgstr "“%s” 需要批次處理模式"
 
 #: builtin/cat-file.c
 #, c-format
 msgid "'-%c' is incompatible with batch mode"
-msgstr "「-%c」與批次處理模式不相容"
+msgstr "“-%c” 與批次處理模式不相容"
 
 #: builtin/cat-file.c
 msgid "batch modes take no arguments"
@@ -4032,12 +4099,12 @@ msgstr "批次處理模式不取引數"
 #: builtin/cat-file.c
 #, c-format
 msgid "<rev> required with '%s'"
-msgstr "<rev> 需要搭配「%s」"
+msgstr "“%s” 需要 <rev>"
 
 #: builtin/cat-file.c
 #, c-format
 msgid "<object> required with '-%c'"
-msgstr "<object> 需要搭配「-%c」"
+msgstr "“-%c” 需要 <object>"
 
 #: builtin/cat-file.c
 #, c-format
@@ -4045,16 +4112,22 @@ msgid "only two arguments allowed in <type> <object> mode, not %d"
 msgstr "只允許在 <type> <object> 模式傳入兩個引數,但傳了 %d 個"
 
 #: builtin/check-attr.c
-msgid "git check-attr [-a | --all | <attr>...] [--] <pathname>..."
-msgstr "git check-attr [-a | --all | <屬性>...] [--] <路徑名>..."
+msgid ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
+msgstr ""
+"git check-attr [--source <tree-ish>] [-a | --all | <attr>...] [--] "
+"<pathname>..."
 
 #: builtin/check-attr.c
-msgid "git check-attr --stdin [-z] [-a | --all | <attr>...]"
-msgstr "git check-attr --stdin [-z] [-a | --all | <屬性>...]"
+msgid ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
+msgstr ""
+"git check-attr --stdin [-z] [--source <tree-ish>] [-a | --all | <attr>...]"
 
 #: builtin/check-attr.c
 msgid "report all attributes set on file"
-msgstr "å ±å\91\8a設定在檔案上的所有屬性"
+msgstr "å\9b\9eå ±設定在檔案上的所有屬性"
 
 #: builtin/check-attr.c
 msgid "use .gitattributes only from the index"
@@ -4062,11 +4135,19 @@ msgstr "只使用索引中的 .gitattributes"
 
 #: builtin/check-attr.c builtin/check-ignore.c builtin/hash-object.c
 msgid "read file names from stdin"
-msgstr "從標準輸入讀出檔案名"
+msgstr "從 stdin 讀出檔案名稱"
 
 #: builtin/check-attr.c builtin/check-ignore.c
 msgid "terminate input and output records by a NUL character"
-msgstr "輸入和輸出的紀錄使用 NUL 字元終結"
+msgstr "輸入和輸出的紀錄使用 NUL 字元終止"
+
+#: builtin/check-attr.c
+msgid "<tree-ish>"
+msgstr "<tree-ish>"
+
+#: builtin/check-attr.c
+msgid "which tree-ish to check attributes at"
+msgstr "要用哪一個樹狀物件檢查屬性"
 
 #: builtin/check-ignore.c builtin/checkout.c builtin/gc.c builtin/worktree.c
 msgid "suppress progress reporting"
@@ -4074,7 +4155,7 @@ msgstr "不顯示進度報告"
 
 #: builtin/check-ignore.c
 msgid "show non-matching input paths"
-msgstr "顯示符合的輸入路徑"
+msgstr "顯示符合的輸入路徑"
 
 #: builtin/check-ignore.c
 msgid "ignore index when checking"
@@ -4082,11 +4163,11 @@ msgstr "檢查時忽略索引"
 
 #: builtin/check-ignore.c
 msgid "cannot specify pathnames with --stdin"
-msgstr "不能同時指定路徑及 --stdin 參數"
+msgstr "無法同時指定路徑名稱及 --stdin"
 
 #: builtin/check-ignore.c
 msgid "-z only makes sense with --stdin"
-msgstr "-z é\9c\80è¦\81å\92\8c --stdin å\8f\83æ\95¸å\85±用才有意義"
+msgstr "-z é\9c\80è¦\81å\92\8c --stdin å\90\8cæ\99\82使用才有意義"
 
 #: builtin/check-ignore.c
 msgid "no path specified"
@@ -4094,11 +4175,11 @@ msgstr "未指定路徑"
 
 #: builtin/check-ignore.c
 msgid "--quiet is only valid with a single pathname"
-msgstr "å\8f\83æ\95¸ --quiet å\8fªå\9c¨æ\8f\90ä¾\9bä¸\80å\80\8bè·¯å¾\91å\90\8d時有效"
+msgstr "å¼\95æ\95¸ --quiet å\8fªå\9c¨æ\8f\90ä¾\9bä¸\80å\80\8bè·¯å¾\91å\90\8d稱時有效"
 
 #: builtin/check-ignore.c
 msgid "cannot have both --quiet and --verbose"
-msgstr "不能同時提供 --quiet 和 --verbose 參數"
+msgstr "無法同時傳入 --quiet 和 --verbose"
 
 #: builtin/check-ignore.c
 msgid "--non-matching is only valid with --verbose"
@@ -4106,41 +4187,41 @@ msgstr "--non-matching 選項只在使用 --verbose 時有效"
 
 #: builtin/check-mailmap.c
 msgid "git check-mailmap [<options>] <contact>..."
-msgstr "git check-mailmap [<選項>] <聯繫位址>..."
+msgstr "git check-mailmap [<options>] <contact>..."
 
 #: builtin/check-mailmap.c
 msgid "also read contacts from stdin"
-msgstr "還從標準輸入讀取聯繫位址"
+msgstr "亦從 stdin 讀取聯絡地址"
 
 #: builtin/check-mailmap.c
 #, c-format
 msgid "unable to parse contact: %s"
-msgstr "不能解析聯繫位址:%s"
+msgstr "無法解析聯絡地址:%s"
 
 #: builtin/check-mailmap.c
 msgid "no contacts specified"
-msgstr "æ\9cªæ\8c\87å®\9aè\81¯ç¹«ä½\8d址"
+msgstr "æ\9cªæ\8c\87å®\9aè\81¯çµ¡å\9c°址"
 
 #: builtin/checkout--worker.c
 msgid "git checkout--worker [<options>]"
-msgstr "git checkout--worker [<選項>]"
+msgstr "git checkout--worker [<options>]"
 
 #: builtin/checkout--worker.c builtin/checkout-index.c builtin/column.c
 #: builtin/submodule--helper.c builtin/worktree.c
 msgid "string"
-msgstr "字串"
+msgstr "string"
 
 #: builtin/checkout--worker.c builtin/checkout-index.c
 msgid "when creating files, prepend <string>"
-msgstr "å\9c¨å»ºç«\8bæª\94æ¡\88æ\99\82ï¼\8cå\9c¨å\89\8dé\9d¢å\8a ä¸\8a <å­\97串>"
+msgstr "建ç«\8bæª\94æ¡\88æ\99\82ï¼\8cå\9c¨å\89\8dé\9d¢å\8a ä¸\8a <string>"
 
 #: builtin/checkout-index.c
 msgid "git checkout-index [<options>] [--] [<file>...]"
-msgstr "git checkout-index [<選項>] [--] [<檔案>...]"
+msgstr "git checkout-index [<options>] [--] [<file>...]"
 
 #: builtin/checkout-index.c
 msgid "stage should be between 1 and 3 or all"
-msgstr "索引值應該取值 1 到 3 或者 all"
+msgstr "stage 應該是 1 到 3 的值,或者是 all"
 
 #: builtin/checkout-index.c
 msgid "check out all files in the index"
@@ -4164,11 +4245,11 @@ msgstr "不簽出新檔案"
 
 #: builtin/checkout-index.c
 msgid "update stat information in the index file"
-msgstr "更新索引檔案的狀態訊息"
+msgstr "更新索引檔案的狀態訊息"
 
 #: builtin/checkout-index.c
 msgid "read list of paths from the standard input"
-msgstr "從標準輸入讀取路徑列表"
+msgstr "從標準輸入讀取路徑清單"
 
 #: builtin/checkout-index.c
 msgid "write the content to temporary files"
@@ -4180,49 +4261,49 @@ msgstr "從指定暫存區中拷出檔案"
 
 #: builtin/checkout.c
 msgid "git checkout [<options>] <branch>"
-msgstr "git checkout [<選項>] <分支>"
+msgstr "git checkout [<options>] <branch>"
 
 #: builtin/checkout.c
 msgid "git checkout [<options>] [<branch>] -- <file>..."
-msgstr "git checkout [<選項>] [<分支>] -- <檔案>..."
+msgstr "git checkout [<options>] [<branch>] -- <file>..."
 
 #: builtin/checkout.c
 msgid "git switch [<options>] [<branch>]"
-msgstr "git switch [<選項>] [<分支>]"
+msgstr "git switch [<options>] [<branch>]"
 
 #: builtin/checkout.c
 msgid "git restore [<options>] [--source=<branch>] <file>..."
-msgstr "git restore [<選項>] [--source=<分支>] <檔案>..."
+msgstr "git restore [<options>] [--source=<branch>] <file>..."
 
 #: builtin/checkout.c
 #, c-format
 msgid "path '%s' does not have our version"
-msgstr "路徑 '%s' 沒有我們的版本"
+msgstr "“%s” 路徑沒有我們的版本"
 
 #: builtin/checkout.c
 #, c-format
 msgid "path '%s' does not have their version"
-msgstr "路徑 '%s' 沒有他們的版本"
+msgstr "“%s” 路徑沒有他們的版本"
 
 #: builtin/checkout.c
 #, c-format
 msgid "path '%s' does not have all necessary versions"
-msgstr "路徑 '%s' 沒有全部必需的版本"
+msgstr "“%s” 路徑沒有所有必須的版本"
 
 #: builtin/checkout.c
 #, c-format
 msgid "path '%s' does not have necessary versions"
-msgstr "路徑 '%s' 沒有必需的版本"
+msgstr "“%s” 路徑沒有必須的版本"
 
 #: builtin/checkout.c
 #, c-format
 msgid "path '%s': cannot merge"
-msgstr "path '%s':無法合併"
+msgstr "path “%s”:無法合併"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Unable to add merge result for '%s'"
-msgstr "無法為 '%s' 新增合併結果"
+msgstr "無法為 “%s” 加上合併結果"
 
 #: builtin/checkout.c
 #, c-format
@@ -4240,41 +4321,41 @@ msgstr[0] "從 %2$s 更新了 %1$d 個路徑"
 #, c-format
 msgid "Updated %d path from the index"
 msgid_plural "Updated %d paths from the index"
-msgstr[0] "å¾\9eç´¢å¼\95å\8d\80æ\9b´æ\96°äº\86 %d 個路徑"
+msgstr[0] "å·²å¾\9eç´¢å¼\95å\8d\80æ\9b´æ\96° %d 個路徑"
 
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' cannot be used with updating paths"
-msgstr "'%s' 不能在更新路徑時使用"
+msgstr "無法在更新路徑時使用 “%s”"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Cannot update paths and switch to branch '%s' at the same time."
-msgstr "不能同時更新路徑並切換到分支'%s'。"
+msgstr "無法同時更新路徑和切換至 “%s” 分支。"
 
 #: builtin/checkout.c
 #, c-format
 msgid "neither '%s' or '%s' is specified"
-msgstr "'%s' 或 '%s' 都沒有指定"
+msgstr "“%s” 或 “%s” 皆未指定"
 
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' must be used when '%s' is not specified"
-msgstr "未指定 '%2$s' 時,必須使用 '%1$s'"
+msgstr "未指定 “%2$s” 時,必須使用 “%1$s”"
 
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' or '%s' cannot be used with %s"
-msgstr "'%s' 或 '%s' 不能和 %s 一起使用"
+msgstr "“%s” 或 “%s” 無法與 %s 一起使用"
 
 #: builtin/checkout.c
 #, c-format
 msgid "path '%s' is unmerged"
-msgstr "路徑 '%s' 未合併"
+msgstr "路徑 “%s” 未合併"
 
 #: builtin/checkout.c
 msgid "you need to resolve your current index first"
-msgstr "您需要先解決目前索引的衝突"
+msgstr "您需要先解決目前索引的衝突"
 
 #: builtin/checkout.c
 #, c-format
@@ -4282,13 +4363,13 @@ msgid ""
 "cannot continue with staged changes in the following files:\n"
 "%s"
 msgstr ""
-"不能繼續,下列檔案有暫存的修改:\n"
+"無法繼續,下列檔案有暫存的更動:\n"
 "%s"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Can not do reflog for '%s': %s\n"
-msgstr "不能對 '%s' 執行 reflog 動作:%s\n"
+msgstr "無法對 “%s” 執行 reflog 動作:%s\n"
 
 #: builtin/checkout.c
 msgid "HEAD is now at"
@@ -4296,38 +4377,38 @@ msgstr "HEAD 目前位於"
 
 #: builtin/checkout.c builtin/clone.c t/helper/test-fast-rebase.c
 msgid "unable to update HEAD"
-msgstr "不能更新 HEAD"
+msgstr "無法更新 HEAD"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Reset branch '%s'\n"
-msgstr "重設分支 '%s'\n"
+msgstr "重設分支 “%s”\n"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Already on '%s'\n"
-msgstr "已經位於 '%s'\n"
+msgstr "已經位於 “%s”\n"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Switched to and reset branch '%s'\n"
-msgstr "å\88\87æ\8f\9b並é\87\8d設å\88\86æ\94¯ '%s'\n"
+msgstr "å·²å\88\87æ\8f\9b並é\87\8d設å\88\86æ\94¯ â\80\9c%sâ\80\9d\n"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Switched to a new branch '%s'\n"
-msgstr "å\88\87æ\8f\9bå\88°ä¸\80å\80\8bæ\96°å\88\86æ\94¯ '%s'\n"
+msgstr "å·²å\88\87æ\8f\9bè\87³æ\96°å\88\86æ\94¯ â\80\9c%sâ\80\9d\n"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Switched to branch '%s'\n"
-msgstr "å\88\87æ\8f\9bå\88°å\88\86æ\94¯ '%s'\n"
+msgstr "å·²å\88\87æ\8f\9bè\87³å\88\86æ\94¯ â\80\9c%sâ\80\9d\n"
 
 #  譯者:請維持前導空格
 #: builtin/checkout.c
 #, c-format
 msgid " ... and %d more.\n"
-msgstr " ... 及其它 %d 個。\n"
+msgstr " …… 及其它 %d 個。\n"
 
 #: builtin/checkout.c
 #, c-format
@@ -4342,7 +4423,8 @@ msgid_plural ""
 "\n"
 "%s\n"
 msgstr[0] ""
-"警告:您正丟下 %d 個提交,未和任何分支關聯:\n"
+"警告:您正丟下 %d 個\n"
+"未和任何分支關聯的提交:\n"
 "\n"
 "%s\n"
 
@@ -4361,23 +4443,23 @@ msgid_plural ""
 " git branch <new-branch-name> %s\n"
 "\n"
 msgstr[0] ""
-"如果您想要透過建立新分支儲存它,這可能是一個好時候。\n"
-"如下動作:\n"
+"如果您想要透過建立新分支留下這些提交,\n"
+"現在很適合執行:\n"
 "\n"
-" git branch <新分支名> %s\n"
+" git branch <新分支名> %s\n"
 "\n"
 
 #: builtin/checkout.c
 msgid "internal error in revision walk"
-msgstr "在版本遍歷時遇到內部錯誤"
+msgstr "在修訂版遍歷時遇到內部錯誤"
 
 #: builtin/checkout.c
 msgid "Previous HEAD position was"
-msgstr "之前的 HEAD 位置是"
+msgstr "之前的 HEAD 指針位置在"
 
 #: builtin/checkout.c
 msgid "You are on a branch yet to be born"
-msgstr "您位於一個尚未初始化的分支"
+msgstr "您位於一個尚未初始化的分支"
 
 #: builtin/checkout.c
 #, c-format
@@ -4385,7 +4467,7 @@ msgid ""
 "'%s' could be both a local file and a tracking branch.\n"
 "Please use -- (and optionally --no-guess) to disambiguate"
 msgstr ""
-"'%s' 既可以是一個本機檔案,也可以是一個追蹤分支。\n"
+"“%s” 既可以是本機檔案,也可以是追蹤分支。\n"
 "請使用 --(和可選的 --no-guess)來消除歧義"
 
 #: builtin/checkout.c
@@ -4399,18 +4481,19 @@ msgid ""
 "one remote, e.g. the 'origin' remote, consider setting\n"
 "checkout.defaultRemote=origin in your config."
 msgstr ""
-"如果您想要簽出一個遠端追蹤分支,例如 'origin',您可以\n"
-"使用 --track 選項寫出全名:\n"
+"如果您想要簽出遠端追蹤分支,例如 “origin”,\n"
+"您可以使用 --track 選項寫出全名:\n"
 "\n"
 "    git checkout --track origin/<name>\n"
 "\n"
-"如果您總是喜歡使用模糊的簡短分支名 <name>,而不喜歡如 'origin' 的遠端\n"
-"版本庫名,可以在設定中設定 checkout.defaultRemote=origin。"
+"如果您平時比較想要使用模糊的簡短分支名稱 <name>,\n"
+"而不太想寫如 “origin” 的遠端版本庫名稱,\n"
+"可以在組態中設定 checkout.defaultRemote=origin。"
 
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' matched multiple (%d) remote tracking branches"
-msgstr "'%s' 符合多個 (%d) 遠端追蹤分支"
+msgstr "“%s” 符合多個 (%d) 遠端追蹤分支"
 
 #: builtin/checkout.c
 msgid "only one reference expected"
@@ -4419,7 +4502,7 @@ msgstr "預期只有一個引用"
 #: builtin/checkout.c
 #, c-format
 msgid "only one reference expected, %d given."
-msgstr "只有一個引用,卻提供了 %d 個。"
+msgstr "預期只有一個引用,卻提供了 %d 個。"
 
 #: builtin/checkout.c builtin/worktree.c
 #, c-format
@@ -4429,112 +4512,112 @@ msgstr "無效引用:%s"
 #: builtin/checkout.c
 #, c-format
 msgid "reference is not a tree: %s"
-msgstr "引用不是一個樹:%s"
+msgstr "引用不是樹狀物件:%s"
 
 #: builtin/checkout.c
 #, c-format
 msgid "a branch is expected, got tag '%s'"
-msgstr "期望一個分支,得到標籤 '%s'"
+msgstr "預期收到分支,卻收到標籤 “%s”"
 
 #: builtin/checkout.c
 #, c-format
 msgid "a branch is expected, got remote branch '%s'"
-msgstr "期望一個分支,得到遠端分支 '%s'"
+msgstr "預期收到分支,卻收到遠端分支 “%s”"
 
 #: builtin/checkout.c
 #, c-format
 msgid "a branch is expected, got '%s'"
-msgstr "期望一個分支,得到 '%s'"
+msgstr "預期收到分支,卻收到 “%s”"
 
 #: builtin/checkout.c
 #, c-format
 msgid "a branch is expected, got commit '%s'"
-msgstr "期望一個分支,得到提交 '%s'"
+msgstr "預期收到分支,卻收到提交 “%s”"
 
 #: builtin/checkout.c
 msgid ""
 "If you want to detach HEAD at the commit, try again with the --detach option."
-msgstr "è\8b¥æ\82¨æ\83³è¦\81å\88\86é\9b¢æ\8f\90交ç\9a\84 HEAD,請傳入 --detach 選項重試。"
+msgstr "è\8b¥æ\82¨æ\83³è¦\81å\9c¨æ­¤æ\8f\90交å\88\86é\9b¢ HEAD æ\8c\87é\87\9d,請傳入 --detach 選項重試。"
 
 #: builtin/checkout.c
 msgid ""
 "cannot switch branch while merging\n"
 "Consider \"git merge --quit\" or \"git worktree add\"."
 msgstr ""
-"不能在合併時切換分支\n"
-"è\80\83æ\85®ä½¿ç\94¨ \"git merge --quit\" æ\88\96 \"git worktree add\"。"
+"無法在合併時切換分支\n"
+"è«\8b試試 â\80\9cgit merge --quitâ\80\9d æ\88\96 â\80\9cgit worktree addâ\80\9d。"
 
 #: builtin/checkout.c
 msgid ""
 "cannot switch branch in the middle of an am session\n"
 "Consider \"git am --quit\" or \"git worktree add\"."
 msgstr ""
-"不能在 am 工作階段期間切換分支\n"
-"è\80\83æ\85®ä½¿ç\94¨ \"git am --quit\" æ\88\96 \"git worktree add\"。"
+"無法在 am 工作階段期間時切換分支\n"
+"è«\8b試試 â\80\9cgit am --quitâ\80\9d æ\88\96 â\80\9cgit worktree addâ\80\9d。"
 
 #: builtin/checkout.c
 msgid ""
 "cannot switch branch while rebasing\n"
 "Consider \"git rebase --quit\" or \"git worktree add\"."
 msgstr ""
-"不能在重定基底時切換分支\n"
-"è\80\83æ\85®ä½¿ç\94¨ \"git rebase --quit\" æ\88\96 \"git worktree add\"。"
+"無法在重定基底時切換分支\n"
+"è«\8b試試 â\80\9cgit rebase --quitâ\80\9d æ\88\96 â\80\9cgit worktree addâ\80\9d。"
 
 #: builtin/checkout.c
 msgid ""
 "cannot switch branch while cherry-picking\n"
 "Consider \"git cherry-pick --quit\" or \"git worktree add\"."
 msgstr ""
-"不能在揀選時切換分支\n"
-"è\80\83æ\85®ä½¿ç\94¨ \"git cherry-pick --quit\" æ\88\96 \"git worktree add\"。"
+"無法在揀選時切換分支\n"
+"è«\8b試試 â\80\9cgit cherry-pick --quitâ\80\9d æ\88\96 â\80\9cgit worktree addâ\80\9d。"
 
 #: builtin/checkout.c
 msgid ""
 "cannot switch branch while reverting\n"
 "Consider \"git revert --quit\" or \"git worktree add\"."
 msgstr ""
-"不能在還原時切換分支\n"
-"è\80\83æ\85®ä½¿ç\94¨ \"git revert --quit\" æ\88\96 \"git worktree add\"。"
+"無法在還原時切換分支\n"
+"è«\8b試試 â\80\9cgit revert --quitâ\80\9d æ\88\96 â\80\9cgit worktree addâ\80\9d。"
 
 #: builtin/checkout.c
 msgid "you are switching branch while bisecting"
-msgstr "您在行二分搜尋時切換分支"
+msgstr "您在行二分搜尋時切換分支"
 
 #: builtin/checkout.c
 msgid "paths cannot be used with switching branches"
-msgstr "路徑不能切換分支同時使用"
+msgstr "路徑不能切換分支同時使用"
 
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' cannot be used with switching branches"
-msgstr "'%s' 不能和切換分支同時使用"
+msgstr "“%s” 不能與切換分支同時使用"
 
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' cannot be used with '%s'"
-msgstr "'%s' 不能和 '%s' 同時使用"
+msgstr "“%s” 不能與 “%s” 同時使用"
 
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' cannot take <start-point>"
-msgstr "'%s' 不帶 <起始點>"
+msgstr "“%s” 不取 <start-point>"
 
 #: builtin/checkout.c
 #, c-format
 msgid "Cannot switch branch to a non-commit '%s'"
-msgstr "不能切換分支到一個非提交 '%s'"
+msgstr "無法將分支切換至非提交項目 “%s”"
 
 #: builtin/checkout.c
 msgid "missing branch or commit argument"
-msgstr "缺å°\91å\88\86æ\94¯æ\88\96æ\8f\90交å\8f\83數"
+msgstr "缺å°\91å\88\86æ\94¯æ\88\96æ\8f\90交å¼\95數"
 
 #: builtin/checkout.c
 msgid "perform a 3-way merge with the new branch"
-msgstr "和新的分支執行三方合併"
+msgstr "和新分支進行三方合併"
 
 #: builtin/checkout.c builtin/log.c parse-options.h
 msgid "style"
-msgstr "風格"
+msgstr "style"
 
 #: builtin/checkout.c
 msgid "conflict style (merge, diff3, or zdiff3)"
@@ -4542,7 +4625,7 @@ msgstr "衝突輸出風格(merge、diff3 或 zdiff3)"
 
 #: builtin/checkout.c builtin/worktree.c
 msgid "detach HEAD at named commit"
-msgstr "HEAD 從指定的提交分離"
+msgstr "自指定提交分離 HEAD 指針"
 
 #: builtin/checkout.c
 msgid "force checkout (throw away local modifications)"
@@ -4550,19 +4633,19 @@ msgstr "強制簽出(捨棄本機修改)"
 
 #: builtin/checkout.c
 msgid "new-branch"
-msgstr "新分支"
+msgstr "new-branch"
 
 #: builtin/checkout.c
 msgid "new unparented branch"
-msgstr "新的沒有父提交的分支"
+msgstr "新的沒有父提交的分支"
 
 #: builtin/checkout.c builtin/merge.c
 msgid "update ignored files (default)"
-msgstr "更新忽略的檔案(預設)"
+msgstr "更新忽略的檔案(預設)"
 
 #: builtin/checkout.c
 msgid "do not check if another worktree is holding the given ref"
-msgstr "不檢查指定的引用是否被其他工作區所占用"
+msgstr "不檢查其他工作區是否正在佔用指定的引用"
 
 #: builtin/checkout.c
 msgid "checkout our version for unmerged files"
@@ -4574,16 +4657,16 @@ msgstr "對尚未合併的檔案簽出他們的版本"
 
 #: builtin/checkout.c
 msgid "do not limit pathspecs to sparse entries only"
-msgstr "對路徑不做稀疏簽出的限制"
+msgstr "對路徑規格不做稀疏簽出的限制"
 
 #: builtin/checkout.c
 #, c-format
 msgid "options '-%c', '-%c', and '%s' cannot be used together"
-msgstr "「-%c」、「-%c」和「%s」選項不得同時使用"
+msgstr "“-%c”、“-%c” 和 “%s” 選項不得同時使用"
 
 #: builtin/checkout.c
 msgid "--track needs a branch name"
-msgstr "--track 需要一個分支名"
+msgstr "--track 需要分支名稱"
 
 #: builtin/checkout.c
 #, c-format
@@ -4602,60 +4685,61 @@ msgstr "無效的路徑規格"
 #: builtin/checkout.c
 #, c-format
 msgid "'%s' is not a commit and a branch '%s' cannot be created from it"
-msgstr "'%s' 不是一個提交,不能基於它建立分支 '%s'"
+msgstr "“%s” 不是提交,因此不能以這為基礎建立 “%s” 分支"
 
 #: builtin/checkout.c
 #, c-format
 msgid "git checkout: --detach does not take a path argument '%s'"
-msgstr "git checkout:--detach 不能接收路徑參數 '%s'"
+msgstr "git checkout:--detach 不取路徑引數 “%s”"
 
 #: builtin/checkout.c
 msgid ""
 "git checkout: --ours/--theirs, --force and --merge are incompatible when\n"
 "checking out of the index."
 msgstr ""
-"git checkout:在從索引簽出時,--ours/--theirs、--force 和 --merge 不相容。"
+"git checkout:在從索引簽出時,--ours/--theirs、--force\n"
+"和 --merge 不相容。"
 
 #: builtin/checkout.c
 msgid "you must specify path(s) to restore"
-msgstr "您必須指定一個要復原的路徑"
+msgstr "您必須指定要還原的路徑"
 
 #: builtin/checkout.c builtin/clone.c builtin/remote.c
 #: builtin/submodule--helper.c builtin/worktree.c
 msgid "branch"
-msgstr "分支"
+msgstr "branch"
 
 #: builtin/checkout.c
 msgid "create and checkout a new branch"
-msgstr "建立並簽出一個新的分支"
+msgstr "建立並簽出分支"
 
 #: builtin/checkout.c
 msgid "create/reset and checkout a branch"
-msgstr "建立/重設並簽出一個分支"
+msgstr "建立/重設並簽出分支"
 
 #: builtin/checkout.c
 msgid "create reflog for new branch"
-msgstr "為新分支建立引用日誌"
+msgstr "為新分支建立引用日誌"
 
 #: builtin/checkout.c
 msgid "second guess 'git checkout <no-such-branch>' (default)"
-msgstr "二次猜測 'git checkout <無此分支>'(預設)"
+msgstr "二次猜測 “git checkout <無此分支>”(預設值)"
 
 #: builtin/checkout.c
 msgid "use overlay mode (default)"
-msgstr "使用疊加模式(預設)"
+msgstr "使用疊加模式(預設)"
 
 #: builtin/checkout.c
 msgid "create and switch to a new branch"
-msgstr "建立並切換一個新分支"
+msgstr "建立並切換新分支"
 
 #: builtin/checkout.c
 msgid "create/reset and switch to a branch"
-msgstr "建立/重設並切換一個分支"
+msgstr "建立/重設並切換至指定分支"
 
 #: builtin/checkout.c
 msgid "second guess 'git switch <no-such-branch>'"
-msgstr "二次猜測 'git switch <無此分支>'"
+msgstr "二次猜測 “git switch <無此分支>”"
 
 #: builtin/checkout.c
 msgid "throw away local modifications"
@@ -4663,19 +4747,19 @@ msgstr "捨棄本機修改"
 
 #: builtin/checkout.c
 msgid "which tree-ish to checkout from"
-msgstr "要簽出哪一個樹"
+msgstr "要自哪一個樹狀物件指示元簽出"
 
 #: builtin/checkout.c
 msgid "restore the index"
-msgstr "原索引"
+msgstr "原索引"
 
 #: builtin/checkout.c
 msgid "restore the working tree (default)"
-msgstr "復原工作區(預設)"
+msgstr "還原工作區(預設值)"
 
 #: builtin/checkout.c
 msgid "ignore unmerged entries"
-msgstr "忽略未合併目"
+msgstr "忽略未合併目"
 
 #: builtin/checkout.c
 msgid "use overlay mode"
@@ -4686,17 +4770,18 @@ msgid ""
 "git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
 "[<pathspec>...]"
 msgstr ""
-"git clean [-d] [-f] [-i] [-n] [-q] [-e <模式>] [-x | -X] [--] [<路徑規格>...]"
+"git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] "
+"[<pathspec>...]"
 
 #: builtin/clean.c
 #, c-format
 msgid "Removing %s\n"
-msgstr "正刪除 %s\n"
+msgstr "æ­£å\9c¨å\88ªé\99¤ %s\n"
 
 #: builtin/clean.c
 #, c-format
 msgid "Would remove %s\n"
-msgstr "將刪除 %s\n"
+msgstr "將刪除 %s\n"
 
 #: builtin/clean.c
 #, c-format
@@ -4711,12 +4796,12 @@ msgstr "將忽略版本庫 %s\n"
 #: builtin/clean.c midx.c
 #, c-format
 msgid "failed to remove %s"
-msgstr "刪除 %s 失敗"
+msgstr "無法移除 %s"
 
 #: builtin/clean.c
 #, c-format
 msgid "could not lstat %s\n"
-msgstr "不能對 %s 呼叫 lstat\n"
+msgstr "不能對 %s 進行 lstat\n"
 
 #: builtin/clean.c
 msgid "Refusing to remove current working directory\n"
@@ -4726,7 +4811,7 @@ msgstr "拒絕移除目前工作目錄\n"
 msgid "Would refuse to remove current working directory\n"
 msgstr "會拒絕移除目前的工作目錄\n"
 
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
 #, c-format
 msgid ""
 "Prompt help:\n"
@@ -4734,12 +4819,12 @@ msgid ""
 "foo        - select item based on unique prefix\n"
 "           - (empty) select nothing\n"
 msgstr ""
-"協助:\n"
-"1          - 透過編號選擇一個選項\n"
-"foo        - 透過唯一前綴選擇一個選項\n"
+"提示說明:\n"
+"1          - 透過編號選擇項目\n"
+"foo        - 根據獨特前綴選擇項目\n"
 "           - (空)什麼也不選擇\n"
 
-#: builtin/clean.c git-add--interactive.perl
+#: builtin/clean.c
 #, c-format
 msgid ""
 "Prompt help:\n"
@@ -4751,39 +4836,39 @@ msgid ""
 "*          - choose all items\n"
 "           - (empty) finish selecting\n"
 msgstr ""
-"協助:\n"
-"1          - é\81¸æ\93\87ä¸\80å\80\8bé\81¸é \85\n"
-"3-5        - 選擇一個範圍內的所有選項\n"
-"2-3,6-9    - 選擇多個範圍內的所有選項\n"
-"foo        - 透過唯一前綴選擇一個選項\n"
-"-...       - å\8f\8dé\81¸ç\89¹å®\9aç\9a\84é\81¸é \85\n"
-"*          - é\81¸æ\93\87æ\89\80æ\9c\89é\81¸é \85\n"
-"           - (空)結束選擇\n"
-
-#: builtin/clean.c git-add--interactive.perl
-#, c-format, perl-format
+"提示說明:\n"
+"1          - é\81¸æ\93\87ä¸\80å\80\8bé \85ç\9b®\n"
+"3-5        - 選擇一個項目範圍\n"
+"2-3,6-9    - 選擇多個項目範圍\n"
+"foo        - 根據獨特前綴選擇項目\n"
+"-...       - å\8f\96æ¶\88é\81¸å\8f\96æ\8c\87å®\9aé \85ç\9b®\n"
+"*          - é\81¸æ\93\87æ\89\80æ\9c\89é \85ç\9b®\n"
+"           - (空)完成選擇\n"
+
+#: builtin/clean.c
+#, c-format
 msgid "Huh (%s)?\n"
-msgstr "嗯(%s)\n"
+msgstr "嗯(%s)?\n"
 
 #: builtin/clean.c
 #, c-format
 msgid "Input ignore patterns>> "
-msgstr "輸入範本以排除條目>> "
+msgstr "輸入要忽略的模式項目>> "
 
 #: builtin/clean.c
 #, c-format
 msgid "WARNING: Cannot find items matched by: %s"
-msgstr "警告:無法找到和 %s 符合的目"
+msgstr "警告:無法找到和 %s 符合的目"
 
 #: builtin/clean.c
 msgid "Select items to delete"
-msgstr "選擇要刪除的目"
+msgstr "選擇要刪除的目"
 
 #. TRANSLATORS: Make sure to keep [y/N] as is
 #: builtin/clean.c
 #, c-format
 msgid "Remove %s [y/N]? "
-msgstr "移除 %s [y/N] "
+msgstr "移除 %s [y/N]? "
 
 #: builtin/clean.c
 msgid ""
@@ -4798,15 +4883,15 @@ msgstr ""
 "clean               - 開始清理\n"
 "filter by pattern   - 透過範本排除要刪除的條目\n"
 "select by numbers   - 透過數字選擇要刪除的條目\n"
-"ask each            - 針對刪除逐一詢問(就像 \"rm -i\")\n"
+"ask each            - 針對刪除逐一詢問(就像 “rm -i”)\n"
 "quit                - 停止刪除並離開\n"
-"help                - 顯示本協助\n"
-"?                   - 顯示如何在提示下選擇的協助"
+"help                - 顯示本輔助說明\n"
+"?                   - 顯示如何在提示下選擇的協助"
 
 #: builtin/clean.c
 msgid "Would remove the following item:"
 msgid_plural "Would remove the following items:"
-msgstr[0] "將刪除如下條目:"
+msgstr[0] "將移除以下項目:"
 
 #: builtin/clean.c
 msgid "No more files to clean, exiting."
@@ -4814,11 +4899,11 @@ msgstr "沒有要清理的檔案,離開。"
 
 #: builtin/clean.c
 msgid "do not print names of files removed"
-msgstr "不列印刪除檔案的名稱"
+msgstr "不輸出移除的檔案的名稱"
 
 #: builtin/clean.c
 msgid "force"
-msgstr "強制"
+msgstr "force"
 
 #: builtin/clean.c
 msgid "interactive cleaning"
@@ -4826,24 +4911,24 @@ msgstr "互動式清除"
 
 #: builtin/clean.c
 msgid "remove whole directories"
-msgstr "除整個目錄"
+msgstr "除整個目錄"
 
 #: builtin/clean.c builtin/describe.c builtin/grep.c builtin/log.c
 #: builtin/ls-files.c builtin/name-rev.c builtin/show-ref.c
 msgid "pattern"
-msgstr "模式"
+msgstr "pattern"
 
 #: builtin/clean.c
 msgid "add <pattern> to ignore rules"
-msgstr "新增 <模式> 到忽略規則"
+msgstr "將 <pattern> 加到忽略規則"
 
 #: builtin/clean.c
 msgid "remove ignored files, too"
-msgstr "ä¹\9få\88ª除忽略的檔案"
+msgstr "亦移除忽略的檔案"
 
 #: builtin/clean.c
 msgid "remove only ignored files"
-msgstr "只除忽略的檔案"
+msgstr "只除忽略的檔案"
 
 #: builtin/clean.c
 msgid ""
@@ -4865,23 +4950,23 @@ msgstr "-x 和 -X 不能同時使用"
 
 #: builtin/clone.c
 msgid "git clone [<options>] [--] <repo> [<dir>]"
-msgstr "git clone [<選項>] [--] <版本庫> [<路徑>]"
+msgstr "git clone [<options>] [--] <repo> [<dir>]"
 
 #: builtin/clone.c
 msgid "don't clone shallow repository"
-msgstr "不要複製淺版本庫"
+msgstr "不要複製淺版本庫"
 
 #: builtin/clone.c
 msgid "don't create a checkout"
-msgstr "不建ç«\8bä¸\80å\80\8bç°½å\87º"
+msgstr "不è¦\81建ç«\8bç°½å\87º"
 
 #: builtin/clone.c builtin/init-db.c
 msgid "create a bare repository"
-msgstr "建立一個純版本庫"
+msgstr "建立版本庫"
 
 #: builtin/clone.c
 msgid "create a mirror repository (implies bare)"
-msgstr "建立一個鏡像版本庫(也是純版本庫)"
+msgstr "建立鏡像版本庫(亦即裸版本庫)"
 
 #: builtin/clone.c
 msgid "to clone from a local repository"
@@ -4889,7 +4974,7 @@ msgstr "從本機版本庫複製"
 
 #: builtin/clone.c
 msgid "don't use local hardlinks, always copy"
-msgstr "不使用本機硬連結,始終複製"
+msgstr "不使用本機硬連結,始終拷貝"
 
 #: builtin/clone.c
 msgid "setup as shared repository"
@@ -4905,15 +4990,15 @@ msgstr "在複製時初始化子模組"
 
 #: builtin/clone.c
 msgid "number of submodules cloned in parallel"
-msgstr "並行複製的子模組數"
+msgstr "平行複製的子模組數量"
 
 #: builtin/clone.c builtin/init-db.c
 msgid "template-directory"
-msgstr "範本目錄"
+msgstr "模板目錄"
 
 #: builtin/clone.c builtin/init-db.c
 msgid "directory from which templates will be used"
-msgstr "範本目錄將被使用"
+msgstr "將被使用的模板目錄"
 
 #: builtin/clone.c builtin/submodule--helper.c
 msgid "reference repository"
@@ -4921,21 +5006,21 @@ msgstr "引用版本庫"
 
 #: builtin/clone.c builtin/submodule--helper.c
 msgid "use --reference only while cloning"
-msgstr "僅在複製時參考 --reference 指向的本機版本庫"
+msgstr "僅在複製時使用 --reference"
 
 #: builtin/clone.c builtin/column.c builtin/fmt-merge-msg.c builtin/init-db.c
 #: builtin/merge-file.c builtin/merge.c builtin/pack-objects.c builtin/repack.c
 #: builtin/submodule--helper.c t/helper/test-simple-ipc.c
 msgid "name"
-msgstr "名稱"
+msgstr "name"
 
 #: builtin/clone.c
 msgid "use <name> instead of 'origin' to track upstream"
-msgstr "使用 <名稱> 而不是 'origin' 去追蹤上游"
+msgstr "使用 <name> 而不是 “origin” 追蹤上游"
 
 #: builtin/clone.c
 msgid "checkout <branch> instead of the remote's HEAD"
-msgstr "簽出 <分支> 而不是遠端 HEAD"
+msgstr "簽出 <branch> 而不是遠端 HEAD"
 
 #: builtin/clone.c
 msgid "path to git-upload-pack on the remote"
@@ -4943,27 +5028,23 @@ msgstr "遠端 git-upload-pack 路徑"
 
 #: builtin/clone.c builtin/fetch.c builtin/grep.c builtin/pull.c
 msgid "depth"
-msgstr "深度"
+msgstr "depth"
 
 #: builtin/clone.c
 msgid "create a shallow clone of that depth"
-msgstr "建立一個指定深度的淺複製"
-
-#: builtin/clone.c builtin/fetch.c builtin/pack-objects.c builtin/pull.c
-msgid "time"
-msgstr "時間"
+msgstr "建立指定深度的淺層複製"
 
 #: builtin/clone.c
 msgid "create a shallow clone since a specific time"
-msgstr "建立從指定時間到現在的淺複製"
+msgstr "建立從指定時間到現在的淺複製"
 
 #: builtin/clone.c builtin/fetch.c builtin/pull.c builtin/rebase.c
 msgid "revision"
-msgstr "修訂版"
+msgstr "revision"
 
 #: builtin/clone.c builtin/fetch.c builtin/pull.c
 msgid "deepen history of shallow clone, excluding rev"
-msgstr "取得更多淺複製的過去歷史記錄,除了特定版本"
+msgstr "取得更多淺層複製的過去歷史記錄,除了特定修訂版"
 
 #: builtin/clone.c builtin/submodule--helper.c
 msgid "clone only one branch, HEAD or --branch"
@@ -4979,11 +5060,11 @@ msgstr "子模組將以淺下載模式複製"
 
 #: builtin/clone.c builtin/init-db.c
 msgid "gitdir"
-msgstr "git目錄"
+msgstr "gitdir"
 
 #: builtin/clone.c builtin/init-db.c
 msgid "separate git dir from working tree"
-msgstr "git目錄和工作區分離"
+msgstr "git 目錄和工作區分離"
 
 #: builtin/clone.c
 msgid "key=value"
@@ -5046,6 +5127,11 @@ msgstr "對 '%s' 呼叫 stat 失敗"
 msgid "%s exists and is not a directory"
 msgstr "%s 存在且不是一個目錄"
 
+#: builtin/clone.c
+#, c-format
+msgid "'%s' is a symlink, refusing to clone with --local"
+msgstr "“%s” 是個符號連結,故不能使用 --local 複製"
+
 #: builtin/clone.c
 #, c-format
 msgid "failed to start iterator over '%s'"
@@ -5059,7 +5145,7 @@ msgstr "「%s」符號連結已存在,拒絕使用 --local 複製"
 #: builtin/clone.c compat/precompose_utf8.c
 #, c-format
 msgid "failed to unlink '%s'"
-msgstr "刪除 '%s' 失敗"
+msgstr "無法刪除 “%s”"
 
 #: builtin/clone.c
 #, c-format
@@ -5127,7 +5213,7 @@ msgstr "無法執行 repack 來清理"
 
 #: builtin/clone.c
 msgid "cannot unlink temporary alternates file"
-msgstr "無法刪除暫時的 alternates 檔案"
+msgstr "無法刪除暫 alternates 檔案"
 
 #: builtin/clone.c
 msgid "Too many arguments."
@@ -5240,6 +5326,10 @@ msgstr "無法初始化版本庫,略過套件包 URI"
 msgid "failed to fetch objects from bundle URI '%s'"
 msgstr "無法從套件包 URL “%s” 抓取物件"
 
+#: builtin/clone.c
+msgid "failed to fetch advertised bundles"
+msgstr "無法抓取公佈的套件包"
+
 #: builtin/clone.c
 msgid "remote transport reported error"
 msgstr "遠端傳輸回報錯誤"
@@ -5609,7 +5699,7 @@ msgid ""
 "in the current commit message"
 msgstr "無法選擇一個未被目前提交說明使用的備註字元"
 
-#: builtin/commit.c
+#: builtin/commit.c builtin/merge-tree.c
 #, c-format
 msgid "could not lookup commit %s"
 msgstr "不能查詢提交 %s"
@@ -5834,13 +5924,13 @@ msgstr "計算完整的領先/落後值"
 msgid "version"
 msgstr "版本"
 
-#: builtin/commit.c builtin/push.c builtin/worktree.c
+#: builtin/commit.c builtin/fetch.c builtin/push.c builtin/worktree.c
 msgid "machine-readable output"
 msgstr "機器可讀的輸出"
 
 #: builtin/commit.c
 msgid "show status in long format (default)"
-msgstr "以長格式顯示狀態(預設)"
+msgstr "以長格式顯示狀態(預設)"
 
 #: builtin/commit.c
 msgid "terminate entries with NUL"
@@ -5917,7 +6007,7 @@ msgstr "日期"
 msgid "override date for commit"
 msgstr "提交時覆蓋日期"
 
-#: builtin/commit.c parse-options.h ref-filter.h
+#: builtin/commit.c builtin/merge-tree.c parse-options.h ref-filter.h
 msgid "commit"
 msgstr "提交"
 
@@ -6068,7 +6158,7 @@ msgstr ""
 msgid "git config [<options>]"
 msgstr "git config [<選項>]"
 
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
 #, c-format
 msgid "unrecognized --type argument, %s"
 msgstr "無法識別的 --type 參數,%s"
@@ -6167,7 +6257,7 @@ msgstr "開啟一個編輯器"
 
 #: builtin/config.c
 msgid "find the color configured: slot [default]"
-msgstr "獲得設定的顏色:設定 [預設]"
+msgstr "獲得設定的顏色:設定 [預設]"
 
 #: builtin/config.c
 msgid "find the color setting: slot [stdout-is-tty]"
@@ -6177,11 +6267,11 @@ msgstr "獲得顏色設定:設定 [stdout-is-tty]"
 msgid "Type"
 msgstr "類型"
 
-#: builtin/config.c builtin/env--helper.c builtin/hash-object.c
+#: builtin/config.c builtin/hash-object.c
 msgid "type"
 msgstr "類型"
 
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
 msgid "value is given this type"
 msgstr "取值為該類型"
 
@@ -6235,7 +6325,7 @@ msgstr ""
 "顯示設定檔的作用域 (工作區 worktree、本機 local、全域 global、系統 system、指"
 "令 command)"
 
-#: builtin/config.c builtin/env--helper.c
+#: builtin/config.c
 msgid "value"
 msgstr "取值"
 
@@ -6770,30 +6860,6 @@ msgstr "沒有為 --tool=<工具> 參數提供 <工具>"
 msgid "no <cmd> given for --extcmd=<cmd>"
 msgstr "沒有為 --extcmd=<命令> 參數提供 <命令>"
 
-#: builtin/env--helper.c
-msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
-msgstr "git env--helper --type=[bool|ulong] <選項> <環境變數>"
-
-#: builtin/env--helper.c
-msgid "default for git_env_*(...) to fall back on"
-msgstr "git_env_*(...) 的預設值"
-
-#: builtin/env--helper.c
-msgid "be quiet only use git_env_*() value as exit code"
-msgstr "安靜模式,只使用 git_env_*() 的值作為離開碼"
-
-#: builtin/env--helper.c
-#, c-format
-msgid "option `--default' expects a boolean value with `--type=bool`, not `%s`"
-msgstr "選項「--default」預期收到「--type=bool」的布林值,而非「%s」"
-
-#: builtin/env--helper.c
-#, c-format
-msgid ""
-"option `--default' expects an unsigned long value with `--type=ulong`, not "
-"`%s`"
-msgstr "選項「--default」預期收到「--type=ulong」的無號 long 數值,而非「%s」"
-
 #: builtin/fast-export.c
 msgid "git fast-export [<rev-list-opts>]"
 msgstr "git fast-export [<rev-list-opts>]"
@@ -6936,144 +7002,14 @@ msgstr "git fetch --all [<選項>]"
 msgid "fetch.parallel cannot be negative"
 msgstr "fetch.parallel 不能為負數"
 
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch from all remotes"
-msgstr "從所有的遠端抓取"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "set upstream for git pull/fetch"
-msgstr "為 git pull/fetch 設定上游"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "append to .git/FETCH_HEAD instead of overwriting"
-msgstr "追加到 .git/FETCH_HEAD 而不是覆蓋它"
-
 #: builtin/fetch.c
-msgid "use atomic transaction to update references"
-msgstr "使用 atomic 事務更新引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "path to upload pack on remote end"
-msgstr "上傳包到遠端的路徑"
+msgid "couldn't find remote ref HEAD"
+msgstr "找不到遠端 HEAD 引用"
 
 #: builtin/fetch.c
-msgid "force overwrite of local reference"
-msgstr "強制覆蓋本機引用"
-
-#: builtin/fetch.c
-msgid "fetch from multiple remotes"
-msgstr "從多個遠端抓取"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "fetch all tags and associated objects"
-msgstr "抓取所有的標籤和關聯物件"
-
-#: builtin/fetch.c
-msgid "do not fetch all tags (--no-tags)"
-msgstr "不抓取任何標籤(--no-tags)"
-
-#: builtin/fetch.c
-msgid "number of submodules fetched in parallel"
-msgstr "並行取得的子模組數量"
-
-#: builtin/fetch.c
-msgid "modify the refspec to place all refs within refs/prefetch/"
-msgstr "修改引用規格 (refspec) 以便將所有引用 (refs) 放置在 refs/prefetch/ 中"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "prune remote-tracking branches no longer on remote"
-msgstr "清除遠端已經不存在的分支的追蹤分支"
-
-#: builtin/fetch.c
-msgid "prune local tags no longer on remote and clobber changed tags"
-msgstr "清除遠端不存在的本機標籤,並且取代變更標籤"
-
-#  譯者:可選值,不能翻譯
-#: builtin/fetch.c builtin/pull.c
-msgid "on-demand"
-msgstr "on-demand"
-
-#: builtin/fetch.c
-msgid "control recursive fetching of submodules"
-msgstr "控制子模組的遞迴抓取"
-
-#: builtin/fetch.c
-msgid "write fetched references to the FETCH_HEAD file"
-msgstr "將取得的引用寫入 FETCH_HEAD 檔案"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "keep downloaded pack"
-msgstr "保持下載包"
-
-#: builtin/fetch.c
-msgid "allow updating of HEAD ref"
-msgstr "允許更新 HEAD 引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow clone"
-msgstr "取得淺複製的更多過去歷史記錄"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "deepen history of shallow repository based on time"
-msgstr "基於時間來深化淺複製的歷史"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "convert to a complete repository"
-msgstr "轉換為一個完整的版本庫"
-
-#: builtin/fetch.c
-msgid "re-fetch without negotiating common commits"
-msgstr "重新抓取而不協商共同提交"
-
-#: builtin/fetch.c
-msgid "prepend this to submodule path output"
-msgstr "在子模組路徑輸出的前面加上此目錄"
-
-#: builtin/fetch.c
-msgid ""
-"default for recursive fetching of submodules (lower priority than config "
-"files)"
-msgstr "遞迴取得子模組的預設值(比設定檔案優先度低)"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "accept refs that update .git/shallow"
-msgstr "接受更新 .git/shallow 的引用"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "refmap"
-msgstr "引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "specify fetch refmap"
-msgstr "指定取得動作的引用映射"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "report that we have only objects reachable from this object"
-msgstr "報告我們只擁有從該物件開始可以取得的物件"
-
-#: builtin/fetch.c
-msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
-msgstr "不取得 packfile,而是輸出協商的祖先提交"
-
-#: builtin/fetch.c
-msgid "run 'maintenance --auto' after fetching"
-msgstr "取得 (fetch) 後執行 'maintenance --auto'"
-
-#: builtin/fetch.c builtin/pull.c
-msgid "check for forced-updates on all updated branches"
-msgstr "在所有更新分支上檢查強制更新"
-
-#: builtin/fetch.c
-msgid "write the commit-graph after fetching"
-msgstr "抓取後寫入分支圖"
-
-#: builtin/fetch.c
-msgid "accept refspecs from stdin"
-msgstr "從標準輸入中接受引用規格"
-
-#: builtin/fetch.c
-msgid "couldn't find remote ref HEAD"
-msgstr "找不到遠端 HEAD 引用"
+#, c-format
+msgid "From %.*s\n"
+msgstr "來自 %.*s\n"
 
 #: builtin/fetch.c
 #, c-format
@@ -7160,11 +7096,6 @@ msgstr "%s 未傳送所有必需的物件\n"
 msgid "rejected %s because shallow roots are not allowed to be updated"
 msgstr "已拒絕 %s,不允許更新淺複製"
 
-#: builtin/fetch.c
-#, c-format
-msgid "From %.*s\n"
-msgstr "來自 %.*s\n"
-
 #: builtin/fetch.c
 #, c-format
 msgid ""
@@ -7278,6 +7209,141 @@ msgstr ""
 msgid "you need to specify a tag name"
 msgstr "您需要指定標籤名稱"
 
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch from all remotes"
+msgstr "從所有的遠端抓取"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "set upstream for git pull/fetch"
+msgstr "為 git pull/fetch 設定上游"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "append to .git/FETCH_HEAD instead of overwriting"
+msgstr "追加到 .git/FETCH_HEAD 而不是覆蓋它"
+
+#: builtin/fetch.c
+msgid "use atomic transaction to update references"
+msgstr "使用 atomic 事務更新引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "path to upload pack on remote end"
+msgstr "上傳包到遠端的路徑"
+
+#: builtin/fetch.c
+msgid "force overwrite of local reference"
+msgstr "強制覆蓋本機引用"
+
+#: builtin/fetch.c
+msgid "fetch from multiple remotes"
+msgstr "從多個遠端抓取"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "fetch all tags and associated objects"
+msgstr "抓取所有的標籤和關聯物件"
+
+#: builtin/fetch.c
+msgid "do not fetch all tags (--no-tags)"
+msgstr "不抓取任何標籤(--no-tags)"
+
+#: builtin/fetch.c
+msgid "number of submodules fetched in parallel"
+msgstr "並行取得的子模組數量"
+
+#: builtin/fetch.c
+msgid "modify the refspec to place all refs within refs/prefetch/"
+msgstr "修改引用規格 (refspec) 以便將所有引用 (refs) 放置在 refs/prefetch/ 中"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "prune remote-tracking branches no longer on remote"
+msgstr "清除遠端已經不存在的分支的追蹤分支"
+
+#: builtin/fetch.c
+msgid "prune local tags no longer on remote and clobber changed tags"
+msgstr "清除遠端不存在的本機標籤,並且取代變更標籤"
+
+#  譯者:可選值,不能翻譯
+#: builtin/fetch.c builtin/pull.c
+msgid "on-demand"
+msgstr "on-demand"
+
+#: builtin/fetch.c
+msgid "control recursive fetching of submodules"
+msgstr "控制子模組的遞迴抓取"
+
+#: builtin/fetch.c
+msgid "write fetched references to the FETCH_HEAD file"
+msgstr "將取得的引用寫入 FETCH_HEAD 檔案"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "keep downloaded pack"
+msgstr "保持下載包"
+
+#: builtin/fetch.c
+msgid "allow updating of HEAD ref"
+msgstr "允許更新 HEAD 引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow clone"
+msgstr "取得淺複製的更多過去歷史記錄"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "deepen history of shallow repository based on time"
+msgstr "基於時間來深化淺複製的歷史"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "convert to a complete repository"
+msgstr "轉換為一個完整的版本庫"
+
+#: builtin/fetch.c
+msgid "re-fetch without negotiating common commits"
+msgstr "重新抓取而不協商共同提交"
+
+#: builtin/fetch.c
+msgid "prepend this to submodule path output"
+msgstr "在子模組路徑輸出的前面加上此目錄"
+
+#: builtin/fetch.c
+msgid ""
+"default for recursive fetching of submodules (lower priority than config "
+"files)"
+msgstr "遞迴取得子模組的預設值(比設定檔案優先度低)"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "accept refs that update .git/shallow"
+msgstr "接受更新 .git/shallow 的引用"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "refmap"
+msgstr "引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "specify fetch refmap"
+msgstr "指定取得動作的引用映射"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "report that we have only objects reachable from this object"
+msgstr "報告我們只擁有從該物件開始可以取得的物件"
+
+#: builtin/fetch.c
+msgid "do not fetch a packfile; instead, print ancestors of negotiation tips"
+msgstr "不取得 packfile,而是輸出協商的祖先提交"
+
+#: builtin/fetch.c
+msgid "run 'maintenance --auto' after fetching"
+msgstr "取得 (fetch) 後執行 'maintenance --auto'"
+
+#: builtin/fetch.c builtin/pull.c
+msgid "check for forced-updates on all updated branches"
+msgstr "在所有更新分支上檢查強制更新"
+
+#: builtin/fetch.c
+msgid "write the commit-graph after fetching"
+msgstr "抓取後寫入分支圖"
+
+#: builtin/fetch.c
+msgid "accept refspecs from stdin"
+msgstr "從標準輸入中接受引用規格"
+
 #: builtin/fetch.c
 msgid "--negotiate-only needs one or more --negotiation-tip=*"
 msgstr "--negotiate-only 需要一或多個 --negotiation-tip=*"
@@ -7290,6 +7356,11 @@ msgstr "--deepen 不支援負數深度"
 msgid "--unshallow on a complete repository does not make sense"
 msgstr "對於一個完整的版本庫,參數 --unshallow 沒有意義"
 
+#: builtin/fetch.c
+#, c-format
+msgid "failed to fetch bundles from '%s'"
+msgstr "無法自「%s」抓取套件包"
+
 #: builtin/fetch.c
 msgid "fetch --all does not take a repository argument"
 msgstr "fetch --all 不能帶一個版本庫參數"
@@ -7418,6 +7489,14 @@ msgstr "只列印包含該提交的引用"
 msgid "print only refs which don't contain the commit"
 msgstr "只列印不包含該提交的引用"
 
+#: builtin/for-each-ref.c
+msgid "read reference patterns from stdin"
+msgstr "從 stdin 讀取引用模式"
+
+#: builtin/for-each-ref.c
+msgid "unknown arguments supplied with --stdin"
+msgstr "為 --stdin 提供的引數未知"
+
 #: builtin/for-each-repo.c
 msgid "git for-each-repo --config=<config> [--] <arguments>"
 msgstr "git for-each-repo --config=<config> [--] <arguments>"
@@ -7434,6 +7513,11 @@ msgstr "儲存版本庫路徑清單的設定鍵"
 msgid "missing --config=<config>"
 msgstr "缺少 --config=<設定>"
 
+#: builtin/for-each-repo.c
+#, c-format
+msgid "got bad config --config=%s"
+msgstr "收到無效的組態 --config=%s"
+
 #: builtin/fsck.c
 msgid "unknown"
 msgstr "未知"
@@ -7619,13 +7703,14 @@ msgid "notice: %s points to an unborn branch (%s)"
 msgstr "注意:%s 指向一個尚未誕生的分支(%s)"
 
 #: builtin/fsck.c
-msgid "Checking cache tree"
-msgstr "正在檢查快取樹"
+#, c-format
+msgid "Checking cache tree of %s"
+msgstr "正在檢查 %s 的快取樹"
 
 #: builtin/fsck.c
 #, c-format
-msgid "%s: invalid sha1 pointer in cache-tree"
-msgstr "%s:cache-tree 中無效的 sha1 指標"
+msgid "%s: invalid sha1 pointer in cache-tree of %s"
+msgstr "%s:%s 的 cache-tree 中的 sha1 指標無效"
 
 #: builtin/fsck.c
 msgid "non-tree in cache-tree"
@@ -7633,8 +7718,18 @@ msgstr "cache-tree 中非樹狀物件"
 
 #: builtin/fsck.c
 #, c-format
-msgid "%s: invalid sha1 pointer in resolve-undo"
-msgstr "%s:resolve-undo 的 sha1 指針無效"
+msgid "%s: invalid sha1 pointer in resolve-undo of %s"
+msgstr "%s:%s 的 resolve-undo 中的 sha1 指標無效"
+
+#: builtin/fsck.c
+#, c-format
+msgid "unable to load rev-index for pack '%s'"
+msgstr "無法讀取 “%s” 封裝的修訂版索引 (rev-index)"
+
+#: builtin/fsck.c
+#, c-format
+msgid "invalid rev-index for pack '%s'"
+msgstr "“%s” 封裝的修訂版索引 (rev-index) 無效"
 
 #: builtin/fsck.c
 msgid ""
@@ -7670,7 +7765,7 @@ msgstr "將索引亦作為檢查的頭節點"
 
 #: builtin/fsck.c
 msgid "make reflogs head nodes (default)"
-msgstr "將引用日誌作為檢查的 HEAD 節點(預設)"
+msgstr "將引用日誌作為檢查的 HEAD 節點(預設)"
 
 #: builtin/fsck.c
 msgid "also consider packs and alternate objects"
@@ -8152,7 +8247,6 @@ msgstr "grep:無法建立執行緒:%s"
 msgid "invalid number of threads specified (%d) for %s"
 msgstr "為 %2$s 設定的執行緒數 (%1$d) 無效"
 
-#. #-#-#-#-#  grep.c.po  #-#-#-#-#
 #. TRANSLATORS: %s is the configuration
 #. variable for tweaking threads, currently
 #. grep.threads
@@ -8224,7 +8318,7 @@ msgstr "用 textconv 過濾器處理二進位檔案"
 
 #: builtin/grep.c
 msgid "search in subdirectories (default)"
-msgstr "在子目錄中尋找(預設)"
+msgstr "在子目錄中尋找(預設)"
 
 #: builtin/grep.c
 msgid "descend at most <depth> levels"
@@ -8236,7 +8330,7 @@ msgstr "使用延伸的 POSIX 常規表示式"
 
 #: builtin/grep.c
 msgid "use basic POSIX regular expressions (default)"
-msgstr "使用基本的 POSIX 常規表示式(預設)"
+msgstr "使用基本的 POSIX 常規表示式(預設)"
 
 #: builtin/grep.c
 msgid "interpret patterns as fixed strings"
@@ -8581,13 +8675,21 @@ msgid "'git help config' for more information"
 msgstr "'git help config' 取得更多訊息"
 
 #: builtin/hook.c
-msgid "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
-msgstr "git hook run [--ignore-missing] <hook-name> [-- <hook-args>]"
+msgid ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
+msgstr ""
+"git hook run [--ignore-missing] [--to-stdin=<path>] <hook-name> [-- <hook-"
+"args>]"
 
 #: builtin/hook.c
 msgid "silently ignore missing requested <hook-name>"
 msgstr "靜默忽略不存在而請求的 <hook-name>"
 
+#: builtin/hook.c
+msgid "file to read into hooks' stdin"
+msgstr "要讀進掛鉤 stdin 的檔案"
+
 #: builtin/index-pack.c
 #, c-format
 msgid "object type mismatch at %s"
@@ -9314,7 +9416,7 @@ msgstr "不包含已在上游提交中的修補檔"
 
 #: builtin/log.c
 msgid "show patch format instead of default (patch + stat)"
-msgstr "顯示純修補檔格式而非預設(修補檔+狀態)"
+msgstr "顯示純修補檔格式而非預設(修補檔+狀態)"
 
 #: builtin/log.c
 msgid "Messaging"
@@ -9330,7 +9432,7 @@ msgstr "新增信件頭"
 
 #: builtin/log.c
 msgid "email"
-msgstr "信件位址"
+msgstr "信"
 
 #: builtin/log.c
 msgid "add To: header"
@@ -9528,7 +9630,7 @@ msgstr "使用小寫字母表示 'fsmonitor clean' 檔案"
 
 #: builtin/ls-files.c
 msgid "show cached files in the output (default)"
-msgstr "顯示快取的檔案(預設)"
+msgstr "顯示快取的檔案(預設)"
 
 #: builtin/ls-files.c
 msgid "show deleted files in the output"
@@ -9629,11 +9731,11 @@ msgstr ""
 msgid ""
 "git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
 "              [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
-"              [--symref] [<repository> [<refs>...]]"
+"              [--symref] [<repository> [<patterns>...]]"
 msgstr ""
 "git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
 "              [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
-"              [--symref] [<repository> [<refs>...]]"
+"              [--symref] [<repository> [<patterns>...]]"
 
 #: builtin/ls-remote.c
 msgid "do not print remote URL"
@@ -9951,10 +10053,18 @@ msgstr "允許合並不相關的歷史"
 msgid "perform multiple merges, one per line of input"
 msgstr "執行多次合併,一次執行輸入一列"
 
+#: builtin/merge-tree.c
+msgid "specify a merge-base for the merge"
+msgstr "指定用來合併的合併基底"
+
 #: builtin/merge-tree.c
 msgid "--trivial-merge is incompatible with all other options"
 msgstr "--trivial-merge 和其他所有選項都不相容"
 
+#: builtin/merge-tree.c
+msgid "--merge-base is incompatible with --stdin"
+msgstr "--merge-base 與 --stdin 不相容"
+
 #: builtin/merge-tree.c builtin/notes.c
 #, c-format
 msgid "malformed input line: '%s'."
@@ -10015,7 +10125,7 @@ msgstr "建立一個單獨的提交而不是做一次合併"
 
 #: builtin/merge.c builtin/pull.c
 msgid "perform a commit if the merge succeeds (default)"
-msgstr "如果合併成功,執行一次提交(預設)"
+msgstr "如果合併成功,執行一次提交(預設)"
 
 #: builtin/merge.c builtin/pull.c
 msgid "edit message before committing"
@@ -10023,7 +10133,7 @@ msgstr "在提交前編輯提交說明"
 
 #: builtin/merge.c
 msgid "allow fast-forward (default)"
-msgstr "允許快轉(預設)"
+msgstr "允許快轉(預設)"
 
 #: builtin/merge.c builtin/pull.c
 msgid "abort if fast-forward is not possible"
@@ -10206,7 +10316,7 @@ msgstr "對於 %s 沒有來自 %s 的遠端追蹤分支"
 msgid "Bad value '%s' in environment '%s'"
 msgstr "環境 '%2$s' 中存在壞的取值 '%1$s'"
 
-#: builtin/merge.c read-cache.c strbuf.c wrapper.c
+#: builtin/merge.c editor.c read-cache.c wrapper.c
 #, c-format
 msgid "could not close '%s'"
 msgstr "不能關閉 '%s'"
@@ -10585,7 +10695,7 @@ msgstr "註解從標準輸入收到的文字"
 
 #: builtin/name-rev.c
 msgid "allow to print `undefined` names (default)"
-msgstr "允許列印 `未定義` 的名稱(預設)"
+msgstr "允許列印 `未定義` 的名稱(預設)"
 
 #: builtin/name-rev.c
 msgid "dereference tags in the input (internal use)"
@@ -11039,7 +11149,7 @@ msgstr "無法寫入位圖索引"
 msgid "wrote %<PRIu32> objects while expecting %<PRIu32>"
 msgstr "寫入 %<PRIu32> 個物件而預期 %<PRIu32> 個"
 
-#: builtin/pack-objects.c
+#: builtin/pack-objects.c builtin/repack.c
 msgid "disabling bitmap writing, as some objects are not being packed"
 msgstr "停用 bitmap 寫入,因為一些物件將不會被打包"
 
@@ -11205,6 +11315,14 @@ msgstr "不支援的索引版本 %s"
 msgid "bad index version '%s'"
 msgstr "壞的索引版本 '%s'"
 
+#: builtin/pack-objects.c
+msgid "show progress meter during object writing phase"
+msgstr "在物件寫入階段顯示進度列"
+
+#: builtin/pack-objects.c
+msgid "similar to --all-progress when progress meter is shown"
+msgstr "顯示進度列時類似 --all-progress"
+
 #: builtin/pack-objects.c
 msgid "<version>[,<offset>]"
 msgstr "<版本>[,<位移>]"
@@ -11447,6 +11565,10 @@ msgstr ""
 "<git@vger.kernel.org> 讓我們知道您還在使用。\n"
 "感謝。\n"
 
+#: builtin/pack-redundant.c
+msgid "refusing to run without --i-still-use-this"
+msgstr "傳入 --i-still-use-this 前拒絕執行"
+
 #: builtin/pack-refs.c
 msgid "git pack-refs [--all] [--no-prune]"
 msgstr "git pack-refs [--all] [--no-prune]"
@@ -11457,7 +11579,7 @@ msgstr "打包一切"
 
 #: builtin/pack-refs.c
 msgid "prune loose refs (default)"
-msgstr "剪除鬆散引用(預設)"
+msgstr "剪除鬆散引用(預設)"
 
 #: builtin/patch-id.c
 msgid "git patch-id [--stable | --unstable | --verbatim]"
@@ -11650,9 +11772,9 @@ msgstr "更新尚未誕生的分支,變更新增至索引。"
 msgid "pull with rebase"
 msgstr "重定基底式拉取"
 
-#: builtin/pull.c
-msgid "please commit or stash them."
-msgstr "請提交或貯存它們。"
+#: builtin/pull.c builtin/rebase.c
+msgid "Please commit or stash them."
+msgstr "請提交或貯存修改。"
 
 #: builtin/pull.c
 #, c-format
@@ -11900,9 +12022,9 @@ msgstr "「%s」的值無效"
 msgid "repository"
 msgstr "版本庫"
 
-#: builtin/push.c builtin/send-pack.c
-msgid "push all refs"
-msgstr "æ\8e¨é\80\81æ\89\80æ\9c\89å¼\95ç\94¨"
+#: builtin/push.c
+msgid "push all branches"
+msgstr "æ\8e¨é\80\81æ\89\80æ\9c\89å\88\86æ\94¯"
 
 #: builtin/push.c builtin/send-pack.c
 msgid "mirror all refs"
@@ -11913,8 +12035,8 @@ msgid "delete refs"
 msgstr "刪除引用"
 
 #: builtin/push.c
-msgid "push tags (can't be used with --all or --mirror)"
-msgstr "推送標籤(不能使用 --all or --mirror)"
+msgid "push tags (can't be used with --all or --branches or --mirror)"
+msgstr "推送標籤(不能和 --all、--branches 或 --mirror 一起使用)"
 
 #: builtin/push.c builtin/send-pack.c
 msgid "force updates"
@@ -11972,7 +12094,7 @@ msgstr "需要遠端支援 atomic 事務"
 msgid "--delete doesn't make sense without any refs"
 msgstr "--delete 未接任何引用沒有意義"
 
-#: builtin/push.c
+#: builtin/push.c t/helper/test-bundle-uri.c
 #, c-format
 msgid "bad repository '%s'"
 msgstr "壞的版本庫 '%s'"
@@ -12237,11 +12359,20 @@ msgstr ""
 "\n"
 "因此 git 無法對其重定基底。"
 
+#: builtin/rebase.c
+#, c-format
+msgid "Unknown rebase-merges mode: %s"
+msgstr "未知的 rebase-merges 模式:%s"
+
 #: builtin/rebase.c
 #, c-format
 msgid "could not switch to %s"
 msgstr "無法切換到 %s"
 
+#: builtin/rebase.c
+msgid "apply options and merge options cannot be used together"
+msgstr "套用選項與合併選項不得同時使用"
+
 #: builtin/rebase.c
 #, c-format
 msgid ""
@@ -12249,6 +12380,15 @@ msgid ""
 "\"ask\"."
 msgstr "無法識別的 '%s' 空類型;有效的數值有 \"drop\"、\"keep\" 跟 \"ask\"。"
 
+#: builtin/rebase.c
+msgid ""
+"--rebase-merges with an empty string argument is deprecated and will stop "
+"working in a future version of Git. Use --rebase-merges without an argument "
+"instead, which does the same thing."
+msgstr ""
+"有字串引數的 --rebase-merges 已被棄用,而且會在未來的 Git 版本停止運作。請改"
+"用無引數的 --rebase-merges,功能相同。"
+
 #: builtin/rebase.c
 #, c-format
 msgid ""
@@ -12512,18 +12652,27 @@ msgstr ""
 msgid "switch `C' expects a numerical value"
 msgstr "開關 `C' 期望一個數字值"
 
-#: builtin/rebase.c
-#, c-format
-msgid "Unknown mode: %s"
-msgstr "未知模式:%s"
-
 #: builtin/rebase.c
 msgid "--strategy requires --merge or --interactive"
 msgstr "--strategy 需要 --merge 或 --interactive"
 
 #: builtin/rebase.c
-msgid "apply options and merge options cannot be used together"
-msgstr "套用選項與合併選項不得同時使用"
+msgid ""
+"apply options are incompatible with rebase.autoSquash.  Consider adding --no-"
+"autosquash"
+msgstr "apply 選項與 rebase.autoSquash 不相容。請考慮加上 --no-autosquash"
+
+#: builtin/rebase.c
+msgid ""
+"apply options are incompatible with rebase.rebaseMerges.  Consider adding --"
+"no-rebase-merges"
+msgstr "apply 選項與 rebase.rebaseMerges 不相容。請考慮加上 --no-rebase-merges"
+
+#: builtin/rebase.c
+msgid ""
+"apply options are incompatible with rebase.updateRefs.  Consider adding --no-"
+"update-refs"
+msgstr "apply 選項與 rebase.updateRefs 不相容。請考慮加上 --no-update-refs"
 
 #: builtin/rebase.c
 #, c-format
@@ -12572,10 +12721,6 @@ msgstr "'%s':只需要一個合併基礎"
 msgid "Does not point to a valid commit '%s'"
 msgstr "沒有指向一個有效的提交 '%s'"
 
-#: builtin/rebase.c
-msgid "Please commit or stash them."
-msgstr "請提交或貯存修改。"
-
 #: builtin/rebase.c
 msgid "HEAD is up to date."
 msgstr "HEAD 是最新的。"
@@ -13375,8 +13520,8 @@ msgid "approxidate"
 msgstr "近似日期"
 
 #: builtin/repack.c
-msgid "with -C, expire objects older than this"
-msgstr "搭配 -C 會將早於此的物件設為過期"
+msgid "with --cruft, expire objects older than this"
+msgstr "搭配 --cruft 會將早於此的物件標為過期"
 
 #: builtin/repack.c
 msgid "remove redundant packs, and run git-prune-packed"
@@ -13484,7 +13629,7 @@ msgstr "pack-objects 沒有為 %2$s-%3$s 套件包寫入 “%1$s” 檔案"
 #: builtin/repack.c sequencer.c
 #, c-format
 msgid "could not unlink: %s"
-msgstr "ç\84¡æ³\95å\8f\96æ¶\88é\80£çµ\90:%s"
+msgstr "ç\84¡æ³\95å\88ªé\99¤:%s"
 
 #: builtin/replace.c
 msgid "git replace [-f] <object> <replacement>"
@@ -14208,6 +14353,10 @@ msgstr ""
 msgid "remote name"
 msgstr "遠端名稱"
 
+#: builtin/send-pack.c
+msgid "push all refs"
+msgstr "推送所有引用"
+
 #: builtin/send-pack.c
 msgid "use stateless RPC protocol"
 msgstr "使用無狀態的 RPC 協定"
@@ -14462,9 +14611,11 @@ msgstr "顯示從標準輸入中讀入的不在本機版本庫中的引用"
 
 #: builtin/sparse-checkout.c
 msgid ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 msgstr ""
-"git sparse-checkout (init | list | set | add | reapply | disable) [<options>]"
+"git sparse-checkout (init | list | set | add | reapply | disable | check-"
+"rules) [<options>]"
 
 #: builtin/sparse-checkout.c
 msgid "this worktree is not sparse"
@@ -14605,6 +14756,27 @@ msgstr "必須在稀疏提交才能重新套用稀疏樣式 (sparsity pattern)"
 msgid "error while refreshing working directory"
 msgstr "重新整理工作目錄時發生錯誤"
 
+#: builtin/sparse-checkout.c
+msgid ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+msgstr ""
+"git sparse-checkout check-rules [-z] [--skip-checks][--[no-]cone] [--rules-"
+"file <file>]"
+
+#: builtin/sparse-checkout.c
+msgid "terminate input and output files by a NUL character"
+msgstr "使用 NUL 字元終止輸入和輸出檔案"
+
+#: builtin/sparse-checkout.c
+msgid "when used with --rules-file interpret patterns as cone mode patterns"
+msgstr ""
+"與 --rules-file 搭配使用時,將 patterns (模式) 解釋為 cone 模式的 patterns"
+
+#: builtin/sparse-checkout.c
+msgid "use patterns in <file> instead of the current ones."
+msgstr "使用 <file> 中的(而非目前使用的)模式。"
+
 #: builtin/stash.c
 msgid "git stash list [<log-options>]"
 msgstr "git stash list [<log-options>]"
@@ -15562,11 +15734,6 @@ msgstr "「%s」不是有效的子模組名稱"
 msgid "git submodule--helper <command>"
 msgstr "git submodule--helper <command>"
 
-#: builtin/submodule--helper.c git.c
-#, c-format
-msgid "%s doesn't support --super-prefix"
-msgstr "%s 不支援 --super-prefix"
-
 #: builtin/symbolic-ref.c
 msgid "git symbolic-ref [-m <reason>] <name> <ref>"
 msgstr "git symbolic-ref [-m <reason>] <name> <ref>"
@@ -16468,6 +16635,11 @@ msgstr "只對除錯有用"
 msgid "core.fsyncMethod = batch is unsupported on this platform"
 msgstr "core.fsyncMethod = batch 不支援本平台"
 
+#: bundle-uri.c
+#, c-format
+msgid "could not parse bundle list key %s with value '%s'"
+msgstr "無法解析套件包清單鍵 %s 的值 “%s”"
+
 #: bundle-uri.c
 #, c-format
 msgid "bundle list at '%s' has no mode"
@@ -16481,6 +16653,15 @@ msgstr "無法建立暫存檔"
 msgid "insufficient capabilities"
 msgstr "功能不足"
 
+#: bundle-uri.c
+#, c-format
+msgid "file downloaded from '%s' is not a bundle"
+msgstr "從 “%s” 下載的檔案不是套件包"
+
+#: bundle-uri.c
+msgid "failed to store maximum creation token"
+msgstr "無法儲存最大的建立權杖"
+
 #: bundle-uri.c
 #, c-format
 msgid "unrecognized bundle mode from URI '%s'"
@@ -16501,6 +16682,15 @@ msgstr "無法從 “%s” URI 下載套件包"
 msgid "file at URI '%s' is not a bundle or bundle list"
 msgstr "位於 URI “%s” 的檔案不是套件包或套件包清單"
 
+#: bundle-uri.c
+#, c-format
+msgid "bundle-uri: unexpected argument: '%s'"
+msgstr "bundle-uri: 非預期的引數:“%s”"
+
+#: bundle-uri.c
+msgid "bundle-uri: expected flush after arguments"
+msgstr "bundle-uri: 引數後應該有一個 flush 包"
+
 #: bundle-uri.c
 msgid "bundle-uri: got an empty line"
 msgstr "bundle-uri: 收到空白列"
@@ -16541,6 +16731,12 @@ msgstr "版本庫中缺少這些必備的提交:"
 msgid "need a repository to verify a bundle"
 msgstr "需要版本庫驗證套件包"
 
+#: bundle.c
+msgid ""
+"some prerequisite commits exist in the object store, but are not connected "
+"to the repository's history"
+msgstr "一些前提提交存在於物件儲存區,但未連接到版本庫的歷史記錄"
+
 #: bundle.c
 #, c-format
 msgid "The bundle contains this ref:"
@@ -16739,7 +16935,7 @@ msgstr "取得和設定版本庫或者全域選項"
 
 #: command-list.h
 msgid "Count unpacked number of objects and their disk consumption"
-msgstr "計算未打包物件的數量和磁碟空間用"
+msgstr "計算未打包物件的數量和磁碟空間用"
 
 #: command-list.h
 msgid "Retrieve and store user credentials"
@@ -18108,8 +18304,8 @@ msgid "bad zlib compression level %d"
 msgstr "錯誤的 zlib 壓縮級別 %d"
 
 #: config.c
-msgid "core.commentChar should only be one character"
-msgstr "core.commentChar 應該是一個字元"
+msgid "core.commentChar should only be one ASCII character"
+msgstr "core.commentChar 應該是一個 ASCII 字元"
 
 #: config.c
 #, c-format
@@ -18247,6 +18443,11 @@ msgstr "不能設定 '%s' 為 '%s'"
 msgid "invalid section name: %s"
 msgstr "無效的小節名稱:%s"
 
+#: config.c
+#, c-format
+msgid "refusing to work with overly long line in '%s' on line %<PRIuMAX>"
+msgstr "因為第 %2$<PRIuMAX> 列中 “%1$s” 的文字列太長,故拒絕運作"
+
 #: config.c
 #, c-format
 msgid "missing value for '%s'"
@@ -18315,17 +18516,26 @@ msgstr "伺服器指定的「%s」物件格式無效"
 
 #: connect.c
 #, c-format
-msgid "invalid ls-refs response: %s"
-msgstr "無效的 ls-refs 回應:%s"
+msgid "error on bundle-uri response line %d: %s"
+msgstr "在 bundle-uri 回應的第 %d 列發現錯誤:%s"
 
 #: connect.c
-msgid "expected flush after ref listing"
-msgstr "在引用列表之後應該有一個 flush 包"
+msgid "expected flush after bundle-uri listing"
+msgstr "在 bundle-uri 清單後應該有一個 flush 包"
 
 #: connect.c
 msgid "expected response end packet after ref listing"
 msgstr "在引用列表後預期要有回應結束封包"
 
+#: connect.c
+#, c-format
+msgid "invalid ls-refs response: %s"
+msgstr "無效的 ls-refs 回應:%s"
+
+#: connect.c
+msgid "expected flush after ref listing"
+msgstr "在引用列表之後應該有一個 flush 包"
+
 #: connect.c
 #, c-format
 msgid "protocol '%s' is not supported"
@@ -18926,7 +19136,7 @@ msgstr "<參數1,參數2>..."
 #: diff.c
 msgid ""
 "output the distribution of relative amount of changes for each sub-directory"
-msgstr "輸出每個子目錄相對變更的分"
+msgstr "輸出每個子目錄相對變更的分"
 
 #: diff.c
 msgid "synonym for --dirstat=cumulative"
@@ -19038,6 +19248,10 @@ msgstr "輸出的每一行附加前綴"
 msgid "do not show any source or destination prefix"
 msgstr "不顯示任何來源和目的地前綴"
 
+#: diff.c
+msgid "use default prefixes a/ and b/"
+msgstr "使用預設的前置名稱 a/ 和 b/"
+
 #: diff.c
 msgid "show context between diff hunks up to the specified number of lines"
 msgstr "顯示指定行數的差異區塊間的上下文"
@@ -19407,6 +19621,16 @@ msgstr "不能從 '%s' 遷移 git 目錄到 '%s'"
 msgid "hint: Waiting for your editor to close the file...%c"
 msgstr "提示:等待您的編輯器關閉檔案...%c"
 
+#: editor.c sequencer.c wrapper.c
+#, c-format
+msgid "could not write to '%s'"
+msgstr "不能寫入 '%s'"
+
+#: editor.c
+#, c-format
+msgid "could not edit '%s'"
+msgstr "無法編輯 '%s'"
+
 #: entry.c
 msgid "Filtering content"
 msgstr "過濾內容"
@@ -19727,16 +19951,14 @@ msgid ""
 "           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
 "bare]\n"
 "           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-"           [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-"           <command> [<args>]"
+"           [--config-env=<name>=<envvar>] <command> [<args>]"
 msgstr ""
 "git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
 "           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
 "           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
 "bare]\n"
 "           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
-"           [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
-"           <command> [<args>]"
+"           [--config-env=<name>=<envvar>] <command> [<args>]"
 
 #: git.c
 msgid ""
@@ -19765,11 +19987,6 @@ msgstr "未傳入目錄至「%s」選項\n"
 msgid "no namespace given for --namespace\n"
 msgstr "沒有為 --namespace 提供命名空間\n"
 
-#: git.c
-#, c-format
-msgid "no prefix given for --super-prefix\n"
-msgstr "沒有為 --super-prefix 提供前綴\n"
-
 #: git.c
 #, c-format
 msgid "-c expects a configuration string\n"
@@ -19780,6 +19997,11 @@ msgstr "應為 -c 提供一個設定字串\n"
 msgid "no config key given for --config-env\n"
 msgstr "未傳入設定鍵至 --config-env\n"
 
+#: git.c
+#, c-format
+msgid "no attribute source given for --attr-source\n"
+msgstr "沒有為 --attr-source 提供屬性來源\n"
+
 #: git.c
 #, c-format
 msgid "unknown option: %s\n"
@@ -19904,8 +20126,13 @@ msgid "gpg.ssh.defaultKeyCommand failed: %s %s"
 msgstr "gpg.ssh.defaultKeyCommand 執行失敗:%s %s"
 
 #: gpg-interface.c
-msgid "gpg failed to sign the data"
-msgstr "gpg 無法為資料簽名"
+#, c-format
+msgid ""
+"gpg failed to sign the data:\n"
+"%s"
+msgstr ""
+"gpg 無法簽名資料:\n"
+"%s"
 
 #: gpg-interface.c
 msgid "user.signingKey needs to be set for ssh signing"
@@ -20566,7 +20793,7 @@ msgstr ""
 #. conflict in a submodule. The first argument is the submodule
 #. name, and the second argument is the abbreviated id of the
 #. commit that needs to be merged.  For example:
-#.  - go to submodule (mysubmodule), and either merge commit abc1234"
+#. - go to submodule (mysubmodule), and either merge commit abc1234"
 #.
 #: merge-ort.c
 #, c-format
@@ -20755,7 +20982,7 @@ msgstr "重新命名"
 
 #: merge-recursive.c
 msgid "renamed"
-msgstr "重新命名"
+msgstr "重新命名"
 
 #: merge-recursive.c
 #, c-format
@@ -21248,6 +21475,11 @@ msgstr "損壞的鬆散物件 '%s'"
 msgid "garbage at end of loose object '%s'"
 msgstr "鬆散物件 '%s' 後面有垃圾資料"
 
+#: object-file.c
+#, c-format
+msgid "unable to open loose object %s"
+msgstr "無法打開鬆散物件 %s"
+
 #: object-file.c
 #, c-format
 msgid "unable to parse %s header"
@@ -21269,19 +21501,14 @@ msgstr "%s 的標頭過長,超出 %d 位元組"
 
 #: object-file.c
 #, c-format
-msgid "failed to read object %s"
-msgstr "讀取物件 %s 失敗"
+msgid "loose object %s (stored in %s) is corrupt"
+msgstr "鬆散物件 %s(儲存在 %s)已損壞"
 
 #: object-file.c
 #, c-format
 msgid "replacement %s not found for %s"
 msgstr "找不到 %2$s 的替代 %1$s"
 
-#: object-file.c
-#, c-format
-msgid "loose object %s (stored in %s) is corrupt"
-msgstr "鬆散物件 %s(儲存在 %s)已損壞"
-
 #: object-file.c
 #, c-format
 msgid "packed object %s (stored in %s) is corrupt"
@@ -21297,10 +21524,6 @@ msgstr "無法寫檔案 %s"
 msgid "unable to set permission to '%s'"
 msgstr "無法為 '%s' 設定權限"
 
-#: object-file.c
-msgid "file write error"
-msgstr "檔案寫錯誤"
-
 #: object-file.c
 msgid "error when closing loose object file"
 msgstr "關閉鬆散物件檔案時發生錯誤"
@@ -21359,12 +21582,13 @@ msgid "cannot read object for %s"
 msgstr "不能讀取物件 %s"
 
 #: object-file.c
-msgid "corrupt commit"
-msgstr "損壞的提交"
+#, c-format
+msgid "object fails fsck: %s"
+msgstr "物件 fsck 失敗:%s"
 
 #: object-file.c
-msgid "corrupt tag"
-msgstr "æ\90\8då£\9eç\9a\84æ¨\99籤"
+msgid "refusing to create malformed object"
+msgstr "æ\8b\92çµ\95建ç«\8bæ ¼å¼\8fé\8c¯èª¤ç\9a\84ç\89©ä»¶"
 
 #: object-file.c
 #, c-format
@@ -21433,7 +21657,7 @@ msgstr "%s [無效物件]"
 #. TRANSLATORS: This is a line of ambiguous commit
 #. object output. E.g.:
 #. *
-#.    "deadbeef commit 2021-01-01 - Some Commit Message"
+#. "deadbeef commit 2021-01-01 - Some Commit Message"
 #.
 #: object-name.c
 #, c-format
@@ -21443,7 +21667,7 @@ msgstr "%s 提交 %s - %s"
 #. TRANSLATORS: This is a line of ambiguous
 #. tag object output. E.g.:
 #. *
-#.    "deadbeef tag 2022-01-01 - Some Tag Message"
+#. "deadbeef tag 2022-01-01 - Some Tag Message"
 #. *
 #. The second argument is the YYYY-MM-DD found
 #. in the tag.
@@ -21460,7 +21684,7 @@ msgstr "%s 標籤 %s - %s"
 #. tag object output where we couldn't parse
 #. the tag itself. E.g.:
 #. *
-#.    "deadbeef [bad tag, could not parse it]"
+#. "deadbeef [bad tag, could not parse it]"
 #.
 #: object-name.c
 #, c-format
@@ -21675,11 +21899,6 @@ msgstr "位圖包索引的 XOR 偏移無效"
 msgid "cannot fstat bitmap file"
 msgstr "無法 fstat 位圖檔案"
 
-#: pack-bitmap.c
-#, c-format
-msgid "ignoring extra bitmap file: '%s'"
-msgstr "忽略多出來的位圖檔案:「%s」"
-
 #: pack-bitmap.c
 msgid "checksum doesn't match in MIDX and bitmap"
 msgstr "總和檢查碼在 MIDX 和位圖中無符合項目"
@@ -21763,6 +21982,11 @@ msgstr "在「%2$s」封包,位移 %3$<PRIuMAX> 的地方找不到「%1$s」"
 msgid "unable to get disk usage of '%s'"
 msgstr "無法取得「%s」的磁碟用量"
 
+#: pack-bitmap.c
+#, c-format
+msgid "bitmap file '%s' has invalid checksum"
+msgstr "“%s” 位圖檔案的總和檢查碼無效"
+
 #: pack-mtimes.c
 #, c-format
 msgid "mtimes file %s is too small"
@@ -21813,6 +22037,15 @@ msgstr "倒排索引檔案 %s 有不支援的版本 %<PRIu32>"
 msgid "reverse-index file %s has unsupported hash id %<PRIu32>"
 msgstr "倒排索引檔案 %s 有不支援的雜湊 ID %<PRIu32>"
 
+#: pack-revindex.c
+msgid "invalid checksum"
+msgstr "無效的總和檢查碼"
+
+#: pack-revindex.c
+#, c-format
+msgid "invalid rev-index position at %<PRIu64>: %<PRIu32> != %<PRIu32>"
+msgstr "%<PRIu64> 位置的修訂版索引 (rev-index) 無效:%<PRIu32> != %<PRIu32>"
+
 #: pack-write.c
 msgid "cannot both write and verify reverse index"
 msgstr "無法同時寫入和驗證倒排索引"
@@ -22006,6 +22239,10 @@ msgstr "更加安靜"
 msgid "use <n> digits to display object names"
 msgstr "用 <n> 位數字顯示物件名稱"
 
+#: parse-options.h
+msgid "prefixed path to initial superproject"
+msgstr "初始父專案的前綴路徑"
+
 #: parse-options.h
 msgid "how to strip spaces and #comments from message"
 msgstr "設定如何刪除提交說明裡的空格和 #備註"
@@ -22587,6 +22824,16 @@ msgstr "落後 %d"
 msgid "ahead %d, behind %d"
 msgstr "領先 %d,落後 %d"
 
+#: ref-filter.c
+#, c-format
+msgid "%%(%.*s) does not take arguments"
+msgstr "%%(%.*s) 不取引數"
+
+#: ref-filter.c
+#, c-format
+msgid "unrecognized %%(%.*s) argument: %s"
+msgstr "無法識別的 %%(%.*s) 引數:%s"
+
 #: ref-filter.c
 #, c-format
 msgid "expected format: %%(color:<color>)"
@@ -22607,26 +22854,6 @@ msgstr "期望整數值 refname:lstrip=%s"
 msgid "Integer value expected refname:rstrip=%s"
 msgstr "期望整數值 refname:rstrip=%s"
 
-#: ref-filter.c
-#, c-format
-msgid "unrecognized %%(%s) argument: %s"
-msgstr "無法識別的 %%(%s) 參數:%s"
-
-#: ref-filter.c
-#, c-format
-msgid "%%(objecttype) does not take arguments"
-msgstr "%%(objecttype) 不帶參數"
-
-#: ref-filter.c
-#, c-format
-msgid "%%(deltabase) does not take arguments"
-msgstr "%%(deltabase) 不帶參數"
-
-#: ref-filter.c
-#, c-format
-msgid "%%(body) does not take arguments"
-msgstr "%%(body) 不帶參數"
-
 #: ref-filter.c
 #, c-format
 msgid "expected %%(trailers:key=<value>)"
@@ -22647,11 +22874,6 @@ msgstr "期望一個正數 contents:lines=%s"
 msgid "positive value expected '%s' in %%(%s)"
 msgstr "%%(%2$s) 中的 '%1$s' 預期是正數值"
 
-#: ref-filter.c
-#, c-format
-msgid "unrecognized email option: %s"
-msgstr "無法識別的 email 選項:%s"
-
 #: ref-filter.c
 #, c-format
 msgid "expected format: %%(align:<width>,<position>)"
@@ -22667,6 +22889,11 @@ msgstr "無法識別的位置:%s"
 msgid "unrecognized width:%s"
 msgstr "無法識別的寬度:%s"
 
+#: ref-filter.c
+#, c-format
+msgid "unrecognized %%(%s) argument: %s"
+msgstr "無法識別的 %%(%s) 參數:%s"
+
 #: ref-filter.c
 #, c-format
 msgid "positive width expected with the %%(align) atom"
@@ -22674,8 +22901,8 @@ msgstr "元素 %%(align) 需要一個正數的寬度"
 
 #: ref-filter.c
 #, c-format
-msgid "%%(rest) does not take arguments"
-msgstr "%%(rest) 未取引數"
+msgid "expected format: %%(ahead-behind:<committish>)"
+msgstr "預期格式:%%(ahead-behind:<committish>)"
 
 #: ref-filter.c
 #, c-format
@@ -23413,7 +23640,7 @@ msgstr "使用之前的解決方案解決 '%s'。"
 #: rerere.c
 #, c-format
 msgid "cannot unlink stray '%s'"
-msgstr "不能刪除 stray '%s'"
+msgstr "無法刪除失散檔案 “%s”"
 
 #: rerere.c
 #, c-format
@@ -23430,11 +23657,6 @@ msgstr "更新 '%s' 中的衝突狀態失敗"
 msgid "no remembered resolution for '%s'"
 msgstr "沒有為 '%s' 記憶的解決方案"
 
-#: rerere.c
-#, c-format
-msgid "cannot unlink '%s'"
-msgstr "不能刪除 '%s'"
-
 #: rerere.c
 #, c-format
 msgid "Updated preimage for '%s'"
@@ -23851,11 +24073,6 @@ msgstr ""
 msgid "could not lock '%s'"
 msgstr "不能鎖定 '%s'"
 
-#: sequencer.c strbuf.c wrapper.c
-#, c-format
-msgid "could not write to '%s'"
-msgstr "不能寫入 '%s'"
-
 #: sequencer.c
 #, c-format
 msgid "could not write eol to '%s'"
@@ -24183,6 +24400,26 @@ msgstr "git %s:無法讀取索引"
 msgid "git %s: failed to refresh the index"
 msgstr "git %s:無法重新整理索引"
 
+#: sequencer.c
+#, c-format
+msgid "'%s' is not a valid label"
+msgstr "“%s” 不是有效的標籤"
+
+#: sequencer.c
+#, c-format
+msgid "'%s' is not a valid refname"
+msgstr "“%s” 不是有效的引用名稱"
+
+#: sequencer.c
+#, c-format
+msgid "update-ref requires a fully qualified refname e.g. refs/heads/%s"
+msgstr "update-ref 需要完全限定的引用名稱,比如:refs/heads/%s"
+
+#: sequencer.c
+#, c-format
+msgid "invalid command '%.*s'"
+msgstr "無效的命令 “%.*s”"
+
 #: sequencer.c
 #, c-format
 msgid "%s does not accept arguments: '%s'"
@@ -24273,10 +24510,6 @@ msgstr "嘗試 \"git cherry-pick (--continue | %s--abort | --quit)\""
 msgid "could not create sequencer directory '%s'"
 msgstr "不能建立序列目錄 '%s'"
 
-#: sequencer.c
-msgid "could not lock HEAD"
-msgstr "不能鎖定 HEAD"
-
 #: sequencer.c
 msgid "no cherry-pick or revert in progress"
 msgstr "揀選或還原動作並未進行"
@@ -24392,22 +24625,22 @@ msgstr ""
 "\n"
 
 #: sequencer.c
-msgid "and made changes to the index and/or the working tree\n"
-msgstr "並且修改索引和/或工作區\n"
+msgid "and made changes to the index and/or the working tree.\n"
+msgstr "並且更改索引和(或)工作區。\n"
 
 #: sequencer.c
 #, c-format
 msgid ""
 "execution succeeded: %s\n"
-"but left changes to the index and/or the working tree\n"
+"but left changes to the index and/or the working tree.\n"
 "Commit or stash your changes, and then run\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
 msgstr ""
 "執行成功:%s\n"
-"但是在索引和/或工作區中存在變更\n"
-"提交或貯存修改,然後執行\n"
+"但是在索引和(或)工作區中存在變更。\n"
+"提交或貯存修改,然後執行\n"
 "\n"
 "  git rebase --continue\n"
 "\n"
@@ -24924,11 +25157,6 @@ msgid "%u byte/s"
 msgid_plural "%u bytes/s"
 msgstr[0] "%u 位元組/秒"
 
-#: strbuf.c
-#, c-format
-msgid "could not edit '%s'"
-msgstr "無法編輯 '%s'"
-
 #: submodule-config.c
 #, c-format
 msgid "ignoring suspicious submodule name: %s"
@@ -25139,6 +25367,19 @@ msgstr "ls-tree 返回未知返回值 %d"
 msgid "failed to lstat '%s'"
 msgstr "無法 lstat “%s”"
 
+#: t/helper/test-bundle-uri.c
+msgid "no remote configured to get bundle URIs from"
+msgstr "沒有設定可以用來取得套件包 URIs 的遠端"
+
+#: t/helper/test-bundle-uri.c
+#, c-format
+msgid "remote '%s' has no configured URL"
+msgstr "“%s” 遠端未設定 URL"
+
+#: t/helper/test-bundle-uri.c
+msgid "could not get the bundle-uri list"
+msgstr "無法取得 bundle-uri 清單"
+
 #: t/helper/test-cache-tree.c
 msgid "test-tool cache-tree <options> (control|prime|update)"
 msgstr "test-tool cache-tree <options> (control|prime|update)"
@@ -25575,6 +25816,14 @@ msgstr "正在終止。"
 msgid "failed to push all needed submodules"
 msgstr "不能推送全部需要的子模組"
 
+#: transport.c
+msgid "bundle-uri operation not supported by protocol"
+msgstr "通訊協定不支援 bundle-uri 動作"
+
+#: transport.c
+msgid "could not retrieve server-advertised bundle-uri list"
+msgstr "無法取得伺服器公佈的 bundle-uri 清單"
+
 #: tree-walk.c
 msgid "too-short tree object"
 msgstr "太短的樹狀物件"
@@ -26489,12 +26738,20 @@ msgstr "忽略的檔案"
 #: wt-status.c
 #, c-format
 msgid ""
-"It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
-"may speed it up, but you have to be careful not to forget to add\n"
-"new files yourself (see 'git help status')."
+"It took %.2f seconds to enumerate untracked files,\n"
+"but the results were cached, and subsequent runs may be faster."
 msgstr ""
-"耗費了 %.2f 秒以枚舉未追蹤的檔案。'status -uno' 也許能提高速度,\n"
-"但您需要小心不要忘了新增新檔案(參見 'git help status')。"
+"列舉未追蹤檔案花費 %.2f 秒,\n"
+"不過已經快取結果,之後執行的速度或許能比較快。"
+
+#: wt-status.c
+#, c-format
+msgid "It took %.2f seconds to enumerate untracked files."
+msgstr "列舉未追蹤檔案花費 %.2f 秒。"
+
+#: wt-status.c
+msgid "See 'git help status' for information on how to improve this."
+msgstr "請參閱 “git help status” 深入了解如何改善。"
 
 #: wt-status.c
 #, c-format
@@ -26582,384 +26839,93 @@ msgstr "領先 "
 msgid "cannot %s: You have unstaged changes."
 msgstr "不能%s:您有未暫存的變更。"
 
-#: wt-status.c
-msgid "additionally, your index contains uncommitted changes."
-msgstr "另外,您的索引中包含未提交的變更。"
-
-#: wt-status.c
-#, c-format
-msgid "cannot %s: Your index contains uncommitted changes."
-msgstr "不能%s:您的索引中包含未提交的變更。"
-
-#: git-merge-octopus.sh git-merge-resolve.sh
-msgid ""
-"Error: Your local changes to the following files would be overwritten by "
-"merge"
-msgstr "錯誤:您對下列檔案的本機修改將被合併動作覆蓋"
-
-#: git-merge-octopus.sh
-msgid "Automated merge did not work."
-msgstr "自動合併未生效。"
-
-#: git-merge-octopus.sh
-msgid "Should not be doing an octopus."
-msgstr "不應該執行章魚式合併。"
-
-#: git-merge-octopus.sh
-#, sh-format
-msgid "Unable to find common commit with $pretty_name"
-msgstr "無法找到和 $pretty_name 的基礎提交"
-
-#: git-merge-octopus.sh
-#, sh-format
-msgid "Already up to date with $pretty_name"
-msgstr "已經和 $pretty_name 保持一致"
-
-#: git-merge-octopus.sh
-#, sh-format
-msgid "Fast-forwarding to: $pretty_name"
-msgstr "快轉至:$pretty_name"
-
-#: git-merge-octopus.sh
-#, sh-format
-msgid "Trying simple merge with $pretty_name"
-msgstr "嘗試和 $pretty_name 的簡單合併"
-
-#: git-merge-octopus.sh
-msgid "Simple merge did not work, trying automatic merge."
-msgstr "簡單合併未生效,嘗試自動合併。"
-
-#: git-sh-setup.sh
-#, sh-format
-msgid "usage: $dashless $USAGE"
-msgstr "用法:$dashless $USAGE"
-
-#: git-sh-setup.sh
-#, sh-format
-msgid "Cannot chdir to $cdup, the toplevel of the working tree"
-msgstr "不能切換目錄到 $cdup,工作區的頂級目錄"
-
-#: git-sh-setup.sh
-#, sh-format
-msgid "fatal: $program_name cannot be used without a working tree."
-msgstr "致命錯誤:$program_name 不能在沒有工作區的情況下使用。"
-
-#: git-sh-setup.sh
-msgid "Cannot rewrite branches: You have unstaged changes."
-msgstr "不能重寫分支:您有未暫存的變更。"
-
-#: git-sh-setup.sh
-#, sh-format
-msgid "Cannot $action: You have unstaged changes."
-msgstr "不能 $action:您有未暫存的變更。"
-
-#: git-sh-setup.sh
-#, sh-format
-msgid "Cannot $action: Your index contains uncommitted changes."
-msgstr "不能 $action:您的索引中包含未提交的變更。"
-
-#: git-sh-setup.sh
-msgid "Additionally, your index contains uncommitted changes."
-msgstr "而且您的索引中包含未提交的變更。"
-
-#: git-sh-setup.sh
-msgid "You need to run this command from the toplevel of the working tree."
-msgstr "您需要在工作區的頂級目錄中執行這個指令。"
-
-#: git-sh-setup.sh
-msgid "Unable to determine absolute path of git directory"
-msgstr "不能確定 git 目錄的絕對路徑"
-
-#. TRANSLATORS: you can adjust this to align "git add -i" status menu
-#: git-add--interactive.perl
-#, perl-format
-msgid "%12s %12s %s"
-msgstr "%12s %12s %s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "touched %d path\n"
-msgid_plural "touched %d paths\n"
-msgstr[0] "建立了 %d 個路徑\n"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for staging."
-msgstr "如果修補檔能完全套用,編輯區塊將立即標記為暫存。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for stashing."
-msgstr "如果修補檔能完全套用,編輯區塊將立即標記為貯存。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for unstaging."
-msgstr "如果修補檔能完全套用,編輯區塊將立即標記為未暫存。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for applying."
-msgstr "如果修補檔能完全套用,編輯區塊將立即標記為套用。"
-
-#: git-add--interactive.perl
-msgid ""
-"If the patch applies cleanly, the edited hunk will immediately be\n"
-"marked for discarding."
-msgstr "如果修補檔能完全套用,編輯塊將立即標記為捨棄。"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for writing: %s"
-msgstr "為寫入開啟區塊編輯檔案失敗:%s"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid ""
-"---\n"
-"To remove '%s' lines, make them ' ' lines (context).\n"
-"To remove '%s' lines, delete them.\n"
-"Lines starting with %s will be removed.\n"
-msgstr ""
-"---\n"
-"要刪除 '%s' 開始的行,使其成為 ' ' 開始的行(上下文)。\n"
-"要刪除 '%s' 開始的行,刪除它們。\n"
-"以 %s 開始的行將被刪除。\n"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "failed to open hunk edit file for reading: %s"
-msgstr "無法讀取區塊編輯檔案:%s"
-
-#: git-add--interactive.perl
-msgid ""
-"y - stage this hunk\n"
-"n - do not stage this hunk\n"
-"q - quit; do not stage this hunk or any of the remaining ones\n"
-"a - stage this hunk and all later hunks in the file\n"
-"d - do not stage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 暫存此區塊\n"
-"n - 不要暫存此區塊\n"
-"q - 離開。不暫存此區塊及後面的全部區塊\n"
-"a - 暫存此區塊和本檔案中後面的全部區塊\n"
-"d - 不暫存此區塊和本檔案中後面的全部區塊"
-
-#: git-add--interactive.perl
-msgid ""
-"y - stash this hunk\n"
-"n - do not stash this hunk\n"
-"q - quit; do not stash this hunk or any of the remaining ones\n"
-"a - stash this hunk and all later hunks in the file\n"
-"d - do not stash this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 貯存此區塊\n"
-"n - 不要貯存此區塊\n"
-"q - 離開。不貯存此區塊及後面的全部區塊\n"
-"a - 貯存此區塊和本檔案中後面的全部區塊\n"
-"d - 不貯存此區塊和本檔案中後面的全部區塊"
-
-#: git-add--interactive.perl
-msgid ""
-"y - unstage this hunk\n"
-"n - do not unstage this hunk\n"
-"q - quit; do not unstage this hunk or any of the remaining ones\n"
-"a - unstage this hunk and all later hunks in the file\n"
-"d - do not unstage this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 不暫存此區塊\n"
-"n - 不要不暫存此區塊\n"
-"q - 離開。不要不暫存此區塊及後面的全部區塊\n"
-"a - 不暫存此區塊和本檔案中後面的全部區塊\n"
-"d - 不要不暫存此區塊和本檔案中後面的全部區塊"
-
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to index\n"
-"n - do not apply this hunk to index\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引中套用此區塊\n"
-"n - 不要在索引中套用此區塊\n"
-"q - 離開。不要套用此區塊及後面的全部區塊\n"
-"a - 套用此區塊和本檔案中後面的全部區塊\n"
-"d - 不要套用此區塊和本檔案中後面的全部區塊"
-
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from worktree\n"
-"n - do not discard this hunk from worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在工作區中捨棄此區塊\n"
-"n - 不要在工作區中捨棄此區塊\n"
-"q - 離開。不要捨棄此區塊及後面的全部區塊\n"
-"a - 捨棄此區塊和本檔案中後面的全部區塊\n"
-"d - 不要捨棄此區塊和本檔案中後面的全部區塊"
+#: wt-status.c
+msgid "additionally, your index contains uncommitted changes."
+msgstr "另外,您的索引中包含未提交的變更。"
 
-#: git-add--interactive.perl
-msgid ""
-"y - discard this hunk from index and worktree\n"
-"n - do not discard this hunk from index and worktree\n"
-"q - quit; do not discard this hunk or any of the remaining ones\n"
-"a - discard this hunk and all later hunks in the file\n"
-"d - do not discard this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引和工作區中捨棄此區塊\n"
-"n - 不要在索引和工作區中捨棄此區塊\n"
-"q - 離開。不要捨棄此區塊及後面的全部區塊\n"
-"a - 捨棄此區塊和本檔案中後面的全部區塊\n"
-"d - 不要捨棄此區塊和本檔案中後面的全部區塊"
+#: wt-status.c
+#, c-format
+msgid "cannot %s: Your index contains uncommitted changes."
+msgstr "不能%s:您的索引中包含未提交的變更。"
 
-#: git-add--interactive.perl
+#: git-merge-octopus.sh git-merge-resolve.sh
 msgid ""
-"y - apply this hunk to index and worktree\n"
-"n - do not apply this hunk to index and worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在索引和工作區中套用此區塊\n"
-"n - 不要在索引和工作區中套用此區塊\n"
-"q - 離開。不要套用此區塊及後面的全部區塊\n"
-"a - 套用此區塊和本檔案中後面的全部區塊\n"
-"d - 不要套用此區塊和本檔案中後面的全部區塊"
+"Error: Your local changes to the following files would be overwritten by "
+"merge"
+msgstr "錯誤:您對下列檔案的本機修改將被合併動作覆蓋"
 
-#: git-add--interactive.perl
-msgid ""
-"y - apply this hunk to worktree\n"
-"n - do not apply this hunk to worktree\n"
-"q - quit; do not apply this hunk or any of the remaining ones\n"
-"a - apply this hunk and all later hunks in the file\n"
-"d - do not apply this hunk or any of the later hunks in the file"
-msgstr ""
-"y - 在工作區中套用此區塊\n"
-"n - 不要在工作區中套用此區塊\n"
-"q - 離開。不要套用此區塊及後面的全部區塊\n"
-"a - 套用此區塊和本檔案中後面的全部區塊\n"
-"d - 不要套用此區塊和本檔案中後面的全部區塊"
+#: git-merge-octopus.sh
+msgid "Automated merge did not work."
+msgstr "自動合併未生效。"
 
-#: git-add--interactive.perl
-msgid ""
-"g - select a hunk to go to\n"
-"/ - search for a hunk matching the given regex\n"
-"j - leave this hunk undecided, see next undecided hunk\n"
-"J - leave this hunk undecided, see next hunk\n"
-"k - leave this hunk undecided, see previous undecided hunk\n"
-"K - leave this hunk undecided, see previous hunk\n"
-"s - split the current hunk into smaller hunks\n"
-"e - manually edit the current hunk\n"
-"? - print help\n"
-msgstr ""
-"g - 選擇跳轉到一個區塊\n"
-"/ - 尋找和提供常規表示式符合的區塊\n"
-"j - 維持此區塊未決狀態,檢視下一個未決定區塊\n"
-"J - 維持此區塊未決狀態,檢視下一個區塊\n"
-"k - 維持此區塊未決狀態,檢視上一個未決定區塊\n"
-"K - 維持此區塊未決狀態,檢視上一個區塊\n"
-"s - 分割目前區塊為更小的區塊\n"
-"e - 手動編輯目前區塊\n"
-"? - 顯示說明\n"
+#: git-merge-octopus.sh
+msgid "Should not be doing an octopus."
+msgstr "不應該執行章魚式合併。"
 
-#: git-add--interactive.perl
-msgid "The selected hunks do not apply to the index!\n"
-msgstr "選取區塊不能套用到索引!\n"
+#: git-merge-octopus.sh
+#, sh-format
+msgid "Unable to find common commit with $pretty_name"
+msgstr "無法找到和 $pretty_name 的基礎提交"
 
-#: git-add--interactive.perl
-#, perl-format
-msgid "ignoring unmerged: %s\n"
-msgstr "忽ç\95¥æ\9cªå¥\97ç\94¨ç\9a\84ï¼\9a%s\n"
+#: git-merge-octopus.sh
+#, sh-format
+msgid "Already up to date with $pretty_name"
+msgstr "å·²ç¶\93å\92\8c $pretty_name ä¿\9dæ\8c\81ä¸\80è\87´"
 
-#: git-add--interactive.perl
-msgid "No other hunks to goto\n"
-msgstr "沒有其它可供跳轉的區塊\n"
+#: git-merge-octopus.sh
+#, sh-format
+msgid "Fast-forwarding to: $pretty_name"
+msgstr "快轉至:$pretty_name"
 
-#: git-add--interactive.perl
-#, perl-format
-msgid "Invalid number: '%s'\n"
-msgstr "無效數字:'%s'\n"
+#: git-merge-octopus.sh
+#, sh-format
+msgid "Trying simple merge with $pretty_name"
+msgstr "嘗試和 $pretty_name 的簡單合併"
 
-#: git-add--interactive.perl
-#, perl-format
-msgid "Sorry, only %d hunk available.\n"
-msgid_plural "Sorry, only %d hunks available.\n"
-msgstr[0] "對不起,只有 %d 個可用區塊。\n"
+#: git-merge-octopus.sh
+msgid "Simple merge did not work, trying automatic merge."
+msgstr "簡單合併未生效,嘗試自動合併。"
 
-#: git-add--interactive.perl
-msgid "No other hunks to search\n"
-msgstr "沒有其它可供尋找的區塊\n"
+#: git-sh-setup.sh
+#, sh-format
+msgid "usage: $dashless $USAGE"
+msgstr "用法:$dashless $USAGE"
 
-#: git-add--interactive.perl
-#, perl-format
-msgid "Malformed search regexp %s: %s\n"
-msgstr "錯誤的常規表示式 %s:%s\n"
+#: git-sh-setup.sh
+#, sh-format
+msgid "Cannot chdir to $cdup, the toplevel of the working tree"
+msgstr "不能切換目錄到 $cdup,工作區的頂級目錄"
 
-#: git-add--interactive.perl
-msgid "No hunk matches the given pattern\n"
-msgstr "沒有和提供模式相符合的區塊\n"
+#: git-sh-setup.sh
+#, sh-format
+msgid "fatal: $program_name cannot be used without a working tree."
+msgstr "致命錯誤:$program_name 不能在沒有工作區的情況下使用。"
 
-#: git-add--interactive.perl
-msgid "No previous hunk\n"
-msgstr "沒有上一個區塊\n"
+#: git-sh-setup.sh
+msgid "Cannot rewrite branches: You have unstaged changes."
+msgstr "不能重寫分支:您有未暫存的變更。"
 
-#: git-add--interactive.perl
-msgid "No next hunk\n"
-msgstr "沒有下一個區塊\n"
+#: git-sh-setup.sh
+#, sh-format
+msgid "Cannot $action: You have unstaged changes."
+msgstr "不能 $action:您有未暫存的變更。"
 
-#: git-add--interactive.perl
-msgid "Sorry, cannot split this hunk\n"
-msgstr "對不起,不能分割這個區塊\n"
+#: git-sh-setup.sh
+#, sh-format
+msgid "Cannot $action: Your index contains uncommitted changes."
+msgstr "不能 $action:您的索引中包含未提交的變更。"
 
-#: git-add--interactive.perl
-#, perl-format
-msgid "Split into %d hunk.\n"
-msgid_plural "Split into %d hunks.\n"
-msgstr[0] "分割為 %d 塊。\n"
-
-#: git-add--interactive.perl
-msgid "Sorry, cannot edit this hunk\n"
-msgstr "對不起,不能編輯這個區塊\n"
-
-#. TRANSLATORS: please do not translate the command names
-#. 'status', 'update', 'revert', etc.
-#: git-add--interactive.perl
-msgid ""
-"status        - show paths with changes\n"
-"update        - add working tree state to the staged set of changes\n"
-"revert        - revert staged set of changes back to the HEAD version\n"
-"patch         - pick hunks and update selectively\n"
-"diff          - view diff between HEAD and index\n"
-"add untracked - add contents of untracked files to the staged set of "
-"changes\n"
-msgstr ""
-"status        - 顯示含變更的路徑\n"
-"update        - 新增工作區狀態至暫存列表\n"
-"revert        - 還原修改的暫存集至 HEAD 版本\n"
-"patch         - 挑選區塊並且有選擇地更新\n"
-"diff          - 顯示 HEAD 和索引間差異\n"
-"add untracked - 新增未追蹤檔案的內容至暫存列表\n"
-
-#: git-add--interactive.perl
-msgid "missing --"
-msgstr "缺少 --"
-
-#: git-add--interactive.perl
-#, perl-format
-msgid "unknown --patch mode: %s"
-msgstr "未知的 --patch 模式:%s"
+#: git-sh-setup.sh
+msgid "Additionally, your index contains uncommitted changes."
+msgstr "而且您的索引中包含未提交的變更。"
 
-#: git-add--interactive.perl
-#, perl-format
-msgid "invalid argument %s, expecting --"
-msgstr "無效的參數 %s,期望是 --"
+#: git-sh-setup.sh
+msgid "You need to run this command from the toplevel of the working tree."
+msgstr "您需要在工作區的頂級目錄中執行這個指令。"
+
+#: git-sh-setup.sh
+msgid "Unable to determine absolute path of git directory"
+msgstr "不能確定 git 目錄的絕對路徑"
 
 #: git-send-email.perl
 msgid "local zone differs from GMT by a non-minute interval\n"
@@ -27282,14 +27248,19 @@ msgstr "(%s) 不能執行 '%s'"
 
 #: git-send-email.perl
 #, perl-format
-msgid "(%s) Adding %s: %s from: '%s'\n"
-msgstr "(%s) 新增 %s: %s 自:'%s'\n"
+msgid "(%s) Malformed output from '%s'"
+msgstr "(%s) 從 “%s” 讀到格式錯誤的輸出"
 
 #: git-send-email.perl
 #, perl-format
 msgid "(%s) failed to close pipe to '%s'"
 msgstr "(%s) 無法關閉管道至 '%s'"
 
+#: git-send-email.perl
+#, perl-format
+msgid "(%s) Adding %s: %s from: '%s'\n"
+msgstr "(%s) 新增 %s: %s 自:'%s'\n"
+
 #: git-send-email.perl
 msgid "cannot send message as 7bit"
 msgstr "不能以 7bit 形式傳送訊息"
@@ -27334,6 +27305,356 @@ msgstr "略過 %s 含備份後綴 '%s'。\n"
 msgid "Do you really want to send %s? [y|N]: "
 msgstr "您真的要傳送 %s?[y|N]: "
 
+#~ msgid "current working directory is untracked"
+#~ msgstr "尚未追蹤目前的工作目錄"
+
+#~ msgid "cannot use --contents with final commit object name"
+#~ msgstr "無法將 --contents 與最終的提交物件名稱共用"
+
+#~ msgid "git bisect--helper --bisect-state (bad|new) [<rev>]"
+#~ msgstr "git bisect--helper --bisect-state (bad|new) [<rev>]"
+
+#~ msgid "won't bisect on cg-seek'ed tree"
+#~ msgstr "不會在做了 cg-seek 的樹狀物件上進行二分搜尋"
+
+#~ msgid "--bisect-terms requires 0 or 1 argument"
+#~ msgstr "--bisect-terms 需要 0 或 1 個引數"
+
+#~ msgid "--bisect-next requires 0 arguments"
+#~ msgstr "--bisect-next 需要 0 個引數"
+
+#~ msgid "--bisect-log requires 0 arguments"
+#~ msgstr "--bisect-log 需要 0 個引數"
+
+#~ msgid "git env--helper --type=[bool|ulong] <options> <env-var>"
+#~ msgstr "git env--helper --type=[bool|ulong] <選項> <環境變數>"
+
+#~ msgid "default for git_env_*(...) to fall back on"
+#~ msgstr "git_env_*(...) 的預設值"
+
+#~ msgid "be quiet only use git_env_*() value as exit code"
+#~ msgstr "安靜模式,只使用 git_env_*() 的值作為離開碼"
+
+#, c-format
+#~ msgid ""
+#~ "option `--default' expects a boolean value with `--type=bool`, not `%s`"
+#~ msgstr "選項「--default」預期收到「--type=bool」的布林值,而非「%s」"
+
+#, c-format
+#~ msgid ""
+#~ "option `--default' expects an unsigned long value with `--type=ulong`, "
+#~ "not `%s`"
+#~ msgstr ""
+#~ "選項「--default」預期收到「--type=ulong」的無號 long 數值,而非「%s」"
+
+#~ msgid "please commit or stash them."
+#~ msgstr "請提交或貯存它們。"
+
+#, c-format
+#~ msgid "Unknown mode: %s"
+#~ msgstr "未知模式:%s"
+
+#, c-format
+#~ msgid "%s doesn't support --super-prefix"
+#~ msgstr "%s 不支援 --super-prefix"
+
+#, c-format
+#~ msgid "no prefix given for --super-prefix\n"
+#~ msgstr "沒有為 --super-prefix 提供前綴\n"
+
+#, c-format
+#~ msgid "failed to read object %s"
+#~ msgstr "讀取物件 %s 失敗"
+
+#~ msgid "file write error"
+#~ msgstr "檔案寫錯誤"
+
+#~ msgid "corrupt commit"
+#~ msgstr "損壞的提交"
+
+#~ msgid "corrupt tag"
+#~ msgstr "損壞的標籤"
+
+#, c-format
+#~ msgid "%%(objecttype) does not take arguments"
+#~ msgstr "%%(objecttype) 不帶參數"
+
+#, c-format
+#~ msgid "%%(deltabase) does not take arguments"
+#~ msgstr "%%(deltabase) 不帶參數"
+
+#, c-format
+#~ msgid "%%(body) does not take arguments"
+#~ msgstr "%%(body) 不帶參數"
+
+#, c-format
+#~ msgid "unrecognized email option: %s"
+#~ msgstr "無法識別的 email 選項:%s"
+
+#~ msgid "could not lock HEAD"
+#~ msgstr "不能鎖定 HEAD"
+
+#, c-format
+#~ msgid ""
+#~ "It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
+#~ "may speed it up, but you have to be careful not to forget to add\n"
+#~ "new files yourself (see 'git help status')."
+#~ msgstr ""
+#~ "耗費了 %.2f 秒以枚舉未追蹤的檔案。'status -uno' 也許能提高速度,\n"
+#~ "但您需要小心不要忘了新增新檔案(參見 'git help status')。"
+
+#, perl-format
+#~ msgid "%12s %12s %s"
+#~ msgstr "%12s %12s %s"
+
+#, perl-format
+#~ msgid "touched %d path\n"
+#~ msgid_plural "touched %d paths\n"
+#~ msgstr[0] "建立了 %d 個路徑\n"
+
+#~ msgid ""
+#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
+#~ "marked for staging."
+#~ msgstr "如果修補檔能完全套用,編輯區塊將立即標記為暫存。"
+
+#~ msgid ""
+#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
+#~ "marked for stashing."
+#~ msgstr "如果修補檔能完全套用,編輯區塊將立即標記為貯存。"
+
+#~ msgid ""
+#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
+#~ "marked for unstaging."
+#~ msgstr "如果修補檔能完全套用,編輯區塊將立即標記為未暫存。"
+
+#~ msgid ""
+#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
+#~ "marked for applying."
+#~ msgstr "如果修補檔能完全套用,編輯區塊將立即標記為套用。"
+
+#~ msgid ""
+#~ "If the patch applies cleanly, the edited hunk will immediately be\n"
+#~ "marked for discarding."
+#~ msgstr "如果修補檔能完全套用,編輯塊將立即標記為捨棄。"
+
+#, perl-format
+#~ msgid "failed to open hunk edit file for writing: %s"
+#~ msgstr "為寫入開啟區塊編輯檔案失敗:%s"
+
+#, perl-format
+#~ msgid ""
+#~ "---\n"
+#~ "To remove '%s' lines, make them ' ' lines (context).\n"
+#~ "To remove '%s' lines, delete them.\n"
+#~ "Lines starting with %s will be removed.\n"
+#~ msgstr ""
+#~ "---\n"
+#~ "要刪除 '%s' 開始的行,使其成為 ' ' 開始的行(上下文)。\n"
+#~ "要刪除 '%s' 開始的行,刪除它們。\n"
+#~ "以 %s 開始的行將被刪除。\n"
+
+#, perl-format
+#~ msgid "failed to open hunk edit file for reading: %s"
+#~ msgstr "無法讀取區塊編輯檔案:%s"
+
+#~ msgid ""
+#~ "y - stage this hunk\n"
+#~ "n - do not stage this hunk\n"
+#~ "q - quit; do not stage this hunk or any of the remaining ones\n"
+#~ "a - stage this hunk and all later hunks in the file\n"
+#~ "d - do not stage this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 暫存此區塊\n"
+#~ "n - 不要暫存此區塊\n"
+#~ "q - 離開。不暫存此區塊及後面的全部區塊\n"
+#~ "a - 暫存此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不暫存此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "y - stash this hunk\n"
+#~ "n - do not stash this hunk\n"
+#~ "q - quit; do not stash this hunk or any of the remaining ones\n"
+#~ "a - stash this hunk and all later hunks in the file\n"
+#~ "d - do not stash this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 貯存此區塊\n"
+#~ "n - 不要貯存此區塊\n"
+#~ "q - 離開。不貯存此區塊及後面的全部區塊\n"
+#~ "a - 貯存此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不貯存此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "y - unstage this hunk\n"
+#~ "n - do not unstage this hunk\n"
+#~ "q - quit; do not unstage this hunk or any of the remaining ones\n"
+#~ "a - unstage this hunk and all later hunks in the file\n"
+#~ "d - do not unstage this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 不暫存此區塊\n"
+#~ "n - 不要不暫存此區塊\n"
+#~ "q - 離開。不要不暫存此區塊及後面的全部區塊\n"
+#~ "a - 不暫存此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不要不暫存此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "y - apply this hunk to index\n"
+#~ "n - do not apply this hunk to index\n"
+#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
+#~ "a - apply this hunk and all later hunks in the file\n"
+#~ "d - do not apply this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 在索引中套用此區塊\n"
+#~ "n - 不要在索引中套用此區塊\n"
+#~ "q - 離開。不要套用此區塊及後面的全部區塊\n"
+#~ "a - 套用此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不要套用此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "y - discard this hunk from worktree\n"
+#~ "n - do not discard this hunk from worktree\n"
+#~ "q - quit; do not discard this hunk or any of the remaining ones\n"
+#~ "a - discard this hunk and all later hunks in the file\n"
+#~ "d - do not discard this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 在工作區中捨棄此區塊\n"
+#~ "n - 不要在工作區中捨棄此區塊\n"
+#~ "q - 離開。不要捨棄此區塊及後面的全部區塊\n"
+#~ "a - 捨棄此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不要捨棄此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "y - discard this hunk from index and worktree\n"
+#~ "n - do not discard this hunk from index and worktree\n"
+#~ "q - quit; do not discard this hunk or any of the remaining ones\n"
+#~ "a - discard this hunk and all later hunks in the file\n"
+#~ "d - do not discard this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 在索引和工作區中捨棄此區塊\n"
+#~ "n - 不要在索引和工作區中捨棄此區塊\n"
+#~ "q - 離開。不要捨棄此區塊及後面的全部區塊\n"
+#~ "a - 捨棄此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不要捨棄此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "y - apply this hunk to index and worktree\n"
+#~ "n - do not apply this hunk to index and worktree\n"
+#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
+#~ "a - apply this hunk and all later hunks in the file\n"
+#~ "d - do not apply this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 在索引和工作區中套用此區塊\n"
+#~ "n - 不要在索引和工作區中套用此區塊\n"
+#~ "q - 離開。不要套用此區塊及後面的全部區塊\n"
+#~ "a - 套用此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不要套用此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "y - apply this hunk to worktree\n"
+#~ "n - do not apply this hunk to worktree\n"
+#~ "q - quit; do not apply this hunk or any of the remaining ones\n"
+#~ "a - apply this hunk and all later hunks in the file\n"
+#~ "d - do not apply this hunk or any of the later hunks in the file"
+#~ msgstr ""
+#~ "y - 在工作區中套用此區塊\n"
+#~ "n - 不要在工作區中套用此區塊\n"
+#~ "q - 離開。不要套用此區塊及後面的全部區塊\n"
+#~ "a - 套用此區塊和本檔案中後面的全部區塊\n"
+#~ "d - 不要套用此區塊和本檔案中後面的全部區塊"
+
+#~ msgid ""
+#~ "g - select a hunk to go to\n"
+#~ "/ - search for a hunk matching the given regex\n"
+#~ "j - leave this hunk undecided, see next undecided hunk\n"
+#~ "J - leave this hunk undecided, see next hunk\n"
+#~ "k - leave this hunk undecided, see previous undecided hunk\n"
+#~ "K - leave this hunk undecided, see previous hunk\n"
+#~ "s - split the current hunk into smaller hunks\n"
+#~ "e - manually edit the current hunk\n"
+#~ "? - print help\n"
+#~ msgstr ""
+#~ "g - 選擇跳轉到一個區塊\n"
+#~ "/ - 尋找和提供常規表示式符合的區塊\n"
+#~ "j - 維持此區塊未決狀態,檢視下一個未決定區塊\n"
+#~ "J - 維持此區塊未決狀態,檢視下一個區塊\n"
+#~ "k - 維持此區塊未決狀態,檢視上一個未決定區塊\n"
+#~ "K - 維持此區塊未決狀態,檢視上一個區塊\n"
+#~ "s - 分割目前區塊為更小的區塊\n"
+#~ "e - 手動編輯目前區塊\n"
+#~ "? - 顯示說明\n"
+
+#~ msgid "The selected hunks do not apply to the index!\n"
+#~ msgstr "選取區塊不能套用到索引!\n"
+
+#, perl-format
+#~ msgid "ignoring unmerged: %s\n"
+#~ msgstr "忽略未套用的:%s\n"
+
+#~ msgid "No other hunks to goto\n"
+#~ msgstr "沒有其它可供跳轉的區塊\n"
+
+#, perl-format
+#~ msgid "Invalid number: '%s'\n"
+#~ msgstr "無效數字:'%s'\n"
+
+#, perl-format
+#~ msgid "Sorry, only %d hunk available.\n"
+#~ msgid_plural "Sorry, only %d hunks available.\n"
+#~ msgstr[0] "對不起,只有 %d 個可用區塊。\n"
+
+#~ msgid "No other hunks to search\n"
+#~ msgstr "沒有其它可供尋找的區塊\n"
+
+#, perl-format
+#~ msgid "Malformed search regexp %s: %s\n"
+#~ msgstr "錯誤的常規表示式 %s:%s\n"
+
+#~ msgid "No hunk matches the given pattern\n"
+#~ msgstr "沒有和提供模式相符合的區塊\n"
+
+#~ msgid "No previous hunk\n"
+#~ msgstr "沒有上一個區塊\n"
+
+#~ msgid "No next hunk\n"
+#~ msgstr "沒有下一個區塊\n"
+
+#~ msgid "Sorry, cannot split this hunk\n"
+#~ msgstr "對不起,不能分割這個區塊\n"
+
+#, perl-format
+#~ msgid "Split into %d hunk.\n"
+#~ msgid_plural "Split into %d hunks.\n"
+#~ msgstr[0] "分割為 %d 塊。\n"
+
+#~ msgid "Sorry, cannot edit this hunk\n"
+#~ msgstr "對不起,不能編輯這個區塊\n"
+
+#~ msgid ""
+#~ "status        - show paths with changes\n"
+#~ "update        - add working tree state to the staged set of changes\n"
+#~ "revert        - revert staged set of changes back to the HEAD version\n"
+#~ "patch         - pick hunks and update selectively\n"
+#~ "diff          - view diff between HEAD and index\n"
+#~ "add untracked - add contents of untracked files to the staged set of "
+#~ "changes\n"
+#~ msgstr ""
+#~ "status        - 顯示含變更的路徑\n"
+#~ "update        - 新增工作區狀態至暫存列表\n"
+#~ "revert        - 還原修改的暫存集至 HEAD 版本\n"
+#~ "patch         - 挑選區塊並且有選擇地更新\n"
+#~ "diff          - 顯示 HEAD 和索引間差異\n"
+#~ "add untracked - 新增未追蹤檔案的內容至暫存列表\n"
+
+#~ msgid "missing --"
+#~ msgstr "缺少 --"
+
+#, perl-format
+#~ msgid "unknown --patch mode: %s"
+#~ msgstr "未知的 --patch 模式:%s"
+
+#, perl-format
+#~ msgid "invalid argument %s, expecting --"
+#~ msgstr "無效的參數 %s,期望是 --"
+
 #, c-format
 #~ msgid "unable to normalize object directory: %s"
 #~ msgstr "無法規範化物件目錄: %s"
index 52544d004e76a011e5078fbc14037bd74a039553..e44530c80cf51edfdff846ed476a16c9bae0047a 100644 (file)
@@ -1,16 +1,20 @@
 /*
  * Copyright (C) 2008 Linus Torvalds
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "pathspec.h"
 #include "dir.h"
 #include "environment.h"
 #include "fsmonitor.h"
 #include "gettext.h"
 #include "config.h"
+#include "preload-index.h"
 #include "progress.h"
+#include "read-cache.h"
 #include "thread-utils.h"
 #include "repository.h"
+#include "symlinks.h"
+#include "trace2.h"
 
 /*
  * Mostly randomly chosen maximum thread counts: we
diff --git a/preload-index.h b/preload-index.h
new file mode 100644 (file)
index 0000000..251b1ed
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef PRELOAD_INDEX_H
+#define PRELOAD_INDEX_H
+
+struct index_state;
+struct pathspec;
+struct repository;
+
+void preload_index(struct index_state *index,
+                  const struct pathspec *pathspec,
+                  unsigned int refresh_flags);
+int repo_read_index_preload(struct repository *,
+                           const struct pathspec *pathspec,
+                           unsigned refresh_flags);
+
+#endif /* PRELOAD_INDEX_H */
index 76fc4f61e40d8ac6c30b054cf6e2558aa403d96f..718530bbab5204b88972849abb95eabd0d3bedaf 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -1,12 +1,13 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "commit.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "utf8.h"
 #include "diff.h"
+#include "pager.h"
 #include "revision.h"
 #include "string-list.h"
 #include "mailmap.h"
@@ -17,6 +18,7 @@
 #include "gpg-interface.h"
 #include "trailer.h"
 #include "run-command.h"
+#include "object-name.h"
 
 /*
  * The limit for formatting directives, which enable the caller to append
@@ -55,6 +57,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
 }
 
 static int git_pretty_formats_config(const char *var, const char *value,
+                                    const struct config_context *ctx UNUSED,
                                     void *cb UNUSED)
 {
        struct cmt_fmt_map *commit_format = NULL;
@@ -1249,6 +1252,27 @@ static int format_trailer_match_cb(const struct strbuf *key, void *ud)
        return 0;
 }
 
+static struct strbuf *expand_separator(struct strbuf *sb,
+                                      const char *argval, size_t arglen)
+{
+       char *fmt = xstrndup(argval, arglen);
+       const char *format = fmt;
+
+       strbuf_reset(sb);
+       while (strbuf_expand_step(sb, &format)) {
+               size_t len;
+
+               if (skip_prefix(format, "%", &format))
+                       strbuf_addch(sb, '%');
+               else if ((len = strbuf_expand_literal(sb, format)))
+                       format += len;
+               else
+                       strbuf_addch(sb, '%');
+       }
+       free(fmt);
+       return sb;
+}
+
 int format_set_trailers_options(struct process_trailer_options *opts,
                                struct string_list *filter_list,
                                struct strbuf *sepbuf,
@@ -1277,21 +1301,9 @@ int format_set_trailers_options(struct process_trailer_options *opts,
                        opts->filter_data = filter_list;
                        opts->only_trailers = 1;
                } else if (match_placeholder_arg_value(*arg, "separator", arg, &argval, &arglen)) {
-                       char *fmt;
-
-                       strbuf_reset(sepbuf);
-                       fmt = xstrndup(argval, arglen);
-                       strbuf_expand(sepbuf, fmt, strbuf_expand_literal_cb, NULL);
-                       free(fmt);
-                       opts->separator = sepbuf;
+                       opts->separator = expand_separator(sepbuf, argval, arglen);
                } else if (match_placeholder_arg_value(*arg, "key_value_separator", arg, &argval, &arglen)) {
-                       char *fmt;
-
-                       strbuf_reset(kvsepbuf);
-                       fmt = xstrndup(argval, arglen);
-                       strbuf_expand(kvsepbuf, fmt, strbuf_expand_literal_cb, NULL);
-                       free(fmt);
-                       opts->key_value_separator = kvsepbuf;
+                       opts->key_value_separator = expand_separator(kvsepbuf, argval, arglen);
                } else if (!match_placeholder_bool_arg(*arg, "only", arg, &opts->only_trailers) &&
                           !match_placeholder_bool_arg(*arg, "unfold", arg, &opts->unfold) &&
                           !match_placeholder_bool_arg(*arg, "keyonly", arg, &opts->key_only) &&
@@ -1385,7 +1397,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
        char **slot;
 
        /* these are independent of the commit */
-       res = strbuf_expand_literal_cb(sb, placeholder, NULL);
+       res = strbuf_expand_literal(sb, placeholder);
        if (res)
                return res;
 
@@ -1803,7 +1815,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
 
 static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
                                 const char *placeholder,
-                                void *context)
+                                struct format_commit_context *context)
 {
        size_t consumed, orig_len;
        enum {
@@ -1842,10 +1854,10 @@ static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
        }
 
        orig_len = sb->len;
-       if (((struct format_commit_context *)context)->flush_type != no_flush)
-               consumed = format_and_pad_commit(sb, placeholder, context);
-       else
+       if (context->flush_type == no_flush)
                consumed = format_commit_one(sb, placeholder, context);
+       else
+               consumed = format_and_pad_commit(sb, placeholder, context);
        if (magic == NO_MAGIC)
                return consumed;
 
@@ -1861,41 +1873,34 @@ static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */
        return consumed + 1;
 }
 
-static size_t userformat_want_item(struct strbuf *sb UNUSED,
-                                  const char *placeholder,
-                                  void *context)
-{
-       struct userformat_want *w = context;
-
-       if (*placeholder == '+' || *placeholder == '-' || *placeholder == ' ')
-               placeholder++;
-
-       switch (*placeholder) {
-       case 'N':
-               w->notes = 1;
-               break;
-       case 'S':
-               w->source = 1;
-               break;
-       case 'd':
-       case 'D':
-               w->decorate = 1;
-               break;
-       }
-       return 0;
-}
-
 void userformat_find_requirements(const char *fmt, struct userformat_want *w)
 {
-       struct strbuf dummy = STRBUF_INIT;
-
        if (!fmt) {
                if (!user_format)
                        return;
                fmt = user_format;
        }
-       strbuf_expand(&dummy, fmt, userformat_want_item, w);
-       strbuf_release(&dummy);
+       while ((fmt = strchr(fmt, '%'))) {
+               fmt++;
+               if (skip_prefix(fmt, "%", &fmt))
+                       continue;
+
+               if (*fmt == '+' || *fmt == '-' || *fmt == ' ')
+                       fmt++;
+
+               switch (*fmt) {
+               case 'N':
+                       w->notes = 1;
+                       break;
+               case 'S':
+                       w->source = 1;
+                       break;
+               case 'd':
+               case 'D':
+                       w->decorate = 1;
+                       break;
+               }
+       }
 }
 
 void repo_format_commit_message(struct repository *r,
@@ -1912,7 +1917,16 @@ void repo_format_commit_message(struct repository *r,
        const char *output_enc = pretty_ctx->output_encoding;
        const char *utf8 = "UTF-8";
 
-       strbuf_expand(sb, format, format_commit_item, &context);
+       while (strbuf_expand_step(sb, &format)) {
+               size_t len;
+
+               if (skip_prefix(format, "%", &format))
+                       strbuf_addch(sb, '%');
+               else if ((len = format_commit_item(sb, format, &context)))
+                       format += len;
+               else
+                       strbuf_addch(sb, '%');
+       }
        rewrap_message_tail(sb, &context, 0, 0, 0);
 
        /*
index dc2476be53a30a6e9c682d934f620422dd855ada..450775a37492082130211431229ce5645ae17613 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "prio-queue.h"
 
 static inline int compare(struct prio_queue *queue, int i, int j)
index 44c784d75f106c066c85b7a7a6569744332a6be2..f695798acac72bd703dfacc59f83054fd761b619 100644 (file)
@@ -9,10 +9,13 @@
  */
 
 #define GIT_TEST_PROGRESS_ONLY
-#include "cache.h"
+#include "git-compat-util.h"
+#include "pager.h"
 #include "progress.h"
+#include "repository.h"
 #include "strbuf.h"
 #include "trace.h"
+#include "trace2.h"
 #include "utf8.h"
 #include "config.h"
 
index a8dbb788e8f1a0a4cb3c77ba16fda20bb8b9f41a..ac3aa1e365760596990188548410a16900e005d7 100644 (file)
@@ -1,9 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "promisor-remote.h"
 #include "config.h"
+#include "trace2.h"
 #include "transport.h"
 #include "strvec.h"
 #include "packfile.h"
@@ -99,7 +100,9 @@ static void promisor_remote_move_to_tail(struct promisor_remote_config *config,
        config->promisors_tail = &r->next;
 }
 
-static int promisor_remote_config(const char *var, const char *value, void *data)
+static int promisor_remote_config(const char *var, const char *value,
+                                 const struct config_context *ctx UNUSED,
+                                 void *data)
 {
        struct promisor_remote_config *config = data;
        const char *name;
index 94c51862c5b4864fb79349f65fd08756b2818f04..808a68c974ab7715513657c62d238aae8d3af07f 100644 (file)
@@ -4,10 +4,10 @@
 #include "hex.h"
 #include "pkt-line.h"
 #include "strvec.h"
-#include "hash.h"
+#include "hash-ll.h"
 #include "hex.h"
 #include "object.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "string-list.h"
 #include "strbuf.h"
 
index bdb32e1eeb62473b9ae309b266c7f508a480c354..079ba75acf4e84451a80aa764cad3ac77a7d667f 100644 (file)
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
 #include "protocol.h"
+#include "trace2.h"
 
 static enum protocol_version parse_protocol_version(const char *value)
 {
index cef1a4a01c7902b0b1181a43580639fcead442ff..de66bf80f8409370069fed46ce97dadb25519d7d 100644 (file)
@@ -1,6 +1,27 @@
 #ifndef PROTOCOL_H
 #define PROTOCOL_H
 
+/*
+ * Intensive research over the course of many years has shown that
+ * port 9418 is totally unused by anything else. Or
+ *
+ *     Your search - "port 9418" - did not match any documents.
+ *
+ * as www.google.com puts it.
+ *
+ * This port has been properly assigned for git use by IANA:
+ * git (Assigned-9418) [I06-050728-0001].
+ *
+ *     git  9418/tcp   git pack transfer service
+ *     git  9418/udp   git pack transfer service
+ *
+ * with Linus Torvalds <torvalds@osdl.org> as the point of
+ * contact. September 2005.
+ *
+ * See http://www.iana.org/assignments/port-numbers
+ */
+#define DEFAULT_GIT_PORT 9418
+
 enum protocol_version {
        protocol_unknown_version = -1,
        protocol_v0 = 0,
index 58412b4fb9157f6ef5d3bf6dde7b890e500b741f..e54daf740a26345a182eb67d7ab2716916e41c37 100644 (file)
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 #include "progress.h"
 #include "prune-packed.h"
diff --git a/quote.c b/quote.c
index 7ccb5a06cd161c46ad2deeacc19de7bec99731a2..3c05194496f65f879f437abd29823986ef118f47 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -1,5 +1,5 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
+#include "path.h"
 #include "quote.h"
 #include "strbuf.h"
 #include "strvec.h"
diff --git a/quote.h b/quote.h
index 87ff458b06dd6430855b39f6cb4833664e630746..0300c291041b02464e55e36a6c820a9faecf260f 100644 (file)
--- a/quote.h
+++ b/quote.h
@@ -3,6 +3,8 @@
 
 struct strbuf;
 
+extern int quote_path_fully;
+
 /* Help to copy the thing properly quoted for the shell safety.
  * any single quote is replaced with '\'', any exclamation point
  * is replaced with '\!', and the whole thing is enclosed in a
index d1ed3b8ee569f7367ff9fab659febe24dfb67121..2e86063491e11fcf9162da016be8471f603e07a2 100644 (file)
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
 #include "range-diff.h"
+#include "object-name.h"
 #include "string-list.h"
 #include "run-command.h"
 #include "strvec.h"
@@ -10,7 +11,9 @@
 #include "linear-assignment.h"
 #include "diffcore.h"
 #include "commit.h"
+#include "pager.h"
 #include "pretty.h"
+#include "repository.h"
 #include "userdiff.h"
 #include "apply.h"
 #include "revision.h"
index 55bb1143530fceb53f4f68450ecb455861cbbe2d..0ce8f83e56a9b42400b8ec792b19deb3a69ddb6e 100644 (file)
 #include "list-objects.h"
 #include "packfile.h"
 #include "worktree.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pack-bitmap.h"
 #include "pack-mtimes.h"
+#include "config.h"
+#include "run-command.h"
 
 struct connectivity_progress {
        struct progress *progress;
@@ -67,8 +69,77 @@ struct recent_data {
        timestamp_t timestamp;
        report_recent_object_fn *cb;
        int ignore_in_core_kept_packs;
+
+       struct oidset extra_recent_oids;
+       int extra_recent_oids_loaded;
 };
 
+static int run_one_gc_recent_objects_hook(struct oidset *set,
+                                           const char *args)
+{
+       struct child_process cmd = CHILD_PROCESS_INIT;
+       struct strbuf buf = STRBUF_INIT;
+       FILE *out;
+       int ret = 0;
+
+       cmd.use_shell = 1;
+       cmd.out = -1;
+
+       strvec_push(&cmd.args, args);
+
+       if (start_command(&cmd))
+               return -1;
+
+       out = xfdopen(cmd.out, "r");
+       while (strbuf_getline(&buf, out) != EOF) {
+               struct object_id oid;
+               const char *rest;
+
+               if (parse_oid_hex(buf.buf, &oid, &rest) || *rest) {
+                       ret = error(_("invalid extra cruft tip: '%s'"), buf.buf);
+                       break;
+               }
+
+               oidset_insert(set, &oid);
+       }
+
+       fclose(out);
+       ret |= finish_command(&cmd);
+
+       strbuf_release(&buf);
+       return ret;
+}
+
+static void load_gc_recent_objects(struct recent_data *data)
+{
+       const struct string_list *programs;
+       int ret = 0;
+       size_t i;
+
+       data->extra_recent_oids_loaded = 1;
+
+       if (git_config_get_string_multi("gc.recentobjectshook", &programs))
+               return;
+
+       for (i = 0; i < programs->nr; i++) {
+               ret = run_one_gc_recent_objects_hook(&data->extra_recent_oids,
+                                                      programs->items[i].string);
+               if (ret)
+                       die(_("unable to enumerate additional recent objects"));
+       }
+}
+
+static int obj_is_recent(const struct object_id *oid, timestamp_t mtime,
+                        struct recent_data *data)
+{
+       if (mtime > data->timestamp)
+               return 1;
+
+       if (!data->extra_recent_oids_loaded)
+               load_gc_recent_objects(data);
+       return oidset_contains(&data->extra_recent_oids, oid);
+}
+
 static void add_recent_object(const struct object_id *oid,
                              struct packed_git *pack,
                              off_t offset,
@@ -78,7 +149,7 @@ static void add_recent_object(const struct object_id *oid,
        struct object *obj;
        enum object_type type;
 
-       if (mtime <= data->timestamp)
+       if (!obj_is_recent(oid, mtime, data))
                return;
 
        /*
@@ -193,16 +264,24 @@ int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
        data.cb = cb;
        data.ignore_in_core_kept_packs = ignore_in_core_kept_packs;
 
+       oidset_init(&data.extra_recent_oids, 0);
+       data.extra_recent_oids_loaded = 0;
+
        r = for_each_loose_object(add_recent_loose, &data,
                                  FOR_EACH_OBJECT_LOCAL_ONLY);
        if (r)
-               return r;
+               goto done;
 
        flags = FOR_EACH_OBJECT_LOCAL_ONLY | FOR_EACH_OBJECT_PACK_ORDER;
        if (ignore_in_core_kept_packs)
                flags |= FOR_EACH_OBJECT_SKIP_IN_CORE_KEPT_PACKS;
 
-       return for_each_packed_object(add_recent_packed, &data, flags);
+       r = for_each_packed_object(add_recent_packed, &data, flags);
+
+done:
+       oidset_clear(&data.extra_recent_oids);
+
+       return r;
 }
 
 static int mark_object_seen(const struct object_id *oid,
diff --git a/read-cache-ll.h b/read-cache-ll.h
new file mode 100644 (file)
index 0000000..9a1a7ed
--- /dev/null
@@ -0,0 +1,481 @@
+#ifndef READ_CACHE_LL_H
+#define READ_CACHE_LL_H
+
+#include "hash-ll.h"
+#include "hashmap.h"
+#include "statinfo.h"
+
+/*
+ * Basic data structures for the directory cache
+ */
+
+#define CACHE_SIGNATURE 0x44495243     /* "DIRC" */
+struct cache_header {
+       uint32_t hdr_signature;
+       uint32_t hdr_version;
+       uint32_t hdr_entries;
+};
+
+#define INDEX_FORMAT_LB 2
+#define INDEX_FORMAT_UB 4
+
+struct cache_entry {
+       struct hashmap_entry ent;
+       struct stat_data ce_stat_data;
+       unsigned int ce_mode;
+       unsigned int ce_flags;
+       unsigned int mem_pool_allocated;
+       unsigned int ce_namelen;
+       unsigned int index;     /* for link extension */
+       struct object_id oid;
+       char name[FLEX_ARRAY]; /* more */
+};
+
+#define CE_STAGEMASK (0x3000)
+#define CE_EXTENDED  (0x4000)
+#define CE_VALID     (0x8000)
+#define CE_STAGESHIFT 12
+
+/*
+ * Range 0xFFFF0FFF in ce_flags is divided into
+ * two parts: in-memory flags and on-disk ones.
+ * Flags in CE_EXTENDED_FLAGS will get saved on-disk
+ * if you want to save a new flag, add it in
+ * CE_EXTENDED_FLAGS
+ *
+ * In-memory only flags
+ */
+#define CE_UPDATE            (1 << 16)
+#define CE_REMOVE            (1 << 17)
+#define CE_UPTODATE          (1 << 18)
+#define CE_ADDED             (1 << 19)
+
+#define CE_HASHED            (1 << 20)
+#define CE_FSMONITOR_VALID   (1 << 21)
+#define CE_WT_REMOVE         (1 << 22) /* remove in work directory */
+#define CE_CONFLICTED        (1 << 23)
+
+#define CE_UNPACKED          (1 << 24)
+#define CE_NEW_SKIP_WORKTREE (1 << 25)
+
+/* used to temporarily mark paths matched by pathspecs */
+#define CE_MATCHED           (1 << 26)
+
+#define CE_UPDATE_IN_BASE    (1 << 27)
+#define CE_STRIP_NAME        (1 << 28)
+
+/*
+ * Extended on-disk flags
+ */
+#define CE_INTENT_TO_ADD     (1 << 29)
+#define CE_SKIP_WORKTREE     (1 << 30)
+/* CE_EXTENDED2 is for future extension */
+#define CE_EXTENDED2         (1U << 31)
+
+#define CE_EXTENDED_FLAGS (CE_INTENT_TO_ADD | CE_SKIP_WORKTREE)
+
+/*
+ * Safeguard to avoid saving wrong flags:
+ *  - CE_EXTENDED2 won't get saved until its semantic is known
+ *  - Bits in 0x0000FFFF have been saved in ce_flags already
+ *  - Bits in 0x003F0000 are currently in-memory flags
+ */
+#if CE_EXTENDED_FLAGS & 0x803FFFFF
+#error "CE_EXTENDED_FLAGS out of range"
+#endif
+
+/* Forward structure decls */
+struct pathspec;
+struct tree;
+
+/*
+ * Copy the sha1 and stat state of a cache entry from one to
+ * another. But we never change the name, or the hash state!
+ */
+static inline void copy_cache_entry(struct cache_entry *dst,
+                                   const struct cache_entry *src)
+{
+       unsigned int state = dst->ce_flags & CE_HASHED;
+       int mem_pool_allocated = dst->mem_pool_allocated;
+
+       /* Don't copy hash chain and name */
+       memcpy(&dst->ce_stat_data, &src->ce_stat_data,
+                       offsetof(struct cache_entry, name) -
+                       offsetof(struct cache_entry, ce_stat_data));
+
+       /* Restore the hash state */
+       dst->ce_flags = (dst->ce_flags & ~CE_HASHED) | state;
+
+       /* Restore the mem_pool_allocated flag */
+       dst->mem_pool_allocated = mem_pool_allocated;
+}
+
+static inline unsigned create_ce_flags(unsigned stage)
+{
+       return (stage << CE_STAGESHIFT);
+}
+
+#define ce_namelen(ce) ((ce)->ce_namelen)
+#define ce_size(ce) cache_entry_size(ce_namelen(ce))
+#define ce_stage(ce) ((CE_STAGEMASK & (ce)->ce_flags) >> CE_STAGESHIFT)
+#define ce_uptodate(ce) ((ce)->ce_flags & CE_UPTODATE)
+#define ce_skip_worktree(ce) ((ce)->ce_flags & CE_SKIP_WORKTREE)
+#define ce_mark_uptodate(ce) ((ce)->ce_flags |= CE_UPTODATE)
+#define ce_intent_to_add(ce) ((ce)->ce_flags & CE_INTENT_TO_ADD)
+
+#define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1)
+
+#define SOMETHING_CHANGED      (1 << 0) /* unclassified changes go here */
+#define CE_ENTRY_CHANGED       (1 << 1)
+#define CE_ENTRY_REMOVED       (1 << 2)
+#define CE_ENTRY_ADDED         (1 << 3)
+#define RESOLVE_UNDO_CHANGED   (1 << 4)
+#define CACHE_TREE_CHANGED     (1 << 5)
+#define SPLIT_INDEX_ORDERED    (1 << 6)
+#define UNTRACKED_CHANGED      (1 << 7)
+#define FSMONITOR_CHANGED      (1 << 8)
+
+struct split_index;
+struct untracked_cache;
+struct progress;
+struct pattern_list;
+
+enum sparse_index_mode {
+       /*
+        * There are no sparse directories in the index at all.
+        *
+        * Repositories that don't use cone-mode sparse-checkout will
+        * always have their indexes in this mode.
+        */
+       INDEX_EXPANDED = 0,
+
+       /*
+        * The index has already been collapsed to sparse directories
+        * whereever possible.
+        */
+       INDEX_COLLAPSED,
+
+       /*
+        * The sparse directories that exist are outside the
+        * sparse-checkout boundary, but it is possible that some file
+        * entries could collapse to sparse directory entries.
+        */
+       INDEX_PARTIALLY_SPARSE,
+};
+
+struct index_state {
+       struct cache_entry **cache;
+       unsigned int version;
+       unsigned int cache_nr, cache_alloc, cache_changed;
+       struct string_list *resolve_undo;
+       struct cache_tree *cache_tree;
+       struct split_index *split_index;
+       struct cache_time timestamp;
+       unsigned name_hash_initialized : 1,
+                initialized : 1,
+                drop_cache_tree : 1,
+                updated_workdir : 1,
+                updated_skipworktree : 1,
+                fsmonitor_has_run_once : 1;
+       enum sparse_index_mode sparse_index;
+       struct hashmap name_hash;
+       struct hashmap dir_hash;
+       struct object_id oid;
+       struct untracked_cache *untracked;
+       char *fsmonitor_last_update;
+       struct ewah_bitmap *fsmonitor_dirty;
+       struct mem_pool *ce_mem_pool;
+       struct progress *progress;
+       struct repository *repo;
+       struct pattern_list *sparse_checkout_patterns;
+};
+
+/**
+ * A "struct index_state istate" must be initialized with
+ * INDEX_STATE_INIT or the corresponding index_state_init().
+ *
+ * If the variable won't be used again, use release_index() to free()
+ * its resources. If it needs to be used again use discard_index(),
+ * which does the same thing, but will use use index_state_init() at
+ * the end. The discard_index() will use its own "istate->repo" as the
+ * "r" argument to index_state_init() in that case.
+ */
+#define INDEX_STATE_INIT(r) { \
+       .repo = (r), \
+}
+void index_state_init(struct index_state *istate, struct repository *r);
+void release_index(struct index_state *istate);
+
+/* Cache entry creation and cleanup */
+
+/*
+ * Create cache_entry intended for use in the specified index. Caller
+ * is responsible for discarding the cache_entry with
+ * `discard_cache_entry`.
+ */
+struct cache_entry *make_cache_entry(struct index_state *istate,
+                                    unsigned int mode,
+                                    const struct object_id *oid,
+                                    const char *path,
+                                    int stage,
+                                    unsigned int refresh_options);
+
+struct cache_entry *make_empty_cache_entry(struct index_state *istate,
+                                          size_t name_len);
+
+/*
+ * Create a cache_entry that is not intended to be added to an index. If
+ * `ce_mem_pool` is not NULL, the entry is allocated within the given memory
+ * pool. Caller is responsible for discarding "loose" entries with
+ * `discard_cache_entry()` and the memory pool with
+ * `mem_pool_discard(ce_mem_pool, should_validate_cache_entries())`.
+ */
+struct cache_entry *make_transient_cache_entry(unsigned int mode,
+                                              const struct object_id *oid,
+                                              const char *path,
+                                              int stage,
+                                              struct mem_pool *ce_mem_pool);
+
+struct cache_entry *make_empty_transient_cache_entry(size_t len,
+                                                    struct mem_pool *ce_mem_pool);
+
+/*
+ * Discard cache entry.
+ */
+void discard_cache_entry(struct cache_entry *ce);
+
+/*
+ * Check configuration if we should perform extra validation on cache
+ * entries.
+ */
+int should_validate_cache_entries(void);
+
+/*
+ * Duplicate a cache_entry. Allocate memory for the new entry from a
+ * memory_pool. Takes into account cache_entry fields that are meant
+ * for managing the underlying memory allocation of the cache_entry.
+ */
+struct cache_entry *dup_cache_entry(const struct cache_entry *ce, struct index_state *istate);
+
+/*
+ * Validate the cache entries in the index.  This is an internal
+ * consistency check that the cache_entry structs are allocated from
+ * the expected memory pool.
+ */
+void validate_cache_entries(const struct index_state *istate);
+
+/*
+ * Bulk prefetch all missing cache entries that are not GITLINKs and that match
+ * the given predicate. This function should only be called if
+ * repo_has_promisor_remote() returns true.
+ */
+typedef int (*must_prefetch_predicate)(const struct cache_entry *);
+void prefetch_cache_entries(const struct index_state *istate,
+                           must_prefetch_predicate must_prefetch);
+
+/* Initialize and use the cache information */
+struct lock_file;
+int do_read_index(struct index_state *istate, const char *path,
+                 int must_exist); /* for testting only! */
+int read_index_from(struct index_state *, const char *path,
+                   const char *gitdir);
+int is_index_unborn(struct index_state *);
+
+/* For use with `write_locked_index()`. */
+#define COMMIT_LOCK            (1 << 0)
+#define SKIP_IF_UNCHANGED      (1 << 1)
+
+/*
+ * Write the index while holding an already-taken lock. Close the lock,
+ * and if `COMMIT_LOCK` is given, commit it.
+ *
+ * Unless a split index is in use, write the index into the lockfile.
+ *
+ * With a split index, write the shared index to a temporary file,
+ * adjust its permissions and rename it into place, then write the
+ * split index to the lockfile. If the temporary file for the shared
+ * index cannot be created, fall back to the behavior described in
+ * the previous paragraph.
+ *
+ * With `COMMIT_LOCK`, the lock is always committed or rolled back.
+ * Without it, the lock is closed, but neither committed nor rolled
+ * back.
+ *
+ * If `SKIP_IF_UNCHANGED` is given and the index is unchanged, nothing
+ * is written (and the lock is rolled back if `COMMIT_LOCK` is given).
+ */
+int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags);
+
+void discard_index(struct index_state *);
+void move_index_extensions(struct index_state *dst, struct index_state *src);
+int unmerged_index(const struct index_state *);
+
+/**
+ * Returns 1 if istate differs from tree, 0 otherwise.  If tree is NULL,
+ * compares istate to HEAD.  If tree is NULL and on an unborn branch,
+ * returns 1 if there are entries in istate, 0 otherwise.  If an strbuf is
+ * provided, the space-separated list of files that differ will be appended
+ * to it.
+ */
+int repo_index_has_changes(struct repository *repo,
+                          struct tree *tree,
+                          struct strbuf *sb);
+
+int verify_path(const char *path, unsigned mode);
+int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
+
+/*
+ * Searches for an entry defined by name and namelen in the given index.
+ * If the return value is positive (including 0) it is the position of an
+ * exact match. If the return value is negative, the negated value minus 1
+ * is the position where the entry would be inserted.
+ * Example: The current index consists of these files and its stages:
+ *
+ *   b#0, d#0, f#1, f#3
+ *
+ * index_name_pos(&index, "a", 1) -> -1
+ * index_name_pos(&index, "b", 1) ->  0
+ * index_name_pos(&index, "c", 1) -> -2
+ * index_name_pos(&index, "d", 1) ->  1
+ * index_name_pos(&index, "e", 1) -> -3
+ * index_name_pos(&index, "f", 1) -> -3
+ * index_name_pos(&index, "g", 1) -> -5
+ */
+int index_name_pos(struct index_state *, const char *name, int namelen);
+
+/*
+ * Like index_name_pos, returns the position of an entry of the given name in
+ * the index if one exists, otherwise returns a negative value where the negated
+ * value minus 1 is the position where the index entry would be inserted. Unlike
+ * index_name_pos, however, a sparse index is not expanded to find an entry
+ * inside a sparse directory.
+ */
+int index_name_pos_sparse(struct index_state *, const char *name, int namelen);
+
+/*
+ * Determines whether an entry with the given name exists within the
+ * given index. The return value is 1 if an exact match is found, otherwise
+ * it is 0. Note that, unlike index_name_pos, this function does not expand
+ * the index if it is sparse. If an item exists within the full index but it
+ * is contained within a sparse directory (and not in the sparse index), 0 is
+ * returned.
+ */
+int index_entry_exists(struct index_state *, const char *name, int namelen);
+
+/*
+ * Some functions return the negative complement of an insert position when a
+ * precise match was not found but a position was found where the entry would
+ * need to be inserted. This helper protects that logic from any integer
+ * underflow.
+ */
+static inline int index_pos_to_insert_pos(uintmax_t pos)
+{
+       if (pos > INT_MAX)
+               die("overflow: -1 - %"PRIuMAX, pos);
+       return -1 - (int)pos;
+}
+
+#define ADD_CACHE_OK_TO_ADD 1          /* Ok to add */
+#define ADD_CACHE_OK_TO_REPLACE 2      /* Ok to replace file/directory */
+#define ADD_CACHE_SKIP_DFCHECK 4       /* Ok to skip DF conflict checks */
+#define ADD_CACHE_JUST_APPEND 8                /* Append only */
+#define ADD_CACHE_NEW_ONLY 16          /* Do not replace existing ones */
+#define ADD_CACHE_KEEP_CACHE_TREE 32   /* Do not invalidate cache-tree */
+#define ADD_CACHE_RENORMALIZE 64        /* Pass along HASH_RENORMALIZE */
+int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
+void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
+
+/* Remove entry, return true if there are more entries to go. */
+int remove_index_entry_at(struct index_state *, int pos);
+
+void remove_marked_cache_entries(struct index_state *istate, int invalidate);
+int remove_file_from_index(struct index_state *, const char *path);
+#define ADD_CACHE_VERBOSE 1
+#define ADD_CACHE_PRETEND 2
+#define ADD_CACHE_IGNORE_ERRORS        4
+#define ADD_CACHE_IGNORE_REMOVAL 8
+#define ADD_CACHE_INTENT 16
+/*
+ * These two are used to add the contents of the file at path
+ * to the index, marking the working tree up-to-date by storing
+ * the cached stat info in the resulting cache entry.  A caller
+ * that has already run lstat(2) on the path can call
+ * add_to_index(), and all others can call add_file_to_index();
+ * the latter will do necessary lstat(2) internally before
+ * calling the former.
+ */
+int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
+int add_file_to_index(struct index_state *, const char *path, int flags);
+
+int chmod_index_entry(struct index_state *, struct cache_entry *ce, char flip);
+int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
+void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
+int index_name_is_other(struct index_state *, const char *, int);
+void *read_blob_data_from_index(struct index_state *, const char *, unsigned long *);
+
+/* do stat comparison even if CE_VALID is true */
+#define CE_MATCH_IGNORE_VALID          01
+/* do not check the contents but report dirty on racily-clean entries */
+#define CE_MATCH_RACY_IS_DIRTY         02
+/* do stat comparison even if CE_SKIP_WORKTREE is true */
+#define CE_MATCH_IGNORE_SKIP_WORKTREE  04
+/* ignore non-existent files during stat update  */
+#define CE_MATCH_IGNORE_MISSING                0x08
+/* enable stat refresh */
+#define CE_MATCH_REFRESH               0x10
+/* don't refresh_fsmonitor state or do stat comparison even if CE_FSMONITOR_VALID is true */
+#define CE_MATCH_IGNORE_FSMONITOR 0X20
+int is_racy_timestamp(const struct index_state *istate,
+                     const struct cache_entry *ce);
+int has_racy_timestamp(struct index_state *istate);
+int ie_match_stat(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
+int ie_modified(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
+
+int match_stat_data_racy(const struct index_state *istate,
+                        const struct stat_data *sd, struct stat *st);
+
+void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, struct stat *st);
+
+#define REFRESH_REALLY                   (1 << 0) /* ignore_valid */
+#define REFRESH_UNMERGED                 (1 << 1) /* allow unmerged */
+#define REFRESH_QUIET                    (1 << 2) /* be quiet about it */
+#define REFRESH_IGNORE_MISSING           (1 << 3) /* ignore non-existent */
+#define REFRESH_IGNORE_SUBMODULES        (1 << 4) /* ignore submodules */
+#define REFRESH_IN_PORCELAIN             (1 << 5) /* user friendly output, not "needs update" */
+#define REFRESH_PROGRESS                 (1 << 6) /* show progress bar if stderr is tty */
+#define REFRESH_IGNORE_SKIP_WORKTREE     (1 << 7) /* ignore skip_worktree entries */
+int refresh_index(struct index_state *, unsigned int flags, const struct pathspec *pathspec, char *seen, const char *header_msg);
+/*
+ * Refresh the index and write it to disk.
+ *
+ * 'refresh_flags' is passed directly to 'refresh_index()', while
+ * 'COMMIT_LOCK | write_flags' is passed to 'write_locked_index()', so
+ * the lockfile is always either committed or rolled back.
+ *
+ * If 'gentle' is passed, errors locking the index are ignored.
+ *
+ * Return 1 if refreshing the index returns an error, -1 if writing
+ * the index to disk fails, 0 on success.
+ *
+ * Note that if refreshing the index returns an error, we still write
+ * out the index (unless locking fails).
+ */
+int repo_refresh_and_write_index(struct repository*, unsigned int refresh_flags, unsigned int write_flags, int gentle, const struct pathspec *, char *seen, const char *header_msg);
+
+struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
+
+void set_alternate_index_output(const char *);
+
+extern int verify_index_checksum;
+extern int verify_ce_order;
+
+int cmp_cache_name_compare(const void *a_, const void *b_);
+
+int add_files_to_cache(struct repository *repo, const char *prefix,
+                      const struct pathspec *pathspec, int include_sparse,
+                      int flags);
+
+void overlay_tree_on_index(struct index_state *istate,
+                          const char *tree_name, const char *prefix);
+
+#endif /* READ_CACHE_LL_H */
index 2a49178633b0398e167675c5784c74e95c123514..080bd39713bc1782434b7212954e6bc590fa4d6d 100644 (file)
@@ -3,9 +3,10 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
+#include "bulk-checkin.h"
 #include "config.h"
+#include "date.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "hex.h"
 #include "cache-tree.h"
 #include "refs.h"
 #include "dir.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
 #include "tree.h"
 #include "commit.h"
 #include "blob.h"
 #include "environment.h"
 #include "gettext.h"
+#include "mem-pool.h"
+#include "name-hash.h"
+#include "object-name.h"
+#include "path.h"
+#include "preload-index.h"
+#include "read-cache.h"
 #include "resolve-undo.h"
+#include "revision.h"
 #include "run-command.h"
 #include "strbuf.h"
+#include "trace2.h"
 #include "varint.h"
 #include "split-index.h"
+#include "symlinks.h"
 #include "utf8.h"
 #include "fsmonitor.h"
 #include "thread-utils.h"
@@ -33,7 +45,6 @@
 #include "csum-file.h"
 #include "promisor-remote.h"
 #include "hook.h"
-#include "wrapper.h"
 
 /* Mask for the name length in ce_flags in the on-disk index */
 
@@ -168,61 +179,6 @@ void rename_index_entry_at(struct index_state *istate, int nr, const char *new_n
                add_index_entry(istate, new_entry, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);
 }
 
-void fill_stat_data(struct stat_data *sd, struct stat *st)
-{
-       sd->sd_ctime.sec = (unsigned int)st->st_ctime;
-       sd->sd_mtime.sec = (unsigned int)st->st_mtime;
-       sd->sd_ctime.nsec = ST_CTIME_NSEC(*st);
-       sd->sd_mtime.nsec = ST_MTIME_NSEC(*st);
-       sd->sd_dev = st->st_dev;
-       sd->sd_ino = st->st_ino;
-       sd->sd_uid = st->st_uid;
-       sd->sd_gid = st->st_gid;
-       sd->sd_size = st->st_size;
-}
-
-int match_stat_data(const struct stat_data *sd, struct stat *st)
-{
-       int changed = 0;
-
-       if (sd->sd_mtime.sec != (unsigned int)st->st_mtime)
-               changed |= MTIME_CHANGED;
-       if (trust_ctime && check_stat &&
-           sd->sd_ctime.sec != (unsigned int)st->st_ctime)
-               changed |= CTIME_CHANGED;
-
-#ifdef USE_NSEC
-       if (check_stat && sd->sd_mtime.nsec != ST_MTIME_NSEC(*st))
-               changed |= MTIME_CHANGED;
-       if (trust_ctime && check_stat &&
-           sd->sd_ctime.nsec != ST_CTIME_NSEC(*st))
-               changed |= CTIME_CHANGED;
-#endif
-
-       if (check_stat) {
-               if (sd->sd_uid != (unsigned int) st->st_uid ||
-                       sd->sd_gid != (unsigned int) st->st_gid)
-                       changed |= OWNER_CHANGED;
-               if (sd->sd_ino != (unsigned int) st->st_ino)
-                       changed |= INODE_CHANGED;
-       }
-
-#ifdef USE_STDEV
-       /*
-        * st_dev breaks on network filesystems where different
-        * clients will have different views of what "device"
-        * the filesystem is on
-        */
-       if (check_stat && sd->sd_dev != (unsigned int) st->st_dev)
-                       changed |= INODE_CHANGED;
-#endif
-
-       if (sd->sd_size != (unsigned int) st->st_size)
-               changed |= DATA_CHANGED;
-
-       return changed;
-}
-
 /*
  * This only updates the "non-critical" parts of the directory
  * cache, ie the parts that aren't tracked by GIT, and only used
@@ -493,87 +449,30 @@ int ie_modified(struct index_state *istate,
        return 0;
 }
 
-int base_name_compare(const char *name1, size_t len1, int mode1,
-                     const char *name2, size_t len2, int mode2)
+static int cache_name_stage_compare(const char *name1, int len1, int stage1,
+                                   const char *name2, int len2, int stage2)
 {
-       unsigned char c1, c2;
-       size_t len = len1 < len2 ? len1 : len2;
        int cmp;
 
-       cmp = memcmp(name1, name2, len);
-       if (cmp)
-               return cmp;
-       c1 = name1[len];
-       c2 = name2[len];
-       if (!c1 && S_ISDIR(mode1))
-               c1 = '/';
-       if (!c2 && S_ISDIR(mode2))
-               c2 = '/';
-       return (c1 < c2) ? -1 : (c1 > c2) ? 1 : 0;
-}
-
-/*
- * df_name_compare() is identical to base_name_compare(), except it
- * compares conflicting directory/file entries as equal. Note that
- * while a directory name compares as equal to a regular file, they
- * then individually compare _differently_ to a filename that has
- * a dot after the basename (because '\0' < '.' < '/').
- *
- * This is used by routines that want to traverse the git namespace
- * but then handle conflicting entries together when possible.
- */
-int df_name_compare(const char *name1, size_t len1, int mode1,
-                   const char *name2, size_t len2, int mode2)
-{
-       unsigned char c1, c2;
-       size_t len = len1 < len2 ? len1 : len2;
-       int cmp;
-
-       cmp = memcmp(name1, name2, len);
+       cmp = name_compare(name1, len1, name2, len2);
        if (cmp)
                return cmp;
-       /* Directories and files compare equal (same length, same name) */
-       if (len1 == len2)
-               return 0;
-       c1 = name1[len];
-       if (!c1 && S_ISDIR(mode1))
-               c1 = '/';
-       c2 = name2[len];
-       if (!c2 && S_ISDIR(mode2))
-               c2 = '/';
-       if (c1 == '/' && !c2)
-               return 0;
-       if (c2 == '/' && !c1)
-               return 0;
-       return c1 - c2;
-}
 
-int name_compare(const char *name1, size_t len1, const char *name2, size_t len2)
-{
-       size_t min_len = (len1 < len2) ? len1 : len2;
-       int cmp = memcmp(name1, name2, min_len);
-       if (cmp)
-               return cmp;
-       if (len1 < len2)
+       if (stage1 < stage2)
                return -1;
-       if (len1 > len2)
+       if (stage1 > stage2)
                return 1;
        return 0;
 }
 
-int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2)
+int cmp_cache_name_compare(const void *a_, const void *b_)
 {
-       int cmp;
-
-       cmp = name_compare(name1, len1, name2, len2);
-       if (cmp)
-               return cmp;
+       const struct cache_entry *ce1, *ce2;
 
-       if (stage1 < stage2)
-               return -1;
-       if (stage1 > stage2)
-               return 1;
-       return 0;
+       ce1 = *((const struct cache_entry **)a_);
+       ce2 = *((const struct cache_entry **)b_);
+       return cache_name_stage_compare(ce1->name, ce1->ce_namelen, ce_stage(ce1),
+                                 ce2->name, ce2->ce_namelen, ce_stage(ce2));
 }
 
 static int index_name_stage_pos(struct index_state *istate,
@@ -2335,6 +2234,7 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
        if (fd < 0) {
                if (!must_exist && errno == ENOENT) {
                        set_new_index_sparsity(istate);
+                       istate->initialized = 1;
                        return 0;
                }
                die_errno(_("%s: index file open failed"), path);
@@ -2504,12 +2404,14 @@ int read_index_from(struct index_state *istate, const char *path,
 
        base_oid_hex = oid_to_hex(&split_index->base_oid);
        base_path = xstrfmt("%s/sharedindex.%s", gitdir, base_oid_hex);
-       trace2_region_enter_printf("index", "shared/do_read_index",
-                                  the_repository, "%s", base_path);
-       ret = do_read_index(split_index->base, base_path, 0);
-       trace2_region_leave_printf("index", "shared/do_read_index",
-                                  the_repository, "%s", base_path);
-       if (!ret) {
+       if (file_exists(base_path)) {
+               trace2_region_enter_printf("index", "shared/do_read_index",
+                                       the_repository, "%s", base_path);
+
+               ret = do_read_index(split_index->base, base_path, 0);
+               trace2_region_leave_printf("index", "shared/do_read_index",
+                                       the_repository, "%s", base_path);
+       } else {
                char *path_copy = xstrdup(path);
                char *base_path2 = xstrfmt("%s/sharedindex.%s",
                                           dirname(path_copy), base_oid_hex);
@@ -3584,35 +3486,6 @@ void *read_blob_data_from_index(struct index_state *istate,
        return data;
 }
 
-void stat_validity_clear(struct stat_validity *sv)
-{
-       FREE_AND_NULL(sv->sd);
-}
-
-int stat_validity_check(struct stat_validity *sv, const char *path)
-{
-       struct stat st;
-
-       if (stat(path, &st) < 0)
-               return sv->sd == NULL;
-       if (!sv->sd)
-               return 0;
-       return S_ISREG(st.st_mode) && !match_stat_data(sv->sd, &st);
-}
-
-void stat_validity_update(struct stat_validity *sv, int fd)
-{
-       struct stat st;
-
-       if (fstat(fd, &st) < 0 || !S_ISREG(st.st_mode))
-               stat_validity_clear(sv);
-       else {
-               if (!sv->sd)
-                       CALLOC_ARRAY(sv->sd, 1);
-               fill_stat_data(sv->sd, &st);
-       }
-}
-
 void move_index_extensions(struct index_state *dst, struct index_state *src)
 {
        dst->untracked = src->untracked;
@@ -3856,3 +3729,240 @@ void prefetch_cache_entries(const struct index_state *istate,
                                   to_fetch.oid, to_fetch.nr);
        oid_array_clear(&to_fetch);
 }
+
+static int read_one_entry_opt(struct index_state *istate,
+                             const struct object_id *oid,
+                             struct strbuf *base,
+                             const char *pathname,
+                             unsigned mode, int opt)
+{
+       int len;
+       struct cache_entry *ce;
+
+       if (S_ISDIR(mode))
+               return READ_TREE_RECURSIVE;
+
+       len = strlen(pathname);
+       ce = make_empty_cache_entry(istate, base->len + len);
+
+       ce->ce_mode = create_ce_mode(mode);
+       ce->ce_flags = create_ce_flags(1);
+       ce->ce_namelen = base->len + len;
+       memcpy(ce->name, base->buf, base->len);
+       memcpy(ce->name + base->len, pathname, len+1);
+       oidcpy(&ce->oid, oid);
+       return add_index_entry(istate, ce, opt);
+}
+
+static int read_one_entry(const struct object_id *oid, struct strbuf *base,
+                         const char *pathname, unsigned mode,
+                         void *context)
+{
+       struct index_state *istate = context;
+       return read_one_entry_opt(istate, oid, base, pathname,
+                                 mode,
+                                 ADD_CACHE_OK_TO_ADD|ADD_CACHE_SKIP_DFCHECK);
+}
+
+/*
+ * This is used when the caller knows there is no existing entries at
+ * the stage that will conflict with the entry being added.
+ */
+static int read_one_entry_quick(const struct object_id *oid, struct strbuf *base,
+                               const char *pathname, unsigned mode,
+                               void *context)
+{
+       struct index_state *istate = context;
+       return read_one_entry_opt(istate, oid, base, pathname,
+                                 mode, ADD_CACHE_JUST_APPEND);
+}
+
+/*
+ * Read the tree specified with --with-tree option
+ * (typically, HEAD) into stage #1 and then
+ * squash them down to stage #0.  This is used for
+ * --error-unmatch to list and check the path patterns
+ * that were given from the command line.  We are not
+ * going to write this index out.
+ */
+void overlay_tree_on_index(struct index_state *istate,
+                          const char *tree_name, const char *prefix)
+{
+       struct tree *tree;
+       struct object_id oid;
+       struct pathspec pathspec;
+       struct cache_entry *last_stage0 = NULL;
+       int i;
+       read_tree_fn_t fn = NULL;
+       int err;
+
+       if (repo_get_oid(the_repository, tree_name, &oid))
+               die("tree-ish %s not found.", tree_name);
+       tree = parse_tree_indirect(&oid);
+       if (!tree)
+               die("bad tree-ish %s", tree_name);
+
+       /* Hoist the unmerged entries up to stage #3 to make room */
+       /* TODO: audit for interaction with sparse-index. */
+       ensure_full_index(istate);
+       for (i = 0; i < istate->cache_nr; i++) {
+               struct cache_entry *ce = istate->cache[i];
+               if (!ce_stage(ce))
+                       continue;
+               ce->ce_flags |= CE_STAGEMASK;
+       }
+
+       if (prefix) {
+               static const char *(matchbuf[1]);
+               matchbuf[0] = NULL;
+               parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC,
+                              PATHSPEC_PREFER_CWD, prefix, matchbuf);
+       } else
+               memset(&pathspec, 0, sizeof(pathspec));
+
+       /*
+        * See if we have cache entry at the stage.  If so,
+        * do it the original slow way, otherwise, append and then
+        * sort at the end.
+        */
+       for (i = 0; !fn && i < istate->cache_nr; i++) {
+               const struct cache_entry *ce = istate->cache[i];
+               if (ce_stage(ce) == 1)
+                       fn = read_one_entry;
+       }
+
+       if (!fn)
+               fn = read_one_entry_quick;
+       err = read_tree(the_repository, tree, &pathspec, fn, istate);
+       clear_pathspec(&pathspec);
+       if (err)
+               die("unable to read tree entries %s", tree_name);
+
+       /*
+        * Sort the cache entry -- we need to nuke the cache tree, though.
+        */
+       if (fn == read_one_entry_quick) {
+               cache_tree_free(&istate->cache_tree);
+               QSORT(istate->cache, istate->cache_nr, cmp_cache_name_compare);
+       }
+
+       for (i = 0; i < istate->cache_nr; i++) {
+               struct cache_entry *ce = istate->cache[i];
+               switch (ce_stage(ce)) {
+               case 0:
+                       last_stage0 = ce;
+                       /* fallthru */
+               default:
+                       continue;
+               case 1:
+                       /*
+                        * If there is stage #0 entry for this, we do not
+                        * need to show it.  We use CE_UPDATE bit to mark
+                        * such an entry.
+                        */
+                       if (last_stage0 &&
+                           !strcmp(last_stage0->name, ce->name))
+                               ce->ce_flags |= CE_UPDATE;
+               }
+       }
+}
+
+struct update_callback_data {
+       struct index_state *index;
+       int include_sparse;
+       int flags;
+       int add_errors;
+};
+
+static int fix_unmerged_status(struct diff_filepair *p,
+                              struct update_callback_data *data)
+{
+       if (p->status != DIFF_STATUS_UNMERGED)
+               return p->status;
+       if (!(data->flags & ADD_CACHE_IGNORE_REMOVAL) && !p->two->mode)
+               /*
+                * This is not an explicit add request, and the
+                * path is missing from the working tree (deleted)
+                */
+               return DIFF_STATUS_DELETED;
+       else
+               /*
+                * Either an explicit add request, or path exists
+                * in the working tree.  An attempt to explicitly
+                * add a path that does not exist in the working tree
+                * will be caught as an error by the caller immediately.
+                */
+               return DIFF_STATUS_MODIFIED;
+}
+
+static void update_callback(struct diff_queue_struct *q,
+                           struct diff_options *opt UNUSED, void *cbdata)
+{
+       int i;
+       struct update_callback_data *data = cbdata;
+
+       for (i = 0; i < q->nr; i++) {
+               struct diff_filepair *p = q->queue[i];
+               const char *path = p->one->path;
+
+               if (!data->include_sparse &&
+                   !path_in_sparse_checkout(path, data->index))
+                       continue;
+
+               switch (fix_unmerged_status(p, data)) {
+               default:
+                       die(_("unexpected diff status %c"), p->status);
+               case DIFF_STATUS_MODIFIED:
+               case DIFF_STATUS_TYPE_CHANGED:
+                       if (add_file_to_index(data->index, path, data->flags)) {
+                               if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
+                                       die(_("updating files failed"));
+                               data->add_errors++;
+                       }
+                       break;
+               case DIFF_STATUS_DELETED:
+                       if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
+                               break;
+                       if (!(data->flags & ADD_CACHE_PRETEND))
+                               remove_file_from_index(data->index, path);
+                       if (data->flags & (ADD_CACHE_PRETEND|ADD_CACHE_VERBOSE))
+                               printf(_("remove '%s'\n"), path);
+                       break;
+               }
+       }
+}
+
+int add_files_to_cache(struct repository *repo, const char *prefix,
+                      const struct pathspec *pathspec, int include_sparse,
+                      int flags)
+{
+       struct update_callback_data data;
+       struct rev_info rev;
+
+       memset(&data, 0, sizeof(data));
+       data.index = repo->index;
+       data.include_sparse = include_sparse;
+       data.flags = flags;
+
+       repo_init_revisions(repo, &rev, prefix);
+       setup_revisions(0, NULL, &rev, NULL);
+       if (pathspec)
+               copy_pathspec(&rev.prune_data, pathspec);
+       rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
+       rev.diffopt.format_callback = update_callback;
+       rev.diffopt.format_callback_data = &data;
+       rev.diffopt.flags.override_submodule_config = 1;
+       rev.max_count = 0; /* do not compare unmerged paths with stage #2 */
+
+       /*
+        * Use an ODB transaction to optimize adding multiple objects.
+        * This function is invoked from commands other than 'add', which
+        * may not have their own transaction active.
+        */
+       begin_odb_transaction();
+       run_diff_files(&rev, DIFF_RACY_IS_MODIFIED);
+       end_odb_transaction();
+
+       release_revisions(&rev);
+       return !!data.add_errors;
+}
diff --git a/read-cache.h b/read-cache.h
new file mode 100644 (file)
index 0000000..043da1f
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef READ_CACHE_H
+#define READ_CACHE_H
+
+#include "read-cache-ll.h"
+#include "object.h"
+#include "pathspec.h"
+
+static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce,
+                                            unsigned int mode)
+{
+       extern int trust_executable_bit, has_symlinks;
+       if (!has_symlinks && S_ISREG(mode) &&
+           ce && S_ISLNK(ce->ce_mode))
+               return ce->ce_mode;
+       if (!trust_executable_bit && S_ISREG(mode)) {
+               if (ce && S_ISREG(ce->ce_mode))
+                       return ce->ce_mode;
+               return create_ce_mode(0666);
+       }
+       return create_ce_mode(mode);
+}
+
+static inline int ce_to_dtype(const struct cache_entry *ce)
+{
+       unsigned ce_mode = ntohl(ce->ce_mode);
+       if (S_ISREG(ce_mode))
+               return DT_REG;
+       else if (S_ISDIR(ce_mode) || S_ISGITLINK(ce_mode))
+               return DT_DIR;
+       else if (S_ISLNK(ce_mode))
+               return DT_LNK;
+       else
+               return DT_UNKNOWN;
+}
+
+static inline int ce_path_match(struct index_state *istate,
+                               const struct cache_entry *ce,
+                               const struct pathspec *pathspec,
+                               char *seen)
+{
+       return match_pathspec(istate, pathspec, ce->name, ce_namelen(ce), 0, seen,
+                             S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode));
+}
+
+#endif /* READ_CACHE_H */
index 79ed61b9fa4a333d905fe1d5258d20e43ce86bb2..d9718409b3d7862fee0eaa7e2255e83f50379656 100644 (file)
@@ -1,14 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "commit.h"
+#include "editor.h"
 #include "environment.h"
 #include "gettext.h"
 #include "sequencer.h"
 #include "rebase-interactive.h"
+#include "repository.h"
 #include "strbuf.h"
 #include "commit-slab.h"
 #include "config.h"
 #include "dir.h"
-#include "wrapper.h"
+#include "object-name.h"
 
 static const char edit_todo_list_advice[] =
 N_("You can fix this with 'git rebase --edit-todo' "
@@ -69,13 +71,14 @@ void append_todo_help(int command_count,
 
        if (!edit_todo) {
                strbuf_addch(buf, '\n');
-               strbuf_commented_addf(buf, Q_("Rebase %s onto %s (%d command)",
-                                             "Rebase %s onto %s (%d commands)",
-                                             command_count),
+               strbuf_commented_addf(buf, comment_line_char,
+                                     Q_("Rebase %s onto %s (%d command)",
+                                        "Rebase %s onto %s (%d commands)",
+                                        command_count),
                                      shortrevisions, shortonto, command_count);
        }
 
-       strbuf_add_commented_lines(buf, msg, strlen(msg));
+       strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_char);
 
        if (get_missing_commit_check_level() == MISSING_COMMIT_CHECK_ERROR)
                msg = _("\nDo not remove any line. Use 'drop' "
@@ -84,7 +87,7 @@ void append_todo_help(int command_count,
                msg = _("\nIf you remove a line here "
                         "THAT COMMIT WILL BE LOST.\n");
 
-       strbuf_add_commented_lines(buf, msg, strlen(msg));
+       strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_char);
 
        if (edit_todo)
                msg = _("\nYou are editing the todo file "
@@ -95,7 +98,7 @@ void append_todo_help(int command_count,
                msg = _("\nHowever, if you remove everything, "
                        "the rebase will be aborted.\n\n");
 
-       strbuf_add_commented_lines(buf, msg, strlen(msg));
+       strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_char);
 }
 
 int edit_todo_list(struct repository *r, struct todo_list *todo_list,
@@ -127,7 +130,7 @@ int edit_todo_list(struct repository *r, struct todo_list *todo_list,
        if (launch_sequence_editor(todo_file, &new_todo->buf, NULL))
                return -2;
 
-       strbuf_stripspace(&new_todo->buf, 1);
+       strbuf_stripspace(&new_todo->buf, comment_line_char);
        if (initial && new_todo->buf.len == 0)
                return -3;
 
index 72175612f3f32f512999099442214339aac948c7..1bfaf20fbff664b09d1c902be499040c8396e363 100644 (file)
@@ -1,12 +1,16 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
+#include "config.h"
+#include "gpg-interface.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "run-command.h"
 #include "refs.h"
 #include "wildmatch.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
 #include "repository.h"
 #include "commit.h"
 #include "remote.h"
@@ -17,6 +21,7 @@
 #include "revision.h"
 #include "utf8.h"
 #include "version.h"
+#include "versioncmp.h"
 #include "trailer.h"
 #include "wt-status.h"
 #include "commit-slab.h"
@@ -142,10 +147,12 @@ enum atom_type {
        ATOM_TAGGERDATE,
        ATOM_CREATOR,
        ATOM_CREATORDATE,
+       ATOM_DESCRIBE,
        ATOM_SUBJECT,
        ATOM_BODY,
        ATOM_TRAILERS,
        ATOM_CONTENTS,
+       ATOM_SIGNATURE,
        ATOM_RAW,
        ATOM_UPSTREAM,
        ATOM_PUSH,
@@ -211,6 +218,11 @@ static struct used_atom {
                struct email_option {
                        enum { EO_RAW, EO_TRIM, EO_LOCALPART } option;
                } email_option;
+               struct {
+                       enum { S_BARE, S_GRADE, S_SIGNER, S_KEY,
+                              S_FINGERPRINT, S_PRI_KEY_FP, S_TRUST_LEVEL } option;
+               } signature;
+               const char **describe_args;
                struct refname_atom refname;
                char *head;
        } u;
@@ -247,6 +259,110 @@ static int err_bad_arg(struct strbuf *sb, const char *name, const char *arg)
        return -1;
 }
 
+/*
+ * Parse option of name "candidate" in the option string "to_parse" of
+ * the form
+ *
+ *     "candidate1[=val1],candidate2[=val2],candidate3[=val3],..."
+ *
+ * The remaining part of "to_parse" is stored in "end" (if we are
+ * parsing the last candidate, then this is NULL) and the value of
+ * the candidate is stored in "valuestart" and its length in "valuelen",
+ * that is the portion after "=". Since it is possible for a "candidate"
+ * to not have a value, in such cases, "valuestart" is set to point to
+ * NULL and "valuelen" to 0.
+ *
+ * The function returns 1 on success. It returns 0 if we don't find
+ * "candidate" in "to_parse" or we find "candidate" but it is followed
+ * by more chars (for example, "candidatefoo"), that is, we don't find
+ * an exact match.
+ *
+ * This function only does the above for one "candidate" at a time. So
+ * it has to be called each time trying to parse a "candidate" in the
+ * option string "to_parse".
+ */
+static int match_atom_arg_value(const char *to_parse, const char *candidate,
+                               const char **end, const char **valuestart,
+                               size_t *valuelen)
+{
+       const char *atom;
+
+       if (!skip_prefix(to_parse, candidate, &atom))
+               return 0; /* definitely not "candidate" */
+
+       if (*atom == '=') {
+               /* we just saw "candidate=" */
+               *valuestart = atom + 1;
+               atom = strchrnul(*valuestart, ',');
+               *valuelen = atom - *valuestart;
+       } else if (*atom != ',' && *atom != '\0') {
+               /* key begins with "candidate" but has more chars */
+               return 0;
+       } else {
+               /* just "candidate" without "=val" */
+               *valuestart = NULL;
+               *valuelen = 0;
+       }
+
+       /* atom points at either the ',' or NUL after this key[=val] */
+       if (*atom == ',')
+               atom++;
+       else if (*atom)
+               BUG("Why is *atom not NULL yet?");
+
+       *end = atom;
+       return 1;
+}
+
+/*
+ * Parse boolean option of name "candidate" in the option list "to_parse"
+ * of the form
+ *
+ *     "candidate1[=bool1],candidate2[=bool2],candidate3[=bool3],..."
+ *
+ * The remaining part of "to_parse" is stored in "end" (if we are parsing
+ * the last candidate, then this is NULL) and the value (if given) is
+ * parsed and stored in "val", so "val" always points to either 0 or 1.
+ * If the value is not given, then "val" is set to point to 1.
+ *
+ * The boolean value is parsed using "git_parse_maybe_bool()", so the
+ * accepted values are
+ *
+ *     to set true  - "1", "yes", "true"
+ *     to set false - "0", "no", "false"
+ *
+ * This function returns 1 on success. It returns 0 when we don't find
+ * an exact match for "candidate" or when the boolean value given is
+ * not valid.
+ */
+static int match_atom_bool_arg(const char *to_parse, const char *candidate,
+                               const char **end, int *val)
+{
+       const char *argval;
+       char *strval;
+       size_t arglen;
+       int v;
+
+       if (!match_atom_arg_value(to_parse, candidate, end, &argval, &arglen))
+               return 0;
+
+       if (!argval) {
+               *val = 1;
+               return 1;
+       }
+
+       strval = xstrndup(argval, arglen);
+       v = git_parse_maybe_bool(strval);
+       free(strval);
+
+       if (v == -1)
+               return 0;
+
+       *val = v;
+
+       return 1;
+}
+
 static int color_atom_parser(struct ref_format *format, struct used_atom *atom,
                             const char *color_value, struct strbuf *err)
 {
@@ -403,8 +519,37 @@ static int subject_atom_parser(struct ref_format *format UNUSED,
        return 0;
 }
 
-static int trailers_atom_parser(struct ref_format *format UNUSED,
-                               struct used_atom *atom,
+static int parse_signature_option(const char *arg)
+{
+       if (!arg)
+               return S_BARE;
+       else if (!strcmp(arg, "signer"))
+               return S_SIGNER;
+       else if (!strcmp(arg, "grade"))
+               return S_GRADE;
+       else if (!strcmp(arg, "key"))
+               return S_KEY;
+       else if (!strcmp(arg, "fingerprint"))
+               return S_FINGERPRINT;
+       else if (!strcmp(arg, "primarykeyfingerprint"))
+               return S_PRI_KEY_FP;
+       else if (!strcmp(arg, "trustlevel"))
+               return S_TRUST_LEVEL;
+       return -1;
+}
+
+static int signature_atom_parser(struct ref_format *format UNUSED,
+                                struct used_atom *atom,
+                                const char *arg, struct strbuf *err)
+{
+       int opt = parse_signature_option(arg);
+       if (opt < 0)
+               return err_bad_arg(err, "signature", arg);
+       atom->u.signature.option = opt;
+       return 0;
+}
+
+static int trailers_atom_parser(struct ref_format *format, struct used_atom *atom,
                                const char *arg, struct strbuf *err)
 {
        atom->u.contents.trailer_opts.no_divider = 1;
@@ -458,6 +603,87 @@ static int contents_atom_parser(struct ref_format *format, struct used_atom *ato
        return 0;
 }
 
+static int describe_atom_option_parser(struct strvec *args, const char **arg,
+                                      struct strbuf *err)
+{
+       const char *argval;
+       size_t arglen = 0;
+       int optval = 0;
+
+       if (match_atom_bool_arg(*arg, "tags", arg, &optval)) {
+               if (!optval)
+                       strvec_push(args, "--no-tags");
+               else
+                       strvec_push(args, "--tags");
+               return 1;
+       }
+
+       if (match_atom_arg_value(*arg, "abbrev", arg, &argval, &arglen)) {
+               char *endptr;
+
+               if (!arglen)
+                       return strbuf_addf_ret(err, -1,
+                                              _("argument expected for %s"),
+                                              "describe:abbrev");
+               if (strtol(argval, &endptr, 10) < 0)
+                       return strbuf_addf_ret(err, -1,
+                                              _("positive value expected %s=%s"),
+                                              "describe:abbrev", argval);
+               if (endptr - argval != arglen)
+                       return strbuf_addf_ret(err, -1,
+                                              _("cannot fully parse %s=%s"),
+                                              "describe:abbrev", argval);
+
+               strvec_pushf(args, "--abbrev=%.*s", (int)arglen, argval);
+               return 1;
+       }
+
+       if (match_atom_arg_value(*arg, "match", arg, &argval, &arglen)) {
+               if (!arglen)
+                       return strbuf_addf_ret(err, -1,
+                                              _("value expected %s="),
+                                              "describe:match");
+
+               strvec_pushf(args, "--match=%.*s", (int)arglen, argval);
+               return 1;
+       }
+
+       if (match_atom_arg_value(*arg, "exclude", arg, &argval, &arglen)) {
+               if (!arglen)
+                       return strbuf_addf_ret(err, -1,
+                                              _("value expected %s="),
+                                              "describe:exclude");
+
+               strvec_pushf(args, "--exclude=%.*s", (int)arglen, argval);
+               return 1;
+       }
+
+       return 0;
+}
+
+static int describe_atom_parser(struct ref_format *format UNUSED,
+                               struct used_atom *atom,
+                               const char *arg, struct strbuf *err)
+{
+       struct strvec args = STRVEC_INIT;
+
+       for (;;) {
+               int found = 0;
+               const char *bad_arg = arg;
+
+               if (!arg || !*arg)
+                       break;
+
+               found = describe_atom_option_parser(&args, &arg, err);
+               if (found < 0)
+                       return found;
+               if (!found)
+                       return err_bad_arg(err, "describe", bad_arg);
+       }
+       atom->u.describe_args = strvec_detach(&args);
+       return 0;
+}
+
 static int raw_atom_parser(struct ref_format *format UNUSED,
                           struct used_atom *atom,
                           const char *arg, struct strbuf *err)
@@ -660,10 +886,12 @@ static struct {
        [ATOM_TAGGERDATE] = { "taggerdate", SOURCE_OBJ, FIELD_TIME },
        [ATOM_CREATOR] = { "creator", SOURCE_OBJ },
        [ATOM_CREATORDATE] = { "creatordate", SOURCE_OBJ, FIELD_TIME },
+       [ATOM_DESCRIBE] = { "describe", SOURCE_OBJ, FIELD_STR, describe_atom_parser },
        [ATOM_SUBJECT] = { "subject", SOURCE_OBJ, FIELD_STR, subject_atom_parser },
        [ATOM_BODY] = { "body", SOURCE_OBJ, FIELD_STR, body_atom_parser },
        [ATOM_TRAILERS] = { "trailers", SOURCE_OBJ, FIELD_STR, trailers_atom_parser },
        [ATOM_CONTENTS] = { "contents", SOURCE_OBJ, FIELD_STR, contents_atom_parser },
+       [ATOM_SIGNATURE] = { "signature", SOURCE_OBJ, FIELD_STR, signature_atom_parser },
        [ATOM_RAW] = { "raw", SOURCE_OBJ, FIELD_STR, raw_atom_parser },
        [ATOM_UPSTREAM] = { "upstream", SOURCE_NONE, FIELD_STR, remote_ref_atom_parser },
        [ATOM_PUSH] = { "push", SOURCE_NONE, FIELD_STR, remote_ref_atom_parser },
@@ -1401,6 +1629,92 @@ static void grab_person(const char *who, struct atom_value *val, int deref, void
        }
 }
 
+static void grab_signature(struct atom_value *val, int deref, struct object *obj)
+{
+       int i;
+       struct commit *commit = (struct commit *) obj;
+       struct signature_check sigc = { 0 };
+       int signature_checked = 0;
+
+       for (i = 0; i < used_atom_cnt; i++) {
+               struct used_atom *atom = &used_atom[i];
+               const char *name = atom->name;
+               struct atom_value *v = &val[i];
+               int opt;
+
+               if (!!deref != (*name == '*'))
+                       continue;
+               if (deref)
+                       name++;
+
+               if (!skip_prefix(name, "signature", &name) ||
+                   (*name && *name != ':'))
+                       continue;
+               if (!*name)
+                       name = NULL;
+               else
+                       name++;
+
+               opt = parse_signature_option(name);
+               if (opt < 0)
+                       continue;
+
+               if (!signature_checked) {
+                       check_commit_signature(commit, &sigc);
+                       signature_checked = 1;
+               }
+
+               switch (opt) {
+               case S_BARE:
+                       v->s = xstrdup(sigc.output ? sigc.output: "");
+                       break;
+               case S_SIGNER:
+                       v->s = xstrdup(sigc.signer ? sigc.signer : "");
+                       break;
+               case S_GRADE:
+                       switch (sigc.result) {
+                       case 'G':
+                               switch (sigc.trust_level) {
+                               case TRUST_UNDEFINED:
+                               case TRUST_NEVER:
+                                       v->s = xstrfmt("%c", (char)'U');
+                                       break;
+                               default:
+                                       v->s = xstrfmt("%c", (char)'G');
+                                       break;
+                               }
+                               break;
+                       case 'B':
+                       case 'E':
+                       case 'N':
+                       case 'X':
+                       case 'Y':
+                       case 'R':
+                               v->s = xstrfmt("%c", (char)sigc.result);
+                               break;
+                       }
+                       break;
+               case S_KEY:
+                       v->s = xstrdup(sigc.key ? sigc.key : "");
+                       break;
+               case S_FINGERPRINT:
+                       v->s = xstrdup(sigc.fingerprint ?
+                                      sigc.fingerprint : "");
+                       break;
+               case S_PRI_KEY_FP:
+                       v->s = xstrdup(sigc.primary_key_fingerprint ?
+                                      sigc.primary_key_fingerprint : "");
+                       break;
+               case S_TRUST_LEVEL:
+                       v->s = xstrdup(gpg_trust_level_to_str(sigc.trust_level));
+                       break;
+               }
+       }
+
+       if (signature_checked)
+               signature_check_clear(&sigc);
+}
+
 static void find_subpos(const char *buf,
                        const char **sub, size_t *sublen,
                        const char **body, size_t *bodylen,
@@ -1479,6 +1793,44 @@ static void append_lines(struct strbuf *out, const char *buf, unsigned long size
        }
 }
 
+static void grab_describe_values(struct atom_value *val, int deref,
+                                struct object *obj)
+{
+       struct commit *commit = (struct commit *)obj;
+       int i;
+
+       for (i = 0; i < used_atom_cnt; i++) {
+               struct used_atom *atom = &used_atom[i];
+               enum atom_type type = atom->atom_type;
+               const char *name = atom->name;
+               struct atom_value *v = &val[i];
+
+               struct child_process cmd = CHILD_PROCESS_INIT;
+               struct strbuf out = STRBUF_INIT;
+               struct strbuf err = STRBUF_INIT;
+
+               if (type != ATOM_DESCRIBE)
+                       continue;
+
+               if (!!deref != (*name == '*'))
+                       continue;
+
+               cmd.git_cmd = 1;
+               strvec_push(&cmd.args, "describe");
+               strvec_pushv(&cmd.args, atom->u.describe_args);
+               strvec_push(&cmd.args, oid_to_hex(&commit->object.oid));
+               if (pipe_command(&cmd, NULL, 0, &out, 0, &err, 0) < 0) {
+                       error(_("failed to run 'describe'"));
+                       v->s = xstrdup("");
+                       continue;
+               }
+               strbuf_rtrim(&out);
+               v->s = strbuf_detach(&out, NULL);
+
+               strbuf_release(&err);
+       }
+}
+
 /* See grab_values */
 static void grab_sub_body_contents(struct atom_value *val, int deref, struct expand_data *data)
 {
@@ -1588,12 +1940,15 @@ static void grab_values(struct atom_value *val, int deref, struct object *obj, s
                grab_tag_values(val, deref, obj);
                grab_sub_body_contents(val, deref, data);
                grab_person("tagger", val, deref, buf);
+               grab_describe_values(val, deref, obj);
                break;
        case OBJ_COMMIT:
                grab_commit_values(val, deref, obj);
                grab_sub_body_contents(val, deref, data);
                grab_person("author", val, deref, buf);
                grab_person("committer", val, deref, buf);
+               grab_signature(val, deref, obj);
+               grab_describe_values(val, deref, obj);
                break;
        case OBJ_TREE:
                /* grab_tree_values(val, deref, obj, buf, sz); */
@@ -2100,12 +2455,12 @@ static int get_ref_atom_value(struct ref_array_item *ref, int atom,
  * matches a pattern "refs/heads/mas") or a wildcard (e.g. the same ref
  * matches "refs/heads/mas*", too).
  */
-static int match_pattern(const struct ref_filter *filter, const char *refname)
+static int match_pattern(const char **patterns, const char *refname,
+                        int ignore_case)
 {
-       const char **patterns = filter->name_patterns;
        unsigned flags = 0;
 
-       if (filter->ignore_case)
+       if (ignore_case)
                flags |= WM_CASEFOLD;
 
        /*
@@ -2130,13 +2485,13 @@ static int match_pattern(const struct ref_filter *filter, const char *refname)
  * matches a pattern "refs/heads/" but not "refs/heads/m") or a
  * wildcard (e.g. the same ref matches "refs/heads/m*", too).
  */
-static int match_name_as_path(const struct ref_filter *filter, const char *refname)
+static int match_name_as_path(const char **pattern, const char *refname,
+                             int ignore_case)
 {
-       const char **pattern = filter->name_patterns;
        int namelen = strlen(refname);
        unsigned flags = WM_PATHNAME;
 
-       if (filter->ignore_case)
+       if (ignore_case)
                flags |= WM_CASEFOLD;
 
        for (; *pattern; pattern++) {
@@ -2161,8 +2516,20 @@ static int filter_pattern_match(struct ref_filter *filter, const char *refname)
        if (!*filter->name_patterns)
                return 1; /* No pattern always matches */
        if (filter->match_as_path)
-               return match_name_as_path(filter, refname);
-       return match_pattern(filter, refname);
+               return match_name_as_path(filter->name_patterns, refname,
+                                         filter->ignore_case);
+       return match_pattern(filter->name_patterns, refname,
+                            filter->ignore_case);
+}
+
+static int filter_exclude_match(struct ref_filter *filter, const char *refname)
+{
+       if (!filter->exclude.nr)
+               return 0;
+       if (filter->match_as_path)
+               return match_name_as_path(filter->exclude.v, refname,
+                                         filter->ignore_case);
+       return match_pattern(filter->exclude.v, refname, filter->ignore_case);
 }
 
 /*
@@ -2194,43 +2561,53 @@ static int for_each_fullref_in_pattern(struct ref_filter *filter,
 
        if (!filter->name_patterns[0]) {
                /* no patterns; we have to look at everything */
-               return for_each_fullref_in("", cb, cb_data);
+               return refs_for_each_fullref_in(get_main_ref_store(the_repository),
+                                                "", filter->exclude.v, cb, cb_data);
        }
 
        return refs_for_each_fullref_in_prefixes(get_main_ref_store(the_repository),
                                                 NULL, filter->name_patterns,
+                                                filter->exclude.v,
                                                 cb, cb_data);
 }
 
 /*
  * Given a ref (oid, refname), check if the ref belongs to the array
  * of oids. If the given ref is a tag, check if the given tag points
- * at one of the oids in the given oid array.
+ * at one of the oids in the given oid array. Returns non-zero if a
+ * match is found.
+ *
  * NEEDSWORK:
- * 1. Only a single level of indirection is obtained, we might want to
- * change this to account for multiple levels (e.g. annotated tags
- * pointing to annotated tags pointing to a commit.)
- * 2. As the refs are cached we might know what refname peels to without
+ * As the refs are cached we might know what refname peels to without
  * the need to parse the object via parse_object(). peel_ref() might be a
  * more efficient alternative to obtain the pointee.
  */
-static const struct object_id *match_points_at(struct oid_array *points_at,
-                                              const struct object_id *oid,
-                                              const char *refname)
+static int match_points_at(struct oid_array *points_at,
+                          const struct object_id *oid,
+                          const char *refname)
 {
-       const struct object_id *tagged_oid = NULL;
        struct object *obj;
 
        if (oid_array_lookup(points_at, oid) >= 0)
-               return oid;
-       obj = parse_object(the_repository, oid);
+               return 1;
+       obj = parse_object_with_flags(the_repository, oid,
+                                     PARSE_OBJECT_SKIP_HASH_CHECK);
+       while (obj && obj->type == OBJ_TAG) {
+               struct tag *tag = (struct tag *)obj;
+
+               if (parse_tag(tag) < 0) {
+                       obj = NULL;
+                       break;
+               }
+
+               if (oid_array_lookup(points_at, get_tagged_oid(tag)) >= 0)
+                       return 1;
+
+               obj = tag->tagged;
+       }
        if (!obj)
                die(_("malformed object at '%s'"), refname);
-       if (obj->type == OBJ_TAG)
-               tagged_oid = get_tagged_oid((struct tag *)obj);
-       if (tagged_oid && oid_array_lookup(points_at, tagged_oid) >= 0)
-               return tagged_oid;
-       return NULL;
+       return 0;
 }
 
 /*
@@ -2332,6 +2709,9 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
        if (!filter_pattern_match(filter, refname))
                return 0;
 
+       if (filter_exclude_match(filter, refname))
+               return 0;
+
        if (filter->points_at.nr && !match_points_at(&filter->points_at, oid, refname))
                return 0;
 
@@ -2414,13 +2794,13 @@ void ref_array_clear(struct ref_array *array)
 #define EXCLUDE_REACHED 0
 #define INCLUDE_REACHED 1
 static void reach_filter(struct ref_array *array,
-                        struct commit_list *check_reachable,
+                        struct commit_list **check_reachable,
                         int include_reached)
 {
        int i, old_nr;
        struct commit **to_clear;
 
-       if (!check_reachable)
+       if (!*check_reachable)
                return;
 
        CALLOC_ARRAY(to_clear, array->nr);
@@ -2430,7 +2810,7 @@ static void reach_filter(struct ref_array *array,
        }
 
        tips_reachable_from_bases(the_repository,
-                                 check_reachable,
+                                 *check_reachable,
                                  to_clear, array->nr,
                                  UNINTERESTING);
 
@@ -2451,8 +2831,8 @@ static void reach_filter(struct ref_array *array,
 
        clear_commit_marks_many(old_nr, to_clear, ALL_REV_FLAGS);
 
-       while (check_reachable) {
-               struct commit *merge_commit = pop_commit(&check_reachable);
+       while (*check_reachable) {
+               struct commit *merge_commit = pop_commit(check_reachable);
                clear_commit_marks(merge_commit, ALL_REV_FLAGS);
        }
 
@@ -2549,8 +2929,8 @@ int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int
        clear_contains_cache(&ref_cbdata.no_contains_cache);
 
        /*  Filters that need revision walking */
-       reach_filter(array, filter->reachable_from, INCLUDE_REACHED);
-       reach_filter(array, filter->unreachable_from, EXCLUDE_REACHED);
+       reach_filter(array, &filter->reachable_from, INCLUDE_REACHED);
+       reach_filter(array, &filter->unreachable_from, EXCLUDE_REACHED);
 
        save_commit_buffer = save_commit_buffer_orig;
        return ret;
@@ -2862,3 +3242,20 @@ int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset)
 
        return 0;
 }
+
+void ref_filter_init(struct ref_filter *filter)
+{
+       struct ref_filter blank = REF_FILTER_INIT;
+       memcpy(filter, &blank, sizeof(blank));
+}
+
+void ref_filter_clear(struct ref_filter *filter)
+{
+       strvec_clear(&filter->exclude);
+       oid_array_clear(&filter->points_at);
+       free_commit_list(filter->with_commit);
+       free_commit_list(filter->no_commit);
+       free_commit_list(filter->reachable_from);
+       free_commit_list(filter->unreachable_from);
+       ref_filter_init(filter);
+}
index 430701cfb765b557d62c6004e6ef7fb27ad5e5f0..1524bc463a5701d475cb68e50caa884a6daf890a 100644 (file)
@@ -6,6 +6,7 @@
 #include "refs.h"
 #include "commit.h"
 #include "string-list.h"
+#include "strvec.h"
 
 /* Quoting styles */
 #define QUOTE_NONE 0
@@ -59,6 +60,7 @@ struct ref_array {
 
 struct ref_filter {
        const char **name_patterns;
+       struct strvec exclude;
        struct oid_array points_at;
        struct commit_list *with_commit;
        struct commit_list *no_commit;
@@ -92,6 +94,10 @@ struct ref_format {
        struct string_list bases;
 };
 
+#define REF_FILTER_INIT { \
+       .points_at = OID_ARRAY_INIT, \
+       .exclude = STRVEC_INIT, \
+}
 #define REF_FORMAT_INIT {             \
        .use_color = -1,              \
        .bases = STRING_LIST_INIT_DUP, \
@@ -109,6 +115,9 @@ struct ref_format {
 #define OPT_REF_SORT(var) \
        OPT_STRING_LIST(0, "sort", (var), \
                        N_("key"), N_("field name to sort on"))
+#define OPT_REF_FILTER_EXCLUDE(var) \
+       OPT_STRVEC(0, "exclude", &(var)->exclude, \
+                  N_("pattern"), N_("exclude refs which match pattern"))
 
 /*
  * API for filtering a set of refs. Based on the type of refs the user
@@ -167,4 +176,7 @@ void filter_ahead_behind(struct repository *r,
                         struct ref_format *format,
                         struct ref_array *array);
 
+void ref_filter_init(struct ref_filter *filter);
+void ref_filter_clear(struct ref_filter *filter);
+
 #endif /*  REF_FILTER_H  */
index 4ba1a10c82cdd3920a1c2818de29a18e1ea153ca..d216f6f966da91459ea946790be56ba011760170 100644 (file)
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "commit.h"
 #include "refs.h"
 #include "diff.h"
+#include "repository.h"
 #include "revision.h"
 #include "string-list.h"
 #include "reflog-walk.h"
index 9c0944308849088e8b69596986fdefd13ee147db..9ad50e7d93e40c7a5f9c7ad0cecb0b7d1766105b 100644 (file)
--- a/reflog.c
+++ b/reflog.c
@@ -1,9 +1,11 @@
 #include "git-compat-util.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "reflog.h"
 #include "refs.h"
 #include "revision.h"
+#include "tree.h"
+#include "tree-walk.h"
 #include "worktree.h"
 
 /* Remember to update object flag allocation in object.h */
diff --git a/refs.c b/refs.c
index 0f369dbde7a092868a767d795911fb3a14168d70..fcae5dddc6050627668048e966384b7f9fa70171 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -2,8 +2,8 @@
  * The backend-independent part of the reference module.
  */
 
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
+#include "advice.h"
 #include "config.h"
 #include "environment.h"
 #include "hashmap.h"
 #include "refs/refs-internal.h"
 #include "run-command.h"
 #include "hook.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "object.h"
+#include "path.h"
 #include "tag.h"
 #include "submodule.h"
 #include "worktree.h"
@@ -26,7 +28,7 @@
 #include "sigchain.h"
 #include "date.h"
 #include "commit.h"
-#include "wrapper.h"
+#include "wildmatch.h"
 
 /*
  * List of all available backends
@@ -373,8 +375,8 @@ char *resolve_refdup(const char *refname, int resolve_flags,
                                   oid, flags);
 }
 
-/* The argument to filter_refs */
-struct ref_filter {
+/* The argument to for_each_filter_refs */
+struct for_each_ref_filter {
        const char *pattern;
        const char *prefix;
        each_ref_fn *fn;
@@ -407,10 +409,11 @@ int ref_exists(const char *refname)
        return refs_ref_exists(get_main_ref_store(the_repository), refname);
 }
 
-static int filter_refs(const char *refname, const struct object_id *oid,
-                          int flags, void *data)
+static int for_each_filter_refs(const char *refname,
+                               const struct object_id *oid,
+                               int flags, void *data)
 {
-       struct ref_filter *filter = (struct ref_filter *)data;
+       struct for_each_ref_filter *filter = data;
 
        if (wildmatch(filter->pattern, refname, 0))
                return 0;
@@ -567,7 +570,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
        const char *prefix, void *cb_data)
 {
        struct strbuf real_pattern = STRBUF_INIT;
-       struct ref_filter filter;
+       struct for_each_ref_filter filter;
        int ret;
 
        if (!prefix && !starts_with(pattern, "refs/"))
@@ -587,7 +590,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
        filter.prefix = prefix;
        filter.fn = fn;
        filter.cb_data = cb_data;
-       ret = for_each_ref(filter_refs, &filter);
+       ret = for_each_ref(for_each_filter_refs, &filter);
 
        strbuf_release(&real_pattern);
        return ret;
@@ -1424,7 +1427,7 @@ char *shorten_unambiguous_ref(const char *refname, int strict)
 }
 
 int parse_hide_refs_config(const char *var, const char *value, const char *section,
-                          struct string_list *hide_refs)
+                          struct strvec *hide_refs)
 {
        const char *key;
        if (!strcmp("transfer.hiderefs", var) ||
@@ -1435,22 +1438,23 @@ int parse_hide_refs_config(const char *var, const char *value, const char *secti
 
                if (!value)
                        return config_error_nonbool(var);
-               ref = xstrdup(value);
+
+               /* drop const to remove trailing '/' characters */
+               ref = (char *)strvec_push(hide_refs, value);
                len = strlen(ref);
                while (len && ref[len - 1] == '/')
                        ref[--len] = '\0';
-               string_list_append_nodup(hide_refs, ref);
        }
        return 0;
 }
 
 int ref_is_hidden(const char *refname, const char *refname_full,
-                 const struct string_list *hide_refs)
+                 const struct strvec *hide_refs)
 {
        int i;
 
        for (i = hide_refs->nr - 1; i >= 0; i--) {
-               const char *match = hide_refs->items[i].string;
+               const char *match = hide_refs->v[i];
                const char *subject;
                int neg = 0;
                const char *p;
@@ -1476,6 +1480,30 @@ int ref_is_hidden(const char *refname, const char *refname_full,
        return 0;
 }
 
+const char **hidden_refs_to_excludes(const struct strvec *hide_refs)
+{
+       const char **pattern;
+       for (pattern = hide_refs->v; *pattern; pattern++) {
+               /*
+                * We can't feed any excludes from hidden refs config
+                * sections, since later rules may override previous
+                * ones. For example, with rules "refs/foo" and
+                * "!refs/foo/bar", we should show "refs/foo/bar" (and
+                * everything underneath it), but the earlier exclusion
+                * would cause us to skip all of "refs/foo".  We
+                * likewise don't implement the namespace stripping
+                * required for '^' rules.
+                *
+                * Both are possible to do, but complicated, so avoid
+                * populating the jump list at all if we see either of
+                * these patterns.
+                */
+               if (**pattern == '!' || **pattern == '^')
+                       return NULL;
+       }
+       return hide_refs->v;
+}
+
 const char *find_descendant_ref(const char *dirname,
                                const struct string_list *extras,
                                const struct string_list *skip)
@@ -1523,7 +1551,9 @@ int head_ref(each_ref_fn fn, void *cb_data)
 
 struct ref_iterator *refs_ref_iterator_begin(
                struct ref_store *refs,
-               const char *prefix, int trim,
+               const char *prefix,
+               const char **exclude_patterns,
+               int trim,
                enum do_for_each_ref_flags flags)
 {
        struct ref_iterator *iter;
@@ -1539,8 +1569,7 @@ struct ref_iterator *refs_ref_iterator_begin(
                }
        }
 
-       iter = refs->be->iterator_begin(refs, prefix, flags);
-
+       iter = refs->be->iterator_begin(refs, prefix, exclude_patterns, flags);
        /*
         * `iterator_begin()` already takes care of prefix, but we
         * might need to do some trimming:
@@ -1574,7 +1603,7 @@ static int do_for_each_repo_ref(struct repository *r, const char *prefix,
        if (!refs)
                return 0;
 
-       iter = refs_ref_iterator_begin(refs, prefix, trim, flags);
+       iter = refs_ref_iterator_begin(refs, prefix, NULL, trim, flags);
 
        return do_for_each_repo_ref_iterator(r, iter, fn, cb_data);
 }
@@ -1584,7 +1613,7 @@ struct do_for_each_ref_help {
        void *cb_data;
 };
 
-static int do_for_each_ref_helper(struct repository *r,
+static int do_for_each_ref_helper(struct repository *r UNUSED,
                                  const char *refname,
                                  const struct object_id *oid,
                                  int flags,
@@ -1596,6 +1625,7 @@ static int do_for_each_ref_helper(struct repository *r,
 }
 
 static int do_for_each_ref(struct ref_store *refs, const char *prefix,
+                          const char **exclude_patterns,
                           each_ref_fn fn, int trim,
                           enum do_for_each_ref_flags flags, void *cb_data)
 {
@@ -1605,7 +1635,8 @@ static int do_for_each_ref(struct ref_store *refs, const char *prefix,
        if (!refs)
                return 0;
 
-       iter = refs_ref_iterator_begin(refs, prefix, trim, flags);
+       iter = refs_ref_iterator_begin(refs, prefix, exclude_patterns, trim,
+                                      flags);
 
        return do_for_each_repo_ref_iterator(the_repository, iter,
                                        do_for_each_ref_helper, &hp);
@@ -1613,7 +1644,7 @@ static int do_for_each_ref(struct ref_store *refs, const char *prefix,
 
 int refs_for_each_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
 {
-       return do_for_each_ref(refs, "", fn, 0, 0, cb_data);
+       return do_for_each_ref(refs, "", NULL, fn, 0, 0, cb_data);
 }
 
 int for_each_ref(each_ref_fn fn, void *cb_data)
@@ -1624,7 +1655,7 @@ int for_each_ref(each_ref_fn fn, void *cb_data)
 int refs_for_each_ref_in(struct ref_store *refs, const char *prefix,
                         each_ref_fn fn, void *cb_data)
 {
-       return do_for_each_ref(refs, prefix, fn, strlen(prefix), 0, cb_data);
+       return do_for_each_ref(refs, prefix, NULL, fn, strlen(prefix), 0, cb_data);
 }
 
 int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data)
@@ -1635,13 +1666,14 @@ int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data)
 int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data)
 {
        return do_for_each_ref(get_main_ref_store(the_repository),
-                              prefix, fn, 0, 0, cb_data);
+                              prefix, NULL, fn, 0, 0, cb_data);
 }
 
 int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
+                            const char **exclude_patterns,
                             each_ref_fn fn, void *cb_data)
 {
-       return do_for_each_ref(refs, prefix, fn, 0, 0, cb_data);
+       return do_for_each_ref(refs, prefix, exclude_patterns, fn, 0, 0, cb_data);
 }
 
 int for_each_replace_ref(struct repository *r, each_repo_ref_fn fn, void *cb_data)
@@ -1652,20 +1684,21 @@ int for_each_replace_ref(struct repository *r, each_repo_ref_fn fn, void *cb_dat
                                    DO_FOR_EACH_INCLUDE_BROKEN, cb_data);
 }
 
-int for_each_namespaced_ref(each_ref_fn fn, void *cb_data)
+int for_each_namespaced_ref(const char **exclude_patterns,
+                           each_ref_fn fn, void *cb_data)
 {
        struct strbuf buf = STRBUF_INIT;
        int ret;
        strbuf_addf(&buf, "%srefs/", get_git_namespace());
        ret = do_for_each_ref(get_main_ref_store(the_repository),
-                             buf.buf, fn, 0, 0, cb_data);
+                             buf.buf, exclude_patterns, fn, 0, 0, cb_data);
        strbuf_release(&buf);
        return ret;
 }
 
 int refs_for_each_rawref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
 {
-       return do_for_each_ref(refs, "", fn, 0,
+       return do_for_each_ref(refs, "", NULL, fn, 0,
                               DO_FOR_EACH_INCLUDE_BROKEN, cb_data);
 }
 
@@ -1735,6 +1768,7 @@ static void find_longest_prefixes(struct string_list *out,
 int refs_for_each_fullref_in_prefixes(struct ref_store *ref_store,
                                      const char *namespace,
                                      const char **patterns,
+                                     const char **exclude_patterns,
                                      each_ref_fn fn, void *cb_data)
 {
        struct string_list prefixes = STRING_LIST_INIT_DUP;
@@ -1750,7 +1784,8 @@ int refs_for_each_fullref_in_prefixes(struct ref_store *ref_store,
 
        for_each_string_list_item(prefix, &prefixes) {
                strbuf_addstr(&buf, prefix->string);
-               ret = refs_for_each_fullref_in(ref_store, buf.buf, fn, cb_data);
+               ret = refs_for_each_fullref_in(ref_store, buf.buf,
+                                              exclude_patterns, fn, cb_data);
                if (ret)
                        break;
                strbuf_setlen(&buf, namespace_len);
@@ -2130,9 +2165,9 @@ void base_ref_store_init(struct ref_store *refs, struct repository *repo,
 }
 
 /* backend functions */
-int refs_pack_refs(struct ref_store *refs, unsigned int flags)
+int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *opts)
 {
-       return refs->be->pack_refs(refs, flags);
+       return refs->be->pack_refs(refs, opts);
 }
 
 int peel_iterated_oid(const struct object_id *base, struct object_id *peeled)
@@ -2405,7 +2440,7 @@ int refs_verify_refname_available(struct ref_store *refs,
        strbuf_addstr(&dirname, refname + dirname.len);
        strbuf_addch(&dirname, '/');
 
-       iter = refs_ref_iterator_begin(refs, dirname.buf, 0,
+       iter = refs_ref_iterator_begin(refs, dirname.buf, NULL, 0,
                                       DO_FOR_EACH_INCLUDE_BROKEN);
        while ((ok = ref_iterator_advance(iter)) == ITER_OK) {
                if (skip &&
diff --git a/refs.h b/refs.h
index 123cfa4424453fbda6503dbbb66d28f092815154..23211a5ea1cabbb0a35d091bf2b5dbbd87e28252 100644 (file)
--- a/refs.h
+++ b/refs.h
@@ -63,6 +63,12 @@ struct worktree;
 #define RESOLVE_REF_NO_RECURSE 0x02
 #define RESOLVE_REF_ALLOW_BAD_NAME 0x04
 
+struct pack_refs_opts {
+       unsigned int flags;
+       struct ref_exclusions *exclusions;
+       struct string_list *includes;
+};
+
 const char *refs_resolve_ref_unsafe(struct ref_store *refs,
                                    const char *refname,
                                    int resolve_flags,
@@ -337,7 +343,12 @@ int for_each_ref(each_ref_fn fn, void *cb_data);
  */
 int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data);
 
+/*
+ * references matching any pattern in "exclude_patterns" are omitted from the
+ * result set on a best-effort basis.
+ */
 int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
+                            const char **exclude_patterns,
                             each_ref_fn fn, void *cb_data);
 int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data);
 
@@ -345,10 +356,15 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data);
  * iterate all refs in "patterns" by partitioning patterns into disjoint sets
  * and iterating the longest-common prefix of each set.
  *
+ * references matching any pattern in "exclude_patterns" are omitted from the
+ * result set on a best-effort basis.
+ *
  * callers should be prepared to ignore references that they did not ask for.
  */
 int refs_for_each_fullref_in_prefixes(struct ref_store *refs,
-                                     const char *namespace, const char **patterns,
+                                     const char *namespace,
+                                     const char **patterns,
+                                     const char **exclude_patterns,
                                      each_ref_fn fn, void *cb_data);
 
 /**
@@ -366,7 +382,12 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
                         const char *prefix, void *cb_data);
 
 int head_ref_namespaced(each_ref_fn fn, void *cb_data);
-int for_each_namespaced_ref(each_ref_fn fn, void *cb_data);
+/*
+ * references matching any pattern in "exclude_patterns" are omitted from the
+ * result set on a best-effort basis.
+ */
+int for_each_namespaced_ref(const char **exclude_patterns,
+                           each_ref_fn fn, void *cb_data);
 
 /* can be used to learn about broken ref and symref */
 int refs_for_each_rawref(struct ref_store *refs, each_ref_fn fn, void *cb_data);
@@ -405,7 +426,7 @@ void warn_dangling_symrefs(FILE *fp, const char *msg_fmt,
  * Write a packed-refs file for the current repository.
  * flags: Combination of the above PACK_REFS_* flags.
  */
-int refs_pack_refs(struct ref_store *refs, unsigned int flags);
+int refs_pack_refs(struct ref_store *refs, struct pack_refs_opts *opts);
 
 /*
  * Setup reflog before using. Fill in err and return -1 on failure.
@@ -804,7 +825,7 @@ int update_ref(const char *msg, const char *refname,
               unsigned int flags, enum action_on_err onerr);
 
 int parse_hide_refs_config(const char *var, const char *value, const char *,
-                          struct string_list *);
+                          struct strvec *);
 
 /*
  * Check whether a ref is hidden. If no namespace is set, both the first and
@@ -814,7 +835,13 @@ int parse_hide_refs_config(const char *var, const char *value, const char *,
  * the ref is outside that namespace, the first parameter is NULL. The second
  * parameter always points to the full ref name.
  */
-int ref_is_hidden(const char *, const char *, const struct string_list *);
+int ref_is_hidden(const char *, const char *, const struct strvec *);
+
+/*
+ * Returns an array of patterns to use as excluded_patterns, if none of the
+ * hidden references use the token '!' or '^'.
+ */
+const char **hidden_refs_to_excludes(const struct strvec *hide_refs);
 
 /* Is this a per-worktree ref living in the refs/ namespace? */
 int is_per_worktree_ref(const char *refname);
index adc34c836fce48f34e811af27c04e79aa50e617b..b7ffc4ce67e333321036592b7e53efa30f8871d8 100644 (file)
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "hex.h"
 #include "refs-internal.h"
+#include "string-list.h"
 #include "trace.h"
 
 static struct trace_key trace_refs = TRACE_KEY_INIT(REFS);
@@ -122,10 +123,10 @@ static int debug_initial_transaction_commit(struct ref_store *refs,
        return res;
 }
 
-static int debug_pack_refs(struct ref_store *ref_store, unsigned int flags)
+static int debug_pack_refs(struct ref_store *ref_store, struct pack_refs_opts *opts)
 {
        struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
-       int res = drefs->refs->be->pack_refs(drefs->refs, flags);
+       int res = drefs->refs->be->pack_refs(drefs->refs, opts);
        trace_printf_key(&trace_refs, "pack_refs: %d\n", res);
        return res;
 }
@@ -228,11 +229,12 @@ static struct ref_iterator_vtable debug_ref_iterator_vtable = {
 
 static struct ref_iterator *
 debug_ref_iterator_begin(struct ref_store *ref_store, const char *prefix,
-                        unsigned int flags)
+                        const char **exclude_patterns, unsigned int flags)
 {
        struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
        struct ref_iterator *res =
-               drefs->refs->be->iterator_begin(drefs->refs, prefix, flags);
+               drefs->refs->be->iterator_begin(drefs->refs, prefix,
+                                               exclude_patterns, flags);
        struct debug_ref_iterator *diter = xcalloc(1, sizeof(*diter));
        base_ref_iterator_init(&diter->base, &debug_ref_iterator_vtable, 1);
        diter->iter = res;
index e6a6971381e09a5f153b25d29b69bb5b1c1d6270..341354182bbf10937dffc9de2c56645027f5cfcd 100644 (file)
@@ -1,7 +1,9 @@
-#include "../cache.h"
+#include "../git-compat-util.h"
 #include "../config.h"
+#include "../copy.h"
 #include "../environment.h"
 #include "../gettext.h"
+#include "../hash.h"
 #include "../hex.h"
 #include "../refs.h"
 #include "refs-internal.h"
 #include "../dir-iterator.h"
 #include "../lockfile.h"
 #include "../object.h"
+#include "../object-file.h"
+#include "../path.h"
 #include "../dir.h"
 #include "../chdir-notify.h"
 #include "../setup.h"
 #include "../worktree.h"
 #include "../wrapper.h"
 #include "../write-or-die.h"
+#include "../revision.h"
+#include <wildmatch.h>
 
 /*
  * This backend uses the following flags in `ref_update::flags` for
@@ -826,7 +832,8 @@ static struct ref_iterator_vtable files_ref_iterator_vtable = {
 
 static struct ref_iterator *files_ref_iterator_begin(
                struct ref_store *ref_store,
-               const char *prefix, unsigned int flags)
+               const char *prefix, const char **exclude_patterns,
+               unsigned int flags)
 {
        struct files_ref_store *refs;
        struct ref_iterator *loose_iter, *packed_iter, *overlay_iter;
@@ -871,7 +878,7 @@ static struct ref_iterator *files_ref_iterator_begin(
         * the packed and loose references.
         */
        packed_iter = refs_ref_iterator_begin(
-                       refs->packed_ref_store, prefix, 0,
+                       refs->packed_ref_store, prefix, exclude_patterns, 0,
                        DO_FOR_EACH_INCLUDE_BROKEN);
 
        overlay_iter = overlay_ref_iterator_begin(loose_iter, packed_iter);
@@ -1172,17 +1179,15 @@ static void prune_refs(struct files_ref_store *refs, struct ref_to_prune **refs_
  */
 static int should_pack_ref(const char *refname,
                           const struct object_id *oid, unsigned int ref_flags,
-                          unsigned int pack_flags)
+                          struct pack_refs_opts *opts)
 {
+       struct string_list_item *item;
+
        /* Do not pack per-worktree refs: */
        if (parse_worktree_ref(refname, NULL, NULL, NULL) !=
            REF_WORKTREE_SHARED)
                return 0;
 
-       /* Do not pack non-tags unless PACK_REFS_ALL is set: */
-       if (!(pack_flags & PACK_REFS_ALL) && !starts_with(refname, "refs/tags/"))
-               return 0;
-
        /* Do not pack symbolic refs: */
        if (ref_flags & REF_ISSYMREF)
                return 0;
@@ -1191,10 +1196,18 @@ static int should_pack_ref(const char *refname,
        if (!ref_resolves_to_object(refname, the_repository, oid, ref_flags))
                return 0;
 
-       return 1;
+       if (ref_excluded(opts->exclusions, refname))
+               return 0;
+
+       for_each_string_list_item(item, opts->includes)
+               if (!wildmatch(item->string, refname, 0))
+                       return 1;
+
+       return 0;
 }
 
-static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
+static int files_pack_refs(struct ref_store *ref_store,
+                          struct pack_refs_opts *opts)
 {
        struct files_ref_store *refs =
                files_downcast(ref_store, REF_STORE_WRITE | REF_STORE_ODB,
@@ -1219,8 +1232,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
                 * in the packed ref cache. If the reference should be
                 * pruned, also add it to refs_to_prune.
                 */
-               if (!should_pack_ref(iter->refname, iter->oid, iter->flags,
-                                    flags))
+               if (!should_pack_ref(iter->refname, iter->oid, iter->flags, opts))
                        continue;
 
                /*
@@ -1234,7 +1246,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
                            iter->refname, err.buf);
 
                /* Schedule the loose reference for pruning if requested. */
-               if ((flags & PACK_REFS_PRUNE)) {
+               if ((opts->flags & PACK_REFS_PRUNE)) {
                        struct ref_to_prune *n;
                        FLEX_ALLOC_STR(n, name, iter->refname);
                        oidcpy(&n->oid, iter->oid);
index 1eba1015dd5aa8378bf722b50a2b466774b43f0d..59c78d7941f8d5e05fec6c895aafeb41803b919d 100644 (file)
@@ -1,7 +1,8 @@
-#include "../cache.h"
+#include "../git-compat-util.h"
 #include "../alloc.h"
 #include "../config.h"
 #include "../gettext.h"
+#include "../hash.h"
 #include "../hex.h"
 #include "../refs.h"
 #include "refs-internal.h"
@@ -9,7 +10,10 @@
 #include "../iterator.h"
 #include "../lockfile.h"
 #include "../chdir-notify.h"
+#include "../statinfo.h"
+#include "../wrapper.h"
 #include "../write-or-die.h"
+#include "../trace2.h"
 
 enum mmap_strategy {
        /*
@@ -301,7 +305,8 @@ static int cmp_packed_ref_records(const void *v1, const void *v2)
  * Compare a snapshot record at `rec` to the specified NUL-terminated
  * refname.
  */
-static int cmp_record_to_refname(const char *rec, const char *refname)
+static int cmp_record_to_refname(const char *rec, const char *refname,
+                                int start)
 {
        const char *r1 = rec + the_hash_algo->hexsz + 1;
        const char *r2 = refname;
@@ -310,7 +315,7 @@ static int cmp_record_to_refname(const char *rec, const char *refname)
                if (*r1 == '\n')
                        return *r2 ? -1 : 0;
                if (!*r2)
-                       return 1;
+                       return start ? 1 : -1;
                if (*r1 != *r2)
                        return (unsigned char)*r1 < (unsigned char)*r2 ? -1 : +1;
                r1++;
@@ -525,22 +530,9 @@ static int load_contents(struct snapshot *snapshot)
        return 1;
 }
 
-/*
- * Find the place in `snapshot->buf` where the start of the record for
- * `refname` starts. If `mustexist` is true and the reference doesn't
- * exist, then return NULL. If `mustexist` is false and the reference
- * doesn't exist, then return the point where that reference would be
- * inserted, or `snapshot->eof` (which might be NULL) if it would be
- * inserted at the end of the file. In the latter mode, `refname`
- * doesn't have to be a proper reference name; for example, one could
- * search for "refs/replace/" to find the start of any replace
- * references.
- *
- * The record is sought using a binary search, so `snapshot->buf` must
- * be sorted.
- */
-static const char *find_reference_location(struct snapshot *snapshot,
-                                          const char *refname, int mustexist)
+static const char *find_reference_location_1(struct snapshot *snapshot,
+                                            const char *refname, int mustexist,
+                                            int start)
 {
        /*
         * This is not *quite* a garden-variety binary search, because
@@ -570,7 +562,7 @@ static const char *find_reference_location(struct snapshot *snapshot,
 
                mid = lo + (hi - lo) / 2;
                rec = find_start_of_record(lo, mid);
-               cmp = cmp_record_to_refname(rec, refname);
+               cmp = cmp_record_to_refname(rec, refname, start);
                if (cmp < 0) {
                        lo = find_end_of_record(mid, hi);
                } else if (cmp > 0) {
@@ -586,6 +578,41 @@ static const char *find_reference_location(struct snapshot *snapshot,
                return lo;
 }
 
+/*
+ * Find the place in `snapshot->buf` where the start of the record for
+ * `refname` starts. If `mustexist` is true and the reference doesn't
+ * exist, then return NULL. If `mustexist` is false and the reference
+ * doesn't exist, then return the point where that reference would be
+ * inserted, or `snapshot->eof` (which might be NULL) if it would be
+ * inserted at the end of the file. In the latter mode, `refname`
+ * doesn't have to be a proper reference name; for example, one could
+ * search for "refs/replace/" to find the start of any replace
+ * references.
+ *
+ * The record is sought using a binary search, so `snapshot->buf` must
+ * be sorted.
+ */
+static const char *find_reference_location(struct snapshot *snapshot,
+                                          const char *refname, int mustexist)
+{
+       return find_reference_location_1(snapshot, refname, mustexist, 1);
+}
+
+/*
+ * Find the place in `snapshot->buf` after the end of the record for
+ * `refname`. In other words, find the location of first thing *after*
+ * `refname`.
+ *
+ * Other semantics are identical to the ones in
+ * `find_reference_location()`.
+ */
+static const char *find_reference_location_end(struct snapshot *snapshot,
+                                              const char *refname,
+                                              int mustexist)
+{
+       return find_reference_location_1(snapshot, refname, mustexist, 0);
+}
+
 /*
  * Create a newly-allocated `snapshot` of the `packed-refs` file in
  * its current state and return it. The return value will already have
@@ -650,7 +677,7 @@ static struct snapshot *create_snapshot(struct packed_ref_store *refs)
                                         snapshot->buf,
                                         snapshot->eof - snapshot->buf);
 
-               string_list_split_in_place(&traits, p, ' ', -1);
+               string_list_split_in_place(&traits, p, " ", -1);
 
                if (unsorted_string_list_has_string(&traits, "fully-peeled"))
                        snapshot->peeled = PEELED_FULLY;
@@ -777,6 +804,13 @@ struct packed_ref_iterator {
        /* The end of the part of the buffer that will be iterated over: */
        const char *eof;
 
+       struct jump_list_entry {
+               const char *start;
+               const char *end;
+       } *jump;
+       size_t jump_nr, jump_alloc;
+       size_t jump_cur;
+
        /* Scratch space for current values: */
        struct object_id oid, peeled;
        struct strbuf refname_buf;
@@ -794,14 +828,36 @@ struct packed_ref_iterator {
  */
 static int next_record(struct packed_ref_iterator *iter)
 {
-       const char *p = iter->pos, *eol;
+       const char *p, *eol;
 
        strbuf_reset(&iter->refname_buf);
 
+       /*
+        * If iter->pos is contained within a skipped region, jump past
+        * it.
+        *
+        * Note that each skipped region is considered at most once,
+        * since they are ordered based on their starting position.
+        */
+       while (iter->jump_cur < iter->jump_nr) {
+               struct jump_list_entry *curr = &iter->jump[iter->jump_cur];
+               if (iter->pos < curr->start)
+                       break; /* not to the next jump yet */
+
+               iter->jump_cur++;
+               if (iter->pos < curr->end) {
+                       iter->pos = curr->end;
+                       trace2_counter_add(TRACE2_COUNTER_ID_PACKED_REFS_JUMPS, 1);
+                       /* jumps are coalesced, so only one jump is necessary */
+                       break;
+               }
+       }
+
        if (iter->pos == iter->eof)
                return ITER_DONE;
 
        iter->base.flags = REF_ISPACKED;
+       p = iter->pos;
 
        if (iter->eof - p < the_hash_algo->hexsz + 2 ||
            parse_oid_hex(p, &iter->oid, &p) ||
@@ -909,6 +965,7 @@ static int packed_ref_iterator_abort(struct ref_iterator *ref_iterator)
        int ok = ITER_DONE;
 
        strbuf_release(&iter->refname_buf);
+       free(iter->jump);
        release_snapshot(iter->snapshot);
        base_ref_iterator_free(ref_iterator);
        return ok;
@@ -920,9 +977,112 @@ static struct ref_iterator_vtable packed_ref_iterator_vtable = {
        .abort = packed_ref_iterator_abort
 };
 
+static int jump_list_entry_cmp(const void *va, const void *vb)
+{
+       const struct jump_list_entry *a = va;
+       const struct jump_list_entry *b = vb;
+
+       if (a->start < b->start)
+               return -1;
+       if (a->start > b->start)
+               return 1;
+       return 0;
+}
+
+static int has_glob_special(const char *str)
+{
+       const char *p;
+       for (p = str; *p; p++) {
+               if (is_glob_special(*p))
+                       return 1;
+       }
+       return 0;
+}
+
+static void populate_excluded_jump_list(struct packed_ref_iterator *iter,
+                                       struct snapshot *snapshot,
+                                       const char **excluded_patterns)
+{
+       size_t i, j;
+       const char **pattern;
+       struct jump_list_entry *last_disjoint;
+
+       if (!excluded_patterns)
+               return;
+
+       for (pattern = excluded_patterns; *pattern; pattern++) {
+               struct jump_list_entry *e;
+               const char *start, *end;
+
+               /*
+                * We can't feed any excludes with globs in them to the
+                * refs machinery.  It only understands prefix matching.
+                * We likewise can't even feed the string leading up to
+                * the first meta-character, as something like "foo[a]"
+                * should not exclude "foobar" (but the prefix "foo"
+                * would match that and mark it for exclusion).
+                */
+               if (has_glob_special(*pattern))
+                       continue;
+
+               start = find_reference_location(snapshot, *pattern, 0);
+               end = find_reference_location_end(snapshot, *pattern, 0);
+
+               if (start == end)
+                       continue; /* nothing to jump over */
+
+               ALLOC_GROW(iter->jump, iter->jump_nr + 1, iter->jump_alloc);
+
+               e = &iter->jump[iter->jump_nr++];
+               e->start = start;
+               e->end = end;
+       }
+
+       if (!iter->jump_nr) {
+               /*
+                * Every entry in exclude_patterns has a meta-character,
+                * nothing to do here.
+                */
+               return;
+       }
+
+       QSORT(iter->jump, iter->jump_nr, jump_list_entry_cmp);
+
+       /*
+        * As an optimization, merge adjacent entries in the jump list
+        * to jump forwards as far as possible when entering a skipped
+        * region.
+        *
+        * For example, if we have two skipped regions:
+        *
+        *      [[A, B], [B, C]]
+        *
+        * we want to combine that into a single entry jumping from A to
+        * C.
+        */
+       last_disjoint = iter->jump;
+
+       for (i = 1, j = 1; i < iter->jump_nr; i++) {
+               struct jump_list_entry *ours = &iter->jump[i];
+               if (ours->start <= last_disjoint->end) {
+                       /* overlapping regions extend the previous one */
+                       last_disjoint->end = last_disjoint->end > ours->end
+                               ? last_disjoint->end : ours->end;
+               } else {
+                       /* otherwise, insert a new region */
+                       iter->jump[j++] = *ours;
+                       last_disjoint = ours;
+               }
+       }
+
+       iter->jump_nr = j;
+       iter->jump_cur = 0;
+}
+
 static struct ref_iterator *packed_ref_iterator_begin(
                struct ref_store *ref_store,
-               const char *prefix, unsigned int flags)
+               const char *prefix, const char **exclude_patterns,
+               unsigned int flags)
 {
        struct packed_ref_store *refs;
        struct snapshot *snapshot;
@@ -954,6 +1114,9 @@ static struct ref_iterator *packed_ref_iterator_begin(
        ref_iterator = &iter->base;
        base_ref_iterator_init(ref_iterator, &packed_ref_iterator_vtable, 1);
 
+       if (exclude_patterns)
+               populate_excluded_jump_list(iter, snapshot, exclude_patterns);
+
        iter->snapshot = snapshot;
        acquire_snapshot(snapshot);
 
@@ -1147,7 +1310,7 @@ static int write_with_updates(struct packed_ref_store *refs,
         * list of refs is exhausted, set iter to NULL. When the list
         * of updates is exhausted, leave i set to updates->nr.
         */
-       iter = packed_ref_iterator_begin(&refs->base, "",
+       iter = packed_ref_iterator_begin(&refs->base, "", NULL,
                                         DO_FOR_EACH_INCLUDE_BROKEN);
        if ((ok = ref_iterator_advance(iter)) != ITER_OK)
                iter = NULL;
@@ -1575,7 +1738,7 @@ static int packed_delete_refs(struct ref_store *ref_store, const char *msg,
 }
 
 static int packed_pack_refs(struct ref_store *ref_store UNUSED,
-                           unsigned int flags UNUSED)
+                           struct pack_refs_opts *pack_opts UNUSED)
 {
        /*
         * Packed refs are already packed. It might be that loose refs
index dc1ca49c85f7cd4be86d88dda0ba31f3f965e6bb..2294c4564fba3e171334314a5623928c5f27c14a 100644 (file)
@@ -1,6 +1,8 @@
 #include "../git-compat-util.h"
 #include "../alloc.h"
+#include "../hash.h"
 #include "../refs.h"
+#include "../repository.h"
 #include "refs-internal.h"
 #include "ref-cache.h"
 #include "../iterator.h"
index 850d9d3744e94270fb5cd445b4f6b7b18aac8128..95c76e27c833112743b82a0b62f9a5423fb52259 100644 (file)
@@ -1,10 +1,11 @@
 #ifndef REFS_REF_CACHE_H
 #define REFS_REF_CACHE_H
 
-#include "cache.h"
+#include "hash-ll.h"
 
 struct ref_dir;
 struct ref_store;
+struct repository;
 
 /*
  * If this ref_cache is filled lazily, this function is used to load
index a85d113123c99b55e1e7047d334c7608843eb2d6..9db8aec4da8eef6fb9542a9db5d1cbae01c129e6 100644 (file)
@@ -367,8 +367,8 @@ int is_empty_ref_iterator(struct ref_iterator *ref_iterator);
  */
 struct ref_iterator *refs_ref_iterator_begin(
                struct ref_store *refs,
-               const char *prefix, int trim,
-               enum do_for_each_ref_flags flags);
+               const char *prefix, const char **exclude_patterns,
+               int trim, enum do_for_each_ref_flags flags);
 
 /*
  * A callback function used to instruct merge_ref_iterator how to
@@ -547,7 +547,8 @@ typedef int ref_transaction_commit_fn(struct ref_store *refs,
                                      struct ref_transaction *transaction,
                                      struct strbuf *err);
 
-typedef int pack_refs_fn(struct ref_store *ref_store, unsigned int flags);
+typedef int pack_refs_fn(struct ref_store *ref_store,
+                        struct pack_refs_opts *opts);
 typedef int create_symref_fn(struct ref_store *ref_store,
                             const char *ref_target,
                             const char *refs_heads_master,
@@ -570,7 +571,8 @@ typedef int copy_ref_fn(struct ref_store *ref_store,
  */
 typedef struct ref_iterator *ref_iterator_begin_fn(
                struct ref_store *ref_store,
-               const char *prefix, unsigned int flags);
+               const char *prefix, const char **exclude_patterns,
+               unsigned int flags);
 
 /* reflog functions */
 
index 7b5c305514d2c251fdcc750186855e5093e42635..d60932f4ded876476b7dec21456b9088260d0d1f 100644 (file)
--- a/refspec.c
+++ b/refspec.c
@@ -1,10 +1,11 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "strvec.h"
 #include "refs.h"
 #include "refspec.h"
+#include "strbuf.h"
 
 static struct refspec_item s_tag_refspec = {
        .force = 0,
index 155953d1b82d4751dc80b1d486661e54d2ba16ba..ce936b4e1887ca982c9d814a014b469cbb49e52e 100644 (file)
@@ -7,7 +7,7 @@ https://developers.google.com/open-source/licenses/bsd
 */
 
 #include "git-compat-util.h"
-#include "hash.h"
+#include "hash-ll.h"
 
 #include "reftable-blocksource.h"
 #include "reftable-error.h"
index 93941f214570ace6e82e3c0a8b3c83d8b945405f..0d1766735e8ff0f1c5c057d1882728aa4292d1ee 100644 (file)
@@ -6,6 +6,7 @@ license that can be found in the LICENSE file or at
 https://developers.google.com/open-source/licenses/bsd
 */
 
+#include "system.h"
 #include "reftable-error.h"
 
 #include <stdio.h>
index 0ad7d5c0ff225cf0904e5dc2ddfe09c0486710d8..bcb82530d6ce35e8a0a582d9718090067b238899 100644 (file)
@@ -6,10 +6,10 @@ license that can be found in the LICENSE file or at
 https://developers.google.com/open-source/licenses/bsd
 */
 
+#include "system.h"
 #include "reftable-malloc.h"
 
 #include "basics.h"
-#include "system.h"
 
 static void *(*reftable_malloc_ptr)(size_t sz);
 static void *(*reftable_realloc_ptr)(void *, size_t);
index 18f9207dfee16accdaac46a77d13b9960aad3ca2..6b74a8151436144225c2e579340dfc3426a26470 100644 (file)
@@ -13,7 +13,7 @@ https://developers.google.com/open-source/licenses/bsd
 
 #include "git-compat-util.h"
 #include "strbuf.h"
-#include "hash.h" /* hash ID, sizes.*/
+#include "hash-ll.h" /* hash ID, sizes.*/
 #include "dir.h" /* remove_dir_recursively, for tests.*/
 
 int hash_size(uint32_t id);
index b8899e060abdd6629d73510a8b126b0c00c90b8d..a5bf880985472dee7cd7c9169047752245599488 100644 (file)
@@ -6,10 +6,10 @@ license that can be found in the LICENSE file or at
 https://developers.google.com/open-source/licenses/bsd
 */
 
+#include "system.h"
 #include "tree.h"
 
 #include "basics.h"
-#include "system.h"
 
 struct tree_node *tree_search(void *key, struct tree_node **rootp,
                              int (*compare)(const void *, const void *),
index cbff12558868a2ad29337da146ed7c34d063634c..ac3a045ad4afbc893f4daff8da98c768cabaf8fd 100644 (file)
@@ -6,6 +6,7 @@ license that can be found in the LICENSE file or at
 https://developers.google.com/open-source/licenses/bsd
 */
 
+#include "system.h"
 #include "tree.h"
 
 #include "basics.h"
index db3bc431fc3e0af4802b5685364ea6a3ade38a6f..ef05752ca5738ea16d16d38c8ea9c65e2a9ea167 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -21,6 +20,7 @@
 #include "setup.h"
 #include "protocol.h"
 #include "quote.h"
+#include "trace2.h"
 #include "transport.h"
 #include "write-or-die.h"
 
@@ -762,7 +762,8 @@ static void check_pktline(struct check_pktline_state *state, const char *ptr, si
                        size -= digits_remaining;
 
                        if (state->len_filled == 4) {
-                               state->remaining = packet_length(state->len_buf);
+                               state->remaining = packet_length(state->len_buf,
+                                                                sizeof(state->len_buf));
                                if (state->remaining < 0) {
                                        die(_("remote-curl: bad line length character: %.4s"), state->len_buf);
                                } else if (state->remaining == 2) {
index 3a831cb5304937122125c26d9e700be16362af4b..abb24822beb2a17187d4afa9474dd1c537f078ba 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1,6 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -9,7 +8,9 @@
 #include "urlmatch.h"
 #include "refs.h"
 #include "refspec.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "commit.h"
 #include "diff.h"
 #include "revision.h"
@@ -348,7 +349,8 @@ static void read_branches_file(struct remote_state *remote_state,
        remote->fetch_tags = 1; /* always auto-follow */
 }
 
-static int handle_config(const char *key, const char *value, void *cb)
+static int handle_config(const char *key, const char *value,
+                        const struct config_context *ctx, void *cb)
 {
        const char *name;
        size_t namelen;
@@ -356,6 +358,7 @@ static int handle_config(const char *key, const char *value, void *cb)
        struct remote *remote;
        struct branch *branch;
        struct remote_state *remote_state = cb;
+       const struct key_value_info *kvi = ctx->kvi;
 
        if (parse_config_key(key, "branch", &name, &namelen, &subkey) >= 0) {
                /* There is no subsection. */
@@ -413,8 +416,8 @@ static int handle_config(const char *key, const char *value, void *cb)
        }
        remote = make_remote(remote_state, name, namelen);
        remote->origin = REMOTE_CONFIG;
-       if (current_config_scope() == CONFIG_SCOPE_LOCAL ||
-           current_config_scope() == CONFIG_SCOPE_WORKTREE)
+       if (kvi->scope == CONFIG_SCOPE_LOCAL ||
+           kvi->scope == CONFIG_SCOPE_WORKTREE)
                remote->configured_in_repo = 1;
        if (!strcmp(subkey, "mirror"))
                remote->mirror = git_config_bool(key, value);
@@ -889,7 +892,7 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite
 {
        int i, matched_negative = 0;
        int find_src = !query->src;
-       struct string_list reversed = STRING_LIST_INIT_NODUP;
+       struct string_list reversed = STRING_LIST_INIT_DUP;
        const char *needle = find_src ? query->dst : query->src;
 
        /*
@@ -2256,7 +2259,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
  * Return true when there is anything to report, otherwise false.
  */
 int format_tracking_info(struct branch *branch, struct strbuf *sb,
-                        enum ahead_behind_flags abf)
+                        enum ahead_behind_flags abf,
+                        int show_divergence_advice)
 {
        int ours, theirs, sti;
        const char *full_base;
@@ -2319,9 +2323,10 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb,
                               "respectively.\n",
                           ours + theirs),
                        base, ours, theirs);
-               if (advice_enabled(ADVICE_STATUS_HINTS))
+               if (show_divergence_advice &&
+                   advice_enabled(ADVICE_STATUS_HINTS))
                        strbuf_addstr(sb,
-                               _("  (use \"git pull\" to merge the remote branch into yours)\n"));
+                               _("  (use \"git pull\" if you want to integrate the remote branch with yours)\n"));
        }
        free(base);
        return 1;
index 73638cefeb102d6dd9a6777645156a2034594240..cdc8b1db42c4a836804009a036628aaa94d94b5a 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -1,6 +1,7 @@
 #ifndef REMOTE_H
 #define REMOTE_H
 
+#include "hash-ll.h"
 #include "hashmap.h"
 #include "refspec.h"
 
@@ -379,7 +380,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
                       const char **upstream_name, int for_push,
                       enum ahead_behind_flags abf);
 int format_tracking_info(struct branch *branch, struct strbuf *sb,
-                        enum ahead_behind_flags abf);
+                        enum ahead_behind_flags abf,
+                        int show_divergence_advice);
 
 struct ref *get_local_heads(void);
 /*
index e98825d5852d80f6799904e4b0280f438375b75a..523215589de9221b0823aab9edbb06389ca52825 100644 (file)
@@ -2,7 +2,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "oidmap.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "refs.h"
 #include "repository.h"
@@ -64,7 +64,7 @@ void prepare_replace_object(struct repository *r)
  * replacement object's name (replaced recursively, if necessary).
  * The return value is either oid or a pointer to a
  * permanently-allocated value.  This function always respects replace
- * references, regardless of the value of read_replace_refs.
+ * references, regardless of the value of r->settings.read_replace_refs.
  */
 const struct object_id *do_lookup_replace_object(struct repository *r,
                                                 const struct object_id *oid)
@@ -84,3 +84,29 @@ const struct object_id *do_lookup_replace_object(struct repository *r,
        }
        die(_("replace depth too high for object %s"), oid_to_hex(oid));
 }
+
+/*
+ * This indicator determines whether replace references should be
+ * respected process-wide, regardless of which repository is being
+ * using at the time.
+ */
+static int read_replace_refs = 1;
+
+void disable_replace_refs(void)
+{
+       read_replace_refs = 0;
+}
+
+int replace_refs_enabled(struct repository *r)
+{
+       if (!read_replace_refs)
+               return 0;
+
+       if (r->gitdir) {
+               prepare_repo_settings(r);
+               return r->settings.read_replace_refs;
+       }
+
+       /* repository has no objects or refs. */
+       return 0;
+}
index 500482b02b38ce30ee51a005d00ca00e76033f19..66c41b938b44f4ba0a94521c4344aca0ca19087e 100644 (file)
@@ -3,15 +3,7 @@
 
 #include "oidmap.h"
 #include "repository.h"
-#include "object-store.h"
-
-/*
- * Do replace refs need to be checked this run?  This variable is
- * initialized to true unless --no-replace-object is used or
- * $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
- * commands that do not want replace references to be active.
- */
-extern int read_replace_refs;
+#include "object-store-ll.h"
 
 struct replace_object {
        struct oidmap_entry original;
@@ -27,6 +19,18 @@ void prepare_replace_object(struct repository *r);
 const struct object_id *do_lookup_replace_object(struct repository *r,
                                                 const struct object_id *oid);
 
+/*
+ * Some commands disable replace-refs unconditionally, and otherwise each
+ * repository could alter the core.useReplaceRefs config value.
+ *
+ * Return 1 if and only if all of the following are true:
+ *
+ *  a. disable_replace_refs() has not been called.
+ *  b. GIT_NO_REPLACE_OBJECTS is unset or zero.
+ *  c. the given repository does not have core.useReplaceRefs=false.
+ */
+int replace_refs_enabled(struct repository *r);
+
 /*
  * If object sha1 should be replaced, return the replacement object's
  * name (replaced recursively, if necessary).  The return value is
@@ -41,11 +45,19 @@ const struct object_id *do_lookup_replace_object(struct repository *r,
 static inline const struct object_id *lookup_replace_object(struct repository *r,
                                                            const struct object_id *oid)
 {
-       if (!read_replace_refs ||
+       if (!replace_refs_enabled(r) ||
            (r->objects->replace_map_initialized &&
             r->objects->replace_map->map.tablesize == 0))
                return oid;
        return do_lookup_replace_object(r, oid);
 }
 
+/*
+ * Some commands override config and environment settings for using
+ * replace references. Use this method to disable the setting and ensure
+ * those other settings will not override this choice. This applies
+ * globally to all in-process repositories.
+ */
+void disable_replace_refs(void);
+
 #endif /* REPLACE_OBJECT_H */
index 0a6c0b381fe13b50fb14b5b6e31ca06c0d44f695..525f69c0c7785845cdf8991e56c8d231c2e6d239 100644 (file)
@@ -43,7 +43,7 @@ void prepare_repo_settings(struct repository *r)
        /* Defaults modified by feature.* */
        if (experimental) {
                r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
-               r->settings.gc_cruft_packs = 1;
+               r->settings.pack_use_bitmap_boundary_traversal = 1;
        }
        if (manyfiles) {
                r->settings.index_version = 4;
@@ -63,6 +63,11 @@ void prepare_repo_settings(struct repository *r)
        repo_cfg_bool(r, "core.multipackindex", &r->settings.core_multi_pack_index, 1);
        repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 0);
        repo_cfg_bool(r, "index.skiphash", &r->settings.index_skip_hash, r->settings.index_skip_hash);
+       repo_cfg_bool(r, "pack.readreverseindex", &r->settings.pack_read_reverse_index, 1);
+       repo_cfg_bool(r, "pack.usebitmapboundarytraversal",
+                     &r->settings.pack_use_bitmap_boundary_traversal,
+                     r->settings.pack_use_bitmap_boundary_traversal);
+       repo_cfg_bool(r, "core.usereplacerefs", &r->settings.read_replace_refs, 1);
 
        /*
         * The GIT_TEST_MULTI_PACK_INDEX variable is special in that
index f6d9f5db08e0ded1390f1ba0d081585cab6b52a3..a7679ceeaa45ce7a20094f9a29a82987290ad354 100644 (file)
@@ -3,17 +3,20 @@
  * declaration matches the definition in this file.
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "config.h"
 #include "object.h"
 #include "lockfile.h"
+#include "path.h"
+#include "read-cache-ll.h"
 #include "remote.h"
 #include "setup.h"
 #include "submodule-config.h"
 #include "sparse-index.h"
+#include "trace2.h"
 #include "promisor-remote.h"
 
 /* The main repository */
@@ -181,6 +184,7 @@ int repo_init(struct repository *repo,
                goto error;
 
        repo_set_hash_algo(repo, format.hash_algo);
+       repo->repository_format_worktree_config = format.worktree_config;
 
        /* take ownership of format.partial_clone */
        repo->repository_format_partial_clone = format.partial_clone;
index 15a8afc5fb5b31b12bc3495663f9f3ca2f399c7e..5f18486f6465c44b44abb2ded74bcdda14ba7bd9 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef REPOSITORY_H
 #define REPOSITORY_H
 
-#include "path.h"
-
 struct config_set;
 struct fsmonitor_settings;
 struct git_hash_algo;
@@ -33,10 +31,20 @@ struct repo_settings {
        int commit_graph_generation_version;
        int commit_graph_read_changed_paths;
        int gc_write_commit_graph;
-       int gc_cruft_packs;
        int fetch_write_commit_graph;
        int command_requires_full_index;
        int sparse_index;
+       int pack_read_reverse_index;
+       int pack_use_bitmap_boundary_traversal;
+
+       /*
+        * Does this repository have core.useReplaceRefs=true (on by
+        * default)? This provides a repository-scoped version of this
+        * config, though it could be disabled process-wide via some Git
+        * builtins or the --no-replace-objects option. See
+        * replace_refs_enabled() for more details.
+        */
+       int read_replace_refs;
 
        struct fsmonitor_settings *fsmonitor; /* lazily loaded */
 
@@ -163,12 +171,16 @@ struct repository {
        struct promisor_remote_config *promisor_remote_config;
 
        /* Configurations */
+       int repository_format_worktree_config;
 
        /* Indicate if a repository has a different 'commondir' from 'gitdir' */
        unsigned different_commondir:1;
 };
 
 extern struct repository *the_repository;
+#ifdef USE_THE_INDEX_VARIABLE
+extern struct index_state the_index;
+#endif
 
 /*
  * Define a custom repository layout. Any field can be NULL, which
@@ -220,9 +232,6 @@ int repo_hold_locked_index(struct repository *repo,
                           struct lock_file *lf,
                           int flags);
 
-int repo_read_index_preload(struct repository *,
-                           const struct pathspec *pathspec,
-                           unsigned refresh_flags);
 int repo_read_index_unmerged(struct repository *);
 /*
  * Opportunistically update the index but do not complain if we can't.
index 5516e336d010cac54d3dca4fba026a025825acdc..725c1b6a95cdedd89152a0f80b8fe2477751458e 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -1,22 +1,24 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
+#include "copy.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "string-list.h"
+#include "read-cache-ll.h"
 #include "rerere.h"
 #include "xdiff-interface.h"
 #include "dir.h"
 #include "resolve-undo.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "attr.h"
+#include "path.h"
 #include "pathspec.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "hash-lookup.h"
 #include "strmap.h"
-#include "wrapper.h"
 
 #define RESOLVED 0
 #define PUNTED 1
@@ -202,7 +204,7 @@ static void read_rr(struct repository *r, struct string_list *rr)
                const unsigned hexsz = the_hash_algo->hexsz;
 
                /* There has to be the hash, tab, path and then NUL */
-               if (buf.len < hexsz + 2 || get_sha1_hex(buf.buf, hash))
+               if (buf.len < hexsz + 2 || get_hash_hex(buf.buf, hash))
                        die(_("corrupt MERGE_RR"));
 
                if (buf.buf[hexsz] != '.') {
diff --git a/reset.c b/reset.c
index ab300923e04f6066cea56680cafa42306af954bd..48da0adf851e1b09edfc22ffbbc0b1128cbbc5ab 100644 (file)
--- a/reset.c
+++ b/reset.c
@@ -3,6 +3,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
+#include "object-name.h"
 #include "refs.h"
 #include "reset.h"
 #include "run-command.h"
diff --git a/reset.h b/reset.h
index a28f81829d859dc3dfd3817d6449ab7eb195b0d3..10708d8ddc0040f86b5b1f400bfb14d932dffe8e 100644 (file)
--- a/reset.h
+++ b/reset.h
@@ -1,7 +1,7 @@
 #ifndef RESET_H
 #define RESET_H
 
-#include "hash.h"
+#include "hash-ll.h"
 #include "repository.h"
 
 #define GIT_REFLOG_ACTION_ENVIRONMENT "GIT_REFLOG_ACTION"
index e81096e2d459bd9391a5a8572fef2aae23d717ab..7817f5d6db178519c23b4eea66785820cb4315ca 100644 (file)
@@ -1,6 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "dir.h"
+#include "hash.h"
+#include "read-cache.h"
 #include "resolve-undo.h"
+#include "sparse-index.h"
 #include "string-list.h"
 
 /* The only error case is to run out of memory in string-list */
index 2b3f0f901e63aeab70dfca86d3067d169dc315e2..c5deafc92fe7751532162ec308cf2bd62d97cf1b 100644 (file)
@@ -1,7 +1,12 @@
 #ifndef RESOLVE_UNDO_H
 #define RESOLVE_UNDO_H
 
-#include "cache.h"
+struct cache_entry;
+struct index_state;
+struct pathspec;
+struct string_list;
+
+#include "hash-ll.h"
 
 struct resolve_undo_info {
        unsigned int mode[3];
index 106ca1ce6c98f59e29af6c63731c75e9121d6b0a..2f4c53ea207b22a68097708b327884ae970c1978 100644 (file)
@@ -1,10 +1,11 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "tag.h"
 #include "blob.h"
 #include "tree.h"
 #include "bisect.h"
 #include "packfile.h"
 #include "worktree.h"
+#include "read-cache.h"
 #include "setup.h"
+#include "sparse-index.h"
 #include "strvec.h"
+#include "trace2.h"
 #include "commit-reach.h"
 #include "commit-graph.h"
 #include "prio-queue.h"
@@ -41,6 +45,7 @@
 #include "list-objects-filter-options.h"
 #include "resolve-undo.h"
 #include "parse-options.h"
+#include "wildmatch.h"
 
 volatile show_early_output_fn_t show_early_output;
 
@@ -1555,7 +1560,7 @@ void init_ref_exclusions(struct ref_exclusions *exclusions)
 void clear_ref_exclusions(struct ref_exclusions *exclusions)
 {
        string_list_clear(&exclusions->excluded_refs, 0);
-       string_list_clear(&exclusions->hidden_refs, 0);
+       strvec_clear(&exclusions->hidden_refs);
        exclusions->hidden_refs_configured = 0;
 }
 
@@ -1569,7 +1574,9 @@ struct exclude_hidden_refs_cb {
        const char *section;
 };
 
-static int hide_refs_config(const char *var, const char *value, void *cb_data)
+static int hide_refs_config(const char *var, const char *value,
+                           const struct config_context *ctx UNUSED,
+                           void *cb_data)
 {
        struct exclude_hidden_refs_cb *cb = cb_data;
        cb->exclusions->hidden_refs_configured = 1;
@@ -2192,39 +2199,6 @@ static void read_pathspec_from_stdin(struct strbuf *sb,
                strvec_push(prune, sb->buf);
 }
 
-static void read_revisions_from_stdin(struct rev_info *revs,
-                                     struct strvec *prune)
-{
-       struct strbuf sb;
-       int seen_dashdash = 0;
-       int save_warning;
-
-       save_warning = warn_on_object_refname_ambiguity;
-       warn_on_object_refname_ambiguity = 0;
-
-       strbuf_init(&sb, 1000);
-       while (strbuf_getline(&sb, stdin) != EOF) {
-               int len = sb.len;
-               if (!len)
-                       break;
-               if (sb.buf[0] == '-') {
-                       if (len == 2 && sb.buf[1] == '-') {
-                               seen_dashdash = 1;
-                               break;
-                       }
-                       die("options not supported in --stdin mode");
-               }
-               if (handle_revision_arg(sb.buf, revs, 0,
-                                       REVARG_CANNOT_BE_FILENAME))
-                       die("bad revision '%s'", sb.buf);
-       }
-       if (seen_dashdash)
-               read_pathspec_from_stdin(&sb, prune);
-
-       strbuf_release(&sb);
-       warn_on_object_refname_ambiguity = save_warning;
-}
-
 static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
 {
        append_grep_pattern(&revs->grep_filter, ptn, "command line", 0, what);
@@ -2667,7 +2641,7 @@ static int for_each_bisect_ref(struct ref_store *refs, each_ref_fn fn,
        struct strbuf bisect_refs = STRBUF_INIT;
        int status;
        strbuf_addf(&bisect_refs, "refs/bisect/%s", term);
-       status = refs_for_each_fullref_in(refs, bisect_refs.buf, fn, cb_data);
+       status = refs_for_each_fullref_in(refs, bisect_refs.buf, NULL, fn, cb_data);
        strbuf_release(&bisect_refs);
        return status;
 }
@@ -2813,6 +2787,53 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
        return 1;
 }
 
+static void read_revisions_from_stdin(struct rev_info *revs,
+                                     struct strvec *prune,
+                                     int *flags)
+{
+       struct strbuf sb;
+       int seen_dashdash = 0;
+       int seen_end_of_options = 0;
+       int save_warning;
+
+       save_warning = warn_on_object_refname_ambiguity;
+       warn_on_object_refname_ambiguity = 0;
+
+       strbuf_init(&sb, 1000);
+       while (strbuf_getline(&sb, stdin) != EOF) {
+               if (!sb.len)
+                       break;
+
+               if (!strcmp(sb.buf, "--")) {
+                       seen_dashdash = 1;
+                       break;
+               }
+
+               if (!seen_end_of_options && sb.buf[0] == '-') {
+                       const char *argv[] = { sb.buf, NULL };
+
+                       if (!strcmp(sb.buf, "--end-of-options")) {
+                               seen_end_of_options = 1;
+                               continue;
+                       }
+
+                       if (handle_revision_pseudo_opt(revs, argv, flags) > 0)
+                               continue;
+
+                       die(_("invalid option '%s' in --stdin mode"), sb.buf);
+               }
+
+               if (handle_revision_arg(sb.buf, revs, 0,
+                                       REVARG_CANNOT_BE_FILENAME))
+                       die("bad revision '%s'", sb.buf);
+       }
+       if (seen_dashdash)
+               read_pathspec_from_stdin(&sb, prune);
+
+       strbuf_release(&sb);
+       warn_on_object_refname_ambiguity = save_warning;
+}
+
 static void NORETURN diagnose_missing_default(const char *def)
 {
        int flags;
@@ -2885,7 +2906,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
                                }
                                if (revs->read_from_stdin++)
                                        die("--stdin given twice?");
-                               read_revisions_from_stdin(revs, &prune_data);
+                               read_revisions_from_stdin(revs, &prune_data, &flags);
                                continue;
                        }
 
@@ -2949,7 +2970,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
        if (!revs->def)
                revs->def = opt ? opt->def : NULL;
        if (opt && opt->tweak)
-               opt->tweak(revs, opt);
+               opt->tweak(revs);
        if (revs->show_merge)
                prepare_show_merge(revs);
        if (revs->def && !revs->pending.nr && !revs->rev_input_given) {
index e8f6de968490340cd2dcd9927d1961e6c9519855..82ab400139de30fd6af5e00f2047c51a62a8ed7d 100644 (file)
@@ -7,8 +7,10 @@
 #include "pretty.h"
 #include "diff.h"
 #include "commit-slab-decl.h"
+#include "decorate.h"
 #include "ident.h"
 #include "list-objects-filter-options.h"
+#include "strvec.h"
 
 /**
  * The revision walking API offers functions to build a list of revisions
@@ -86,7 +88,7 @@ struct rev_cmdline_info {
 struct ref_exclusions {
        /*
         * Excluded refs is a list of wildmatch patterns. If any of the
-        * patterns matches, the reference will be excluded.
+        * patterns match, the reference will be excluded.
         */
        struct string_list excluded_refs;
 
@@ -94,7 +96,7 @@ struct ref_exclusions {
         * Hidden refs is a list of patterns that is to be hidden via
         * `ref_is_hidden()`.
         */
-       struct string_list hidden_refs;
+       struct strvec hidden_refs;
 
        /*
         * Indicates whether hidden refs have been configured. This is to
@@ -109,7 +111,7 @@ struct ref_exclusions {
  */
 #define REF_EXCLUSIONS_INIT { \
        .excluded_refs = STRING_LIST_INIT_DUP, \
-       .hidden_refs = STRING_LIST_INIT_DUP, \
+       .hidden_refs = STRVEC_INIT, \
 }
 
 struct oidset;
@@ -427,7 +429,7 @@ void repo_init_revisions(struct repository *r,
  */
 struct setup_revision_opt {
        const char *def;
-       void (*tweak)(struct rev_info *, struct setup_revision_opt *);
+       void (*tweak)(struct rev_info *);
        unsigned int    assume_dashdash:1,
                        allow_exclude_promisor_objects:1,
                        free_removed_argv_elements:1;
index 614d48fa9a231e4192485d2b1bc75fae91542845..a558042c876ad2baefcfcc111163bab9691f7f1c 100644 (file)
@@ -1,18 +1,22 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "run-command.h"
 #include "environment.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "sigchain.h"
 #include "strvec.h"
+#include "symlinks.h"
 #include "thread-utils.h"
 #include "strbuf.h"
 #include "string-list.h"
+#include "trace.h"
+#include "trace2.h"
 #include "quote.h"
 #include "config.h"
 #include "packfile.h"
 #include "hook.h"
 #include "compat/nonblock.h"
+#include "alloc.h"
 
 void child_process_init(struct child_process *child)
 {
@@ -166,6 +170,7 @@ int is_executable(const char *name)
        return st.st_mode & S_IXUSR;
 }
 
+#ifndef locate_in_PATH
 /*
  * Search $PATH for a command.  This emulates the path search that
  * execvp would perform, without actually executing the command so it
@@ -214,6 +219,7 @@ static char *locate_in_PATH(const char *file)
        strbuf_release(&buf);
        return NULL;
 }
+#endif
 
 int exists_in_PATH(const char *command)
 {
@@ -303,7 +309,6 @@ enum child_errcode {
        CHILD_ERR_DUP2,
        CHILD_ERR_CLOSE,
        CHILD_ERR_SIGPROCMASK,
-       CHILD_ERR_ENOENT,
        CHILD_ERR_SILENT,
        CHILD_ERR_ERRNO
 };
@@ -386,9 +391,6 @@ static void child_err_spew(struct child_process *cmd, struct child_err *cerr)
        case CHILD_ERR_SIGPROCMASK:
                error_errno("sigprocmask failed restoring signals");
                break;
-       case CHILD_ERR_ENOENT:
-               error_errno("cannot run %s", cmd->args.v[0]);
-               break;
        case CHILD_ERR_SILENT:
                break;
        case CHILD_ERR_ERRNO:
@@ -842,13 +844,9 @@ fail_pipe:
                        execve(argv.v[0], (char *const *) argv.v,
                               (char *const *) childenv);
 
-               if (errno == ENOENT) {
-                       if (cmd->silent_exec_failure)
-                               child_die(CHILD_ERR_SILENT);
-                       child_die(CHILD_ERR_ENOENT);
-               } else {
-                       child_die(CHILD_ERR_ERRNO);
-               }
+               if (cmd->silent_exec_failure && errno == ENOENT)
+                       child_die(CHILD_ERR_SILENT);
+               child_die(CHILD_ERR_ERRNO);
        }
        atfork_parent(&as);
        if (cmd->pid < 0)
index 072db56a4dff15996889bded735dd02f2bc52e73..1f22cc3827d7d0c53119d085c3ef53a6ab3c36fd 100644 (file)
@@ -503,7 +503,7 @@ void run_processes_parallel(const struct run_process_parallel_opts *opts);
  * exception of GIT_CONFIG_PARAMETERS and GIT_CONFIG_COUNT (which cause the
  * corresponding environment variables to be unset in the subprocess) and adds
  * an environment variable pointing to new_git_dir. See local_repo_env in
- * cache.h for more information.
+ * environment.h for more information.
  */
 void prepare_other_repo_env(struct strvec *env, const char *new_git_dir);
 
@@ -564,4 +564,6 @@ enum start_bg_result start_bg_command(struct child_process *cmd,
                                      void *cb_data,
                                      unsigned int timeout_sec);
 
+int sane_execvp(const char *file, char *const argv[]);
+
 #endif
diff --git a/sane-ctype.h b/sane-ctype.h
new file mode 100644 (file)
index 0000000..cbea1b2
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef SANE_CTYPE_H
+#define SANE_CTYPE_H
+
+/* Sane ctype - no locale, and works with signed chars */
+#undef isascii
+#undef isspace
+#undef isdigit
+#undef isalpha
+#undef isalnum
+#undef isprint
+#undef islower
+#undef isupper
+#undef tolower
+#undef toupper
+#undef iscntrl
+#undef ispunct
+#undef isxdigit
+
+extern const unsigned char sane_ctype[256];
+extern const signed char hexval_table[256];
+#define GIT_SPACE 0x01
+#define GIT_DIGIT 0x02
+#define GIT_ALPHA 0x04
+#define GIT_GLOB_SPECIAL 0x08
+#define GIT_REGEX_SPECIAL 0x10
+#define GIT_PATHSPEC_MAGIC 0x20
+#define GIT_CNTRL 0x40
+#define GIT_PUNCT 0x80
+#define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)
+#define isascii(x) (((x) & ~0x7f) == 0)
+#define isspace(x) sane_istest(x,GIT_SPACE)
+#define isdigit(x) sane_istest(x,GIT_DIGIT)
+#define isalpha(x) sane_istest(x,GIT_ALPHA)
+#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
+#define isprint(x) ((x) >= 0x20 && (x) <= 0x7e)
+#define islower(x) sane_iscase(x, 1)
+#define isupper(x) sane_iscase(x, 0)
+#define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL)
+#define is_regex_special(x) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL)
+#define iscntrl(x) (sane_istest(x,GIT_CNTRL))
+#define ispunct(x) sane_istest(x, GIT_PUNCT | GIT_REGEX_SPECIAL | \
+               GIT_GLOB_SPECIAL | GIT_PATHSPEC_MAGIC)
+#define isxdigit(x) (hexval_table[(unsigned char)(x)] != -1)
+#define tolower(x) sane_case((unsigned char)(x), 0x20)
+#define toupper(x) sane_case((unsigned char)(x), 0)
+#define is_pathspec_magic(x) sane_istest(x,GIT_PATHSPEC_MAGIC)
+
+static inline int sane_case(int x, int high)
+{
+       if (sane_istest(x, GIT_ALPHA))
+               x = (x & ~0x20) | high;
+       return x;
+}
+
+static inline int sane_iscase(int x, int is_lower)
+{
+       if (!sane_istest(x, GIT_ALPHA))
+               return 0;
+
+       if (is_lower)
+               return (x & 0x20) != 0;
+       else
+               return (x & 0x20) == 0;
+}
+
+#endif
index de07c37d21001d54d026fb6f5f1de0ebccaf7e9c..df7358f481cc2d6fd307a27f0bfc5bd070daefd5 100644 (file)
--- a/scalar.c
+++ b/scalar.c
@@ -2,7 +2,7 @@
  * The Scalar command-line interface.
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "gettext.h"
 #include "parse-options.h"
@@ -16,6 +16,7 @@
 #include "packfile.h"
 #include "help.h"
 #include "setup.h"
+#include "trace2.h"
 
 static void setup_enlistment_directory(int argc, const char **argv,
                                       const char * const *usagestr,
@@ -593,7 +594,9 @@ static int cmd_register(int argc, const char **argv)
        return register_dir();
 }
 
-static int get_scalar_repos(const char *key, const char *value, void *data)
+static int get_scalar_repos(const char *key, const char *value,
+                           const struct config_context *ctx UNUSED,
+                           void *data)
 {
        struct string_list *list = data;
 
index f81bbb28d79259f25db58548ca3d51fb8b2f6a2d..89aca9d829ed046f532b87120f39d807c86ebcb9 100644 (file)
@@ -1,10 +1,11 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "commit.h"
+#include "date.h"
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pkt-line.h"
 #include "sideband.h"
 #include "run-command.h"
@@ -538,7 +539,7 @@ int send_pack(struct send_pack_args *args,
                die(_("the receiving end does not support this repository's hash algorithm"));
 
        if (args->push_cert != SEND_PACK_PUSH_CERT_NEVER) {
-               int len;
+               size_t len;
                push_cert_nonce = server_feature_value("push-cert", &len);
                if (push_cert_nonce) {
                        reject_invalid_nonce(push_cert_nonce, len);
index d2c7698c48ceb92f1bd1ceb03496033cc78f35a0..5e0c15a16b73b3bf04fc76afc2bc2bd1c15f677d 100644 (file)
@@ -1,14 +1,18 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
+#include "advice.h"
 #include "config.h"
+#include "copy.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "dir.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "object.h"
+#include "pager.h"
 #include "commit.h"
 #include "sequencer.h"
 #include "tag.h"
 #include "utf8.h"
 #include "cache-tree.h"
 #include "diff.h"
+#include "path.h"
 #include "revision.h"
 #include "rerere.h"
+#include "merge.h"
 #include "merge-ort.h"
 #include "merge-ort-wrappers.h"
 #include "refs.h"
+#include "sparse-index.h"
 #include "strvec.h"
 #include "quote.h"
 #include "trailer.h"
@@ -41,7 +48,6 @@
 #include "rebase-interactive.h"
 #include "reset.h"
 #include "branch.h"
-#include "wrapper.h"
 
 #define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
 
@@ -214,7 +220,8 @@ static struct update_ref_record *init_update_ref_record(const char *ref)
        return rec;
 }
 
-static int git_sequencer_config(const char *k, const char *v, void *cb)
+static int git_sequencer_config(const char *k, const char *v,
+                               const struct config_context *ctx, void *cb)
 {
        struct replay_opts *opts = cb;
        int status;
@@ -269,7 +276,7 @@ static int git_sequencer_config(const char *k, const char *v, void *cb)
        if (opts->action == REPLAY_REVERT && !strcmp(k, "revert.reference"))
                opts->commit_use_reference = git_config_bool(k, v);
 
-       return git_diff_basic_config(k, v, NULL);
+       return git_diff_basic_config(k, v, ctx, NULL);
 }
 
 void sequencer_init_config(struct replay_opts *opts)
@@ -655,11 +662,12 @@ void append_conflicts_hint(struct index_state *istate,
        }
 
        strbuf_addch(msgbuf, '\n');
-       strbuf_commented_addf(msgbuf, "Conflicts:\n");
+       strbuf_commented_addf(msgbuf, comment_line_char, "Conflicts:\n");
        for (i = 0; i < istate->cache_nr;) {
                const struct cache_entry *ce = istate->cache[i++];
                if (ce_stage(ce)) {
-                       strbuf_commented_addf(msgbuf, "\t%s\n", ce->name);
+                       strbuf_commented_addf(msgbuf, comment_line_char,
+                                             "\t%s\n", ce->name);
                        while (i < istate->cache_nr &&
                               !strcmp(ce->name, istate->cache[i]->name))
                                i++;
@@ -1138,7 +1146,8 @@ void cleanup_message(struct strbuf *msgbuf,
            cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS)
                strbuf_setlen(msgbuf, wt_status_locate_end(msgbuf->buf, msgbuf->len));
        if (cleanup_mode != COMMIT_MSG_CLEANUP_NONE)
-               strbuf_stripspace(msgbuf, cleanup_mode == COMMIT_MSG_CLEANUP_ALL);
+               strbuf_stripspace(msgbuf,
+                 cleanup_mode == COMMIT_MSG_CLEANUP_ALL ? comment_line_char : '\0');
 }
 
 /*
@@ -1169,7 +1178,8 @@ int template_untouched(const struct strbuf *sb, const char *template_file,
        if (!template_file || strbuf_read_file(&tmpl, template_file, 0) <= 0)
                return 0;
 
-       strbuf_stripspace(&tmpl, cleanup_mode == COMMIT_MSG_CLEANUP_ALL);
+       strbuf_stripspace(&tmpl,
+         cleanup_mode == COMMIT_MSG_CLEANUP_ALL ? comment_line_char : '\0');
        if (!skip_prefix(sb->buf, tmpl.buf, &start))
                start = sb->buf;
        strbuf_release(&tmpl);
@@ -1541,7 +1551,8 @@ static int try_to_commit(struct repository *r,
                cleanup = opts->default_msg_cleanup;
 
        if (cleanup != COMMIT_MSG_CLEANUP_NONE)
-               strbuf_stripspace(msg, cleanup == COMMIT_MSG_CLEANUP_ALL);
+               strbuf_stripspace(msg,
+                 cleanup == COMMIT_MSG_CLEANUP_ALL ? comment_line_char : '\0');
        if ((flags & EDIT_MSG) && message_is_empty(msg, cleanup)) {
                res = 1; /* run 'git commit' to display error message */
                goto out;
@@ -1835,7 +1846,7 @@ static void add_commented_lines(struct strbuf *buf, const void *str, size_t len)
                s += count;
                len -= count;
        }
-       strbuf_add_commented_lines(buf, s, len);
+       strbuf_add_commented_lines(buf, s, len, comment_line_char);
 }
 
 /* Does the current fixup chain contain a squash command? */
@@ -1934,7 +1945,7 @@ static int append_squash_message(struct strbuf *buf, const char *body,
        strbuf_addf(buf, _(nth_commit_msg_fmt),
                    ++opts->current_fixup_count + 1);
        strbuf_addstr(buf, "\n\n");
-       strbuf_add_commented_lines(buf, body, commented_len);
+       strbuf_add_commented_lines(buf, body, commented_len, comment_line_char);
        /* buf->buf may be reallocated so store an offset into the buffer */
        fixup_off = buf->len;
        strbuf_addstr(buf, body + commented_len);
@@ -2024,7 +2035,8 @@ static int update_squash_messages(struct repository *r,
                              _(first_commit_msg_str));
                strbuf_addstr(&buf, "\n\n");
                if (is_fixup_flag(command, flag))
-                       strbuf_add_commented_lines(&buf, body, strlen(body));
+                       strbuf_add_commented_lines(&buf, body, strlen(body),
+                                                  comment_line_char);
                else
                        strbuf_addstr(&buf, body);
 
@@ -2043,7 +2055,8 @@ static int update_squash_messages(struct repository *r,
                strbuf_addf(&buf, _(skip_nth_commit_msg_fmt),
                            ++opts->current_fixup_count + 1);
                strbuf_addstr(&buf, "\n\n");
-               strbuf_add_commented_lines(&buf, body, strlen(body));
+               strbuf_add_commented_lines(&buf, body, strlen(body),
+                                          comment_line_char);
        } else
                return error(_("unknown command: %d"), command);
        repo_unuse_commit_buffer(r, commit, message);
@@ -2472,7 +2485,6 @@ void todo_list_release(struct todo_list *todo_list)
 static struct todo_item *append_new_todo(struct todo_list *todo_list)
 {
        ALLOC_GROW(todo_list->items, todo_list->nr + 1, todo_list->alloc);
-       todo_list->total_nr++;
        return todo_list->items + todo_list->nr++;
 }
 
@@ -2663,7 +2675,7 @@ int todo_list_parse_insn_buffer(struct repository *r, char *buf,
        char *p = buf, *next_p;
        int i, res = 0, fixup_okay = file_exists(rebase_path_done());
 
-       todo_list->current = todo_list->nr = 0;
+       todo_list->current = todo_list->nr = todo_list->total_nr = 0;
 
        for (i = 1; *p; i++, p = next_p) {
                char *eol = strchrnul(p, '\n');
@@ -2684,10 +2696,13 @@ int todo_list_parse_insn_buffer(struct repository *r, char *buf,
                        item->commit = NULL;
                }
 
+               if (item->command != TODO_COMMENT)
+                       todo_list->total_nr++;
+
                if (fixup_okay)
                        ; /* do nothing */
                else if (is_fixup(item->command))
-                       return error(_("cannot '%s' without a previous commit"),
+                       res = error(_("cannot '%s' without a previous commit"),
                                command_to_string(item->command));
                else if (!is_noop(item->command))
                        fixup_okay = 1;
@@ -2874,7 +2889,9 @@ static int git_config_string_dup(char **dest,
        return 0;
 }
 
-static int populate_opts_cb(const char *key, const char *value, void *data)
+static int populate_opts_cb(const char *key, const char *value,
+                           const struct config_context *ctx,
+                           void *data)
 {
        struct replay_opts *opts = data;
        int error_flag = 1;
@@ -2882,26 +2899,26 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
        if (!value)
                error_flag = 0;
        else if (!strcmp(key, "options.no-commit"))
-               opts->no_commit = git_config_bool_or_int(key, value, &error_flag);
+               opts->no_commit = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.edit"))
-               opts->edit = git_config_bool_or_int(key, value, &error_flag);
+               opts->edit = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.allow-empty"))
                opts->allow_empty =
-                       git_config_bool_or_int(key, value, &error_flag);
+                       git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.allow-empty-message"))
                opts->allow_empty_message =
-                       git_config_bool_or_int(key, value, &error_flag);
+                       git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.keep-redundant-commits"))
                opts->keep_redundant_commits =
-                       git_config_bool_or_int(key, value, &error_flag);
+                       git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.signoff"))
-               opts->signoff = git_config_bool_or_int(key, value, &error_flag);
+               opts->signoff = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.record-origin"))
-               opts->record_origin = git_config_bool_or_int(key, value, &error_flag);
+               opts->record_origin = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.allow-ff"))
-               opts->allow_ff = git_config_bool_or_int(key, value, &error_flag);
+               opts->allow_ff = git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.mainline"))
-               opts->mainline = git_config_int(key, value);
+               opts->mainline = git_config_int(key, value, ctx->kvi);
        else if (!strcmp(key, "options.strategy"))
                git_config_string_dup(&opts->strategy, key, value);
        else if (!strcmp(key, "options.gpg-sign"))
@@ -2910,7 +2927,7 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
                strvec_push(&opts->xopts, value);
        } else if (!strcmp(key, "options.allow-rerere-auto"))
                opts->allow_rerere_auto =
-                       git_config_bool_or_int(key, value, &error_flag) ?
+                       git_config_bool_or_int(key, value, ctx->kvi, &error_flag) ?
                                RERERE_AUTOUPDATE : RERERE_NOAUTOUPDATE;
        else if (!strcmp(key, "options.default-msg-cleanup")) {
                opts->explicit_cleanup = 1;
@@ -3621,14 +3638,14 @@ static int do_exec(struct repository *r, const char *command_line)
                          "  git rebase --continue\n"
                          "\n"),
                        command_line,
-                       dirty ? N_("and made changes to the index and/or the "
-                               "working tree\n") : "");
+                       dirty ? _("and made changes to the index and/or the "
+                               "working tree.\n") : "");
                if (status == 127)
                        /* command not found */
                        status = 1;
        } else if (dirty) {
                warning(_("execution succeeded: %s\nbut "
-                         "left changes to the index and/or the working tree\n"
+                         "left changes to the index and/or the working tree.\n"
                          "Commit or stash your changes, and then run\n"
                          "\n"
                          "  git rebase --continue\n"
@@ -4265,7 +4282,7 @@ void todo_list_filter_update_refs(struct repository *r,
                if (!is_null_oid(&rec->after))
                        continue;
 
-               for (j = 0; !found && j < todo_list->total_nr; j++) {
+               for (j = 0; !found && j < todo_list->nr; j++) {
                        struct todo_item *item = &todo_list->items[j];
                        const char *arg = todo_list->buf.buf + item->arg_offset;
 
@@ -4295,7 +4312,7 @@ void todo_list_filter_update_refs(struct repository *r,
         * For each todo_item, check if its ref is in the update_refs list.
         * If not, then add it as an un-updated ref.
         */
-       for (i = 0; i < todo_list->total_nr; i++) {
+       for (i = 0; i < todo_list->nr; i++) {
                struct todo_item *item = &todo_list->items[i];
                const char *arg = todo_list->buf.buf + item->arg_offset;
                int j, found = 0;
@@ -5031,19 +5048,31 @@ static int commit_staged_changes(struct repository *r,
                                 * We need to update the squash message to skip
                                 * the latest commit message.
                                 */
+                               int res = 0;
                                struct commit *commit;
+                               const char *msg;
                                const char *path = rebase_path_squash_msg();
                                const char *encoding = get_commit_output_encoding();
 
-                               if (parse_head(r, &commit) ||
-                                   !(p = repo_logmsg_reencode(r, commit, NULL, encoding)) ||
-                                   write_message(p, strlen(p), path, 0)) {
-                                       repo_unuse_commit_buffer(r, commit, p);
-                                       return error(_("could not write file: "
+                               if (parse_head(r, &commit))
+                                       return error(_("could not parse HEAD"));
+
+                               p = repo_logmsg_reencode(r, commit, NULL, encoding);
+                               if (!p)  {
+                                       res = error(_("could not parse commit %s"),
+                                                   oid_to_hex(&commit->object.oid));
+                                       goto unuse_commit_buffer;
+                               }
+                               find_commit_subject(p, &msg);
+                               if (write_message(msg, strlen(msg), path, 0)) {
+                                       res = error(_("could not write file: "
                                                       "'%s'"), path);
+                                       goto unuse_commit_buffer;
                                }
-                               repo_unuse_commit_buffer(r,
-                                                        commit, p);
+                       unuse_commit_buffer:
+                               repo_unuse_commit_buffer(r, commit, p);
+                               if (res)
+                                       return res;
                        }
                }
 
@@ -6143,7 +6172,8 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
        todo_list_to_strbuf(r, &new_todo, &buf2, -1, 0);
        strbuf_swap(&new_todo.buf, &buf2);
        strbuf_release(&buf2);
-       new_todo.total_nr -= new_todo.nr;
+       /* Nothing is done yet, and we're reparsing, so let's reset the count */
+       new_todo.total_nr = 0;
        if (todo_list_parse_insn_buffer(r, new_todo.buf.buf, &new_todo) < 0)
                BUG("invalid todo list after expanding IDs:\n%s",
                    new_todo.buf.buf);
diff --git a/serve.c b/serve.c
index 5329c91011f2919fc24bcc3039c264a0c9e2c877..a1d71134d49cc88ead5af690315b27ae23215e56 100644 (file)
--- a/serve.c
+++ b/serve.c
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "repository.h"
 #include "config.h"
+#include "hash-ll.h"
 #include "pkt-line.h"
 #include "version.h"
 #include "ls-refs.h"
index 355b6e01a52a0ce25b1a9fdf145749b37085f852..e2fe0f91432d8089e74c7e562728aca329dec66c 100644 (file)
@@ -1,5 +1,4 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "dir.h"
 #include "environment.h"
 #include "hex.h"
@@ -9,9 +8,11 @@
 #include "commit.h"
 #include "tag.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "path.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "server-info.h"
 #include "strbuf.h"
-#include "wrapper.h"
 
 struct update_info_ctx {
        FILE *cur_fp;
diff --git a/server-info.h b/server-info.h
new file mode 100644 (file)
index 0000000..13bbde2
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef SERVER_INFO_H
+#define SERVER_INFO_H
+
+/* Dumb servers support */
+int update_server_info(int);
+
+#endif /* SERVER_INFO_H */
diff --git a/setup.c b/setup.c
index 6c5b85e96c1e6bfc5367ec54d068d5d61f329aec..18927a847b86bbde543ba5ba539269c9b4e323f1 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -1,15 +1,22 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
+#include "copy.h"
 #include "environment.h"
+#include "exec-cmd.h"
 #include "gettext.h"
+#include "object-name.h"
+#include "refs.h"
 #include "repository.h"
 #include "config.h"
 #include "dir.h"
 #include "setup.h"
 #include "string-list.h"
 #include "chdir-notify.h"
+#include "path.h"
 #include "promisor-remote.h"
 #include "quote.h"
+#include "trace2.h"
+#include "worktree.h"
 
 static int inside_git_dir = -1;
 static int inside_work_tree = -1;
@@ -514,7 +521,9 @@ no_prevention_needed:
        startup_info->original_cwd = NULL;
 }
 
-static int read_worktree_config(const char *var, const char *value, void *vdata)
+static int read_worktree_config(const char *var, const char *value,
+                               const struct config_context *ctx UNUSED,
+                               void *vdata)
 {
        struct repository_format *data = vdata;
 
@@ -585,13 +594,14 @@ static enum extension_result handle_extension(const char *var,
        return EXTENSION_UNKNOWN;
 }
 
-static int check_repo_format(const char *var, const char *value, void *vdata)
+static int check_repo_format(const char *var, const char *value,
+                            const struct config_context *ctx, void *vdata)
 {
        struct repository_format *data = vdata;
        const char *ext;
 
        if (strcmp(var, "core.repositoryformatversion") == 0)
-               data->version = git_config_int(var, value);
+               data->version = git_config_int(var, value, ctx->kvi);
        else if (skip_prefix(var, "extensions.", &ext)) {
                switch (handle_extension_v0(var, value, ext, data)) {
                case EXTENSION_ERROR:
@@ -614,7 +624,7 @@ static int check_repo_format(const char *var, const char *value, void *vdata)
                }
        }
 
-       return read_worktree_config(var, value, vdata);
+       return read_worktree_config(var, value, ctx, vdata);
 }
 
 static int check_repository_format_gently(const char *gitdir, struct repository_format *candidate, int *nongit_ok)
@@ -647,11 +657,10 @@ static int check_repository_format_gently(const char *gitdir, struct repository_
        }
 
        repository_format_precious_objects = candidate->precious_objects;
-       repository_format_worktree_config = candidate->worktree_config;
        string_list_clear(&candidate->unknown_extensions, 0);
        string_list_clear(&candidate->v1_only_extensions, 0);
 
-       if (repository_format_worktree_config) {
+       if (candidate->worktree_config) {
                /*
                 * pick up core.bare and core.worktree from per-worktree
                 * config if present
@@ -1113,7 +1122,8 @@ struct safe_directory_data {
        int is_safe;
 };
 
-static int safe_directory_cb(const char *key, const char *value, void *d)
+static int safe_directory_cb(const char *key, const char *value,
+                            const struct config_context *ctx UNUSED, void *d)
 {
        struct safe_directory_data *data = d;
 
@@ -1169,7 +1179,9 @@ static int ensure_valid_ownership(const char *gitfile,
        return data.is_safe;
 }
 
-static int allowed_bare_repo_cb(const char *key, const char *value, void *d)
+static int allowed_bare_repo_cb(const char *key, const char *value,
+                               const struct config_context *ctx UNUSED,
+                               void *d)
 {
        enum allowed_bare_repo *allowed_bare_repo = d;
 
@@ -1349,6 +1361,7 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
                }
 
                if (is_git_directory(dir->buf)) {
+                       trace2_data_string("setup", NULL, "implicit-bare-repository", dir->buf);
                        if (get_allowed_bare_repo() == ALLOWED_BARE_REPO_EXPLICIT)
                                return GIT_DIR_DISALLOWED_BARE;
                        if (!ensure_valid_ownership(NULL, NULL, dir->buf, report))
@@ -1419,11 +1432,6 @@ int discover_git_directory(struct strbuf *commondir,
                return -1;
        }
 
-       /* take ownership of candidate.partial_clone */
-       the_repository->repository_format_partial_clone =
-               candidate.partial_clone;
-       candidate.partial_clone = NULL;
-
        clear_repository_format(&candidate);
        return 0;
 }
@@ -1556,6 +1564,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
                }
                if (startup_info->have_repository) {
                        repo_set_hash_algo(the_repository, repo_fmt.hash_algo);
+                       the_repository->repository_format_worktree_config =
+                               repo_fmt.worktree_config;
                        /* take ownership of repo_fmt.partial_clone */
                        the_repository->repository_format_partial_clone =
                                repo_fmt.partial_clone;
@@ -1647,6 +1657,8 @@ void check_repository_format(struct repository_format *fmt)
        check_repository_format_gently(get_git_dir(), fmt, NULL);
        startup_info->have_repository = 1;
        repo_set_hash_algo(the_repository, fmt->hash_algo);
+       the_repository->repository_format_worktree_config =
+               fmt->worktree_config;
        the_repository->repository_format_partial_clone =
                xstrdup_or_null(fmt->partial_clone);
        clear_repository_format(&repo_fmt);
@@ -1703,3 +1715,491 @@ int daemonize(void)
        return 0;
 #endif
 }
+
+#ifdef NO_TRUSTABLE_FILEMODE
+#define TEST_FILEMODE 0
+#else
+#define TEST_FILEMODE 1
+#endif
+
+#define GIT_DEFAULT_HASH_ENVIRONMENT "GIT_DEFAULT_HASH"
+
+static void copy_templates_1(struct strbuf *path, struct strbuf *template_path,
+                            DIR *dir)
+{
+       size_t path_baselen = path->len;
+       size_t template_baselen = template_path->len;
+       struct dirent *de;
+
+       /* Note: if ".git/hooks" file exists in the repository being
+        * re-initialized, /etc/core-git/templates/hooks/update would
+        * cause "git init" to fail here.  I think this is sane but
+        * it means that the set of templates we ship by default, along
+        * with the way the namespace under .git/ is organized, should
+        * be really carefully chosen.
+        */
+       safe_create_dir(path->buf, 1);
+       while ((de = readdir(dir)) != NULL) {
+               struct stat st_git, st_template;
+               int exists = 0;
+
+               strbuf_setlen(path, path_baselen);
+               strbuf_setlen(template_path, template_baselen);
+
+               if (de->d_name[0] == '.')
+                       continue;
+               strbuf_addstr(path, de->d_name);
+               strbuf_addstr(template_path, de->d_name);
+               if (lstat(path->buf, &st_git)) {
+                       if (errno != ENOENT)
+                               die_errno(_("cannot stat '%s'"), path->buf);
+               }
+               else
+                       exists = 1;
+
+               if (lstat(template_path->buf, &st_template))
+                       die_errno(_("cannot stat template '%s'"), template_path->buf);
+
+               if (S_ISDIR(st_template.st_mode)) {
+                       DIR *subdir = opendir(template_path->buf);
+                       if (!subdir)
+                               die_errno(_("cannot opendir '%s'"), template_path->buf);
+                       strbuf_addch(path, '/');
+                       strbuf_addch(template_path, '/');
+                       copy_templates_1(path, template_path, subdir);
+                       closedir(subdir);
+               }
+               else if (exists)
+                       continue;
+               else if (S_ISLNK(st_template.st_mode)) {
+                       struct strbuf lnk = STRBUF_INIT;
+                       if (strbuf_readlink(&lnk, template_path->buf,
+                                           st_template.st_size) < 0)
+                               die_errno(_("cannot readlink '%s'"), template_path->buf);
+                       if (symlink(lnk.buf, path->buf))
+                               die_errno(_("cannot symlink '%s' '%s'"),
+                                         lnk.buf, path->buf);
+                       strbuf_release(&lnk);
+               }
+               else if (S_ISREG(st_template.st_mode)) {
+                       if (copy_file(path->buf, template_path->buf, st_template.st_mode))
+                               die_errno(_("cannot copy '%s' to '%s'"),
+                                         template_path->buf, path->buf);
+               }
+               else
+                       error(_("ignoring template %s"), template_path->buf);
+       }
+}
+
+static void copy_templates(const char *template_dir, const char *init_template_dir)
+{
+       struct strbuf path = STRBUF_INIT;
+       struct strbuf template_path = STRBUF_INIT;
+       size_t template_len;
+       struct repository_format template_format = REPOSITORY_FORMAT_INIT;
+       struct strbuf err = STRBUF_INIT;
+       DIR *dir;
+       char *to_free = NULL;
+
+       if (!template_dir)
+               template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT);
+       if (!template_dir)
+               template_dir = init_template_dir;
+       if (!template_dir)
+               template_dir = to_free = system_path(DEFAULT_GIT_TEMPLATE_DIR);
+       if (!template_dir[0]) {
+               free(to_free);
+               return;
+       }
+
+       strbuf_addstr(&template_path, template_dir);
+       strbuf_complete(&template_path, '/');
+       template_len = template_path.len;
+
+       dir = opendir(template_path.buf);
+       if (!dir) {
+               warning(_("templates not found in %s"), template_dir);
+               goto free_return;
+       }
+
+       /* Make sure that template is from the correct vintage */
+       strbuf_addstr(&template_path, "config");
+       read_repository_format(&template_format, template_path.buf);
+       strbuf_setlen(&template_path, template_len);
+
+       /*
+        * No mention of version at all is OK, but anything else should be
+        * verified.
+        */
+       if (template_format.version >= 0 &&
+           verify_repository_format(&template_format, &err) < 0) {
+               warning(_("not copying templates from '%s': %s"),
+                         template_dir, err.buf);
+               strbuf_release(&err);
+               goto close_free_return;
+       }
+
+       strbuf_addstr(&path, get_git_common_dir());
+       strbuf_complete(&path, '/');
+       copy_templates_1(&path, &template_path, dir);
+close_free_return:
+       closedir(dir);
+free_return:
+       free(to_free);
+       strbuf_release(&path);
+       strbuf_release(&template_path);
+       clear_repository_format(&template_format);
+}
+
+/*
+ * If the git_dir is not directly inside the working tree, then git will not
+ * find it by default, and we need to set the worktree explicitly.
+ */
+static int needs_work_tree_config(const char *git_dir, const char *work_tree)
+{
+       if (!strcmp(work_tree, "/") && !strcmp(git_dir, "/.git"))
+               return 0;
+       if (skip_prefix(git_dir, work_tree, &git_dir) &&
+           !strcmp(git_dir, "/.git"))
+               return 0;
+       return 1;
+}
+
+void initialize_repository_version(int hash_algo, int reinit)
+{
+       char repo_version_string[10];
+       int repo_version = GIT_REPO_VERSION;
+
+       if (hash_algo != GIT_HASH_SHA1)
+               repo_version = GIT_REPO_VERSION_READ;
+
+       /* This forces creation of new config file */
+       xsnprintf(repo_version_string, sizeof(repo_version_string),
+                 "%d", repo_version);
+       git_config_set("core.repositoryformatversion", repo_version_string);
+
+       if (hash_algo != GIT_HASH_SHA1)
+               git_config_set("extensions.objectformat",
+                              hash_algos[hash_algo].name);
+       else if (reinit)
+               git_config_set_gently("extensions.objectformat", NULL);
+}
+
+static int create_default_files(const char *template_path,
+                               const char *original_git_dir,
+                               const char *initial_branch,
+                               const struct repository_format *fmt,
+                               int prev_bare_repository,
+                               int init_shared_repository,
+                               int quiet)
+{
+       struct stat st1;
+       struct strbuf buf = STRBUF_INIT;
+       char *path;
+       char junk[2];
+       int reinit;
+       int filemode;
+       struct strbuf err = STRBUF_INIT;
+       const char *init_template_dir = NULL;
+       const char *work_tree = get_git_work_tree();
+
+       /*
+        * First copy the templates -- we might have the default
+        * config file there, in which case we would want to read
+        * from it after installing.
+        *
+        * Before reading that config, we also need to clear out any cached
+        * values (since we've just potentially changed what's available on
+        * disk).
+        */
+       git_config_get_pathname("init.templatedir", &init_template_dir);
+       copy_templates(template_path, init_template_dir);
+       free((char *)init_template_dir);
+       git_config_clear();
+       reset_shared_repository();
+       git_config(git_default_config, NULL);
+
+       /*
+        * We must make sure command-line options continue to override any
+        * values we might have just re-read from the config.
+        */
+       if (init_shared_repository != -1)
+               set_shared_repository(init_shared_repository);
+       /*
+        * TODO: heed core.bare from config file in templates if no
+        *       command-line override given
+        */
+       is_bare_repository_cfg = prev_bare_repository || !work_tree;
+       /* TODO (continued):
+        *
+        * Unfortunately, the line above is equivalent to
+        *    is_bare_repository_cfg = !work_tree;
+        * which ignores the config entirely even if no `--[no-]bare`
+        * command line option was present.
+        *
+        * To see why, note that before this function, there was this call:
+        *    prev_bare_repository = is_bare_repository()
+        * expanding the right hand side:
+        *                 = is_bare_repository_cfg && !get_git_work_tree()
+        *                 = is_bare_repository_cfg && !work_tree
+        * note that the last simplification above is valid because nothing
+        * calls repo_init() or set_git_work_tree() between any of the
+        * relevant calls in the code, and thus the !get_git_work_tree()
+        * calls will return the same result each time.  So, what we are
+        * interested in computing is the right hand side of the line of
+        * code just above this comment:
+        *     prev_bare_repository || !work_tree
+        *        = is_bare_repository_cfg && !work_tree || !work_tree
+        *        = !work_tree
+        * because "A && !B || !B == !B" for all boolean values of A & B.
+        */
+
+       /*
+        * We would have created the above under user's umask -- under
+        * shared-repository settings, we would need to fix them up.
+        */
+       if (get_shared_repository()) {
+               adjust_shared_perm(get_git_dir());
+       }
+
+       /*
+        * We need to create a "refs" dir in any case so that older
+        * versions of git can tell that this is a repository.
+        */
+       safe_create_dir(git_path("refs"), 1);
+       adjust_shared_perm(git_path("refs"));
+
+       if (refs_init_db(&err))
+               die("failed to set up refs db: %s", err.buf);
+
+       /*
+        * Point the HEAD symref to the initial branch with if HEAD does
+        * not yet exist.
+        */
+       path = git_path_buf(&buf, "HEAD");
+       reinit = (!access(path, R_OK)
+                 || readlink(path, junk, sizeof(junk)-1) != -1);
+       if (!reinit) {
+               char *ref;
+
+               if (!initial_branch)
+                       initial_branch = git_default_branch_name(quiet);
+
+               ref = xstrfmt("refs/heads/%s", initial_branch);
+               if (check_refname_format(ref, 0) < 0)
+                       die(_("invalid initial branch name: '%s'"),
+                           initial_branch);
+
+               if (create_symref("HEAD", ref, NULL) < 0)
+                       exit(1);
+               free(ref);
+       }
+
+       initialize_repository_version(fmt->hash_algo, 0);
+
+       /* Check filemode trustability */
+       path = git_path_buf(&buf, "config");
+       filemode = TEST_FILEMODE;
+       if (TEST_FILEMODE && !lstat(path, &st1)) {
+               struct stat st2;
+               filemode = (!chmod(path, st1.st_mode ^ S_IXUSR) &&
+                               !lstat(path, &st2) &&
+                               st1.st_mode != st2.st_mode &&
+                               !chmod(path, st1.st_mode));
+               if (filemode && !reinit && (st1.st_mode & S_IXUSR))
+                       filemode = 0;
+       }
+       git_config_set("core.filemode", filemode ? "true" : "false");
+
+       if (is_bare_repository())
+               git_config_set("core.bare", "true");
+       else {
+               git_config_set("core.bare", "false");
+               /* allow template config file to override the default */
+               if (log_all_ref_updates == LOG_REFS_UNSET)
+                       git_config_set("core.logallrefupdates", "true");
+               if (needs_work_tree_config(original_git_dir, work_tree))
+                       git_config_set("core.worktree", work_tree);
+       }
+
+       if (!reinit) {
+               /* Check if symlink is supported in the work tree */
+               path = git_path_buf(&buf, "tXXXXXX");
+               if (!close(xmkstemp(path)) &&
+                   !unlink(path) &&
+                   !symlink("testing", path) &&
+                   !lstat(path, &st1) &&
+                   S_ISLNK(st1.st_mode))
+                       unlink(path); /* good */
+               else
+                       git_config_set("core.symlinks", "false");
+
+               /* Check if the filesystem is case-insensitive */
+               path = git_path_buf(&buf, "CoNfIg");
+               if (!access(path, F_OK))
+                       git_config_set("core.ignorecase", "true");
+               probe_utf8_pathname_composition();
+       }
+
+       strbuf_release(&buf);
+       return reinit;
+}
+
+static void create_object_directory(void)
+{
+       struct strbuf path = STRBUF_INIT;
+       size_t baselen;
+
+       strbuf_addstr(&path, get_object_directory());
+       baselen = path.len;
+
+       safe_create_dir(path.buf, 1);
+
+       strbuf_setlen(&path, baselen);
+       strbuf_addstr(&path, "/pack");
+       safe_create_dir(path.buf, 1);
+
+       strbuf_setlen(&path, baselen);
+       strbuf_addstr(&path, "/info");
+       safe_create_dir(path.buf, 1);
+
+       strbuf_release(&path);
+}
+
+static void separate_git_dir(const char *git_dir, const char *git_link)
+{
+       struct stat st;
+
+       if (!stat(git_link, &st)) {
+               const char *src;
+
+               if (S_ISREG(st.st_mode))
+                       src = read_gitfile(git_link);
+               else if (S_ISDIR(st.st_mode))
+                       src = git_link;
+               else
+                       die(_("unable to handle file type %d"), (int)st.st_mode);
+
+               if (rename(src, git_dir))
+                       die_errno(_("unable to move %s to %s"), src, git_dir);
+               repair_worktrees(NULL, NULL);
+       }
+
+       write_file(git_link, "gitdir: %s", git_dir);
+}
+
+static void validate_hash_algorithm(struct repository_format *repo_fmt, int hash)
+{
+       const char *env = getenv(GIT_DEFAULT_HASH_ENVIRONMENT);
+       /*
+        * If we already have an initialized repo, don't allow the user to
+        * specify a different algorithm, as that could cause corruption.
+        * Otherwise, if the user has specified one on the command line, use it.
+        */
+       if (repo_fmt->version >= 0 && hash != GIT_HASH_UNKNOWN && hash != repo_fmt->hash_algo)
+               die(_("attempt to reinitialize repository with different hash"));
+       else if (hash != GIT_HASH_UNKNOWN)
+               repo_fmt->hash_algo = hash;
+       else if (env) {
+               int env_algo = hash_algo_by_name(env);
+               if (env_algo == GIT_HASH_UNKNOWN)
+                       die(_("unknown hash algorithm '%s'"), env);
+               repo_fmt->hash_algo = env_algo;
+       }
+}
+
+int init_db(const char *git_dir, const char *real_git_dir,
+           const char *template_dir, int hash, const char *initial_branch,
+           int init_shared_repository, unsigned int flags)
+{
+       int reinit;
+       int exist_ok = flags & INIT_DB_EXIST_OK;
+       char *original_git_dir = real_pathdup(git_dir, 1);
+       struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT;
+       int prev_bare_repository;
+
+       if (real_git_dir) {
+               struct stat st;
+
+               if (!exist_ok && !stat(git_dir, &st))
+                       die(_("%s already exists"), git_dir);
+
+               if (!exist_ok && !stat(real_git_dir, &st))
+                       die(_("%s already exists"), real_git_dir);
+
+               set_git_dir(real_git_dir, 1);
+               git_dir = get_git_dir();
+               separate_git_dir(git_dir, original_git_dir);
+       }
+       else {
+               set_git_dir(git_dir, 1);
+               git_dir = get_git_dir();
+       }
+       startup_info->have_repository = 1;
+
+       /* Ensure `core.hidedotfiles` is processed */
+       git_config(platform_core_config, NULL);
+
+       safe_create_dir(git_dir, 0);
+
+       prev_bare_repository = is_bare_repository();
+
+       /* Check to see if the repository version is right.
+        * Note that a newly created repository does not have
+        * config file, so this will not fail.  What we are catching
+        * is an attempt to reinitialize new repository with an old tool.
+        */
+       check_repository_format(&repo_fmt);
+
+       validate_hash_algorithm(&repo_fmt, hash);
+
+       reinit = create_default_files(template_dir, original_git_dir,
+                                     initial_branch, &repo_fmt,
+                                     prev_bare_repository,
+                                     init_shared_repository,
+                                     flags & INIT_DB_QUIET);
+       if (reinit && initial_branch)
+               warning(_("re-init: ignored --initial-branch=%s"),
+                       initial_branch);
+
+       create_object_directory();
+
+       if (get_shared_repository()) {
+               char buf[10];
+               /* We do not spell "group" and such, so that
+                * the configuration can be read by older version
+                * of git. Note, we use octal numbers for new share modes,
+                * and compatibility values for PERM_GROUP and
+                * PERM_EVERYBODY.
+                */
+               if (get_shared_repository() < 0)
+                       /* force to the mode value */
+                       xsnprintf(buf, sizeof(buf), "0%o", -get_shared_repository());
+               else if (get_shared_repository() == PERM_GROUP)
+                       xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_GROUP);
+               else if (get_shared_repository() == PERM_EVERYBODY)
+                       xsnprintf(buf, sizeof(buf), "%d", OLD_PERM_EVERYBODY);
+               else
+                       BUG("invalid value for shared_repository");
+               git_config_set("core.sharedrepository", buf);
+               git_config_set("receive.denyNonFastforwards", "true");
+       }
+
+       if (!(flags & INIT_DB_QUIET)) {
+               int len = strlen(git_dir);
+
+               if (reinit)
+                       printf(get_shared_repository()
+                              ? _("Reinitialized existing shared Git repository in %s%s\n")
+                              : _("Reinitialized existing Git repository in %s%s\n"),
+                              git_dir, len && git_dir[len-1] != '/' ? "/" : "");
+               else
+                       printf(get_shared_repository()
+                              ? _("Initialized empty shared Git repository in %s%s\n")
+                              : _("Initialized empty Git repository in %s%s\n"),
+                              git_dir, len && git_dir[len-1] != '/' ? "/" : "");
+       }
+
+       free(original_git_dir);
+       return 0;
+}
diff --git a/setup.h b/setup.h
index 4c1ca9d0c94b88060033de50294da4d2e242bf15..58fd2605dd2697a1c82e1bc81b98a1f783c63d18 100644 (file)
--- a/setup.h
+++ b/setup.h
@@ -140,6 +140,15 @@ int verify_repository_format(const struct repository_format *format,
  */
 void check_repository_format(struct repository_format *fmt);
 
+#define INIT_DB_QUIET 0x0001
+#define INIT_DB_EXIST_OK 0x0002
+
+int init_db(const char *git_dir, const char *real_git_dir,
+           const char *template_dir, int hash_algo,
+           const char *initial_branch, int init_shared_repository,
+           unsigned int flags);
+void initialize_repository_version(int hash_algo, int reinit);
+
 /*
  * NOTE NOTE NOTE!!
  *
diff --git a/sha1/openssl.h b/sha1/openssl.h
new file mode 100644 (file)
index 0000000..006c1f4
--- /dev/null
@@ -0,0 +1,49 @@
+/* wrappers for the EVP API of OpenSSL 3+ */
+#ifndef SHA1_OPENSSL_H
+#define SHA1_OPENSSL_H
+#include <openssl/evp.h>
+
+struct openssl_SHA1_CTX {
+       EVP_MD_CTX *ectx;
+};
+
+typedef struct openssl_SHA1_CTX openssl_SHA1_CTX;
+
+static inline void openssl_SHA1_Init(struct openssl_SHA1_CTX *ctx)
+{
+       const EVP_MD *type = EVP_sha1();
+
+       ctx->ectx = EVP_MD_CTX_new();
+       if (!ctx->ectx)
+               die("EVP_MD_CTX_new: out of memory");
+
+       EVP_DigestInit_ex(ctx->ectx, type, NULL);
+}
+
+static inline void openssl_SHA1_Update(struct openssl_SHA1_CTX *ctx,
+                                       const void *data,
+                                       size_t len)
+{
+       EVP_DigestUpdate(ctx->ectx, data, len);
+}
+
+static inline void openssl_SHA1_Final(unsigned char *digest,
+                                      struct openssl_SHA1_CTX *ctx)
+{
+       EVP_DigestFinal_ex(ctx->ectx, digest, NULL);
+       EVP_MD_CTX_free(ctx->ectx);
+}
+
+static inline void openssl_SHA1_Clone(struct openssl_SHA1_CTX *dst,
+                                       const struct openssl_SHA1_CTX *src)
+{
+       EVP_MD_CTX_copy_ex(dst->ectx, src->ectx);
+}
+
+#define platform_SHA_CTX openssl_SHA1_CTX
+#define platform_SHA1_Init openssl_SHA1_Init
+#define platform_SHA1_Clone openssl_SHA1_Clone
+#define platform_SHA1_Update openssl_SHA1_Update
+#define platform_SHA1_Final openssl_SHA1_Final
+
+#endif /* SHA1_OPENSSL_H */
index 501da5ed9197ec61497e244879c7f60ba58617c1..17a90f1052526c84847aa6d530a3e54e2558329f 100644 (file)
@@ -7,22 +7,25 @@
 
 typedef gcry_md_hd_t gcrypt_SHA256_CTX;
 
-inline void gcrypt_SHA256_Init(gcrypt_SHA256_CTX *ctx)
+static inline void gcrypt_SHA256_Init(gcrypt_SHA256_CTX *ctx)
 {
-       gcry_md_open(ctx, GCRY_MD_SHA256, 0);
+       gcry_error_t err = gcry_md_open(ctx, GCRY_MD_SHA256, 0);
+       if (err)
+               die("gcry_md_open: %s", gcry_strerror(err));
 }
 
-inline void gcrypt_SHA256_Update(gcrypt_SHA256_CTX *ctx, const void *data, size_t len)
+static inline void gcrypt_SHA256_Update(gcrypt_SHA256_CTX *ctx, const void *data, size_t len)
 {
        gcry_md_write(*ctx, data, len);
 }
 
-inline void gcrypt_SHA256_Final(unsigned char *digest, gcrypt_SHA256_CTX *ctx)
+static inline void gcrypt_SHA256_Final(unsigned char *digest, gcrypt_SHA256_CTX *ctx)
 {
        memcpy(digest, gcry_md_read(*ctx, GCRY_MD_SHA256), SHA256_DIGEST_SIZE);
+       gcry_md_close(*ctx);
 }
 
-inline void gcrypt_SHA256_Clone(gcrypt_SHA256_CTX *dst, const gcrypt_SHA256_CTX *src)
+static inline void gcrypt_SHA256_Clone(gcrypt_SHA256_CTX *dst, const gcrypt_SHA256_CTX *src)
 {
        gcry_md_copy(dst, *src);
 }
diff --git a/sha256/openssl.h b/sha256/openssl.h
new file mode 100644 (file)
index 0000000..c1083d9
--- /dev/null
@@ -0,0 +1,49 @@
+/* wrappers for the EVP API of OpenSSL 3+ */
+#ifndef SHA256_OPENSSL_H
+#define SHA256_OPENSSL_H
+#include <openssl/evp.h>
+
+struct openssl_SHA256_CTX {
+       EVP_MD_CTX *ectx;
+};
+
+typedef struct openssl_SHA256_CTX openssl_SHA256_CTX;
+
+static inline void openssl_SHA256_Init(struct openssl_SHA256_CTX *ctx)
+{
+       const EVP_MD *type = EVP_sha256();
+
+       ctx->ectx = EVP_MD_CTX_new();
+       if (!ctx->ectx)
+               die("EVP_MD_CTX_new: out of memory");
+
+       EVP_DigestInit_ex(ctx->ectx, type, NULL);
+}
+
+static inline void openssl_SHA256_Update(struct openssl_SHA256_CTX *ctx,
+                                       const void *data,
+                                       size_t len)
+{
+       EVP_DigestUpdate(ctx->ectx, data, len);
+}
+
+static inline void openssl_SHA256_Final(unsigned char *digest,
+                                      struct openssl_SHA256_CTX *ctx)
+{
+       EVP_DigestFinal_ex(ctx->ectx, digest, NULL);
+       EVP_MD_CTX_free(ctx->ectx);
+}
+
+static inline void openssl_SHA256_Clone(struct openssl_SHA256_CTX *dst,
+                                       const struct openssl_SHA256_CTX *src)
+{
+       EVP_MD_CTX_copy_ex(dst->ectx, src->ectx);
+}
+
+#define platform_SHA256_CTX openssl_SHA256_CTX
+#define platform_SHA256_Init openssl_SHA256_Init
+#define platform_SHA256_Clone openssl_SHA256_Clone
+#define platform_SHA256_Update openssl_SHA256_Update
+#define platform_SHA256_Final openssl_SHA256_Final
+
+#endif /* SHA256_OPENSSL_H */
index b4d726bd5954c4cbf4156c9ea8c98822471c9db4..5413719fd4ef16c130117440c4d4687f9c1c5525 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -1,23 +1,24 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "hex.h"
 #include "repository.h"
 #include "tempfile.h"
 #include "lockfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "tag.h"
 #include "pkt-line.h"
 #include "remote.h"
 #include "refs.h"
 #include "oid-array.h"
+#include "path.h"
 #include "diff.h"
 #include "revision.h"
 #include "commit-slab.h"
 #include "list-objects.h"
 #include "commit-reach.h"
 #include "shallow.h"
-#include "wrapper.h"
+#include "statinfo.h"
+#include "trace.h"
 
 void set_alternate_shallow_file(struct repository *r, const char *path, int override)
 {
index 0af582858bf4175e8c3047cffc10eb156661a631..6cbfd391c47fb531740eb4b963a11b77f8abe29d 100644 (file)
@@ -1,6 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "color.h"
 #include "config.h"
+#include "editor.h"
 #include "gettext.h"
 #include "sideband.h"
 #include "help.h"
index ee778c0580b6d9eb47ebc0d5f1ea7a9d7637a96c..66123bdbabb04123c6f0f4b64a8262584e3d2555 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "sigchain.h"
 
 #define SIGCHAIN_MAX_SIGNALS 32
index 886054729e5e343f664d81da5c5ad6b48cf06e8a..1fdb07a9e69be2db0b03d283f0f100a1d2842ad2 100644 (file)
@@ -1,7 +1,8 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
+#include "name-hash.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "sparse-index.h"
 #include "tree.h"
@@ -10,7 +11,7 @@
 #include "cache-tree.h"
 #include "config.h"
 #include "dir.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 
 struct modify_index_context {
        struct index_state *write;
index 59a92d819ecdac1430b69db081b79cfc7e8ca84a..a16f3e67d75913daffc7ded0e08118ca233d1f5d 100644 (file)
@@ -37,4 +37,6 @@ struct pattern_list;
  */
 void expand_index(struct index_state *istate, struct pattern_list *pl);
 
+void ensure_full_index(struct index_state *istate);
+
 #endif
index c98807c655b1fddb6df70e9c4fbf0122264c5b58..8c38687c04b81ceaa57746a96daf670874e31643 100644 (file)
@@ -1,7 +1,10 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "gettext.h"
+#include "hash.h"
+#include "mem-pool.h"
+#include "read-cache-ll.h"
 #include "split-index.h"
+#include "strbuf.h"
 #include "ewah/ewok.h"
 
 struct split_index *init_split_index(struct index_state *istate)
index 7a435ca2c970111b40ac9edba65726e79bd7941d..15a29cd08c96be6eeff23f609ec7c8d9533175b1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SPLIT_INDEX_H
 #define SPLIT_INDEX_H
 
-#include "cache.h"
+#include "hash-ll.h"
 
 struct index_state;
 struct strbuf;
diff --git a/statinfo.c b/statinfo.c
new file mode 100644 (file)
index 0000000..17bb896
--- /dev/null
@@ -0,0 +1,87 @@
+#include "git-compat-util.h"
+#include "environment.h"
+#include "statinfo.h"
+
+void fill_stat_data(struct stat_data *sd, struct stat *st)
+{
+       sd->sd_ctime.sec = (unsigned int)st->st_ctime;
+       sd->sd_mtime.sec = (unsigned int)st->st_mtime;
+       sd->sd_ctime.nsec = ST_CTIME_NSEC(*st);
+       sd->sd_mtime.nsec = ST_MTIME_NSEC(*st);
+       sd->sd_dev = st->st_dev;
+       sd->sd_ino = st->st_ino;
+       sd->sd_uid = st->st_uid;
+       sd->sd_gid = st->st_gid;
+       sd->sd_size = st->st_size;
+}
+
+int match_stat_data(const struct stat_data *sd, struct stat *st)
+{
+       int changed = 0;
+
+       if (sd->sd_mtime.sec != (unsigned int)st->st_mtime)
+               changed |= MTIME_CHANGED;
+       if (trust_ctime && check_stat &&
+           sd->sd_ctime.sec != (unsigned int)st->st_ctime)
+               changed |= CTIME_CHANGED;
+
+#ifdef USE_NSEC
+       if (check_stat && sd->sd_mtime.nsec != ST_MTIME_NSEC(*st))
+               changed |= MTIME_CHANGED;
+       if (trust_ctime && check_stat &&
+           sd->sd_ctime.nsec != ST_CTIME_NSEC(*st))
+               changed |= CTIME_CHANGED;
+#endif
+
+       if (check_stat) {
+               if (sd->sd_uid != (unsigned int) st->st_uid ||
+                       sd->sd_gid != (unsigned int) st->st_gid)
+                       changed |= OWNER_CHANGED;
+               if (sd->sd_ino != (unsigned int) st->st_ino)
+                       changed |= INODE_CHANGED;
+       }
+
+#ifdef USE_STDEV
+       /*
+        * st_dev breaks on network filesystems where different
+        * clients will have different views of what "device"
+        * the filesystem is on
+        */
+       if (check_stat && sd->sd_dev != (unsigned int) st->st_dev)
+                       changed |= INODE_CHANGED;
+#endif
+
+       if (sd->sd_size != (unsigned int) st->st_size)
+               changed |= DATA_CHANGED;
+
+       return changed;
+}
+
+void stat_validity_clear(struct stat_validity *sv)
+{
+       FREE_AND_NULL(sv->sd);
+}
+
+int stat_validity_check(struct stat_validity *sv, const char *path)
+{
+       struct stat st;
+
+       if (stat(path, &st) < 0)
+               return sv->sd == NULL;
+       if (!sv->sd)
+               return 0;
+       return S_ISREG(st.st_mode) && !match_stat_data(sv->sd, &st);
+}
+
+void stat_validity_update(struct stat_validity *sv, int fd)
+{
+       struct stat st;
+
+       if (fstat(fd, &st) < 0 || !S_ISREG(st.st_mode))
+               stat_validity_clear(sv);
+       else {
+               if (!sv->sd)
+                       CALLOC_ARRAY(sv->sd, 1);
+               fill_stat_data(sv->sd, &st);
+       }
+}
index e49e3054eaaa54f9916ae2a01fa9a1ca987b339a..700f502ac0b3cb938c2f376653dc1e91ac4e6d24 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef STATINFO_H
 #define STATINFO_H
 
+struct index_state;
+
 /*
  * The "cache_time" is just the low 32 bits of the
  * time. It doesn't matter if it overflows - we only
@@ -21,4 +23,67 @@ struct stat_data {
        unsigned int sd_size;
 };
 
+/*
+ * A struct to encapsulate the concept of whether a file has changed
+ * since we last checked it. This uses criteria similar to those used
+ * for the index.
+ */
+struct stat_validity {
+       struct stat_data *sd;
+};
+
+#define MTIME_CHANGED  0x0001
+#define CTIME_CHANGED  0x0002
+#define OWNER_CHANGED  0x0004
+#define MODE_CHANGED    0x0008
+#define INODE_CHANGED   0x0010
+#define DATA_CHANGED    0x0020
+#define TYPE_CHANGED    0x0040
+
+/*
+ * Record to sd the data from st that we use to check whether a file
+ * might have changed.
+ */
+void fill_stat_data(struct stat_data *sd, struct stat *st);
+
+/*
+ * Return 0 if st is consistent with a file not having been changed
+ * since sd was filled.  If there are differences, return a
+ * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
+ * INODE_CHANGED, and DATA_CHANGED.
+ */
+int match_stat_data(const struct stat_data *sd, struct stat *st);
+
+void stat_validity_clear(struct stat_validity *sv);
+
+/*
+ * Returns 1 if the path is a regular file (or a symlink to a regular
+ * file) and matches the saved stat_validity, 0 otherwise.  A missing
+ * or inaccessible file is considered a match if the struct was just
+ * initialized, or if the previous update found an inaccessible file.
+ */
+int stat_validity_check(struct stat_validity *sv, const char *path);
+
+/*
+ * Update the stat_validity from a file opened at descriptor fd. If
+ * the file is missing, inaccessible, or not a regular file, then
+ * future calls to stat_validity_check will match iff one of those
+ * conditions continues to be true.
+ */
+void stat_validity_update(struct stat_validity *sv, int fd);
+
+#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
+#define DTYPE(de)      ((de)->d_type)
+#else
+#undef DT_UNKNOWN
+#undef DT_DIR
+#undef DT_REG
+#undef DT_LNK
+#define DT_UNKNOWN     0
+#define DT_DIR         1
+#define DT_REG         2
+#define DT_LNK         3
+#define DTYPE(de)      DT_UNKNOWN
+#endif
+
 #endif
index 70a83e7980e0e575cde2d9b8fed5eec1fa9f48e5..4c9ac6dc5e3cd34fd059ca3a20f8e98bd08b2d4a 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,14 +1,10 @@
-#include "cache.h"
-#include "abspath.h"
-#include "alloc.h"
-#include "environment.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
-#include "refs.h"
+#include "strbuf.h"
 #include "string-list.h"
 #include "utf8.h"
 #include "date.h"
-#include "wrapper.h"
 
 int starts_with(const char *str, const char *prefix)
 {
@@ -363,7 +359,8 @@ static void add_lines(struct strbuf *out,
        strbuf_complete_line(out);
 }
 
-void strbuf_add_commented_lines(struct strbuf *out, const char *buf, size_t size)
+void strbuf_add_commented_lines(struct strbuf *out, const char *buf,
+                               size_t size, char comment_line_char)
 {
        static char prefix1[3];
        static char prefix2[2];
@@ -375,7 +372,8 @@ void strbuf_add_commented_lines(struct strbuf *out, const char *buf, size_t size
        add_lines(out, prefix1, prefix2, buf, size);
 }
 
-void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...)
+void strbuf_commented_addf(struct strbuf *sb, char comment_line_char,
+                          const char *fmt, ...)
 {
        va_list params;
        struct strbuf buf = STRBUF_INIT;
@@ -385,7 +383,7 @@ void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...)
        strbuf_vaddf(&buf, fmt, params);
        va_end(params);
 
-       strbuf_add_commented_lines(sb, buf.buf, buf.len);
+       strbuf_add_commented_lines(sb, buf.buf, buf.len, comment_line_char);
        if (incomplete_line)
                sb->buf[--sb->len] = '\0';
 
@@ -413,36 +411,19 @@ void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap)
        strbuf_setlen(sb, sb->len + len);
 }
 
-void strbuf_expand(struct strbuf *sb, const char *format, expand_fn_t fn,
-                  void *context)
+int strbuf_expand_step(struct strbuf *sb, const char **formatp)
 {
-       for (;;) {
-               const char *percent;
-               size_t consumed;
-
-               percent = strchrnul(format, '%');
-               strbuf_add(sb, format, percent - format);
-               if (!*percent)
-                       break;
-               format = percent + 1;
-
-               if (*format == '%') {
-                       strbuf_addch(sb, '%');
-                       format++;
-                       continue;
-               }
+       const char *format = *formatp;
+       const char *percent = strchrnul(format, '%');
 
-               consumed = fn(sb, format, context);
-               if (consumed)
-                       format += consumed;
-               else
-                       strbuf_addch(sb, '%');
-       }
+       strbuf_add(sb, format, percent - format);
+       if (!*percent)
+               return 0;
+       *formatp = percent + 1;
+       return 1;
 }
 
-size_t strbuf_expand_literal_cb(struct strbuf *sb,
-                               const char *placeholder,
-                               void *context UNUSED)
+size_t strbuf_expand_literal(struct strbuf *sb, const char *placeholder)
 {
        int ch;
 
@@ -461,22 +442,6 @@ size_t strbuf_expand_literal_cb(struct strbuf *sb,
        return 0;
 }
 
-size_t strbuf_expand_dict_cb(struct strbuf *sb, const char *placeholder,
-               void *context)
-{
-       struct strbuf_expand_dict_entry *e = context;
-       size_t len;
-
-       for (; e->placeholder && (len = strlen(e->placeholder)); e++) {
-               if (!strncmp(placeholder, e->placeholder, len)) {
-                       if (e->value)
-                               strbuf_addstr(sb, e->value);
-                       return len;
-               }
-       }
-       return 0;
-}
-
 void strbuf_addbuf_percentquote(struct strbuf *dst, const struct strbuf *src)
 {
        size_t i, len = src->len;
@@ -719,11 +684,11 @@ static int strbuf_getdelim(struct strbuf *sb, FILE *fp, int term)
        return 0;
 }
 
-int strbuf_getline(struct strbuf *sb, FILE *fp)
+int strbuf_getdelim_strip_crlf(struct strbuf *sb, FILE *fp, int term)
 {
-       if (strbuf_getwholeline(sb, fp, '\n'))
+       if (strbuf_getwholeline(sb, fp, term))
                return EOF;
-       if (sb->buf[sb->len - 1] == '\n') {
+       if (term == '\n' && sb->buf[sb->len - 1] == '\n') {
                strbuf_setlen(sb, sb->len - 1);
                if (sb->len && sb->buf[sb->len - 1] == '\r')
                        strbuf_setlen(sb, sb->len - 1);
@@ -731,6 +696,11 @@ int strbuf_getline(struct strbuf *sb, FILE *fp)
        return 0;
 }
 
+int strbuf_getline(struct strbuf *sb, FILE *fp)
+{
+       return strbuf_getdelim_strip_crlf(sb, fp, '\n');
+}
+
 int strbuf_getline_lf(struct strbuf *sb, FILE *fp)
 {
        return strbuf_getdelim(sb, fp, '\n');
@@ -809,25 +779,6 @@ void strbuf_addstr_xml_quoted(struct strbuf *buf, const char *s)
        }
 }
 
-int is_rfc3986_reserved_or_unreserved(char ch)
-{
-       if (is_rfc3986_unreserved(ch))
-               return 1;
-       switch (ch) {
-               case '!': case '*': case '\'': case '(': case ')': case ';':
-               case ':': case '@': case '&': case '=': case '+': case '$':
-               case ',': case '/': case '?': case '#': case '[': case ']':
-                       return 1;
-       }
-       return 0;
-}
-
-int is_rfc3986_unreserved(char ch)
-{
-       return isalnum(ch) ||
-               ch == '-' || ch == '_' || ch == '.' || ch == '~';
-}
-
 static void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
                                 char_predicate allow_unencoded_fn)
 {
@@ -898,42 +849,6 @@ void strbuf_humanise_rate(struct strbuf *buf, off_t bytes)
        strbuf_humanise(buf, bytes, 1);
 }
 
-void strbuf_add_absolute_path(struct strbuf *sb, const char *path)
-{
-       if (!*path)
-               die("The empty string is not a valid path");
-       if (!is_absolute_path(path)) {
-               struct stat cwd_stat, pwd_stat;
-               size_t orig_len = sb->len;
-               char *cwd = xgetcwd();
-               char *pwd = getenv("PWD");
-               if (pwd && strcmp(pwd, cwd) &&
-                   !stat(cwd, &cwd_stat) &&
-                   (cwd_stat.st_dev || cwd_stat.st_ino) &&
-                   !stat(pwd, &pwd_stat) &&
-                   pwd_stat.st_dev == cwd_stat.st_dev &&
-                   pwd_stat.st_ino == cwd_stat.st_ino)
-                       strbuf_addstr(sb, pwd);
-               else
-                       strbuf_addstr(sb, cwd);
-               if (sb->len > orig_len && !is_dir_sep(sb->buf[sb->len - 1]))
-                       strbuf_addch(sb, '/');
-               free(cwd);
-       }
-       strbuf_addstr(sb, path);
-}
-
-void strbuf_add_real_path(struct strbuf *sb, const char *path)
-{
-       if (sb->len) {
-               struct strbuf resolved = STRBUF_INIT;
-               strbuf_realpath(&resolved, path, 1);
-               strbuf_addbuf(sb, &resolved);
-               strbuf_release(&resolved);
-       } else
-               strbuf_realpath(sb, path, 1);
-}
-
 int printf_ln(const char *fmt, ...)
 {
        int ret;
@@ -1020,37 +935,20 @@ void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm,
         * we want for %z, but the computation for %s has to convert to number
         * of seconds.
         */
-       for (;;) {
-               const char *percent = strchrnul(fmt, '%');
-               strbuf_add(&munged_fmt, fmt, percent - fmt);
-               if (!*percent)
-                       break;
-               fmt = percent + 1;
-               switch (*fmt) {
-               case '%':
+       while (strbuf_expand_step(&munged_fmt, &fmt)) {
+               if (skip_prefix(fmt, "%", &fmt))
                        strbuf_addstr(&munged_fmt, "%%");
-                       fmt++;
-                       break;
-               case 's':
+               else if (skip_prefix(fmt, "s", &fmt))
                        strbuf_addf(&munged_fmt, "%"PRItime,
                                    (timestamp_t)tm_to_time_t(tm) -
                                    3600 * (tz_offset / 100) -
                                    60 * (tz_offset % 100));
-                       fmt++;
-                       break;
-               case 'z':
+               else if (skip_prefix(fmt, "z", &fmt))
                        strbuf_addf(&munged_fmt, "%+05d", tz_offset);
-                       fmt++;
-                       break;
-               case 'Z':
-                       if (suppress_tz_name) {
-                               fmt++;
-                               break;
-                       }
-                       /* FALLTHROUGH */
-               default:
+               else if (suppress_tz_name && skip_prefix(fmt, "Z", &fmt))
+                       ; /* nothing */
+               else
                        strbuf_addch(&munged_fmt, '%');
-               }
        }
        fmt = munged_fmt.buf;
 
@@ -1078,21 +976,6 @@ void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm,
        strbuf_setlen(sb, sb->len + len);
 }
 
-void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
-                                  const struct object_id *oid, int abbrev_len)
-{
-       int r;
-       strbuf_grow(sb, GIT_MAX_HEXSZ + 1);
-       r = repo_find_unique_abbrev_r(repo, sb->buf + sb->len, oid, abbrev_len);
-       strbuf_setlen(sb, sb->len + r);
-}
-
-void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
-                             int abbrev_len)
-{
-       strbuf_repo_add_unique_abbrev(sb, the_repository, oid, abbrev_len);
-}
-
 /*
  * Returns the length of a line, without trailing spaces.
  *
@@ -1122,10 +1005,10 @@ static size_t cleanup(char *line, size_t len)
  *
  * If last line does not have a newline at the end, one is added.
  *
- * Enable skip_comments to skip every line starting with comment
- * character.
+ * Pass a non-NUL comment_line_char to skip every line starting
+ * with it.
  */
-void strbuf_stripspace(struct strbuf *sb, int skip_comments)
+void strbuf_stripspace(struct strbuf *sb, char comment_line_char)
 {
        size_t empties = 0;
        size_t i, j, len, newlen;
@@ -1138,7 +1021,8 @@ void strbuf_stripspace(struct strbuf *sb, int skip_comments)
                eol = memchr(sb->buf + i, '\n', sb->len - i);
                len = eol ? eol - (sb->buf + i) + 1 : sb->len - i;
 
-               if (skip_comments && len && sb->buf[i] == comment_line_char) {
+               if (comment_line_char && len &&
+                   sb->buf[i] == comment_line_char) {
                        newlen = 0;
                        continue;
                }
@@ -1159,54 +1043,6 @@ void strbuf_stripspace(struct strbuf *sb, int skip_comments)
        strbuf_setlen(sb, j);
 }
 
-int strbuf_normalize_path(struct strbuf *src)
-{
-       struct strbuf dst = STRBUF_INIT;
-
-       strbuf_grow(&dst, src->len);
-       if (normalize_path_copy(dst.buf, src->buf) < 0) {
-               strbuf_release(&dst);
-               return -1;
-       }
-
-       /*
-        * normalize_path does not tell us the new length, so we have to
-        * compute it by looking for the new NUL it placed
-        */
-       strbuf_setlen(&dst, strlen(dst.buf));
-       strbuf_swap(src, &dst);
-       strbuf_release(&dst);
-       return 0;
-}
-
-int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
-                             const char *const *env)
-{
-       char *path2 = NULL;
-       int fd, res = 0;
-
-       if (!is_absolute_path(path))
-               path = path2 = xstrdup(git_path("%s", path));
-
-       fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
-       if (fd < 0)
-               res = error_errno(_("could not open '%s' for writing"), path);
-       else if (write_in_full(fd, buffer->buf, buffer->len) < 0) {
-               res = error_errno(_("could not write to '%s'"), path);
-               close(fd);
-       } else if (close(fd) < 0)
-               res = error_errno(_("could not close '%s'"), path);
-       else {
-               strbuf_reset(buffer);
-               if (launch_editor(path, buffer, env) < 0)
-                       res = error_errno(_("could not edit '%s'"), path);
-               unlink(path);
-       }
-
-       free(path2);
-       return res;
-}
-
 void strbuf_strip_file_from_path(struct strbuf *sb)
 {
        char *path_sep = find_last_dir_sep(sb->buf);
index b980f9edc6d9b79dd0319b06d13f9e5165624653..fd43c46433a4b938f3c46a634db740b4c352a475 100644 (file)
--- a/strbuf.h
+++ b/strbuf.h
@@ -1,6 +1,14 @@
 #ifndef STRBUF_H
 #define STRBUF_H
 
+/*
+ * NOTE FOR STRBUF DEVELOPERS
+ *
+ * strbuf is a low-level primitive; as such it should interact only
+ * with other low-level primitives. Do not introduce new functions
+ * which interact with higher-level APIs.
+ */
+
 struct string_list;
 
 /**
@@ -72,10 +80,6 @@ struct strbuf {
 extern char strbuf_slopbuf[];
 #define STRBUF_INIT  { .buf = strbuf_slopbuf }
 
-/*
- * Predeclare this here, since cache.h includes this file before it defines the
- * struct.
- */
 struct object_id;
 
 /**
@@ -283,7 +287,8 @@ void strbuf_splice(struct strbuf *sb, size_t pos, size_t len,
  * by a comment character and a blank.
  */
 void strbuf_add_commented_lines(struct strbuf *out,
-                               const char *buf, size_t size);
+                               const char *buf, size_t size,
+                               char comment_line_char);
 
 
 /**
@@ -318,58 +323,19 @@ const char *strbuf_join_argv(struct strbuf *buf, int argc,
                             const char **argv, char delim);
 
 /**
- * This function can be used to expand a format string containing
- * placeholders. To that end, it parses the string and calls the specified
- * function for every percent sign found.
- *
- * The callback function is given a pointer to the character after the `%`
- * and a pointer to the struct strbuf.  It is expected to add the expanded
- * version of the placeholder to the strbuf, e.g. to add a newline
- * character if the letter `n` appears after a `%`.  The function returns
- * the length of the placeholder recognized and `strbuf_expand()` skips
- * over it.
- *
- * The format `%%` is automatically expanded to a single `%` as a quoting
- * mechanism; callers do not need to handle the `%` placeholder themselves,
- * and the callback function will not be invoked for this placeholder.
- *
- * All other characters (non-percent and not skipped ones) are copied
- * verbatim to the strbuf.  If the callback returned zero, meaning that the
- * placeholder is unknown, then the percent sign is copied, too.
- *
- * In order to facilitate caching and to make it possible to give
- * parameters to the callback, `strbuf_expand()` passes a context
- * pointer with any kind of data.
- */
-typedef size_t (*expand_fn_t) (struct strbuf *sb,
-                              const char *placeholder,
-                              void *context);
-void strbuf_expand(struct strbuf *sb,
-                  const char *format,
-                  expand_fn_t fn,
-                  void *context);
-
-/**
- * Used as callback for `strbuf_expand` to only expand literals
- * (i.e. %n and %xNN). The context argument is ignored.
+ * Used with `strbuf_expand_step` to expand the literals %n and %x
+ * followed by two hexadecimal digits. Returns the number of recognized
+ * characters.
  */
-size_t strbuf_expand_literal_cb(struct strbuf *sb,
-                               const char *placeholder,
-                               void *context);
+size_t strbuf_expand_literal(struct strbuf *sb, const char *placeholder);
 
 /**
- * Used as callback for `strbuf_expand()`, expects an array of
- * struct strbuf_expand_dict_entry as context, i.e. pairs of
- * placeholder and replacement string.  The array needs to be
- * terminated by an entry with placeholder set to NULL.
+ * If the string pointed to by `formatp` contains a percent sign ("%"),
+ * advance it to point to the character following the next one and
+ * return 1, otherwise return 0.  Append the substring before that
+ * percent sign to `sb`, or the whole string if there is none.
  */
-struct strbuf_expand_dict_entry {
-       const char *placeholder;
-       const char *value;
-};
-size_t strbuf_expand_dict_cb(struct strbuf *sb,
-                            const char *placeholder,
-                            void *context);
+int strbuf_expand_step(struct strbuf *sb, const char **formatp);
 
 /**
  * Append the contents of one strbuf to another, quoting any
@@ -412,8 +378,8 @@ void strbuf_addf(struct strbuf *sb, const char *fmt, ...);
  * Add a formatted string prepended by a comment character and a
  * blank to the buffer.
  */
-__attribute__((format (printf, 2, 3)))
-void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...);
+__attribute__((format (printf, 3, 4)))
+void strbuf_commented_addf(struct strbuf *sb, char comment_line_char, const char *fmt, ...);
 
 __attribute__((format (printf,2,0)))
 void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap);
@@ -475,6 +441,18 @@ int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint);
  */
 ssize_t strbuf_write(struct strbuf *sb, FILE *stream);
 
+/**
+ * Read from a FILE * until the specified terminator is encountered,
+ * overwriting the existing contents of the strbuf.
+ *
+ * Reading stops after the terminator or at EOF.  The terminator is
+ * removed from the buffer before returning.  If the terminator is LF
+ * and if it is preceded by a CR, then the whole CRLF is stripped.
+ * Returns 0 unless there was nothing left before EOF, in which case
+ * it returns `EOF`.
+ */
+int strbuf_getdelim_strip_crlf(struct strbuf *sb, FILE *fp, int term);
+
 /**
  * Read a line from a FILE *, overwriting the existing contents of
  * the strbuf.  The strbuf_getline*() family of functions share
@@ -527,28 +505,6 @@ int strbuf_getwholeline_fd(struct strbuf *sb, int fd, int term);
  */
 int strbuf_getcwd(struct strbuf *sb);
 
-/**
- * Add a path to a buffer, converting a relative path to an
- * absolute one in the process.  Symbolic links are not
- * resolved.
- */
-void strbuf_add_absolute_path(struct strbuf *sb, const char *path);
-
-/**
- * Canonize `path` (make it absolute, resolve symlinks, remove extra
- * slashes) and append it to `sb`.  Die with an informative error
- * message if there is a problem.
- *
- * The directory part of `path` (i.e., everything up to the last
- * dir_sep) must denote a valid, existing directory, but the last
- * component need not exist.
- *
- * Callers that don't mind links should use the more lightweight
- * strbuf_add_absolute_path() instead.
- */
-void strbuf_add_real_path(struct strbuf *sb, const char *path);
-
-
 /**
  * Normalize in-place the path contained in the strbuf. See
  * normalize_path_copy() for details. If an error occurs, the contents of "sb"
@@ -557,10 +513,11 @@ void strbuf_add_real_path(struct strbuf *sb, const char *path);
 int strbuf_normalize_path(struct strbuf *sb);
 
 /**
- * Strip whitespace from a buffer. The second parameter controls if
- * comments are considered contents to be removed or not.
+ * Strip whitespace from a buffer. If comment_line_char is non-NUL,
+ * then lines beginning with that character are considered comments,
+ * thus removed.
  */
-void strbuf_stripspace(struct strbuf *buf, int skip_comments);
+void strbuf_stripspace(struct strbuf *buf, char comment_line_char);
 
 static inline int strbuf_strip_suffix(struct strbuf *sb, const char *suffix)
 {
@@ -630,40 +587,6 @@ void strbuf_add_separated_string_list(struct strbuf *str,
  */
 void strbuf_list_free(struct strbuf **list);
 
-/**
- * Add the abbreviation, as generated by repo_find_unique_abbrev(), of `sha1` to
- * the strbuf `sb`.
- */
-struct repository;
-void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
-                                  const struct object_id *oid, int abbrev_len);
-void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
-                             int abbrev_len);
-
-/**
- * Launch the user preferred editor to edit a file and fill the buffer
- * with the file's contents upon the user completing their editing. The
- * third argument can be used to set the environment which the editor is
- * run in. If the buffer is NULL the editor is launched as usual but the
- * file's contents are not read into the buffer upon completion.
- */
-int launch_editor(const char *path, struct strbuf *buffer,
-                 const char *const *env);
-
-int launch_sequence_editor(const char *path, struct strbuf *buffer,
-                          const char *const *env);
-
-/*
- * In contrast to `launch_editor()`, this function writes out the contents
- * of the specified file first, then clears the `buffer`, then launches
- * the editor and reads back in the file contents into the `buffer`.
- * Finally, it deletes the temporary file.
- *
- * If `path` is relative, it refers to a file in the `.git` directory.
- */
-int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
-                             const char *const *env);
-
 /*
  * Remove the filename from the provided path string. If the path
  * contains a trailing separator, then the path is considered a directory
@@ -728,9 +651,6 @@ int strbuf_check_branch_ref(struct strbuf *sb, const char *name);
 
 typedef int (*char_predicate)(char ch);
 
-int is_rfc3986_unreserved(char ch);
-int is_rfc3986_reserved_or_unreserved(char ch);
-
 void strbuf_addstr_urlencode(struct strbuf *sb, const char *name,
                             char_predicate allow_unencoded_fn);
 
@@ -751,4 +671,36 @@ char *xstrvfmt(const char *fmt, va_list ap);
 __attribute__((format (printf, 1, 2)))
 char *xstrfmt(const char *fmt, ...);
 
+int starts_with(const char *str, const char *prefix);
+int istarts_with(const char *str, const char *prefix);
+
+/*
+ * If the string "str" is the same as the string in "prefix", then the "arg"
+ * parameter is set to the "def" parameter and 1 is returned.
+ * If the string "str" begins with the string found in "prefix" and then a
+ * "=" sign, then the "arg" parameter is set to "str + strlen(prefix) + 1"
+ * (i.e., to the point in the string right after the prefix and the "=" sign),
+ * and 1 is returned.
+ *
+ * Otherwise, return 0 and leave "arg" untouched.
+ *
+ * When we accept both a "--key" and a "--key=<val>" option, this function
+ * can be used instead of !strcmp(arg, "--key") and then
+ * skip_prefix(arg, "--key=", &arg) to parse such an option.
+ */
+int skip_to_optional_arg_default(const char *str, const char *prefix,
+                                const char **arg, const char *def);
+
+static inline int skip_to_optional_arg(const char *str, const char *prefix,
+                                      const char **arg)
+{
+       return skip_to_optional_arg_default(str, prefix, arg, "");
+}
+
+static inline int ends_with(const char *str, const char *suffix)
+{
+       size_t len;
+       return strip_suffix(str, suffix, &len);
+}
+
 #endif /* STRBUF_H */
index 024fd796b7d02f48452c6cf541e6ebb2ccdadd74..10adf625b2e7ab23ffde1c8c826f6c10691792d8 100644 (file)
@@ -1,14 +1,15 @@
 /*
  * Copyright (c) 2011, Google Inc.
  */
-#include "cache.h"
+#include "git-compat-util.h"
+#include "convert.h"
 #include "environment.h"
 #include "streaming.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "packfile.h"
-#include "wrapper.h"
 
 typedef int (*open_istream_fn)(struct git_istream *,
                               struct repository *,
index db473f273e1f77c45f2a5b0cf7a70b106bc19d02..954569f381d8d7ea2e1c6f1333b1e8379ffe2fe8 100644 (file)
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "string-list.h"
-#include "alloc.h"
 
 void string_list_init_nodup(struct string_list *list)
 {
@@ -203,6 +202,15 @@ void string_list_clear_func(struct string_list *list, string_list_clear_func_t c
        list->nr = list->alloc = 0;
 }
 
+void string_list_setlen(struct string_list *list, size_t nr)
+{
+       if (list->strdup_strings)
+               BUG("cannot setlen a string_list which owns its entries");
+       if (nr > list->nr)
+               BUG("cannot grow a string_list with setlen");
+       list->nr = nr;
+}
+
 struct string_list_item *string_list_append_nodup(struct string_list *list,
                                                  char *string)
 {
@@ -301,7 +309,7 @@ int string_list_split(struct string_list *list, const char *string,
 }
 
 int string_list_split_in_place(struct string_list *list, char *string,
-                              int delim, int maxsplit)
+                              const char *delim, int maxsplit)
 {
        int count = 0;
        char *p = string, *end;
@@ -315,7 +323,7 @@ int string_list_split_in_place(struct string_list *list, char *string,
                        string_list_append(list, p);
                        return count;
                }
-               end = strchr(p, delim);
+               end = strpbrk(p, delim);
                if (end) {
                        *end = '\0';
                        string_list_append(list, p);
index c7b0d5d0008efb906ba034c632adb69b53c4f545..122b3186419880403da702c928724aaefd8e34f3 100644 (file)
@@ -134,6 +134,16 @@ typedef void (*string_list_clear_func_t)(void *p, const char *str);
 /** Call a custom clear function on each util pointer */
 void string_list_clear_func(struct string_list *list, string_list_clear_func_t clearfunc);
 
+/*
+ * Set the length of a string_list to `nr`, provided that (a) `list`
+ * does not own its own storage, and (b) that `nr` is no larger than
+ * `list->nr`.
+ *
+ * Useful when "shrinking" `list` to write over existing entries that
+ * are no longer used without reallocating.
+ */
+void string_list_setlen(struct string_list *list, size_t nr);
+
 /**
  * Apply `func` to each item. If `func` returns nonzero, the
  * iteration aborts and the return value is propagated.
@@ -270,5 +280,5 @@ int string_list_split(struct string_list *list, const char *string,
  * list->strdup_strings must *not* be set.
  */
 int string_list_split_in_place(struct string_list *list, char *string,
-                              int delim, int maxsplit);
+                              const char *delim, int maxsplit);
 #endif /* STRING_LIST_H */
index 17d54b6c3bc500f7c8f927a702e1ec26ba66b7a1..89dc9e7e753313acbb0a5dc83b7705f3538a4c45 100644 (file)
--- a/strvec.c
+++ b/strvec.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "strvec.h"
-#include "alloc.h"
 #include "hex.h"
 #include "strbuf.h"
 
index ecf0fcf007481806d9e7f63c6d35f0218bca587e..6a48fd12f66f93d132aab6745d67effd482a168f 100644 (file)
@@ -1,16 +1,18 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "path.h"
 #include "repository.h"
 #include "config.h"
 #include "submodule-config.h"
 #include "submodule.h"
 #include "strbuf.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "parse-options.h"
+#include "thread-utils.h"
 #include "tree-walk.h"
 
 /*
@@ -302,9 +304,10 @@ static int parse_fetch_recurse(const char *opt, const char *arg,
        }
 }
 
-int parse_submodule_fetchjobs(const char *var, const char *value)
+int parse_submodule_fetchjobs(const char *var, const char *value,
+                             const struct key_value_info *kvi)
 {
-       int fetchjobs = git_config_int(var, value);
+       int fetchjobs = git_config_int(var, value, kvi);
        if (fetchjobs < 0)
                die(_("negative values not allowed for submodule.fetchJobs"));
        if (!fetchjobs)
@@ -424,7 +427,8 @@ struct parse_config_parameter {
  * config store (.git/config, etc).  Callers are responsible for
  * checking for overrides in the main config store when appropriate.
  */
-static int parse_config(const char *var, const char *value, void *data)
+static int parse_config(const char *var, const char *value,
+                       const struct config_context *ctx UNUSED, void *data)
 {
        struct parse_config_parameter *me = data;
        struct submodule *submodule;
@@ -603,7 +607,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
        parameter.gitmodules_oid = &oid;
        parameter.overwrite = 0;
        git_config_from_mem(parse_config, CONFIG_ORIGIN_SUBMODULE_BLOB, rev.buf,
-                       config, config_size, &parameter, NULL);
+                           config, config_size, &parameter, CONFIG_SCOPE_UNKNOWN, NULL);
        strbuf_release(&rev);
        free(config);
 
@@ -657,7 +661,6 @@ static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void
                        config_source.file = file;
                } else if (repo_get_oid(repo, GITMODULES_INDEX, &oid) >= 0 ||
                           repo_get_oid(repo, GITMODULES_HEAD, &oid) >= 0) {
-                       config_source.repo = repo;
                        config_source.blob = oidstr = xstrdup(oid_to_hex(&oid));
                        if (repo != the_repository)
                                add_submodule_odb_by_path(repo->objects->odb->path);
@@ -665,7 +668,7 @@ static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void
                        goto out;
                }
 
-               config_with_options(fn, data, &config_source, &opts);
+               config_with_options(fn, data, &config_source, repo, &opts);
 
 out:
                free(oidstr);
@@ -673,7 +676,8 @@ out:
        }
 }
 
-static int gitmodules_cb(const char *var, const char *value, void *data)
+static int gitmodules_cb(const char *var, const char *value,
+                        const struct config_context *ctx, void *data)
 {
        struct repository *repo = data;
        struct parse_config_parameter parameter;
@@ -683,7 +687,7 @@ static int gitmodules_cb(const char *var, const char *value, void *data)
        parameter.gitmodules_oid = null_oid();
        parameter.overwrite = 1;
 
-       return parse_config(var, value, &parameter);
+       return parse_config(var, value, ctx, &parameter);
 }
 
 void repo_read_gitmodules(struct repository *repo, int skip_if_read)
@@ -711,7 +715,8 @@ void gitmodules_config_oid(const struct object_id *commit_oid)
 
        if (gitmodule_oid_from_commit(commit_oid, &oid, &rev)) {
                git_config_from_blob_oid(gitmodules_cb, rev.buf,
-                                        the_repository, &oid, the_repository);
+                                        the_repository, &oid, the_repository,
+                                        CONFIG_SCOPE_UNKNOWN);
        }
        strbuf_release(&rev);
 
@@ -800,7 +805,9 @@ void submodule_free(struct repository *r)
                submodule_cache_clear(r->submodule_cache);
 }
 
-static int config_print_callback(const char *var, const char *value, void *cb_data)
+static int config_print_callback(const char *var, const char *value,
+                                const struct config_context *ctx UNUSED,
+                                void *cb_data)
 {
        char *wanted_key = cb_data;
 
@@ -842,13 +849,15 @@ struct fetch_config {
        int *recurse_submodules;
 };
 
-static int gitmodules_fetch_config(const char *var, const char *value, void *cb)
+static int gitmodules_fetch_config(const char *var, const char *value,
+                                  const struct config_context *ctx,
+                                  void *cb)
 {
        struct fetch_config *config = cb;
        if (!strcmp(var, "submodule.fetchjobs")) {
                if (config->max_children)
                        *(config->max_children) =
-                               parse_submodule_fetchjobs(var, value);
+                               parse_submodule_fetchjobs(var, value, ctx->kvi);
                return 0;
        } else if (!strcmp(var, "fetch.recursesubmodules")) {
                if (config->recurse_submodules)
@@ -870,11 +879,12 @@ void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules)
 }
 
 static int gitmodules_update_clone_config(const char *var, const char *value,
+                                         const struct config_context *ctx,
                                          void *cb)
 {
        int *max_jobs = cb;
        if (!strcmp(var, "submodule.fetchjobs"))
-               *max_jobs = parse_submodule_fetchjobs(var, value);
+               *max_jobs = parse_submodule_fetchjobs(var, value, ctx->kvi);
        return 0;
 }
 
index c2045875bbb4caa271e30d8318e8af353c525e37..2a37689cc272e30fa6f5dc9cfbbde044a52068c3 100644 (file)
@@ -50,7 +50,8 @@ struct repository;
 
 void submodule_cache_free(struct submodule_cache *cache);
 
-int parse_submodule_fetchjobs(const char *var, const char *value);
+int parse_submodule_fetchjobs(const char *var, const char *value,
+                             const struct key_value_info *kvi);
 int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg);
 struct option;
 int option_fetch_parse_recurse_submodules(const struct option *opt,
index 94644fac0a39f1bad2af719a01f99b1a551e0e8d..e603a19a876c88c59f18da33caa1541b15ded9f3 100644 (file)
@@ -1,6 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "repository.h"
 #include "config.h"
 #include "submodule-config.h"
 #include "strvec.h"
 #include "blob.h"
 #include "thread-utils.h"
+#include "path.h"
 #include "quote.h"
 #include "remote.h"
 #include "worktree.h"
 #include "parse-options.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "commit-reach.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "shallow.h"
+#include "trace2.h"
 
 static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;
 static int initialized_fetch_ref_tips;
index 27ecc93693b035179bf5cd1d53a5852480f93b39..b29e340c2da43e9ac35adcda05322b1e068017ca 100644 (file)
@@ -1,6 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "setup.h"
+#include "symlinks.h"
 
 static int threaded_check_leading_path(struct cache_def *cache, const char *name,
                                       int len, int warn_on_lstat_err);
diff --git a/symlinks.h b/symlinks.h
new file mode 100644 (file)
index 0000000..7ae3d5b
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef SYMLINKS_H
+#define SYMLINKS_H
+
+#include "strbuf.h"
+
+struct cache_def {
+       struct strbuf path;
+       int flags;
+       int track_flags;
+       int prefix_len_stat_func;
+};
+#define CACHE_DEF_INIT { \
+       .path = STRBUF_INIT, \
+}
+static inline void cache_def_clear(struct cache_def *cache)
+{
+       strbuf_release(&cache->path);
+}
+
+int has_symlink_leading_path(const char *name, int len);
+int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
+int check_leading_path(const char *name, int len, int warn_on_lstat_err);
+int has_dirs_only_path(const char *name, int len, int prefix_len);
+void invalidate_lstat_cache(void);
+void schedule_dir_for_removal(const char *name, int len);
+void remove_scheduled_dirs(void);
+
+#endif /* SYMLINKS_H */
index 9930e283512b663133161fd474fc2101c19ec283..b9cea1795d84e3c4e334a89822e059e8d67512ef 100644 (file)
@@ -22,3 +22,4 @@ t[0-9][0-9][0-9][0-9]/* -whitespace
 /t7500/* eol=lf
 /t8005/*.txt eol=lf
 /t9*/*.dump eol=lf
+/t0040*.sh whitespace=-indent-with-non-tab
index 29576c37488593d79978a50d405e107b25dbcc7c..61080859899bef0de95e04070ab54484bf591345 100644 (file)
--- a/t/README
+++ b/t/README
@@ -442,6 +442,10 @@ GIT_TEST_INDEX_VERSION=<n> exercises the index read/write code path
 for the index version specified.  Can be set to any valid version
 (currently 2, 3, or 4).
 
+GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=<boolean> if enabled will
+use the boundary-based bitmap traversal algorithm. See the documentation
+of `pack.useBitmapBoundaryTraversal` for more details.
+
 GIT_TEST_PACK_SPARSE=<boolean> if disabled will default the pack-objects
 builtin to use the non-sparse object walk. This can still be overridden by
 the --sparse command-line argument.
@@ -475,7 +479,7 @@ GIT_TEST_DEFAULT_HASH=<hash-algo> specifies which hash algorithm to
 use in the test scripts. Recognized values for <hash-algo> are "sha1"
 and "sha256".
 
-GIT_TEST_WRITE_REV_INDEX=<boolean>, when true enables the
+GIT_TEST_NO_WRITE_REV_INDEX=<boolean>, when true disables the
 'pack.writeReverseIndex' setting.
 
 GIT_TEST_SPARSE_INDEX=<boolean>, when true enables index writes to use the
@@ -1098,6 +1102,12 @@ see test-lib-functions.sh for the full list and their options.
    the symbolic link in the file system and a part that does; then only
    the latter part need be protected by a SYMLINKS prerequisite (see below).
 
+ - test_path_is_executable
+
+   This tests whether a file is executable and prints an error message
+   if not. This must be used only under the POSIXPERM prerequisite
+   (see below).
+
  - test_oid_init
 
    This function loads facts and useful object IDs related to the hash
index b35be20cf327249874a48d91681f381f873ad176..5e21e84f3884eb8c787ab82a5d1360d2b7cffb74 100644 (file)
@@ -72,14 +72,30 @@ test_expect_success 'blame 1 author' '
        check_count A 2
 '
 
+test_expect_success 'blame working copy' '
+       test_when_finished "git restore file" &&
+       echo "1A quick brown fox jumps over the" >file &&
+       echo "another lazy dog" >>file &&
+       check_count A 1 "Not Committed Yet" 1
+'
+
 test_expect_success 'blame with --contents' '
        check_count --contents=file A 2
 '
 
+test_expect_success 'blame with --contents in a bare repo' '
+       git clone --bare . bare-contents.git &&
+       (
+               cd bare-contents.git &&
+               echo "1A quick brown fox jumps over the" >contents &&
+               check_count --contents=contents A 1
+       )
+'
+
 test_expect_success 'blame with --contents changed' '
        echo "1A quick brown fox jumps over the" >contents &&
        echo "another lazy dog" >>contents &&
-       check_count --contents=contents A 1 "Not Committed Yet" 1
+       check_count --contents=contents A 1 "External file (--contents)" 1
 '
 
 test_expect_success 'blame in a bare repo without starting commit' '
@@ -109,7 +125,7 @@ test_expect_success 'blame 2 authors' '
 '
 
 test_expect_success 'blame with --contents and revision' '
-       check_count -h testTag --contents=file A 2 "Not Committed Yet" 2
+       check_count -h testTag --contents=file A 2 "External file (--contents)" 2
 '
 
 test_expect_success 'setup B1 lines (branch1)' '
index d2b30d644da54c9da778a15960d3fecca9b927bc..aabe31d724b675e4f69c9f3760bcd0a6e8e9bbad 100644 (file)
@@ -2,6 +2,7 @@
 #include "bloom.h"
 #include "hex.h"
 #include "commit.h"
+#include "repository.h"
 #include "setup.h"
 
 static struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
index cdaf5046f5aa1adeee936c13f7129146dfefe355..e7236392c8132a3720f55148d6c2acbf5de01a41 100644 (file)
@@ -1,11 +1,12 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "gettext.h"
 #include "hex.h"
 #include "tree.h"
 #include "cache-tree.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 
 static char const * const test_cache_tree_usage[] = {
index dc28890a183f1d123b3356131e90fd588aa5a439..0e5538833a8fb58bf5a8f3910af40ff3bfe8c07f 100644 (file)
@@ -94,7 +94,7 @@ int cmd__chmtime(int argc, const char **argv)
        if (timespec_arg(argv[i], &set_time, &set_eq)) {
                ++i;
        } else {
-               if (get == 0) {
+               if (get == 0 && verbose == 0) {
                        fprintf(stderr, "Not a base-10 integer: %s\n", argv[i] + 1);
                        goto usage;
                }
index ad78fc17683d99b53b6ced2e67a72a6387051dbf..ed444ca4c25fbf2c581d5f950609c218b53a341c 100644 (file)
  *
  */
 
-static int iterate_cb(const char *var, const char *value, void *data UNUSED)
+static int iterate_cb(const char *var, const char *value,
+                     const struct config_context *ctx,
+                     void *data UNUSED)
 {
+       const struct key_value_info *kvi = ctx->kvi;
        static int nr;
 
        if (nr++)
@@ -51,26 +54,29 @@ static int iterate_cb(const char *var, const char *value, void *data UNUSED)
 
        printf("key=%s\n", var);
        printf("value=%s\n", value ? value : "(null)");
-       printf("origin=%s\n", current_config_origin_type());
-       printf("name=%s\n", current_config_name());
-       printf("lno=%d\n", current_config_line());
-       printf("scope=%s\n", config_scope_name(current_config_scope()));
+       printf("origin=%s\n", config_origin_type_name(kvi->origin_type));
+       printf("name=%s\n", kvi->filename ? kvi->filename : "");
+       printf("lno=%d\n", kvi->linenr);
+       printf("scope=%s\n", config_scope_name(kvi->scope));
 
        return 0;
 }
 
-static int parse_int_cb(const char *var, const char *value, void *data)
+static int parse_int_cb(const char *var, const char *value,
+                       const struct config_context *ctx, void *data)
 {
        const char *key_to_match = data;
 
        if (!strcmp(key_to_match, var)) {
-               int parsed = git_config_int(value, value);
+               int parsed = git_config_int(value, value, ctx->kvi);
                printf("%d\n", parsed);
        }
        return 0;
 }
 
-static int early_config_cb(const char *var, const char *value, void *vdata)
+static int early_config_cb(const char *var, const char *value,
+                          const struct config_context *ctx UNUSED,
+                          void *vdata)
 {
        const char *key = vdata;
 
@@ -176,7 +182,7 @@ int cmd__config(int argc, const char **argv)
                                goto exit2;
                        }
                }
-               if (!git_configset_get_value(&cs, argv[2], &v)) {
+               if (!git_configset_get_value(&cs, argv[2], &v, NULL)) {
                        if (!v)
                                printf("(NULL)\n");
                        else
index 71a1a5c9b04125933e368cb489f933f3fd8f6cab..e5659df40beb01c9eedbad4d65a0e8ff0a81b1b7 100644 (file)
@@ -27,6 +27,8 @@ static int is_in(const char *s, int ch)
                if (is_in(s, i) != t(i))        \
                        report_error(#t, i);    \
        }                                       \
+       if (t(EOF))                             \
+               report_error(#t, EOF);          \
 }
 
 #define DIGIT "0123456789"
index 2d9232cc68ee12ebcbd8d2ed9c1a81ad67273b6e..0683d46574fa41e6b4186e8ec49d06ce65d93256 100644 (file)
@@ -1,6 +1,6 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "date.h"
+#include "trace.h"
 
 static const char *usage_msg = "\n"
 "  test-tool date relative [time_t]...\n"
index e7d134ec251e01405a6f854bbd496d797980172f..6bc787a4743be08fcd1b977ced58273c3bf274d0 100644 (file)
@@ -11,7 +11,6 @@
 #include "test-tool.h"
 #include "git-compat-util.h"
 #include "delta.h"
-#include "wrapper.h"
 
 static const char usage_str[] =
        "test-tool delta (-d|-p) <from_file> <data_file> <out_file>";
index 2041ca18572e6879ec3f1680d09f0a24830cf804..c38f546e4f096fbd3e9b6cb13ab96bb800f56504 100644 (file)
@@ -1,9 +1,11 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
+#include "hash.h"
 #include "hex.h"
 #include "tree.h"
 #include "cache-tree.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 
 static void dump_one(struct cache_tree *it, const char *pfx, const char *x)
index 7c6f50158bb09462ca94ba37c8c01960e5924af8..4f215fea025290f868defcae8bdca5aeefc627ba 100644 (file)
@@ -1,5 +1,6 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 
 int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
index d1badd711263f9192c72854de6de73dd4bc76a88..f29d18ef9490b7a0dd8fd689082a68b4cd5332b0 100644 (file)
@@ -1,12 +1,13 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "hex.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 #include "split-index.h"
 #include "ewah/ewok.h"
 
-static void show_bit(size_t pos, void *data)
+static void show_bit(size_t pos, void *data UNUSED)
 {
        printf(" %d", (int)pos);
 }
index 9225ced5344ab1c06081e3803b7308c47c86da72..b4af9712fe5f2cfb815e22dc41a588890faecea5 100644 (file)
@@ -1,8 +1,9 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "dir.h"
 #include "hex.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 
 static int compare_untracked(const void *a_, const void *b_)
index 2cf302ffcb3be7d82be344ce276879dded42d81a..2ed910adaa3da3b5db771679ccb1eefb0a8da2f5 100644 (file)
@@ -2,6 +2,7 @@
 #include "git-compat-util.h"
 #include "object.h"
 #include "decorate.h"
+#include "repository.h"
 
 int cmd__example_decorate(int argc UNUSED, const char **argv UNUSED)
 {
index fd48e0ee2c8fdaeec535a5a35b26c36031fe32a6..cac20a72b3fcb52c5ccb66cbbb1679ecb8f39f97 100644 (file)
 
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "cache-tree.h"
 #include "commit.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "merge-ort.h"
+#include "object-name.h"
+#include "read-cache-ll.h"
 #include "refs.h"
 #include "revision.h"
 #include "sequencer.h"
index 14522b4c47469c642d75846be1d7c7db794302ab..8280984d08fe84b23722948709e83252e5d40895 100644 (file)
@@ -4,13 +4,13 @@
  */
 
 #include "test-tool.h"
-#include "cache.h"
 #include "parse-options.h"
 #include "fsmonitor-ipc.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 #include "thread-utils.h"
 #include "trace2.h"
-#include "wrapper.h"
 
 #ifndef HAVE_FSMONITOR_DAEMON_BACKEND
 int cmd__fsmonitor_client(int argc UNUSED, const char **argv UNUSED)
index f40d9ad0c2ddd293f2b1a1e7e142885ede078ae6..b235da594f749b1a6b680d0b674c5bb822b1b978 100644 (file)
@@ -1,5 +1,5 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "hash-ll.h"
 
 #define NUM_SECONDS 3
 
index 36ff07bd4beaefabe5f42d119b0eac26cf3ae8d9..0eb0b3d49cecc57ae08a4760065eb7b530a5f191 100644 (file)
@@ -2,6 +2,7 @@
 #include "git-compat-util.h"
 #include "hashmap.h"
 #include "strbuf.h"
+#include "string-list.h"
 
 struct test_entry
 {
@@ -150,6 +151,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
  */
 int cmd__hashmap(int argc, const char **argv)
 {
+       struct string_list parts = STRING_LIST_INIT_NODUP;
        struct strbuf line = STRBUF_INIT;
        int icase;
        struct hashmap map = HASHMAP_INIT(test_entry_cmp, &icase);
@@ -159,21 +161,26 @@ int cmd__hashmap(int argc, const char **argv)
 
        /* process commands from stdin */
        while (strbuf_getline(&line, stdin) != EOF) {
-               char *cmd, *p1 = NULL, *p2 = NULL;
+               char *cmd, *p1, *p2;
                unsigned int hash = 0;
                struct test_entry *entry;
 
                /* break line into command and up to two parameters */
-               cmd = strtok(line.buf, DELIM);
+               string_list_setlen(&parts, 0);
+               string_list_split_in_place(&parts, line.buf, DELIM, 2);
+               string_list_remove_empty_items(&parts, 0);
+
                /* ignore empty lines */
-               if (!cmd || *cmd == '#')
+               if (!parts.nr)
+                       continue;
+               if (!*parts.items[0].string || *parts.items[0].string == '#')
                        continue;
 
-               p1 = strtok(NULL, DELIM);
-               if (p1) {
+               cmd = parts.items[0].string;
+               p1 = parts.nr >= 1 ? parts.items[1].string : NULL;
+               p2 = parts.nr >= 2 ? parts.items[2].string : NULL;
+               if (p1)
                        hash = icase ? strihash(p1) : strhash(p1);
-                       p2 = strtok(NULL, DELIM);
-               }
 
                if (!strcmp("add", cmd) && p1 && p2) {
 
@@ -260,6 +267,7 @@ int cmd__hashmap(int argc, const char **argv)
                }
        }
 
+       string_list_clear(&parts, 0);
        strbuf_release(&line);
        hashmap_clear_and_free(&map, struct test_entry, ent);
        return 0;
index a06c45c1f8477724125fe612dffaa85816f4b02f..f3c2dbe0a2ca512beff2821715d65bd625b3126a 100644 (file)
@@ -1,5 +1,5 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "read-cache-ll.h"
 
 int cmd__index_version(int argc UNUSED, const char **argv UNUSED)
 {
index 86887f53203c0d7c1c7b9dd5b71ae78cb156b390..afe393f5974131b390f2eca932960cbd962f0b6d 100644 (file)
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "json-writer.h"
+#include "string-list.h"
 
 static const char *expect_obj1 = "{\"a\":\"abc\",\"b\":42,\"c\":true}";
 static const char *expect_obj2 = "{\"a\":-1,\"b\":2147483647,\"c\":0}";
@@ -394,35 +395,41 @@ static int unit_tests(void)
        return 0;
 }
 
-static void get_s(int line_nr, char **s_in)
+struct line {
+       struct string_list *parts;
+       size_t consumed_nr;
+       int nr;
+};
+
+static void get_s(struct line *line, char **s_in)
 {
-       *s_in = strtok(NULL, " ");
-       if (!*s_in)
-               die("line[%d]: expected: <s>", line_nr);
+       if (line->consumed_nr > line->parts->nr)
+               die("line[%d]: expected: <s>", line->nr);
+       *s_in = line->parts->items[line->consumed_nr++].string;
 }
 
-static void get_i(int line_nr, intmax_t *s_in)
+static void get_i(struct line *line, intmax_t *s_in)
 {
        char *s;
        char *endptr;
 
-       get_s(line_nr, &s);
+       get_s(line, &s);
 
        *s_in = strtol(s, &endptr, 10);
        if (*endptr || errno == ERANGE)
-               die("line[%d]: invalid integer value", line_nr);
+               die("line[%d]: invalid integer value", line->nr);
 }
 
-static void get_d(int line_nr, double *s_in)
+static void get_d(struct line *line, double *s_in)
 {
        char *s;
        char *endptr;
 
-       get_s(line_nr, &s);
+       get_s(line, &s);
 
        *s_in = strtod(s, &endptr);
        if (*endptr || errno == ERANGE)
-               die("line[%d]: invalid float value", line_nr);
+               die("line[%d]: invalid float value", line->nr);
 }
 
 static int pretty;
@@ -453,6 +460,7 @@ static char *get_trimmed_line(char *buf, int buf_size)
 
 static int scripted(void)
 {
+       struct string_list parts = STRING_LIST_INIT_NODUP;
        struct json_writer jw = JSON_WRITER_INIT;
        char buf[MAX_LINE_LENGTH];
        char *line;
@@ -470,66 +478,77 @@ static int scripted(void)
                die("expected first line to be 'object' or 'array'");
 
        while ((line = get_trimmed_line(buf, MAX_LINE_LENGTH)) != NULL) {
+               struct line state = { 0 };
                char *verb;
                char *key;
                char *s_value;
                intmax_t i_value;
                double d_value;
 
-               line_nr++;
+               state.parts = &parts;
+               state.nr = ++line_nr;
+
+               /* break line into command and zero or more tokens */
+               string_list_setlen(&parts, 0);
+               string_list_split_in_place(&parts, line, " ", -1);
+               string_list_remove_empty_items(&parts, 0);
+
+               /* ignore empty lines */
+               if (!parts.nr || !*parts.items[0].string)
+                       continue;
 
-               verb = strtok(line, " ");
+               verb = parts.items[state.consumed_nr++].string;
 
                if (!strcmp(verb, "end")) {
                        jw_end(&jw);
                }
                else if (!strcmp(verb, "object-string")) {
-                       get_s(line_nr, &key);
-                       get_s(line_nr, &s_value);
+                       get_s(&state, &key);
+                       get_s(&state, &s_value);
                        jw_object_string(&jw, key, s_value);
                }
                else if (!strcmp(verb, "object-int")) {
-                       get_s(line_nr, &key);
-                       get_i(line_nr, &i_value);
+                       get_s(&state, &key);
+                       get_i(&state, &i_value);
                        jw_object_intmax(&jw, key, i_value);
                }
                else if (!strcmp(verb, "object-double")) {
-                       get_s(line_nr, &key);
-                       get_i(line_nr, &i_value);
-                       get_d(line_nr, &d_value);
+                       get_s(&state, &key);
+                       get_i(&state, &i_value);
+                       get_d(&state, &d_value);
                        jw_object_double(&jw, key, i_value, d_value);
                }
                else if (!strcmp(verb, "object-true")) {
-                       get_s(line_nr, &key);
+                       get_s(&state, &key);
                        jw_object_true(&jw, key);
                }
                else if (!strcmp(verb, "object-false")) {
-                       get_s(line_nr, &key);
+                       get_s(&state, &key);
                        jw_object_false(&jw, key);
                }
                else if (!strcmp(verb, "object-null")) {
-                       get_s(line_nr, &key);
+                       get_s(&state, &key);
                        jw_object_null(&jw, key);
                }
                else if (!strcmp(verb, "object-object")) {
-                       get_s(line_nr, &key);
+                       get_s(&state, &key);
                        jw_object_inline_begin_object(&jw, key);
                }
                else if (!strcmp(verb, "object-array")) {
-                       get_s(line_nr, &key);
+                       get_s(&state, &key);
                        jw_object_inline_begin_array(&jw, key);
                }
                else if (!strcmp(verb, "array-string")) {
-                       get_s(line_nr, &s_value);
+                       get_s(&state, &s_value);
                        jw_array_string(&jw, s_value);
                }
                else if (!strcmp(verb, "array-int")) {
-                       get_i(line_nr, &i_value);
+                       get_i(&state, &i_value);
                        jw_array_intmax(&jw, i_value);
                }
                else if (!strcmp(verb, "array-double")) {
-                       get_i(line_nr, &i_value);
-                       get_d(line_nr, &d_value);
+                       get_i(&state, &i_value);
+                       get_d(&state, &d_value);
                        jw_array_double(&jw, i_value, d_value);
                }
                else if (!strcmp(verb, "array-true"))
@@ -552,6 +571,7 @@ static int scripted(void)
        printf("%s\n", jw.json.buf);
 
        jw_release(&jw);
+       string_list_clear(&parts, 0);
        return 0;
 }
 
index 06ce3a47ccfbfd3e33bb6bbacf796253c3da365f..187a115d5743f39f7b93e0bf128ead62262a12bb 100644 (file)
@@ -1,9 +1,12 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "environment.h"
+#include "name-hash.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
+#include "trace.h"
 
 static int single;
 static int multi;
index 508eb7066ad278fdb925788e9262f5a554f682db..d0db5ff26f0772373b5ccba7ad0aa89df01548ff 100644 (file)
@@ -1,6 +1,8 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hex.h"
+#include "match-trees.h"
+#include "object-name.h"
+#include "repository.h"
 #include "setup.h"
 #include "tree.h"
 
index 335e5bb3a9008c8ce1cb31198bd54808c70566dc..42ccc8705167b07266a5c3902fba7cb7a8081c64 100644 (file)
@@ -1,6 +1,7 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "mem-pool.h"
 #include "mergesort.h"
+#include "strbuf.h"
 
 static uint32_t minstd_rand(uint32_t *state)
 {
index 30e1947b90fa665e5c764a2f8979c74a7a32169d..aafe398ef07e538ef774fedc72cd27189391f2fb 100644 (file)
@@ -1,10 +1,10 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hex.h"
 #include "oid-array.h"
 #include "setup.h"
+#include "strbuf.h"
 
-static int print_oid(const struct object_id *oid, void *data)
+static int print_oid(const struct object_id *oid, void *data UNUSED)
 {
        puts(oid_to_hex(oid));
        return 0;
index a7b7b38df1f7641e3cf644f01c36db89ca0ce2c4..bd30244a54cc88370ab27da5d25108b78c296f85 100644 (file)
@@ -1,9 +1,11 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hex.h"
+#include "object-name.h"
 #include "oidmap.h"
+#include "repository.h"
 #include "setup.h"
 #include "strbuf.h"
+#include "string-list.h"
 
 /* key is an oid and value is a name (could be a refname for example) */
 struct test_entry {
@@ -25,6 +27,7 @@ struct test_entry {
  */
 int cmd__oidmap(int argc UNUSED, const char **argv UNUSED)
 {
+       struct string_list parts = STRING_LIST_INIT_NODUP;
        struct strbuf line = STRBUF_INIT;
        struct oidmap map = OIDMAP_INIT;
 
@@ -35,19 +38,24 @@ int cmd__oidmap(int argc UNUSED, const char **argv UNUSED)
 
        /* process commands from stdin */
        while (strbuf_getline(&line, stdin) != EOF) {
-               char *cmd, *p1 = NULL, *p2 = NULL;
+               char *cmd, *p1, *p2;
                struct test_entry *entry;
                struct object_id oid;
 
                /* break line into command and up to two parameters */
-               cmd = strtok(line.buf, DELIM);
+               string_list_setlen(&parts, 0);
+               string_list_split_in_place(&parts, line.buf, DELIM, 2);
+               string_list_remove_empty_items(&parts, 0);
+
                /* ignore empty lines */
-               if (!cmd || *cmd == '#')
+               if (!parts.nr)
+                       continue;
+               if (!*parts.items[0].string || *parts.items[0].string == '#')
                        continue;
 
-               p1 = strtok(NULL, DELIM);
-               if (p1)
-                       p2 = strtok(NULL, DELIM);
+               cmd = parts.items[0].string;
+               p1 = parts.nr >= 1 ? parts.items[1].string : NULL;
+               p2 = parts.nr >= 2 ? parts.items[2].string : NULL;
 
                if (!strcmp("put", cmd) && p1 && p2) {
 
@@ -108,6 +116,7 @@ int cmd__oidmap(int argc UNUSED, const char **argv UNUSED)
                }
        }
 
+       string_list_clear(&parts, 0);
        strbuf_release(&line);
        oidmap_free(&map, 1);
        return 0;
index 5b98f2f70ad94d87a7edff9d45ac449ecf71767b..c7a1d4c6420118e06923b2aa0f28cc6f8e983edc 100644 (file)
@@ -1,8 +1,8 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hex.h"
 #include "oidtree.h"
 #include "setup.h"
+#include "strbuf.h"
 
 static enum cb_next print_oid(const struct object_id *oid, void *data UNUSED)
 {
index 0f3fbeec5325922a83e0d15382b940e6afddcb51..67a964ef9041a061497c0b10698413d360f561e1 100644 (file)
@@ -1,7 +1,7 @@
 #include "test-tool.h"
 #include "hex.h"
 #include "strbuf.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 #include "pack-mtimes.h"
 #include "setup.h"
index b66039e57519980de76c0b204c74286a3bd600a7..a4f6e24b0c6e1bf6557803921b5e9b21853791a3 100644 (file)
@@ -1,6 +1,6 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "parse-options.h"
+#include "strbuf.h"
 #include "string-list.h"
 #include "trace2.h"
 
@@ -133,6 +133,8 @@ int cmd__parse_options(int argc, const char **argv)
                OPT_STRING(0, "st", &string, "st", "get another string (pervert ordering)"),
                OPT_STRING('o', NULL, &string, "str", "get another string"),
                OPT_NOOP_NOARG(0, "obsolete"),
+               OPT_SET_INT_F(0, "longhelp", &integer, "help text of this entry\n"
+                             "spans multiple lines", 0, PARSE_OPT_NONEG),
                OPT_STRING_LIST(0, "list", &list, "str", "add str to list"),
                OPT_GROUP("Magic arguments"),
                OPT_NUMBER_CALLBACK(&integer, "set integer to NUM",
index 362bd64a4c21a632e27a53a4154355803400a9de..910a12861442264ca951a1a2ef27e6fb20eb7985 100644 (file)
@@ -1,7 +1,7 @@
 #include "test-tool.h"
 #include "hex.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "setup.h"
 
 /*
index 4f5ac2fadce3d940241c7f8b3fc529bc3318ec71..70396fa38454e86d661b9a4857e3ef463ee40f63 100644 (file)
@@ -1,9 +1,11 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "abspath.h"
 #include "environment.h"
+#include "path.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "string-list.h"
+#include "trace.h"
 #include "utf8.h"
 
 /*
index b0deaa106a288cf57b10d8e818a575c40eb9fdf4..3e173399a00f5296a70aa293107dfb4db94b1633 100644 (file)
@@ -1,11 +1,10 @@
 #include "test-tool.h"
-#include "cache.h"
-#include "alloc.h"
 #include "commit.h"
 #include "commit-reach.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "ref-filter.h"
 #include "setup.h"
@@ -139,7 +138,7 @@ int cmd__reach(int ac, const char **av)
 
                printf("%s(X,_,_,0,0):%d\n", av[1], can_all_from_reach_with_flag(&X_obj, 2, 4, 0, 0));
        } else if (!strcmp(av[1], "commit_contains")) {
-               struct ref_filter filter;
+               struct ref_filter filter = REF_FILTER_INIT;
                struct contains_cache cache;
                init_contains_cache(&cache);
 
index a4c24d0e4215f6bec167b61125bc8629bbc774a0..1acd3623465283e4751a75bce0cbb8bf1926bcd7 100644 (file)
@@ -1,9 +1,9 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "config.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
-#include "wrapper.h"
 
 int cmd__read_cache(int argc, const char **argv)
 {
index 3ac496e27e497df4d3ba800409c0117fbb8ded1f..8c7a83f578f41c3d90bcb17628bd5307e5927636 100644 (file)
@@ -1,7 +1,7 @@
 #include "test-tool.h"
 #include "commit-graph.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "bloom.h"
 #include "setup.h"
 
index 05c4f2b2625b8b634e859ff975de99621ec92026..e9a444ddba55b49c9c47ceb3b27a31d3e022a8dc 100644 (file)
@@ -1,10 +1,10 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hex.h"
 #include "midx.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pack-bitmap.h"
+#include "packfile.h"
 #include "setup.h"
 
 static int read_midx_file(const char *object_dir, int show_objects)
index 6d8f844e9c7dc4889d6670e86a26fcb59f87bbb1..48552e6a9e0049365185499c02d9b1c7d1069d0c 100644 (file)
@@ -3,8 +3,11 @@
 #include "refs.h"
 #include "setup.h"
 #include "worktree.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "path.h"
 #include "repository.h"
+#include "strbuf.h"
+#include "revision.h"
 
 struct flag_definition {
        const char *name;
@@ -116,8 +119,16 @@ static struct flag_definition pack_flags[] = { FLAG_DEF(PACK_REFS_PRUNE),
 static int cmd_pack_refs(struct ref_store *refs, const char **argv)
 {
        unsigned int flags = arg_flags(*argv++, "flags", pack_flags);
+       static struct ref_exclusions exclusions = REF_EXCLUSIONS_INIT;
+       static struct string_list included_refs = STRING_LIST_INIT_NODUP;
+       struct pack_refs_opts pack_opts = { .flags = flags,
+                                           .exclusions = &exclusions,
+                                           .includes = &included_refs };
 
-       return refs_pack_refs(refs, flags);
+       if (pack_opts.flags & PACK_REFS_ALL)
+               string_list_append(pack_opts.includes, "*");
+
+       return refs_pack_refs(refs, &pack_opts);
 }
 
 static int cmd_create_symref(struct ref_store *refs, const char **argv)
@@ -175,6 +186,15 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)
        return refs_for_each_ref_in(refs, prefix, each_ref, NULL);
 }
 
+static int cmd_for_each_ref__exclude(struct ref_store *refs, const char **argv)
+{
+       const char *prefix = notnull(*argv++, "prefix");
+       const char **exclude_patterns = argv;
+
+       return refs_for_each_fullref_in(refs, prefix, exclude_patterns, each_ref,
+                                       NULL);
+}
+
 static int cmd_resolve_ref(struct ref_store *refs, const char **argv)
 {
        struct object_id oid = *null_oid();
@@ -257,11 +277,6 @@ static int cmd_delete_reflog(struct ref_store *refs, const char **argv)
        return refs_delete_reflog(refs, refname);
 }
 
-static int cmd_reflog_expire(struct ref_store *refs, const char **argv)
-{
-       die("not supported yet");
-}
-
 static int cmd_delete_ref(struct ref_store *refs, const char **argv)
 {
        const char *msg = notnull(*argv++, "msg");
@@ -307,6 +322,7 @@ static struct command commands[] = {
        { "delete-refs", cmd_delete_refs },
        { "rename-ref", cmd_rename_ref },
        { "for-each-ref", cmd_for_each_ref },
+       { "for-each-ref--exclude", cmd_for_each_ref__exclude },
        { "resolve-ref", cmd_resolve_ref },
        { "verify-ref", cmd_verify_ref },
        { "for-each-reflog", cmd_for_each_reflog },
@@ -315,7 +331,6 @@ static struct command commands[] = {
        { "reflog-exists", cmd_reflog_exists },
        { "create-reflog", cmd_create_reflog },
        { "delete-reflog", cmd_delete_reflog },
-       { "reflog-expire", cmd_reflog_expire },
        /*
         * backend transaction functions can't be tested separately
         */
index 1f0a28cbb64de427ff8d8c542e0b1166250093e2..00237ef0d9e08fb9747010891b64d1d5ca421a29 100644 (file)
@@ -1,3 +1,4 @@
+#include "reftable/system.h"
 #include "reftable/reftable-tests.h"
 #include "test-tool.h"
 
index bafd2a5bf95b3e31cab6397d623329e835f5e0fc..4cd8a952e5c6f55fbb3cfdbffe8c3be07bf008d7 100644 (file)
@@ -4,7 +4,7 @@
 #include "config.h"
 #include "environment.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "repository.h"
 #include "setup.h"
index 0c62b9de1850b1409313395df3a76f8d591bf910..f346951bc28c99e4791d841fac0d873a128cc973 100644 (file)
@@ -11,6 +11,7 @@
 #include "test-tool.h"
 #include "commit.h"
 #include "diff.h"
+#include "repository.h"
 #include "revision.h"
 #include "setup.h"
 
index 3fecd06d17052b64d05739decf2720dc0754e3f2..0a816a96e28b6c43a0b4927418c97bb11ba5298c 100644 (file)
@@ -1,7 +1,8 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "lockfile.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 #include "tree.h"
 #include "cache-tree.h"
index 71fe5c61455a89eddd6363a87e3c4eb7968f09b6..dcb7f6c0032b556959c6635db3c89fd49e8790d0 100644 (file)
@@ -1,5 +1,5 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "hash-ll.h"
 
 int cmd__sha1(int ac, const char **av)
 {
index 0ac6a99d5f2a38d89317564185e91ee5126fd3ac..08cf14900140d37733e5afcad7c9fdc97c3b7eae 100644 (file)
@@ -1,5 +1,5 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "hash-ll.h"
 
 int cmd__sha256(int ac, const char **av)
 {
index 96b9a5b5291a637a7effff289ecf1d96860e6c24..d8473cf2fcfeb61bdbced865455dd2e3a35b71bb 100644 (file)
@@ -1,5 +1,5 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "read-cache-ll.h"
 
 int cmd__strcmp_offset(int argc UNUSED, const char **argv)
 {
index 2123dda85bf10033dcbf0d801028b3705e73a507..e2aad611d1c8bbc110c877c7d7555c046b82e7db 100644 (file)
@@ -1,5 +1,5 @@
 #include "test-tool.h"
-#include "cache.h"
+#include "strbuf.h"
 #include "string-list.h"
 
 /*
@@ -62,7 +62,7 @@ int cmd__string_list(int argc, const char **argv)
                struct string_list list = STRING_LIST_INIT_NODUP;
                int i;
                char *s = xstrdup(argv[2]);
-               int delim = *argv[3];
+               const char *delim = argv[3];
                int maxsplit = atoi(argv[4]);
 
                i = string_list_split_in_place(&list, s, delim, maxsplit);
@@ -111,7 +111,7 @@ int cmd__string_list(int argc, const char **argv)
                 */
                if (sb.len && sb.buf[sb.len - 1] == '\n')
                        strbuf_setlen(&sb, sb.len - 1);
-               string_list_split_in_place(&list, sb.buf, '\n', -1);
+               string_list_split_in_place(&list, sb.buf, "\n", -1);
 
                string_list_sort(&list);
 
index 40a6ee45af0597e565fa43b59b1bdd33d4807daf..9df2f03ac80de2b9cf977b0d7e252eb904c903f3 100644 (file)
@@ -1,6 +1,8 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "config.h"
+#include "hash.h"
+#include "object-name.h"
+#include "repository.h"
 #include "setup.h"
 #include "submodule-config.h"
 #include "submodule.h"
index d31f5e48ab58ee99ca44e27d9f3249aba68ef879..ecd40ded995c0f88b2b58de0d08fd2a1831fca26 100644 (file)
@@ -1,4 +1,5 @@
 #include "test-tool.h"
+#include "repository.h"
 #include "setup.h"
 #include "submodule-config.h"
 
index 7cbd59922a9db11f1275679f73827ea9f3adef15..356e0a26c5a0b87714d76f608a917807f69599f5 100644 (file)
@@ -2,6 +2,7 @@
 #include "test-tool-utils.h"
 #include "parse-options.h"
 #include "remote.h"
+#include "repository.h"
 #include "setup.h"
 #include "submodule-config.h"
 #include "submodule.h"
index 98f071452a4b9edd18ee2592bb24abef77ea9c40..20c7495f38593550a8a4dd35a957cc62cf3a2ded 100644 (file)
@@ -3,6 +3,7 @@
 #include "run-command.h"
 #include "exec-cmd.h"
 #include "config.h"
+#include "repository.h"
 #include "trace2.h"
 
 typedef int(fn_unit_test)(int argc, const char **argv);
index 680124a676087c65606ca6b750cd3f63c7cd44b0..0ce31ce59f54fe972b2d8c1fd16af6bb5a2c24fd 100644 (file)
@@ -12,7 +12,9 @@ static int driver_cb(struct userdiff_driver *driver,
        return 0;
 }
 
-static int cmd__userdiff_config(const char *var, const char *value, void *cb UNUSED)
+static int cmd__userdiff_config(const char *var, const char *value,
+                               const struct config_context *ctx UNUSED,
+                               void *cb UNUSED)
 {
        if (userdiff_config(var, value) < 0)
                return -1;
index a95bb4da9b174e547b41eb2c57dee9fd9273c5ea..b4ff5f986ae00b099ead5d75e5e8b196de88f67c 100644 (file)
@@ -1,4 +1,5 @@
 #include "test-tool.h"
+#include "wildmatch.h"
 
 int cmd__wildmatch(int argc, const char **argv)
 {
index a93417ed3a97c8a027e49dd6e2b6851295227dd0..f084034d38e0328e0792d096225c31ddd91d74c7 100644 (file)
@@ -1,7 +1,8 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "lockfile.h"
+#include "read-cache-ll.h"
+#include "repository.h"
 #include "setup.h"
 
 int cmd__write_cache(int argc, const char **argv)
index 5d79e1a4e967619125a06ae1a2ecf38c0fe3fcab..89b26676fbb94b0b4f570ec9a51ca74cce7620c5 100755 (executable)
@@ -14,24 +14,37 @@ graph_git_two_modes() {
        test_cmp expect output
 }
 
+# graph_git_behavior <name> <directory> <branch> <compare>
+#
+# Ensures that a handful of traversal operations produce the same
+# results with and without the commit-graph in use.
+#
+# NOTE: it is a bug to call this function with <directory> containing
+# any characters in $IFS.
 graph_git_behavior() {
        MSG=$1
        DIR=$2
        BRANCH=$3
        COMPARE=$4
        test_expect_success "check normal git operations: $MSG" '
-               cd "$TRASH_DIRECTORY/$DIR" &&
-               graph_git_two_modes "log --oneline $BRANCH" &&
-               graph_git_two_modes "log --topo-order $BRANCH" &&
-               graph_git_two_modes "log --graph $COMPARE..$BRANCH" &&
-               graph_git_two_modes "branch -vv" &&
-               graph_git_two_modes "merge-base -a $BRANCH $COMPARE"
+               graph_git_two_modes "${DIR:+-C $DIR} log --oneline $BRANCH" &&
+               graph_git_two_modes "${DIR:+-C $DIR} log --topo-order $BRANCH" &&
+               graph_git_two_modes "${DIR:+-C $DIR} log --graph $COMPARE..$BRANCH" &&
+               graph_git_two_modes "${DIR:+-C $DIR} branch -vv" &&
+               graph_git_two_modes "${DIR:+-C $DIR} merge-base -a $BRANCH $COMPARE"
        '
 }
 
 graph_read_expect() {
        OPTIONAL=""
        NUM_CHUNKS=3
+       DIR="."
+       if test "$1" = -C
+       then
+               shift
+               DIR="$1"
+               shift
+       fi
        if test -n "$2"
        then
                OPTIONAL=" $2"
@@ -47,12 +60,15 @@ graph_read_expect() {
        then
                OPTIONS=" read_generation_data"
        fi
-       cat >expect <<- EOF
+       cat >"$DIR/expect" <<-EOF
        header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
        num_commits: $1
        chunks: oid_fanout oid_lookup commit_metadata$OPTIONAL
        options:$OPTIONS
        EOF
-       test-tool read-graph >output &&
-       test_cmp expect output
+       (
+               cd "$DIR" &&
+               test-tool read-graph >output &&
+               test_cmp expect output
+       )
 }
index 5ea8bc9f1dcfe644da4b9ce720f2a523ff172475..032b2d8fcc48aa2cd72c60fa05f9b1299680f92c 100644 (file)
@@ -43,6 +43,11 @@ helper_test_clean() {
        reject $1 https example.com store-user
        reject $1 https example.com user1
        reject $1 https example.com user2
+       reject $1 https example.com user4
+       reject $1 https example.com user-distinct-pass
+       reject $1 https example.com user-overwrite
+       reject $1 https example.com user-erase1
+       reject $1 https example.com user-erase2
        reject $1 http path.tld user
        reject $1 https timeout.tld user
        reject $1 https sso.tld
@@ -166,6 +171,49 @@ helper_test() {
                EOF
        '
 
+       test_expect_success "helper ($HELPER) overwrites on store" '
+               check approve $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-overwrite
+               password=pass1
+               EOF
+               check approve $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-overwrite
+               password=pass2
+               EOF
+               check fill $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-overwrite
+               --
+               protocol=https
+               host=example.com
+               username=user-overwrite
+               password=pass2
+               EOF
+               check reject $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-overwrite
+               password=pass2
+               EOF
+               check fill $HELPER <<-\EOF
+               protocol=https
+               host=example.com
+               username=user-overwrite
+               --
+               protocol=https
+               host=example.com
+               username=user-overwrite
+               password=askpass-password
+               --
+               askpass: Password for '\''https://user-overwrite@example.com'\'':
+               EOF
+       '
+
        test_expect_success "helper ($HELPER) can forget host" '
                check reject $HELPER <<-\EOF &&
                protocol=https
@@ -220,6 +268,31 @@ helper_test() {
                EOF
        '
 
+       test_expect_success "helper ($HELPER) does not erase a password distinct from input" '
+               check approve $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-distinct-pass
+               password=pass1
+               EOF
+               check reject $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-distinct-pass
+               password=pass2
+               EOF
+               check fill $HELPER <<-\EOF
+               protocol=https
+               host=example.com
+               username=user-distinct-pass
+               --
+               protocol=https
+               host=example.com
+               username=user-distinct-pass
+               password=pass1
+               EOF
+       '
+
        test_expect_success "helper ($HELPER) can forget user" '
                check reject $HELPER <<-\EOF &&
                protocol=https
@@ -270,6 +343,66 @@ helper_test() {
                password=
                EOF
        '
+
+       test_expect_success "helper ($HELPER) erases all matching credentials" '
+               check approve $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-erase1
+               password=pass1
+               EOF
+               check approve $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               username=user-erase2
+               password=pass1
+               EOF
+               check reject $HELPER <<-\EOF &&
+               protocol=https
+               host=example.com
+               EOF
+               check fill $HELPER <<-\EOF
+               protocol=https
+               host=example.com
+               --
+               protocol=https
+               host=example.com
+               username=askpass-username
+               password=askpass-password
+               --
+               askpass: Username for '\''https://example.com'\'':
+               askpass: Password for '\''https://askpass-username@example.com'\'':
+               EOF
+       '
+
+       : ${GIT_TEST_LONG_CRED_BUFFER:=1024}
+       # 23 bytes accounts for "wwwauth[]=basic realm=" plus NUL
+       LONG_VALUE_LEN=$((GIT_TEST_LONG_CRED_BUFFER - 23))
+       LONG_VALUE=$(perl -e 'print "a" x shift' $LONG_VALUE_LEN)
+
+       test_expect_success "helper ($HELPER) not confused by long header" '
+               check approve $HELPER <<-\EOF &&
+               protocol=https
+               host=victim.example.com
+               username=user
+               password=to-be-stolen
+               EOF
+
+               check fill $HELPER <<-EOF
+               protocol=https
+               host=badguy.example.com
+               wwwauth[]=basic realm=${LONG_VALUE}host=victim.example.com
+               --
+               protocol=https
+               host=badguy.example.com
+               username=askpass-username
+               password=askpass-password
+               wwwauth[]=basic realm=${LONG_VALUE}host=victim.example.com
+               --
+               askpass: Username for '\''https://badguy.example.com'\'':
+               askpass: Password for '\''https://askpass-username@badguy.example.com'\'':
+               EOF
+       '
 }
 
 helper_test_timeout() {
@@ -298,6 +431,35 @@ helper_test_timeout() {
        '
 }
 
+helper_test_oauth_refresh_token() {
+       HELPER=$1
+
+       test_expect_success "helper ($HELPER) stores oauth_refresh_token" '
+               check approve $HELPER <<-\EOF
+               protocol=https
+               host=example.com
+               username=user4
+               password=pass
+               oauth_refresh_token=xyzzy
+               EOF
+       '
+
+       test_expect_success "helper ($HELPER) gets oauth_refresh_token" '
+               check fill $HELPER <<-\EOF
+               protocol=https
+               host=example.com
+               username=user4
+               --
+               protocol=https
+               host=example.com
+               username=user4
+               password=pass
+               oauth_refresh_token=xyzzy
+               --
+               EOF
+       '
+}
+
 write_script askpass <<\EOF
 echo >&2 askpass: $*
 what=$(echo $1 | cut -d" " -f1 | tr A-Z a-z | tr -cd a-z)
index a8f5d3274a5a6007ca9acb3317752c6c1c7982a0..c4dc2d46dc1ef4d3c95bda858d208045ded864c2 100644 (file)
@@ -112,15 +112,36 @@ EOF
 
        STRATEGY=$1
 
-       test_expect_success "$STRATEGY diff from attributes" '
+       test_expect_success "setup attributes files for tests with $STRATEGY" '
+               git checkout -b master &&
                echo "file* diff=driver" >.gitattributes &&
-               git config diff.driver.algorithm "$STRATEGY" &&
-               test_must_fail git diff --no-index file1 file2 > output &&
-               cat expect &&
-               cat output &&
+               git add file1 file2 .gitattributes &&
+               git commit -m "adding files" &&
+               git checkout -b branchA &&
+               echo "file* diff=driverA" >.gitattributes &&
+               git add .gitattributes &&
+               git commit -m "adding driverA as diff driver" &&
+               git checkout master &&
+               git clone --bare --no-local . bare.git
+       '
+
+       test_expect_success "$STRATEGY diff from attributes" '
+               test_must_fail git -c diff.driver.algorithm=$STRATEGY diff --no-index file1 file2 > output &&
                test_cmp expect output
        '
 
+       test_expect_success "diff from attributes with bare repo with source" '
+               git -C bare.git --attr-source=branchA -c diff.driver.algorithm=myers \
+                       -c diff.driverA.algorithm=$STRATEGY \
+                       diff HEAD:file1 HEAD:file2 >output &&
+               test_cmp expect output
+       '
+
+       test_expect_success "diff from attributes with bare repo with invalid source" '
+               test_must_fail git -C bare.git --attr-source=invalid-branch diff \
+                       HEAD:file1 HEAD:file2
+       '
+
        test_expect_success "$STRATEGY diff from attributes has valid diffstat" '
                echo "file* diff=driver" >.gitattributes &&
                git config diff.driver.algorithm "$STRATEGY" &&
index 114785586abde524fb13cb29e4b1f357ae9a3286..4eebd9c2b50f0445b975c46bc660efc9eb90ecd5 100644 (file)
@@ -51,6 +51,27 @@ test_lazy_prereq GPG '
        esac
 '
 
+test_lazy_prereq GPG2 '
+       gpg_version=$(gpg --version 2>&1)
+       test $? != 127 || exit 1
+
+       case "$gpg_version" in
+       "gpg (GnuPG) "[01].*)
+               say "This test requires a GPG version >= v2.0.0"
+               exit 1
+               ;;
+       *)
+               (gpgconf --kill all || : ) &&
+               gpg --homedir "${GNUPGHOME}" --import \
+                       "$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
+               gpg --homedir "${GNUPGHOME}" --import-ownertrust \
+                       "$TEST_DIRECTORY"/lib-gpg/ownertrust &&
+               gpg --homedir "${GNUPGHOME}" </dev/null >/dev/null \
+                       --sign -u committer@example.com
+               ;;
+       esac
+'
+
 test_lazy_prereq GPGSM '
        test_have_prereq GPG &&
        # Available key info:
@@ -135,8 +156,9 @@ test_lazy_prereq GPGSSH '
 '
 
 test_lazy_prereq GPGSSH_VERIFYTIME '
+       test_have_prereq GPGSSH &&
        # Check if ssh-keygen has a verify-time option by passing an invalid date to it
-       ssh-keygen -Overify-time=INVALID -Y check-novalidate -s doesnotmatter 2>&1 | grep -q -F "Invalid \"verify-time\"" &&
+       ssh-keygen -Overify-time=INVALID -Y check-novalidate -n "git" -s doesnotmatter 2>&1 | grep -q -F "Invalid \"verify-time\"" &&
 
        # Set up keys with key lifetimes
        ssh-keygen -t ed25519 -N "" -C "timeboxed valid key" -f "${GPGSSH_KEY_TIMEBOXEDVALID}" >/dev/null &&
index 6805229dcb9528e75399aefc46735e8cd14f4b4c..2fb1b2ae5613a5384dea41df405658cdb787117b 100644 (file)
@@ -191,6 +191,20 @@ enable_http2 () {
        test_set_prereq HTTP2
 }
 
+enable_cgipassauth () {
+       # We are looking for 2.4.13 or more recent. Since we only support
+       # 2.4 and up, no need to check for older major/minor.
+       if test "$HTTPD_VERSION_MAJOR" = 2 &&
+          test "$HTTPD_VERSION_MINOR" = 4 &&
+          test "$(echo $HTTPD_VERSION | cut -d. -f3)" -lt 13
+       then
+               echo >&4 "apache $HTTPD_VERSION too old for CGIPassAuth"
+               return
+       fi
+       HTTPD_PARA="$HTTPD_PARA -DUSE_CGIPASSAUTH"
+       test_set_prereq CGIPASSAUTH
+}
+
 start_httpd() {
        prepare_httpd >&3 2>&4
 
index 9e6892970defa73896f70ba303a78d2fe49099ad..a22d1386052b40334ddec013ec230af6655fb086 100644 (file)
@@ -146,7 +146,9 @@ SetEnv PERL_PATH ${PERL_PATH}
 <LocationMatch /custom_auth/>
        SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
        SetEnv GIT_HTTP_EXPORT_ALL
+       <IfDefine USE_CGIPASSAUTH>
        CGIPassAuth on
+       </IfDefine>
 </LocationMatch>
 ScriptAlias /smart/incomplete_length/git-upload-pack incomplete-length-upload-pack-v2-http.sh/
 ScriptAlias /smart/incomplete_body/git-upload-pack incomplete-body-upload-pack-v2-http.sh/
index dee14992c52d5d24075c9b048dfe1e47c620b29e..9acb0d5d19d2ec44827856a7496a2f785c537e02 100644 (file)
@@ -802,7 +802,7 @@ test_submodule_recursing_with_args_common () {
                        git branch -t no_submodule origin/no_submodule &&
                        $command no_submodule &&
                        test_superproject_content origin/no_submodule &&
-                       ! test_path_is_dir sub1 &&
+                       test_path_is_missing sub1 &&
                        test_must_fail git config -f .git/modules/sub1/config core.worktree &&
                        test_must_fail git config -f .git/modules/sub1/modules/sub2/config core.worktree
                )
index 60d1de0662ac4842f0163d05366b20a62524f3db..96ed3e1d69881541c82bdaf8c7f6b6fd8af97ef5 100755 (executable)
@@ -129,5 +129,10 @@ test_perf_on_all git grep --cached bogus -- "f2/f1/f1/*"
 test_perf_on_all git write-tree
 test_perf_on_all git describe --dirty
 test_perf_on_all 'echo >>new && git describe --dirty'
+test_perf_on_all git diff-files
+test_perf_on_all git diff-files -- $SPARSE_CONE/a
+test_perf_on_all git diff-tree HEAD
+test_perf_on_all git diff-tree HEAD -- $SPARSE_CONE/a
+test_perf_on_all "git worktree add ../temp && git worktree remove ../temp"
 
 test_done
index 0684b690af020442847d2ef94162f311e20abc8a..ceec60656b59119c2bb82651f8ae6057899f41c5 100755 (executable)
@@ -12,8 +12,7 @@ test_lookup_pack_bitmap () {
        test_perf_large_repo
 
        test_expect_success 'setup bitmap config' '
-               git config pack.writebitmaps true &&
-               git config pack.writeReverseIndex true
+               git config pack.writebitmaps true
        '
 
        # we need to create the tag up front such that it is covered by the repack and
index 8ea31d187a91ee4df52203cbd72a1fac7dd4140e..6e300be2ac55aff51ed0e2d8ef16a978f5efedb9 100755 (executable)
@@ -1014,7 +1014,7 @@ test_expect_success 'validate object ID for a known tree' '
 '
 
 test_expect_success 'showing tree with git ls-tree' '
-    git ls-tree $tree >current
+       git ls-tree $tree >current
 '
 
 test_expect_success 'git ls-tree output for a known tree' '
index 89b306cb114debb61e787e6d80417cd362cc367f..26e082f05b4473a553b4de9b7747b928179439cd 100755 (executable)
@@ -30,8 +30,17 @@ attr_check_quote () {
 attr_check_source () {
        path="$1" expect="$2" source="$3" git_opts="$4" &&
 
-       git $git_opts check-attr --source $source test -- "$path" >actual 2>err &&
        echo "$path: test: $expect" >expect &&
+
+       git $git_opts check-attr --source $source test -- "$path" >actual 2>err &&
+       test_cmp expect actual &&
+       test_must_be_empty err &&
+
+       git $git_opts --attr-source="$source" check-attr test -- "$path" >actual 2>err &&
+       test_cmp expect actual &&
+       test_must_be_empty err
+
+       GIT_ATTR_SOURCE="$source" git $git_opts check-attr test -- "$path" >actual 2>err &&
        test_cmp expect actual &&
        test_must_be_empty err
 }
index eeb8539c1bcb2df86a5aff1fa2c78fc555598d14..8cb597f99c4cead2388681416d3cc0eddd90fa0f 100755 (executable)
@@ -147,6 +147,84 @@ test_expect_success 'get GIT_SEQUENCE_EDITOR with configuration and environment
        )
 '
 
+test_expect_success POSIXPERM 'GIT_SHELL_PATH points to a valid executable' '
+       shellpath=$(git var GIT_SHELL_PATH) &&
+       test_path_is_executable "$shellpath"
+'
+
+# We know in this environment that our shell will be one of a few fixed values
+# that all end in "sh".
+test_expect_success MINGW 'GIT_SHELL_PATH points to a suitable shell' '
+       shellpath=$(git var GIT_SHELL_PATH) &&
+       case "$shellpath" in
+       *sh) ;;
+       *) return 1;;
+       esac
+'
+
+test_expect_success 'GIT_ATTR_SYSTEM produces expected output' '
+       test_must_fail env GIT_ATTR_NOSYSTEM=1 git var GIT_ATTR_SYSTEM &&
+       (
+               sane_unset GIT_ATTR_NOSYSTEM &&
+               systempath=$(git var GIT_ATTR_SYSTEM) &&
+               test "$systempath" != ""
+       )
+'
+
+test_expect_success 'GIT_ATTR_GLOBAL points to the correct location' '
+       TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+       globalpath=$(XDG_CONFIG_HOME="$TRASHDIR/.config" git var GIT_ATTR_GLOBAL) &&
+       test "$globalpath" = "$TRASHDIR/.config/git/attributes" &&
+       (
+               sane_unset XDG_CONFIG_HOME &&
+               globalpath=$(HOME="$TRASHDIR" git var GIT_ATTR_GLOBAL) &&
+               test "$globalpath" = "$TRASHDIR/.config/git/attributes"
+       )
+'
+
+test_expect_success 'GIT_CONFIG_SYSTEM points to the correct location' '
+       TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+       test_must_fail env GIT_CONFIG_NOSYSTEM=1 git var GIT_CONFIG_SYSTEM &&
+       (
+               sane_unset GIT_CONFIG_NOSYSTEM &&
+               systempath=$(git var GIT_CONFIG_SYSTEM) &&
+               test "$systempath" != "" &&
+               systempath=$(GIT_CONFIG_SYSTEM=/dev/null git var GIT_CONFIG_SYSTEM) &&
+               if test_have_prereq MINGW
+               then
+                       test "$systempath" = "nul"
+               else
+                       test "$systempath" = "/dev/null"
+               fi &&
+               systempath=$(GIT_CONFIG_SYSTEM="$TRASHDIR/gitconfig" git var GIT_CONFIG_SYSTEM) &&
+               test "$systempath" = "$TRASHDIR/gitconfig"
+       )
+'
+
+test_expect_success 'GIT_CONFIG_GLOBAL points to the correct location' '
+       TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+       HOME="$TRASHDIR" XDG_CONFIG_HOME="$TRASHDIR/foo" git var GIT_CONFIG_GLOBAL >actual &&
+       echo "$TRASHDIR/foo/git/config" >expected &&
+       echo "$TRASHDIR/.gitconfig" >>expected &&
+       test_cmp expected actual &&
+       (
+               sane_unset XDG_CONFIG_HOME &&
+               HOME="$TRASHDIR" git var GIT_CONFIG_GLOBAL >actual &&
+               echo "$TRASHDIR/.config/git/config" >expected &&
+               echo "$TRASHDIR/.gitconfig" >>expected &&
+               test_cmp expected actual &&
+               globalpath=$(GIT_CONFIG_GLOBAL=/dev/null git var GIT_CONFIG_GLOBAL) &&
+               if test_have_prereq MINGW
+               then
+                       test "$globalpath" = "nul"
+               else
+                       test "$globalpath" = "/dev/null"
+               fi &&
+               globalpath=$(GIT_CONFIG_GLOBAL="$TRASHDIR/gitconfig" git var GIT_CONFIG_GLOBAL) &&
+               test "$globalpath" = "$TRASHDIR/gitconfig"
+       )
+'
+
 # For git var -l, we check only a representative variable;
 # testing the whole output would make our test too brittle with
 # respect to unrelated changes in the test suite's environment.
@@ -164,6 +242,28 @@ test_expect_success 'git var -l lists config' '
        test_cmp expect actual.bare
 '
 
+test_expect_success 'git var -l lists multiple global configs' '
+       TRASHDIR="$(test-tool path-utils normalize_path_copy "$(pwd)")" &&
+       HOME="$TRASHDIR" XDG_CONFIG_HOME="$TRASHDIR/foo" git var -l >actual &&
+       grep "^GIT_CONFIG_GLOBAL=" actual >filtered &&
+       echo "GIT_CONFIG_GLOBAL=$TRASHDIR/foo/git/config" >expected &&
+       echo "GIT_CONFIG_GLOBAL=$TRASHDIR/.gitconfig" >>expected &&
+       test_cmp expected filtered
+'
+
+test_expect_success 'git var -l does not split multiline editors' '
+       (
+               GIT_EDITOR="!f() {
+                       echo Hello!
+               }; f" &&
+               export GIT_EDITOR &&
+               echo "GIT_EDITOR=$GIT_EDITOR" >expected &&
+               git var -l >var &&
+               sed -n -e "/^GIT_EDITOR/,\$p" var | head -n 3 >actual &&
+               test_cmp expected actual
+       )
+'
+
 test_expect_success 'listing and asking for variables are exclusive' '
        test_must_fail git var -l GIT_COMMITTER_IDENT
 '
index 35cc8c3b39896cb5caf6740d6847f5dec66e1dea..81946e87ccb9b478789164a6db54d9a80278288d 100755 (executable)
@@ -125,7 +125,7 @@ test_expect_success 'update with autocrlf=input' '
        munge_cr append dir/two &&
        git update-index -- one dir/two &&
        differs=$(git diff-index --cached HEAD) &&
-       verbose test -z "$differs"
+       test -z "$differs"
 
 '
 
@@ -138,7 +138,7 @@ test_expect_success 'update with autocrlf=true' '
        munge_cr append dir/two &&
        git update-index -- one dir/two &&
        differs=$(git diff-index --cached HEAD) &&
-       verbose test -z "$differs"
+       test -z "$differs"
 
 '
 
@@ -153,7 +153,7 @@ test_expect_success 'checkout with autocrlf=true' '
        test "$one" = $(git hash-object --stdin <one) &&
        test "$two" = $(git hash-object --stdin <dir/two) &&
        differs=$(git diff-index --cached HEAD) &&
-       verbose test -z "$differs"
+       test -z "$differs"
 '
 
 test_expect_success 'checkout with autocrlf=input' '
@@ -167,7 +167,7 @@ test_expect_success 'checkout with autocrlf=input' '
        test "$one" = $(git hash-object --stdin <one) &&
        test "$two" = $(git hash-object --stdin <dir/two) &&
        differs=$(git diff-index --cached HEAD) &&
-       verbose test -z "$differs"
+       test -z "$differs"
 '
 
 test_expect_success 'apply patch (autocrlf=input)' '
@@ -177,7 +177,7 @@ test_expect_success 'apply patch (autocrlf=input)' '
        git read-tree --reset -u HEAD &&
 
        git apply patch.file &&
-       verbose test "$patched" = "$(git hash-object --stdin <one)"
+       test "$patched" = "$(git hash-object --stdin <one)"
 '
 
 test_expect_success 'apply patch --cached (autocrlf=input)' '
@@ -187,7 +187,7 @@ test_expect_success 'apply patch --cached (autocrlf=input)' '
        git read-tree --reset -u HEAD &&
 
        git apply --cached patch.file &&
-       verbose test "$patched" = $(git rev-parse :one)
+       test "$patched" = $(git rev-parse :one)
 '
 
 test_expect_success 'apply patch --index (autocrlf=input)' '
@@ -197,8 +197,8 @@ test_expect_success 'apply patch --index (autocrlf=input)' '
        git read-tree --reset -u HEAD &&
 
        git apply --index patch.file &&
-       verbose test "$patched" = $(git rev-parse :one) &&
-       verbose test "$patched" = $(git hash-object --stdin <one)
+       test "$patched" = $(git rev-parse :one) &&
+       test "$patched" = $(git hash-object --stdin <one)
 '
 
 test_expect_success 'apply patch (autocrlf=true)' '
@@ -208,7 +208,7 @@ test_expect_success 'apply patch (autocrlf=true)' '
        git read-tree --reset -u HEAD &&
 
        git apply patch.file &&
-       verbose test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
+       test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
 '
 
 test_expect_success 'apply patch --cached (autocrlf=true)' '
@@ -218,7 +218,7 @@ test_expect_success 'apply patch --cached (autocrlf=true)' '
        git read-tree --reset -u HEAD &&
 
        git apply --cached patch.file &&
-       verbose test "$patched" = $(git rev-parse :one)
+       test "$patched" = $(git rev-parse :one)
 '
 
 test_expect_success 'apply patch --index (autocrlf=true)' '
@@ -228,8 +228,8 @@ test_expect_success 'apply patch --index (autocrlf=true)' '
        git read-tree --reset -u HEAD &&
 
        git apply --index patch.file &&
-       verbose test "$patched" = $(git rev-parse :one) &&
-       verbose test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
+       test "$patched" = $(git rev-parse :one) &&
+       test "$patched" = "$(remove_cr <one | git hash-object --stdin)"
 '
 
 test_expect_success '.gitattributes says two is binary' '
@@ -240,7 +240,7 @@ test_expect_success '.gitattributes says two is binary' '
        git read-tree --reset -u HEAD &&
 
        ! has_cr dir/two &&
-       verbose has_cr one &&
+       has_cr one &&
        ! has_cr three
 '
 
@@ -259,8 +259,8 @@ test_expect_success '.gitattributes says two and three are text' '
        echo "t* crlf" >.gitattributes &&
        git read-tree --reset -u HEAD &&
 
-       verbose has_cr dir/two &&
-       verbose has_cr three
+       has_cr dir/two &&
+       has_cr three
 '
 
 test_expect_success 'in-tree .gitattributes (1)' '
@@ -273,7 +273,7 @@ test_expect_success 'in-tree .gitattributes (1)' '
        git read-tree --reset -u HEAD &&
 
        ! has_cr one &&
-       verbose has_cr three
+       has_cr three
 '
 
 test_expect_success 'in-tree .gitattributes (2)' '
@@ -283,7 +283,7 @@ test_expect_success 'in-tree .gitattributes (2)' '
        git checkout-index -f -q -u -a &&
 
        ! has_cr one &&
-       verbose has_cr three
+       has_cr three
 '
 
 test_expect_success 'in-tree .gitattributes (3)' '
@@ -294,7 +294,7 @@ test_expect_success 'in-tree .gitattributes (3)' '
        git checkout-index -u one dir/two three &&
 
        ! has_cr one &&
-       verbose has_cr three
+       has_cr three
 '
 
 test_expect_success 'in-tree .gitattributes (4)' '
@@ -305,7 +305,7 @@ test_expect_success 'in-tree .gitattributes (4)' '
        git checkout-index -u .gitattributes &&
 
        ! has_cr one &&
-       verbose has_cr three
+       has_cr three
 '
 
 test_expect_success 'checkout with existing .gitattributes' '
index 0a5713c5248280d88a241b8027b5c98e4f321718..d1b3be872576789541410fa66d4473a006db99b2 100755 (executable)
@@ -17,396 +17,378 @@ printf_git_stripspace () {
     printf "$1" | git stripspace
 }
 
-test_expect_success \
-    'long lines without spaces should be unchanged' '
-    echo "$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual &&
-
-    echo "$ttt$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual &&
-
-    echo "$ttt$ttt$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual &&
-
-    echo "$ttt$ttt$ttt$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual
+test_expect_success 'long lines without spaces should be unchanged' '
+       echo "$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual &&
+
+       echo "$ttt$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual &&
+
+       echo "$ttt$ttt$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual &&
+
+       echo "$ttt$ttt$ttt$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success \
-    'lines with spaces at the beginning should be unchanged' '
-    echo "$sss$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual &&
+test_expect_success 'lines with spaces at the beginning should be unchanged' '
+       echo "$sss$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual &&
 
-    echo "$sss$sss$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual &&
+       echo "$sss$sss$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual &&
 
-    echo "$sss$sss$sss$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual
+       echo "$sss$sss$sss$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success \
-    'lines with intermediate spaces should be unchanged' '
-    echo "$ttt$sss$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual &&
+test_expect_success 'lines with intermediate spaces should be unchanged' '
+       echo "$ttt$sss$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual &&
 
-    echo "$ttt$sss$sss$ttt" >expect &&
-    git stripspace <expect >actual &&
-    test_cmp expect actual
+       echo "$ttt$sss$sss$ttt" >expect &&
+       git stripspace <expect >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success \
-    'consecutive blank lines should be unified' '
-    printf "$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+test_expect_success 'consecutive blank lines should be unified' '
+       printf "$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt$ttt$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt\n\n\n\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$ttt$ttt\n" > expect &&
-    printf "$ttt\n\n\n\n\n$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$ttt$ttt\n" > expect &&
+       printf "$ttt\n\n\n\n\n$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
-    printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
+       printf "$ttt\n\n\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt$ttt$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt$ttt$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$ttt\n" > expect &&
-    printf "$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$ttt\n" > expect &&
+       printf "$ttt\n\t\n \n\n  \t\t\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$ttt$ttt\n" > expect &&
-    printf "$ttt\n\t\n \n\n  \t\t\n$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$ttt$ttt\n" > expect &&
+       printf "$ttt\n\t\n \n\n  \t\t\n$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
-    printf "$ttt\n\t\n \n\n  \t\t\n$ttt$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual
+       printf "$ttt\n\n$ttt$ttt$ttt\n" > expect &&
+       printf "$ttt\n\t\n \n\n  \t\t\n$ttt$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success \
-    'only consecutive blank lines should be completely removed' '
+test_expect_success 'only consecutive blank lines should be completely removed' '
+       printf "\n" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "\n" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "\n\n\n" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "\n\n\n" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "$sss\n$sss\n$sss\n" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "$sss\n$sss\n$sss\n" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "$sss$sss\n$sss\n\n" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "$sss$sss\n$sss\n\n" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "\n$sss\n$sss$sss\n" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "\n$sss\n$sss$sss\n" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "$sss$sss$sss$sss\n\n\n" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "$sss$sss$sss$sss\n\n\n" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "\n$sss$sss$sss$sss\n\n" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "\n$sss$sss$sss$sss\n\n" | git stripspace >actual &&
-    test_must_be_empty actual &&
-
-    printf "\n\n$sss$sss$sss$sss\n" | git stripspace >actual &&
-    test_must_be_empty actual
+       printf "\n\n$sss$sss$sss$sss\n" | git stripspace >actual &&
+       test_must_be_empty actual
 '
 
-test_expect_success \
-    'consecutive blank lines at the beginning should be removed' '
-    printf "$ttt\n" > expect &&
-    printf "\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+test_expect_success 'consecutive blank lines at the beginning should be removed' '
+       printf "$ttt\n" > expect &&
+       printf "\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n" > expect &&
-    printf "\n\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n" > expect &&
+       printf "\n\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt\n" > expect &&
-    printf "\n\n\n$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt\n" > expect &&
+       printf "\n\n\n$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt$ttt\n" > expect &&
-    printf "\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt$ttt\n" > expect &&
+       printf "\n\n\n$ttt$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt$ttt$ttt\n" > expect &&
-    printf "\n\n\n$ttt$ttt$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt$ttt$ttt\n" > expect &&
+       printf "\n\n\n$ttt$ttt$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n" > expect &&
+       printf "$ttt\n" > expect &&
 
-    printf "$sss\n$sss\n$sss\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$sss\n$sss\n$sss\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "\n$sss\n$sss$sss\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "\n$sss\n$sss$sss\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$sss$sss\n$sss\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$sss$sss\n$sss\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$sss$sss$sss\n\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$sss$sss$sss\n\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "\n$sss$sss$sss\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "\n$sss$sss$sss\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "\n\n$sss$sss$sss\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual
+       printf "\n\n$sss$sss$sss\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success \
-    'consecutive blank lines at the end should be removed' '
-    printf "$ttt\n" > expect &&
-    printf "$ttt\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+test_expect_success 'consecutive blank lines at the end should be removed' '
+       printf "$ttt\n" > expect &&
+       printf "$ttt\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n" > expect &&
-    printf "$ttt\n\n\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n" > expect &&
+       printf "$ttt\n\n\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt\n" > expect &&
-    printf "$ttt$ttt\n\n\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt\n" > expect &&
+       printf "$ttt$ttt\n\n\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt$ttt\n" > expect &&
-    printf "$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt$ttt\n" > expect &&
+       printf "$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt$ttt$ttt\n" > expect &&
-    printf "$ttt$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt$ttt$ttt\n" > expect &&
+       printf "$ttt$ttt$ttt$ttt\n\n\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n" > expect &&
+       printf "$ttt\n" > expect &&
 
-    printf "$ttt\n$sss\n$sss\n$sss\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n$sss\n$sss\n$sss\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$sss\n$sss$sss\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$sss\n$sss$sss\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n$sss$sss\n$sss\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n$sss$sss\n$sss\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n$sss$sss$sss\n\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n$sss$sss$sss\n\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n$sss$sss$sss\n\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n\n$sss$sss$sss\n\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n\n\n$sss$sss$sss\n" | git stripspace >actual &&
-    test_cmp expect actual
+       printf "$ttt\n\n\n$sss$sss$sss\n" | git stripspace >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success \
-    'text without newline at end should end with newline' '
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$ttt"
+test_expect_success 'text without newline at end should end with newline' '
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$ttt"
 '
 
 # text plus spaces at the end:
 
-test_expect_success \
-    'text plus spaces without newline at end should end with newline' '
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$sss" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss$sss" &&
-    test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss$sss"
+test_expect_success 'text plus spaces without newline at end should end with newline' '
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$sss" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$sss$sss" &&
+       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$sss$sss$sss"
 '
 
-test_expect_success \
-    'text plus spaces without newline at end should not show spaces' '
-    printf "$ttt$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    printf "$ttt$ttt$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    printf "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    printf "$ttt$sss$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    printf "$ttt$ttt$sss$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    printf "$ttt$sss$sss$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null
+test_expect_success 'text plus spaces without newline at end should not show spaces' '
+       printf "$ttt$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       printf "$ttt$ttt$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       printf "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       printf "$ttt$sss$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       printf "$ttt$ttt$sss$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       printf "$ttt$sss$sss$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null
 '
 
-test_expect_success \
-    'text plus spaces without newline should show the correct lines' '
-    printf "$ttt\n" >expect &&
-    printf "$ttt$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+test_expect_success 'text plus spaces without newline should show the correct lines' '
+       printf "$ttt\n" >expect &&
+       printf "$ttt$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n" >expect &&
-    printf "$ttt$sss$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n" >expect &&
+       printf "$ttt$sss$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n" >expect &&
-    printf "$ttt$sss$sss$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n" >expect &&
+       printf "$ttt$sss$sss$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt\n" >expect &&
-    printf "$ttt$ttt$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt\n" >expect &&
+       printf "$ttt$ttt$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt\n" >expect &&
-    printf "$ttt$ttt$sss$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt\n" >expect &&
+       printf "$ttt$ttt$sss$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt$ttt\n" >expect &&
-    printf "$ttt$ttt$ttt$sss" | git stripspace >actual &&
-    test_cmp expect actual
+       printf "$ttt$ttt$ttt\n" >expect &&
+       printf "$ttt$ttt$ttt$sss" | git stripspace >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success \
-    'text plus spaces at end should not show spaces' '
-    echo "$ttt$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    echo "$ttt$ttt$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    echo "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    echo "$ttt$sss$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    echo "$ttt$ttt$sss$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null &&
-    echo "$ttt$sss$sss$sss" | git stripspace >tmp &&
-    ! grep "  " tmp >/dev/null
+test_expect_success 'text plus spaces at end should not show spaces' '
+       echo "$ttt$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       echo "$ttt$ttt$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       echo "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       echo "$ttt$sss$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       echo "$ttt$ttt$sss$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null &&
+       echo "$ttt$sss$sss$sss" | git stripspace >tmp &&
+       ! grep "  " tmp >/dev/null
 '
 
-test_expect_success \
-    'text plus spaces at end should be cleaned and newline must remain' '
-    echo "$ttt" >expect &&
-    echo "$ttt$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+test_expect_success 'text plus spaces at end should be cleaned and newline must remain' '
+       echo "$ttt" >expect &&
+       echo "$ttt$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    echo "$ttt" >expect &&
-    echo "$ttt$sss$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       echo "$ttt" >expect &&
+       echo "$ttt$sss$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    echo "$ttt" >expect &&
-    echo "$ttt$sss$sss$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       echo "$ttt" >expect &&
+       echo "$ttt$sss$sss$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    echo "$ttt$ttt" >expect &&
-    echo "$ttt$ttt$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       echo "$ttt$ttt" >expect &&
+       echo "$ttt$ttt$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    echo "$ttt$ttt" >expect &&
-    echo "$ttt$ttt$sss$sss" | git stripspace >actual &&
-    test_cmp expect actual &&
+       echo "$ttt$ttt" >expect &&
+       echo "$ttt$ttt$sss$sss" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    echo "$ttt$ttt$ttt" >expect &&
-    echo "$ttt$ttt$ttt$sss" | git stripspace >actual &&
-    test_cmp expect actual
+       echo "$ttt$ttt$ttt" >expect &&
+       echo "$ttt$ttt$ttt$sss" | git stripspace >actual &&
+       test_cmp expect actual
 '
 
 # spaces only:
 
-test_expect_success \
-    'spaces with newline at end should be replaced with empty string' '
-    echo | git stripspace >actual &&
-    test_must_be_empty actual &&
+test_expect_success 'spaces with newline at end should be replaced with empty string' '
+       echo | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    echo "$sss" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       echo "$sss" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    echo "$sss$sss" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       echo "$sss$sss" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    echo "$sss$sss$sss" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       echo "$sss$sss$sss" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    echo "$sss$sss$sss$sss" | git stripspace >actual &&
-    test_must_be_empty actual
+       echo "$sss$sss$sss$sss" | git stripspace >actual &&
+       test_must_be_empty actual
 '
 
-test_expect_success \
-    'spaces without newline at end should not show spaces' '
-    printf "" | git stripspace >tmp &&
-    ! grep " " tmp >/dev/null &&
-    printf "$sss" | git stripspace >tmp &&
-    ! grep " " tmp >/dev/null &&
-    printf "$sss$sss" | git stripspace >tmp &&
-    ! grep " " tmp >/dev/null &&
-    printf "$sss$sss$sss" | git stripspace >tmp &&
-    ! grep " " tmp >/dev/null &&
-    printf "$sss$sss$sss$sss" | git stripspace >tmp &&
-    ! grep " " tmp >/dev/null
+test_expect_success 'spaces without newline at end should not show spaces' '
+       printf "" | git stripspace >tmp &&
+       ! grep " " tmp >/dev/null &&
+       printf "$sss" | git stripspace >tmp &&
+       ! grep " " tmp >/dev/null &&
+       printf "$sss$sss" | git stripspace >tmp &&
+       ! grep " " tmp >/dev/null &&
+       printf "$sss$sss$sss" | git stripspace >tmp &&
+       ! grep " " tmp >/dev/null &&
+       printf "$sss$sss$sss$sss" | git stripspace >tmp &&
+       ! grep " " tmp >/dev/null
 '
 
-test_expect_success \
-    'spaces without newline at end should be replaced with empty string' '
-    printf "" | git stripspace >actual &&
-    test_must_be_empty actual &&
+test_expect_success 'spaces without newline at end should be replaced with empty string' '
+       printf "" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "$sss$sss" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "$sss$sss" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "$sss$sss$sss" | git stripspace >actual &&
-    test_must_be_empty actual &&
+       printf "$sss$sss$sss" | git stripspace >actual &&
+       test_must_be_empty actual &&
 
-    printf "$sss$sss$sss$sss" | git stripspace >actual &&
-    test_must_be_empty actual
+       printf "$sss$sss$sss$sss" | git stripspace >actual &&
+       test_must_be_empty actual
 '
 
-test_expect_success \
-    'consecutive text lines should be unchanged' '
-    printf "$ttt$ttt\n$ttt\n" >expect &&
-    printf "$ttt$ttt\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+test_expect_success 'consecutive text lines should be unchanged' '
+       printf "$ttt$ttt\n$ttt\n" >expect &&
+       printf "$ttt$ttt\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n$ttt$ttt\n$ttt\n" >expect &&
-    printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n$ttt$ttt\n$ttt\n" >expect &&
+       printf "$ttt\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect &&
-    printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" >expect &&
+       printf "$ttt\n$ttt\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" >expect &&
-    printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" >expect &&
+       printf "$ttt\n$ttt\n\n$ttt$ttt\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect &&
-    printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual &&
+       printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" >expect &&
+       printf "$ttt$ttt\n\n$ttt\n$ttt$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual &&
 
-    printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect &&
-    printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual &&
-    test_cmp expect actual
+       printf "$ttt\n$ttt$ttt\n\n$ttt\n" >expect &&
+       printf "$ttt\n$ttt$ttt\n\n$ttt\n" | git stripspace >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'strip comments, too' '
index 11c15a48aab57ee81245a933f5dfdab5210103a5..038b8b788d7dea688c2efa807e1d1856b8f33c13 100755 (executable)
@@ -7,13 +7,26 @@ TEST_PASSES_SANITIZE_LEAK=true
 
 pwd="$(pwd)"
 
-expect_accepted () {
-       git "$@" rev-parse --git-dir
+expect_accepted_implicit () {
+       test_when_finished 'rm "$pwd/trace.perf"' &&
+       GIT_TRACE2_PERF="$pwd/trace.perf" git "$@" rev-parse --git-dir &&
+       # Note: we're intentionally only checking that the bare repo has a
+       # directory *prefix* of $pwd
+       grep -F "implicit-bare-repository:$pwd" "$pwd/trace.perf"
+}
+
+expect_accepted_explicit () {
+       test_when_finished 'rm "$pwd/trace.perf"' &&
+       GIT_DIR="$1" GIT_TRACE2_PERF="$pwd/trace.perf" git rev-parse --git-dir &&
+       ! grep -F "implicit-bare-repository:$pwd" "$pwd/trace.perf"
 }
 
 expect_rejected () {
-       test_must_fail git "$@" rev-parse --git-dir 2>err &&
-       grep -F "cannot use bare repository" err
+       test_when_finished 'rm "$pwd/trace.perf"' &&
+       test_env GIT_TRACE2_PERF="$pwd/trace.perf" \
+               test_must_fail git "$@" rev-parse --git-dir 2>err &&
+       grep -F "cannot use bare repository" err &&
+       grep -F "implicit-bare-repository:$pwd" "$pwd/trace.perf"
 }
 
 test_expect_success 'setup bare repo in worktree' '
@@ -22,12 +35,13 @@ test_expect_success 'setup bare repo in worktree' '
 '
 
 test_expect_success 'safe.bareRepository unset' '
-       expect_accepted -C outer-repo/bare-repo
+       test_unconfig --global safe.bareRepository &&
+       expect_accepted_implicit -C outer-repo/bare-repo
 '
 
 test_expect_success 'safe.bareRepository=all' '
        test_config_global safe.bareRepository all &&
-       expect_accepted -C outer-repo/bare-repo
+       expect_accepted_implicit -C outer-repo/bare-repo
 '
 
 test_expect_success 'safe.bareRepository=explicit' '
@@ -47,7 +61,7 @@ test_expect_success 'safe.bareRepository in the repository' '
 
 test_expect_success 'safe.bareRepository on the command line' '
        test_config_global safe.bareRepository explicit &&
-       expect_accepted -C outer-repo/bare-repo \
+       expect_accepted_implicit -C outer-repo/bare-repo \
                -c safe.bareRepository=all
 '
 
@@ -60,4 +74,8 @@ test_expect_success 'safe.bareRepository in included file' '
        expect_rejected -C outer-repo/bare-repo
 '
 
+test_expect_success 'no trace when GIT_DIR is explicitly provided' '
+       expect_accepted_explicit "$pwd/outer-repo/bare-repo"
+'
+
 test_done
index 7d7ecfd57162cf9cde2e74007a6323c635a3b2a9..e19a19963697a08255bb1b933631cdc90d57340d 100755 (executable)
@@ -30,11 +30,12 @@ usage: test-tool parse-options <options>
     -F, --file <file>     set file to <file>
 
 String options
-    -s, --string <string>
-                          get a string
+    -s, --string <string> get a string
     --string2 <str>       get another string
     --st <st>             get another string (pervert ordering)
     -o <str>              get another string
+    --longhelp            help text of this entry
+                          spans multiple lines
     --list <str>          add str to list
 
 Magic arguments
index c4fc34eb18eb1401c5331667408c496e663c9c69..9ea974b0c6c68a247ddd3f1b7cae806a4c79fbc4 100755 (executable)
@@ -5,6 +5,7 @@ test_description='Test commands behavior when given invalid argument value'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup ' '
index 46d4839194bb2322b2a8cd9b80618a855e0fb070..1fee6d90102cc6f9b90786a6324f56e7086b91bf 100755 (executable)
@@ -18,6 +18,14 @@ test_split () {
        "
 }
 
+test_split_in_place() {
+       cat >expected &&
+       test_expect_success "split (in place) $1 at $2, max $3" "
+               test-tool string-list split_in_place '$1' '$2' '$3' >actual &&
+               test_cmp expected actual
+       "
+}
+
 test_split "foo:bar:baz" ":" "-1" <<EOF
 3
 [0]: "foo"
@@ -61,6 +69,49 @@ test_split ":" ":" "-1" <<EOF
 [1]: ""
 EOF
 
+test_split_in_place "foo:;:bar:;:baz:;:" ":;" "-1" <<EOF
+10
+[0]: "foo"
+[1]: ""
+[2]: ""
+[3]: "bar"
+[4]: ""
+[5]: ""
+[6]: "baz"
+[7]: ""
+[8]: ""
+[9]: ""
+EOF
+
+test_split_in_place "foo:;:bar:;:baz" ":;" "0" <<EOF
+1
+[0]: "foo:;:bar:;:baz"
+EOF
+
+test_split_in_place "foo:;:bar:;:baz" ":;" "1" <<EOF
+2
+[0]: "foo"
+[1]: ";:bar:;:baz"
+EOF
+
+test_split_in_place "foo:;:bar:;:baz" ":;" "2" <<EOF
+3
+[0]: "foo"
+[1]: ""
+[2]: ":bar:;:baz"
+EOF
+
+test_split_in_place "foo:;:bar:;:" ":;" "-1" <<EOF
+7
+[0]: "foo"
+[1]: ""
+[2]: ""
+[3]: "bar"
+[4]: ""
+[5]: ""
+[6]: ""
+EOF
+
 test_expect_success "test filter_string_list" '
        test "x-" = "x$(test-tool string-list filter - y)" &&
        test "x-" = "x$(test-tool string-list filter no y)" &&
index b6d2f591acdd999483b2d28af8bbbe3d30008ea7..f6998269beb4fea3f68f14ffae22b541a066e6b3 100755 (executable)
@@ -5,29 +5,50 @@ test_description='git bugreport'
 TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
-# Headers "[System Info]" will be followed by a non-empty line if we put some
-# information there; we can make sure all our headers were followed by some
-# information to check if the command was successful.
-HEADER_PATTERN="^\[.*\]$"
-
-check_all_headers_populated () {
-       while read -r line
-       do
-               if test "$(grep "$HEADER_PATTERN" "$line")"
-               then
-                       echo "$line"
-                       read -r nextline
-                       if test -z "$nextline"; then
-                               return 1;
-                       fi
-               fi
-       done
-}
-
-test_expect_success 'creates a report with content in the right places' '
-       test_when_finished rm git-bugreport-check-headers.txt &&
-       git bugreport -s check-headers &&
-       check_all_headers_populated <git-bugreport-check-headers.txt
+test_expect_success 'create a report' '
+       git bugreport -s format &&
+       test_file_not_empty git-bugreport-format.txt
+'
+
+test_expect_success 'report contains wanted template (before first section)' '
+       sed -ne "/^\[/q;p" git-bugreport-format.txt >actual &&
+       cat >expect <<-\EOF &&
+       Thank you for filling out a Git bug report!
+       Please answer the following questions to help us understand your issue.
+
+       What did you do before the bug happened? (Steps to reproduce your issue)
+
+       What did you expect to happen? (Expected behavior)
+
+       What happened instead? (Actual behavior)
+
+       What'\''s different between what you expected and what actually happened?
+
+       Anything else you want to add:
+
+       Please review the rest of the bug report below.
+       You can delete any lines you don'\''t wish to share.
+
+
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'sanity check "System Info" section' '
+       test_when_finished rm -f git-bugreport-format.txt &&
+
+       sed -ne "/^\[System Info\]$/,/^$/p" <git-bugreport-format.txt >system &&
+
+       # The beginning should match "git version --build-info" verbatim,
+       # but rather than checking bit-for-bit equality, just test some basics.
+       grep "git version [0-9]." system &&
+       grep "shell-path: ." system &&
+
+       # After the version, there should be some more info.
+       # This is bound to differ from environment to environment,
+       # so we just do some rather high-level checks.
+       grep "uname: ." system &&
+       grep "compiler info: ." system
 '
 
 test_expect_success 'dies if file with same name as report already exists' '
index b4e91351181bcbe767f9681a689e570025dd4f53..cfba6861322e373c64897e4c543838b7879cf3e0 100755 (executable)
@@ -203,7 +203,7 @@ test_expect_success 'stopwatch timer test/test1' '
        have_timer_event "main" "timer" "test" "test1" 5 actual
 '
 
-test_expect_success PTHREAD 'stopwatch timer test/test2' '
+test_expect_success PTHREADS 'stopwatch timer test/test2' '
        test_when_finished "rm trace.perf actual" &&
        test_config_global trace2.perfBrief 1 &&
        test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
@@ -249,7 +249,7 @@ test_expect_success 'global counter test/test1' '
        have_counter_event "main" "counter" "test" "test1" 15 actual
 '
 
-test_expect_success PTHREAD 'global counter test/test2' '
+test_expect_success PTHREADS 'global counter test/test2' '
        test_when_finished "rm trace.perf actual" &&
        test_config_global trace2.perfBrief 1 &&
        test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
index c66d91e82d8bc737bc6b909c9427f163aef5dfea..a4f5bba5075c3d61a86b2fad1cb95ba73058bc8e 100755 (executable)
@@ -214,6 +214,24 @@ test_expect_success 'credential_approve stores password expiry' '
        EOF
 '
 
+test_expect_success 'credential_approve stores oauth refresh token' '
+       check approve useless <<-\EOF
+       protocol=http
+       host=example.com
+       username=foo
+       password=bar
+       oauth_refresh_token=xyzzy
+       --
+       --
+       useless: store
+       useless: protocol=http
+       useless: host=example.com
+       useless: username=foo
+       useless: password=bar
+       useless: oauth_refresh_token=xyzzy
+       EOF
+'
+
 test_expect_success 'do not bother storing password-less credential' '
        check approve useless <<-\EOF
        protocol=http
@@ -808,7 +826,7 @@ test_expect_success 'credential config with partial URLs' '
 
        git -c credential.$partial.helper=yep \
                -c credential.with%0anewline.username=uh-oh \
-               credential fill <stdin >stdout 2>stderr &&
+               credential fill <stdin 2>stderr &&
        test_i18ngrep "skipping credential lookup for key" stderr
 '
 
index 698b7159f030905fb63ce4f6856d7ecf49f50b02..c02a3b5969c3d2265d1552132464df7135cd522b 100755 (executable)
@@ -29,6 +29,7 @@ test_atexit 'git credential-cache exit'
 
 # test that the daemon works with no special setup
 helper_test cache
+helper_test_oauth_refresh_token cache
 
 test_expect_success 'socket defaults to ~/.cache/git/credential/socket' '
        test_when_finished "
index 3fb1b0c162ded2a5d78767dbd62de97fc59e5d29..88c524f6558eedd0775da7500d84a90ba19edeba 100755 (executable)
@@ -26,7 +26,7 @@ TEST_PASSES_SANITIZE_LEAK=true
 . "$TEST_DIRECTORY"/lib-read-tree.sh
 
 read_tree_twoway () {
-    git read-tree -m "$1" "$2" && git ls-files --stage
+       git read-tree -m "$1" "$2" && git ls-files --stage
 }
 
 compare_change () {
index cdc077ce12d46603171f2a97c65a63e873e86733..a7c2ed0d7c0a31180e6af1abe9dcc6366e62e2c5 100755 (executable)
@@ -37,315 +37,312 @@ check_cache_at () {
        esac
 }
 
-test_expect_success \
-    setup \
-    'echo frotz >frotz &&
-     echo nitfol >nitfol &&
-     echo bozbar >bozbar &&
-     echo rezrov >rezrov &&
-     git update-index --add nitfol bozbar rezrov &&
-     treeH=$(git write-tree) &&
-     echo treeH $treeH &&
-     git ls-tree $treeH &&
-
-     echo gnusto >bozbar &&
-     git update-index --add frotz bozbar --force-remove rezrov &&
-     git ls-files --stage >M.out &&
-     treeM=$(git write-tree) &&
-     echo treeM $treeM &&
-     git ls-tree $treeM &&
-     cp bozbar bozbar.M &&
-     cp frotz frotz.M &&
-     cp nitfol nitfol.M &&
-     git diff-tree $treeH $treeM'
-
-test_expect_success \
-    '1, 2, 3 - no carry forward' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >1-3.out &&
-     cmp M.out 1-3.out &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol &&
-     check_cache_at bozbar clean &&
-     check_cache_at frotz clean &&
-     check_cache_at nitfol clean'
-
-test_expect_success \
-    '4 - carry forward local addition.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo "+100644 X 0 yomin" >expected &&
-     echo yomin >yomin &&
-     git update-index --add yomin &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >4.out &&
-     test_might_fail git diff -U0 --no-index M.out 4.out >4diff.out &&
-     compare_change 4diff.out expected &&
-     check_cache_at yomin clean &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol &&
-     echo yomin >yomin1 &&
-     diff yomin yomin1 &&
-     rm -f yomin1'
-
-test_expect_success \
-    '5 - carry forward local addition.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     read_tree_u_must_succeed -m -u $treeH &&
-     echo yomin >yomin &&
-     git update-index --add yomin &&
-     echo yomin yomin >yomin &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >5.out &&
-     test_might_fail git diff -U0 --no-index M.out 5.out >5diff.out &&
-     compare_change 5diff.out expected &&
-     check_cache_at yomin dirty &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol &&
-     : dirty index should have prevented -u from checking it out. &&
-     echo yomin yomin >yomin1 &&
-     diff yomin yomin1 &&
-     rm -f yomin1'
-
-test_expect_success \
-    '6 - local addition already has the same.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo frotz >frotz &&
-     git update-index --add frotz &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >6.out &&
-     test_cmp M.out 6.out &&
-     check_cache_at frotz clean &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol &&
-     echo frotz >frotz1 &&
-     diff frotz frotz1 &&
-     rm -f frotz1'
-
-test_expect_success \
-    '7 - local addition already has the same.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo frotz >frotz &&
-     git update-index --add frotz &&
-     echo frotz frotz >frotz &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >7.out &&
-     test_cmp M.out 7.out &&
-     check_cache_at frotz dirty &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp nitfol.M nitfol &&
-     : dirty index should have prevented -u from checking it out. &&
-     echo frotz frotz >frotz1 &&
-     diff frotz frotz1 &&
-     rm -f frotz1'
-
-test_expect_success \
-    '8 - conflicting addition.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo frotz frotz >frotz &&
-     git update-index --add frotz &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
-
-test_expect_success \
-    '9 - conflicting addition.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo frotz frotz >frotz &&
-     git update-index --add frotz &&
-     echo frotz >frotz &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
-
-test_expect_success \
-    '10 - path removed.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo rezrov >rezrov &&
-     git update-index --add rezrov &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >10.out &&
-     cmp M.out 10.out &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol
+test_expect_success setup '
+       echo frotz >frotz &&
+       echo nitfol >nitfol &&
+       echo bozbar >bozbar &&
+       echo rezrov >rezrov &&
+       git update-index --add nitfol bozbar rezrov &&
+       treeH=$(git write-tree) &&
+       echo treeH $treeH &&
+       git ls-tree $treeH &&
+
+       echo gnusto >bozbar &&
+       git update-index --add frotz bozbar --force-remove rezrov &&
+       git ls-files --stage >M.out &&
+       treeM=$(git write-tree) &&
+       echo treeM $treeM &&
+       git ls-tree $treeM &&
+       cp bozbar bozbar.M &&
+       cp frotz frotz.M &&
+       cp nitfol nitfol.M &&
+       git diff-tree $treeH $treeM
 '
 
-test_expect_success \
-    '11 - dirty path removed.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo rezrov >rezrov &&
-     git update-index --add rezrov &&
-     echo rezrov rezrov >rezrov &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
-
-test_expect_success \
-    '12 - unmatching local changes being removed.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo rezrov rezrov >rezrov &&
-     git update-index --add rezrov &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
-
-test_expect_success \
-    '13 - unmatching local changes being removed.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo rezrov rezrov >rezrov &&
-     git update-index --add rezrov &&
-     echo rezrov >rezrov &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
+test_expect_success '1, 2, 3 - no carry forward' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >1-3.out &&
+       cmp M.out 1-3.out &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol &&
+       check_cache_at bozbar clean &&
+       check_cache_at frotz clean &&
+       check_cache_at nitfol clean
+'
+
+test_expect_success '4 - carry forward local addition.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo "+100644 X 0       yomin" >expected &&
+       echo yomin >yomin &&
+       git update-index --add yomin &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >4.out &&
+       test_might_fail git diff -U0 --no-index M.out 4.out >4diff.out &&
+       compare_change 4diff.out expected &&
+       check_cache_at yomin clean &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol &&
+       echo yomin >yomin1 &&
+       diff yomin yomin1 &&
+       rm -f yomin1
+'
+
+test_expect_success '5 - carry forward local addition.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       read_tree_u_must_succeed -m -u $treeH &&
+       echo yomin >yomin &&
+       git update-index --add yomin &&
+       echo yomin yomin >yomin &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >5.out &&
+       test_might_fail git diff -U0 --no-index M.out 5.out >5diff.out &&
+       compare_change 5diff.out expected &&
+       check_cache_at yomin dirty &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol &&
+       : dirty index should have prevented -u from checking it out. &&
+       echo yomin yomin >yomin1 &&
+       diff yomin yomin1 &&
+       rm -f yomin1
+'
+
+test_expect_success '6 - local addition already has the same.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo frotz >frotz &&
+       git update-index --add frotz &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >6.out &&
+       test_cmp M.out 6.out &&
+       check_cache_at frotz clean &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol &&
+       echo frotz >frotz1 &&
+       diff frotz frotz1 &&
+       rm -f frotz1
+'
+
+test_expect_success '7 - local addition already has the same.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo frotz >frotz &&
+       git update-index --add frotz &&
+       echo frotz frotz >frotz &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >7.out &&
+       test_cmp M.out 7.out &&
+       check_cache_at frotz dirty &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp nitfol.M nitfol &&
+       : dirty index should have prevented -u from checking it out. &&
+       echo frotz frotz >frotz1 &&
+       diff frotz frotz1 &&
+       rm -f frotz1
+'
+
+test_expect_success '8 - conflicting addition.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo frotz frotz >frotz &&
+       git update-index --add frotz &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '9 - conflicting addition.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo frotz frotz >frotz &&
+       git update-index --add frotz &&
+       echo frotz >frotz &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '10 - path removed.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo rezrov >rezrov &&
+       git update-index --add rezrov &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >10.out &&
+       cmp M.out 10.out &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol
+'
+
+test_expect_success '11 - dirty path removed.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo rezrov >rezrov &&
+       git update-index --add rezrov &&
+       echo rezrov rezrov >rezrov &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '12 - unmatching local changes being removed.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo rezrov rezrov >rezrov &&
+       git update-index --add rezrov &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '13 - unmatching local changes being removed.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo rezrov rezrov >rezrov &&
+       git update-index --add rezrov &&
+       echo rezrov >rezrov &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
 
 cat >expected <<EOF
 -100644 X 0    nitfol
 +100644 X 0    nitfol
 EOF
 
-test_expect_success \
-    '14 - unchanged in two heads.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo nitfol nitfol >nitfol &&
-     git update-index --add nitfol &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >14.out &&
-     test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
-     compare_change 14diff.out expected &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     check_cache_at nitfol clean &&
-     echo nitfol nitfol >nitfol1 &&
-     diff nitfol nitfol1 &&
-     rm -f nitfol1'
-
-test_expect_success \
-    '15 - unchanged in two heads.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo nitfol nitfol >nitfol &&
-     git update-index --add nitfol &&
-     echo nitfol nitfol nitfol >nitfol &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >15.out &&
-     test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
-     compare_change 15diff.out expected &&
-     check_cache_at nitfol dirty &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     echo nitfol nitfol nitfol >nitfol1 &&
-     diff nitfol nitfol1 &&
-     rm -f nitfol1'
-
-test_expect_success \
-    '16 - conflicting local change.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo bozbar bozbar >bozbar &&
-     git update-index --add bozbar &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
-
-test_expect_success \
-    '17 - conflicting local change.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo bozbar bozbar >bozbar &&
-     git update-index --add bozbar &&
-     echo bozbar bozbar bozbar >bozbar &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
-
-test_expect_success \
-    '18 - local change already having a good result.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo gnusto >bozbar &&
-     git update-index --add bozbar &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >18.out &&
-     test_cmp M.out 18.out &&
-     check_cache_at bozbar clean &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol
+test_expect_success '14 - unchanged in two heads.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo nitfol nitfol >nitfol &&
+       git update-index --add nitfol &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >14.out &&
+       test_must_fail git diff -U0 --no-index M.out 14.out >14diff.out &&
+       compare_change 14diff.out expected &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       check_cache_at nitfol clean &&
+       echo nitfol nitfol >nitfol1 &&
+       diff nitfol nitfol1 &&
+       rm -f nitfol1
 '
 
-test_expect_success \
-    '19 - local change already having a good result, further modified.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo gnusto >bozbar &&
-     git update-index --add bozbar &&
-     echo gnusto gnusto >bozbar &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >19.out &&
-     test_cmp M.out 19.out &&
-     check_cache_at bozbar dirty &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol &&
-     echo gnusto gnusto >bozbar1 &&
-     diff bozbar bozbar1 &&
-     rm -f bozbar1'
-
-test_expect_success \
-    '20 - no local change, use new tree.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo bozbar >bozbar &&
-     git update-index --add bozbar &&
-     read_tree_u_must_succeed -m -u $treeH $treeM &&
-     git ls-files --stage >20.out &&
-     test_cmp M.out 20.out &&
-     check_cache_at bozbar clean &&
-     test_cmp bozbar.M bozbar &&
-     test_cmp frotz.M frotz &&
-     test_cmp nitfol.M nitfol
+test_expect_success '15 - unchanged in two heads.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo nitfol nitfol >nitfol &&
+       git update-index --add nitfol &&
+       echo nitfol nitfol nitfol >nitfol &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >15.out &&
+       test_must_fail git diff -U0 --no-index M.out 15.out >15diff.out &&
+       compare_change 15diff.out expected &&
+       check_cache_at nitfol dirty &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       echo nitfol nitfol nitfol >nitfol1 &&
+       diff nitfol nitfol1 &&
+       rm -f nitfol1
 '
 
-test_expect_success \
-    '21 - no local change, dirty cache.' \
-    'rm -f .git/index nitfol bozbar rezrov frotz &&
-     read_tree_u_must_succeed --reset -u $treeH &&
-     echo bozbar >bozbar &&
-     git update-index --add bozbar &&
-     echo gnusto gnusto >bozbar &&
-     ! read_tree_u_must_succeed -m -u $treeH $treeM'
+test_expect_success '16 - conflicting local change.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo bozbar bozbar >bozbar &&
+       git update-index --add bozbar &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '17 - conflicting local change.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo bozbar bozbar >bozbar &&
+       git update-index --add bozbar &&
+       echo bozbar bozbar bozbar >bozbar &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
+
+test_expect_success '18 - local change already having a good result.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo gnusto >bozbar &&
+       git update-index --add bozbar &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >18.out &&
+       test_cmp M.out 18.out &&
+       check_cache_at bozbar clean &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol
+'
+
+test_expect_success '19 - local change already having a good result, further modified.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo gnusto >bozbar &&
+       git update-index --add bozbar &&
+       echo gnusto gnusto >bozbar &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >19.out &&
+       test_cmp M.out 19.out &&
+       check_cache_at bozbar dirty &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol &&
+       echo gnusto gnusto >bozbar1 &&
+       diff bozbar bozbar1 &&
+       rm -f bozbar1
+'
+
+test_expect_success '20 - no local change, use new tree.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo bozbar >bozbar &&
+       git update-index --add bozbar &&
+       read_tree_u_must_succeed -m -u $treeH $treeM &&
+       git ls-files --stage >20.out &&
+       test_cmp M.out 20.out &&
+       check_cache_at bozbar clean &&
+       test_cmp bozbar.M bozbar &&
+       test_cmp frotz.M frotz &&
+       test_cmp nitfol.M nitfol
+'
+
+test_expect_success '21 - no local change, dirty cache.' '
+       rm -f .git/index nitfol bozbar rezrov frotz &&
+       read_tree_u_must_succeed --reset -u $treeH &&
+       echo bozbar >bozbar &&
+       git update-index --add bozbar &&
+       echo gnusto gnusto >bozbar &&
+       ! read_tree_u_must_succeed -m -u $treeH $treeM
+'
 
 # Also make sure we did not break DF vs DF/DF case.
-test_expect_success \
-    'DF vs DF/DF case setup.' \
-    'rm -f .git/index &&
-     echo DF >DF &&
-     git update-index --add DF &&
-     treeDF=$(git write-tree) &&
-     echo treeDF $treeDF &&
-     git ls-tree $treeDF &&
-
-     rm -f DF &&
-     mkdir DF &&
-     echo DF/DF >DF/DF &&
-     git update-index --add --remove DF DF/DF &&
-     treeDFDF=$(git write-tree) &&
-     echo treeDFDF $treeDFDF &&
-     git ls-tree $treeDFDF &&
-     git ls-files --stage >DFDF.out'
-
-test_expect_success \
-    'DF vs DF/DF case test.' \
-    'rm -f .git/index &&
-     rm -fr DF &&
-     echo DF >DF &&
-     git update-index --add DF &&
-     read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
-     git ls-files --stage >DFDFcheck.out &&
-     test_cmp DFDF.out DFDFcheck.out &&
-     check_cache_at DF/DF clean'
+test_expect_success 'DF vs DF/DF case setup.' '
+       rm -f .git/index &&
+       echo DF >DF &&
+       git update-index --add DF &&
+       treeDF=$(git write-tree) &&
+       echo treeDF $treeDF &&
+       git ls-tree $treeDF &&
+
+       rm -f DF &&
+       mkdir DF &&
+       echo DF/DF >DF/DF &&
+       git update-index --add --remove DF DF/DF &&
+       treeDFDF=$(git write-tree) &&
+       echo treeDFDF $treeDFDF &&
+       git ls-tree $treeDFDF &&
+       git ls-files --stage >DFDF.out
+'
+
+test_expect_success 'DF vs DF/DF case test.' '
+       rm -f .git/index &&
+       rm -fr DF &&
+       echo DF >DF &&
+       git update-index --add DF &&
+       read_tree_u_must_succeed -m -u $treeDF $treeDFDF &&
+       git ls-files --stage >DFDFcheck.out &&
+       test_cmp DFDF.out DFDFcheck.out &&
+       check_cache_at DF/DF clean
+'
 
 test_done
index 8eac74b59c2faa9c6e9f2396214264861c8416c1..d73a0be1b9d1bfa3e0f1fd96e69c0e78ad2dec06 100755 (executable)
@@ -89,7 +89,8 @@ done
 for opt in --buffer \
        --follow-symlinks \
        --batch-all-objects \
-       -z
+       -z \
+       -Z
 do
        test_expect_success "usage: bad option combination: $opt without batch mode" '
                test_incompatible_usage git cat-file $opt &&
@@ -109,26 +110,12 @@ strlen () {
     echo_without_newline "$1" | wc -c | sed -e 's/^ *//'
 }
 
-maybe_remove_timestamp () {
-       if test -z "$2"; then
-               echo_without_newline "$1"
-       else
-               echo_without_newline "$(printf '%s\n' "$1" | remove_timestamp)"
-       fi
-}
-
-remove_timestamp () {
-       sed -e 's/ [0-9][0-9]* [-+][0-9][0-9][0-9][0-9]$//'
-}
-
-
 run_tests () {
     type=$1
     sha1=$2
     size=$3
     content=$4
     pretty_content=$5
-    no_ts=$6
 
     batch_output="$sha1 $type $size
 $content"
@@ -163,21 +150,21 @@ $content"
 
     test -z "$content" ||
     test_expect_success "Content of $type is correct" '
-       maybe_remove_timestamp "$content" $no_ts >expect &&
-       maybe_remove_timestamp "$(git cat-file $type $sha1)" $no_ts >actual &&
+       echo_without_newline "$content" >expect &&
+       git cat-file $type $sha1 >actual &&
        test_cmp expect actual
     '
 
     test_expect_success "Pretty content of $type is correct" '
-       maybe_remove_timestamp "$pretty_content" $no_ts >expect &&
-       maybe_remove_timestamp "$(git cat-file -p $sha1)" $no_ts >actual &&
+       echo_without_newline "$pretty_content" >expect &&
+       git cat-file -p $sha1 >actual &&
        test_cmp expect actual
     '
 
     test -z "$content" ||
     test_expect_success "--batch output of $type is correct" '
-       maybe_remove_timestamp "$batch_output" $no_ts >expect &&
-       maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" $no_ts >actual &&
+       echo "$batch_output" >expect &&
+       echo $sha1 | git cat-file --batch >actual &&
        test_cmp expect actual
     '
 
@@ -191,9 +178,8 @@ $content"
     do
        test -z "$content" ||
                test_expect_success "--batch-command $opt output of $type content is correct" '
-               maybe_remove_timestamp "$batch_output" $no_ts >expect &&
-               maybe_remove_timestamp "$(test_write_lines "contents $sha1" |
-               git cat-file --batch-command $opt)" $no_ts >actual &&
+               echo "$batch_output" >expect &&
+               test_write_lines "contents $sha1" | git cat-file --batch-command $opt >actual &&
                test_cmp expect actual
        '
 
@@ -228,10 +214,9 @@ $content"
     test_expect_success "--batch without type ($type)" '
        {
                echo "$size" &&
-               maybe_remove_timestamp "$content" $no_ts
+               echo "$content"
        } >expect &&
-       echo $sha1 | git cat-file --batch="%(objectsize)" >actual.full &&
-       maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+       echo $sha1 | git cat-file --batch="%(objectsize)" >actual &&
        test_cmp expect actual
     '
 
@@ -239,10 +224,9 @@ $content"
     test_expect_success "--batch without size ($type)" '
        {
                echo "$type" &&
-               maybe_remove_timestamp "$content" $no_ts
+               echo "$content"
        } >expect &&
-       echo $sha1 | git cat-file --batch="%(objecttype)" >actual.full &&
-       maybe_remove_timestamp "$(cat actual.full)" $no_ts >actual &&
+       echo $sha1 | git cat-file --batch="%(objecttype)" >actual &&
        test_cmp expect actual
     '
 }
@@ -284,7 +268,7 @@ test_expect_success '--batch-check without %(rest) considers whole line' '
 
 tree_sha1=$(git write-tree)
 tree_size=$(($(test_oid rawsz) + 13))
-tree_pretty_content="100644 blob $hello_sha1   hello"
+tree_pretty_content="100644 blob $hello_sha1   hello${LF}"
 
 run_tests 'tree' $tree_sha1 $tree_size "" "$tree_pretty_content"
 
@@ -292,12 +276,12 @@ commit_message="Initial commit"
 commit_sha1=$(echo_without_newline "$commit_message" | git commit-tree $tree_sha1)
 commit_size=$(($(test_oid hexsz) + 137))
 commit_content="tree $tree_sha1
-author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 0 +0000
-committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 0 +0000
+author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> $GIT_AUTHOR_DATE
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
 $commit_message"
 
-run_tests 'commit' $commit_sha1 $commit_size "$commit_content" "$commit_content" 1
+run_tests 'commit' $commit_sha1 $commit_size "$commit_content" "$commit_content"
 
 tag_header_without_timestamp="object $hello_sha1
 type blob
@@ -311,11 +295,13 @@ $tag_description"
 tag_sha1=$(echo_without_newline "$tag_content" | git hash-object -t tag --stdin -w)
 tag_size=$(strlen "$tag_content")
 
-run_tests 'tag' $tag_sha1 $tag_size "$tag_content" "$tag_content" 1
+run_tests 'tag' $tag_sha1 $tag_size "$tag_content" "$tag_content"
 
-test_expect_success \
-    "Reach a blob from a tag pointing to it" \
-    "test '$hello_content' = \"\$(git cat-file blob $tag_sha1)\""
+test_expect_success "Reach a blob from a tag pointing to it" '
+       echo_without_newline "$hello_content" >expect &&
+       git cat-file blob $tag_sha1 >actual &&
+       test_cmp expect actual
+'
 
 for batch in batch batch-check batch-command
 do
@@ -351,30 +337,47 @@ do
 done
 
 test_expect_success "--batch-check for a non-existent named object" '
-    test "foobar42 missing
-foobar84 missing" = \
-    "$( ( echo foobar42 && echo_without_newline foobar84 ) | git cat-file --batch-check)"
+       cat >expect <<-EOF &&
+       foobar42 missing
+       foobar84 missing
+       EOF
+
+       printf "foobar42\nfoobar84" >in &&
+       git cat-file --batch-check <in >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success "--batch-check for a non-existent hash" '
-    test "0000000000000000000000000000000000000042 missing
-0000000000000000000000000000000000000084 missing" = \
-    "$( ( echo 0000000000000000000000000000000000000042 &&
-        echo_without_newline 0000000000000000000000000000000000000084 ) |
-       git cat-file --batch-check)"
+       cat >expect <<-EOF &&
+       0000000000000000000000000000000000000042 missing
+       0000000000000000000000000000000000000084 missing
+       EOF
+
+       printf "0000000000000000000000000000000000000042\n0000000000000000000000000000000000000084" >in &&
+       git cat-file --batch-check <in >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success "--batch for an existent and a non-existent hash" '
-    test "$tag_sha1 tag $tag_size
-$tag_content
-0000000000000000000000000000000000000000 missing" = \
-    "$( ( echo $tag_sha1 &&
-        echo_without_newline 0000000000000000000000000000000000000000 ) |
-       git cat-file --batch)"
+       cat >expect <<-EOF &&
+       $tag_sha1 tag $tag_size
+       $tag_content
+       0000000000000000000000000000000000000000 missing
+       EOF
+
+       printf "$tag_sha1\n0000000000000000000000000000000000000000" >in &&
+       git cat-file --batch <in >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success "--batch-check for an empty line" '
-    test " missing" = "$(echo | git cat-file --batch-check)"
+       cat >expect <<-EOF &&
+        missing
+       EOF
+
+       echo >in &&
+       git cat-file --batch-check <in >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'empty --batch-check notices missing object' '
@@ -390,23 +393,34 @@ deadbeef
 
 "
 
-batch_output="$hello_sha1 blob $hello_size
-$hello_content
-$commit_sha1 commit $commit_size
-$commit_content
-$tag_sha1 tag $tag_size
-$tag_content
-deadbeef missing
- missing"
+printf "%s\0" \
+       "$hello_sha1 blob $hello_size" \
+       "$hello_content" \
+       "$commit_sha1 commit $commit_size" \
+       "$commit_content" \
+       "$tag_sha1 tag $tag_size" \
+       "$tag_content" \
+       "deadbeef missing" \
+       " missing" >batch_output
 
 test_expect_success '--batch with multiple sha1s gives correct format' '
-       test "$(maybe_remove_timestamp "$batch_output" 1)" = "$(maybe_remove_timestamp "$(echo_without_newline "$batch_input" | git cat-file --batch)" 1)"
+       tr "\0" "\n" <batch_output >expect &&
+       echo_without_newline "$batch_input" >in &&
+       git cat-file --batch <in >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success '--batch, -z with multiple sha1s gives correct format' '
        echo_without_newline_nul "$batch_input" >in &&
-       test "$(maybe_remove_timestamp "$batch_output" 1)" = \
-       "$(maybe_remove_timestamp "$(git cat-file --batch -z <in)" 1)"
+       tr "\0" "\n" <batch_output >expect &&
+       git cat-file --batch -z <in >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success '--batch, -Z with multiple sha1s gives correct format' '
+       echo_without_newline_nul "$batch_input" >in &&
+       git cat-file --batch -Z <in >actual &&
+       test_cmp batch_output actual
 '
 
 batch_check_input="$hello_sha1
@@ -417,36 +431,55 @@ deadbeef
 
 "
 
-batch_check_output="$hello_sha1 blob $hello_size
-$tree_sha1 tree $tree_size
-$commit_sha1 commit $commit_size
-$tag_sha1 tag $tag_size
-deadbeef missing
- missing"
+printf "%s\0" \
+       "$hello_sha1 blob $hello_size" \
+       "$tree_sha1 tree $tree_size" \
+       "$commit_sha1 commit $commit_size" \
+       "$tag_sha1 tag $tag_size" \
+       "deadbeef missing" \
+       " missing" >batch_check_output
 
 test_expect_success "--batch-check with multiple sha1s gives correct format" '
-    test "$batch_check_output" = \
-    "$(echo_without_newline "$batch_check_input" | git cat-file --batch-check)"
+       tr "\0" "\n" <batch_check_output >expect &&
+       echo_without_newline "$batch_check_input" >in &&
+       git cat-file --batch-check <in >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success "--batch-check, -z with multiple sha1s gives correct format" '
-    echo_without_newline_nul "$batch_check_input" >in &&
-    test "$batch_check_output" = "$(git cat-file --batch-check -z <in)"
+       tr "\0" "\n" <batch_check_output >expect &&
+       echo_without_newline_nul "$batch_check_input" >in &&
+       git cat-file --batch-check -z <in >actual &&
+       test_cmp expect actual
 '
 
-test_expect_success FUNNYNAMES '--batch-check, -z with newline in input' '
+test_expect_success "--batch-check, -Z with multiple sha1s gives correct format" '
+       echo_without_newline_nul "$batch_check_input" >in &&
+       git cat-file --batch-check -Z <in >actual &&
+       test_cmp batch_check_output actual
+'
+
+test_expect_success FUNNYNAMES 'setup with newline in input' '
        touch -- "newline${LF}embedded" &&
        git add -- "newline${LF}embedded" &&
        git commit -m "file with newline embedded" &&
        test_tick &&
 
-       printf "HEAD:newline${LF}embedded" >in &&
-       git cat-file --batch-check -z <in >actual &&
+       printf "HEAD:newline${LF}embedded" >in
+'
 
+test_expect_success FUNNYNAMES '--batch-check, -z with newline in input' '
+       git cat-file --batch-check -z <in >actual &&
        echo "$(git rev-parse "HEAD:newline${LF}embedded") blob 0" >expect &&
        test_cmp expect actual
 '
 
+test_expect_success FUNNYNAMES '--batch-check, -Z with newline in input' '
+       git cat-file --batch-check -Z <in >actual &&
+       printf "%s\0" "$(git rev-parse "HEAD:newline${LF}embedded") blob 0" >expect &&
+       test_cmp expect actual
+'
+
 batch_command_multiple_info="info $hello_sha1
 info $tree_sha1
 info $commit_sha1
@@ -470,7 +503,13 @@ test_expect_success '--batch-command with multiple info calls gives correct form
        echo "$batch_command_multiple_info" | tr "\n" "\0" >in &&
        git cat-file --batch-command --buffer -z <in >actual &&
 
-       test_cmp expect actual
+       test_cmp expect actual &&
+
+       echo "$batch_command_multiple_info" | tr "\n" "\0" >in &&
+       tr "\n" "\0" <expect >expect_nul &&
+       git cat-file --batch-command --buffer -Z <in >actual &&
+
+       test_cmp expect_nul actual
 '
 
 batch_command_multiple_contents="contents $hello_sha1
@@ -480,27 +519,30 @@ contents deadbeef
 flush"
 
 test_expect_success '--batch-command with multiple command calls gives correct format' '
-       remove_timestamp >expect <<-EOF &&
-       $hello_sha1 blob $hello_size
-       $hello_content
-       $commit_sha1 commit $commit_size
-       $commit_content
-       $tag_sha1 tag $tag_size
-       $tag_content
-       deadbeef missing
-       EOF
+       printf "%s\0" \
+               "$hello_sha1 blob $hello_size" \
+               "$hello_content" \
+               "$commit_sha1 commit $commit_size" \
+               "$commit_content" \
+               "$tag_sha1 tag $tag_size" \
+               "$tag_content" \
+               "deadbeef missing" >expect_nul &&
+       tr "\0" "\n" <expect_nul >expect &&
 
        echo "$batch_command_multiple_contents" >in &&
-       git cat-file --batch-command --buffer <in >actual_raw &&
+       git cat-file --batch-command --buffer <in >actual &&
 
-       remove_timestamp <actual_raw >actual &&
        test_cmp expect actual &&
 
        echo "$batch_command_multiple_contents" | tr "\n" "\0" >in &&
-       git cat-file --batch-command --buffer -z <in >actual_raw &&
+       git cat-file --batch-command --buffer -z <in >actual &&
 
-       remove_timestamp <actual_raw >actual &&
-       test_cmp expect actual
+       test_cmp expect actual &&
+
+       echo "$batch_command_multiple_contents" | tr "\n" "\0" >in &&
+       git cat-file --batch-command --buffer -Z <in >actual &&
+
+       test_cmp expect_nul actual
 '
 
 test_expect_success 'setup blobs which are likely to delta' '
@@ -840,6 +882,13 @@ test_expect_success 'git cat-file --batch-check --follow-symlinks works for brok
        test_cmp expect actual
 '
 
+test_expect_success 'git cat-file --batch-check --follow-symlinks -Z works for broken in-repo, same-dir links' '
+       printf "HEAD:broken-same-dir-link\0" >in &&
+       printf "dangling 25\0HEAD:broken-same-dir-link\0" >expect &&
+       git cat-file --batch-check --follow-symlinks -Z <in >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'git cat-file --batch-check --follow-symlinks works for same-dir links-to-links' '
        echo HEAD:link-to-link | git cat-file --batch-check --follow-symlinks >actual &&
        test_cmp found actual
@@ -854,6 +903,15 @@ test_expect_success 'git cat-file --batch-check --follow-symlinks works for pare
        test_cmp expect actual
 '
 
+test_expect_success 'git cat-file --batch-check --follow-symlinks -Z works for parent-dir links' '
+       echo HEAD:dir/parent-dir-link | git cat-file --batch-check --follow-symlinks >actual &&
+       test_cmp found actual &&
+       printf "notdir 29\0HEAD:dir/parent-dir-link/nope\0" >expect &&
+       printf "HEAD:dir/parent-dir-link/nope\0" >in &&
+       git cat-file --batch-check --follow-symlinks -Z <in >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'git cat-file --batch-check --follow-symlinks works for .. links' '
        echo dangling 22 >expect &&
        echo HEAD:dir/link-dir/nope >>expect &&
@@ -968,6 +1026,13 @@ test_expect_success 'git cat-file --batch-check --follow-symlink breaks loops' '
        test_cmp expect actual
 '
 
+test_expect_success 'git cat-file --batch-check --follow-symlink -Z breaks loops' '
+       printf "loop 10\0HEAD:loop1\0" >expect &&
+       printf "HEAD:loop1\0" >in &&
+       git cat-file --batch-check --follow-symlinks -Z <in >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'git cat-file --batch --follow-symlink returns correct sha and mode' '
        echo HEAD:morx | git cat-file --batch >expect &&
        echo HEAD:morx | git cat-file --batch --follow-symlinks >actual &&
index 0c784813f15757e037bf061d2f9e9d82c3eca71b..8a95adf4b50de6b543598ceac84f8515d9442f4d 100755 (executable)
@@ -1377,7 +1377,7 @@ test_expect_success 'index.sparse disabled inline uses full index' '
        ! test_region index ensure_full_index trace2.txt
 '
 
-ensure_not_expanded () {
+run_sparse_index_trace2 () {
        rm -f trace2.txt &&
        if test -z "$WITHOUT_UNTRACKED_TXT"
        then
@@ -1397,7 +1397,16 @@ ensure_not_expanded () {
                        git -C sparse-index "$@" \
                        >sparse-index-out \
                        2>sparse-index-error || return 1
-       fi &&
+       fi
+}
+
+ensure_expanded () {
+       run_sparse_index_trace2 "$@" &&
+       test_region index ensure_full_index trace2.txt
+}
+
+ensure_not_expanded () {
+       run_sparse_index_trace2 "$@" &&
        test_region ! index ensure_full_index trace2.txt
 }
 
@@ -2080,22 +2089,32 @@ test_expect_success 'grep sparse directory within submodules' '
        test_cmp actual expect
 '
 
-test_expect_success 'write-tree on all' '
+test_expect_success 'write-tree' '
        init_repos &&
 
+       test_all_match git write-tree &&
+
        write_script edit-contents <<-\EOF &&
        echo text >>"$1"
        EOF
 
+       # make a change inside the sparse cone
        run_on_all ../edit-contents deep/a &&
-       run_on_all git update-index deep/a &&
+       test_all_match git update-index deep/a &&
        test_all_match git write-tree &&
+       test_all_match git status --porcelain=v2 &&
 
+       # make a change outside the sparse cone
        run_on_all mkdir -p folder1 &&
        run_on_all cp a folder1/a &&
        run_on_all ../edit-contents folder1/a &&
-       run_on_all git update-index folder1/a &&
-       test_all_match git write-tree
+       test_all_match git update-index folder1/a &&
+       test_all_match git write-tree &&
+       test_all_match git status --porcelain=v2 &&
+
+       # check that SKIP_WORKTREE files are not materialized
+       test_path_is_missing sparse-checkout/folder2/a &&
+       test_path_is_missing sparse-index/folder2/a
 '
 
 test_expect_success 'sparse-index is not expanded: write-tree' '
@@ -2108,4 +2127,136 @@ test_expect_success 'sparse-index is not expanded: write-tree' '
        ensure_not_expanded write-tree
 '
 
+test_expect_success 'diff-files with pathspec inside sparse definition' '
+       init_repos &&
+
+       write_script edit-contents <<-\EOF &&
+       echo text >>"$1"
+       EOF
+
+       run_on_all ../edit-contents deep/a &&
+
+       test_all_match git diff-files &&
+
+       test_all_match git diff-files -- deep/a &&
+
+       # test wildcard
+       test_all_match git diff-files -- "deep/*"
+'
+
+test_expect_success 'diff-files with pathspec outside sparse definition' '
+       init_repos &&
+
+       test_sparse_match git diff-files -- folder2/a &&
+
+       write_script edit-contents <<-\EOF &&
+       echo text >>"$1"
+       EOF
+
+       # The directory "folder1" is outside the cone of interest
+       # and will not exist in the sparse checkout repositories.
+       # Create it as needed, add file "folder1/a" there with
+       # contents that is different from the staged version.
+       run_on_all mkdir -p folder1 &&
+       run_on_all cp a folder1/a &&
+
+       run_on_all ../edit-contents folder1/a &&
+       test_all_match git diff-files &&
+       test_all_match git diff-files -- folder1/a &&
+       test_all_match git diff-files -- "folder*/a"
+'
+
+test_expect_success 'sparse index is not expanded: diff-files' '
+       init_repos &&
+
+       write_script edit-contents <<-\EOF &&
+       echo text >>"$1"
+       EOF
+
+       run_on_all ../edit-contents deep/a &&
+
+       ensure_not_expanded diff-files &&
+       ensure_not_expanded diff-files -- deep/a &&
+       ensure_not_expanded diff-files -- "deep/*"
+'
+
+test_expect_success 'diff-tree' '
+       init_repos &&
+
+       # Test change inside sparse cone
+       tree1=$(git -C sparse-index rev-parse HEAD^{tree}) &&
+       tree2=$(git -C sparse-index rev-parse update-deep^{tree}) &&
+       test_all_match git diff-tree $tree1 $tree2 &&
+       test_all_match git diff-tree $tree1 $tree2 -- deep/a &&
+       test_all_match git diff-tree HEAD update-deep &&
+       test_all_match git diff-tree HEAD update-deep -- deep/a &&
+
+       # Test change outside sparse cone
+       tree3=$(git -C sparse-index rev-parse update-folder1^{tree}) &&
+       test_all_match git diff-tree $tree1 $tree3 &&
+       test_all_match git diff-tree $tree1 $tree3 -- folder1/a &&
+       test_all_match git diff-tree HEAD update-folder1 &&
+       test_all_match git diff-tree HEAD update-folder1 -- folder1/a &&
+
+       # Check that SKIP_WORKTREE files are not materialized
+       test_path_is_missing sparse-checkout/folder1/a &&
+       test_path_is_missing sparse-index/folder1/a &&
+       test_path_is_missing sparse-checkout/folder2/a &&
+       test_path_is_missing sparse-index/folder2/a
+'
+
+test_expect_success 'sparse-index is not expanded: diff-tree' '
+       init_repos &&
+
+       tree1=$(git -C sparse-index rev-parse HEAD^{tree}) &&
+       tree2=$(git -C sparse-index rev-parse update-deep^{tree}) &&
+       tree3=$(git -C sparse-index rev-parse update-folder1^{tree}) &&
+
+       ensure_not_expanded diff-tree $tree1 $tree2 &&
+       ensure_not_expanded diff-tree $tree1 $tree2 -- deep/a &&
+       ensure_not_expanded diff-tree HEAD update-deep &&
+       ensure_not_expanded diff-tree HEAD update-deep -- deep/a &&
+       ensure_not_expanded diff-tree $tree1 $tree3 &&
+       ensure_not_expanded diff-tree $tree1 $tree3 -- folder1/a &&
+       ensure_not_expanded diff-tree HEAD update-folder1 &&
+       ensure_not_expanded diff-tree HEAD update-folder1 -- folder1/a
+'
+
+test_expect_success 'worktree' '
+       init_repos &&
+
+       write_script edit-contents <<-\EOF &&
+       echo text >>"$1"
+       EOF
+
+       for repo in full-checkout sparse-checkout sparse-index
+       do
+               worktree=${repo}-wt &&
+               git -C $repo worktree add ../$worktree &&
+
+               # Compare worktree content with "ls"
+               (cd $repo && ls) >worktree_contents &&
+               (cd $worktree && ls) >new_worktree_contents &&
+               test_cmp worktree_contents new_worktree_contents &&
+
+               # Compare index content with "ls-files --sparse"
+               git -C $repo ls-files --sparse >index_contents &&
+               git -C $worktree ls-files --sparse >new_index_contents &&
+               test_cmp index_contents new_index_contents &&
+
+               git -C $repo worktree remove ../$worktree || return 1
+       done &&
+
+       test_all_match git worktree add .worktrees/hotfix &&
+       run_on_all ../edit-contents .worktrees/hotfix/deep/a &&
+       test_all_match test_must_fail git worktree remove .worktrees/hotfix
+'
+
+test_expect_success 'worktree is not expanded' '
+       init_repos &&
+
+       ensure_not_expanded worktree add .worktrees/hotfix &&
+       ensure_not_expanded worktree remove .worktrees/hotfix
+'
+
 test_done
index 2575279ab84e8a32239a7ea30f72022d3ff6b9f8..387d336c91f44e58d1e5073febdae266156212c8 100755 (executable)
@@ -98,6 +98,23 @@ test_expect_success 'subsections are not canonicalized by git-config' '
        test_cmp_config two section.SubSection.key
 '
 
+test_missing_key () {
+       local key="$1" &&
+       local title="$2" &&
+       test_expect_success "value for $title is not printed" '
+               test_must_fail git config "$key" >out 2>err &&
+               test_must_be_empty out &&
+               test_must_be_empty err
+       '
+}
+
+test_missing_key 'missingsection.missingkey' 'missing section and missing key'
+test_missing_key 'missingsection.penguin' 'missing section and existing key'
+test_missing_key 'section.missingkey' 'existing section and missing key'
+test_missing_key 'section.MissingSubSection.missingkey' 'missing subsection and missing key'
+test_missing_key 'section.SubSection.missingkey' 'existing subsection and missing key'
+test_missing_key 'section.MissingSubSection.key' 'missing subsection and existing key'
+
 cat > .git/config <<\EOF
 [alpha]
 bar = foo
@@ -617,6 +634,36 @@ test_expect_success 'renaming to bogus section is rejected' '
        test_must_fail git config --rename-section branch.zwei "bogus name"
 '
 
+test_expect_success 'renaming a section with a long line' '
+       {
+               printf "[b]\\n" &&
+               printf "  c = d %1024s [a] e = f\\n" " " &&
+               printf "[a] g = h\\n"
+       } >y &&
+       git config -f y --rename-section a xyz &&
+       test_must_fail git config -f y b.e
+'
+
+test_expect_success 'renaming an embedded section with a long line' '
+       {
+               printf "[b]\\n" &&
+               printf "  c = d %1024s [a] [foo] e = f\\n" " " &&
+               printf "[a] g = h\\n"
+       } >y &&
+       git config -f y --rename-section a xyz &&
+       test_must_fail git config -f y foo.e
+'
+
+test_expect_success 'renaming a section with an overly-long line' '
+       {
+               printf "[b]\\n" &&
+               printf "  c = d %525000s e" " " &&
+               printf "[a] g = h\\n"
+       } >y &&
+       test_must_fail git config -f y --rename-section a xyz 2>err &&
+       grep "refusing to work with overly long line in .y. on line 2" err
+'
+
 cat >> .git/config << EOF
   [branch "zwei"] a = 1 [branch "vier"]
 EOF
@@ -1458,35 +1505,29 @@ test_expect_success 'git config ignores pairs without count' '
        test_must_be_empty error
 '
 
-test_expect_success 'git config ignores pairs with zero count' '
-       test_must_fail env \
-               GIT_CONFIG_COUNT=0 \
-               GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
-               git config pair.one
-'
-
 test_expect_success 'git config ignores pairs exceeding count' '
        GIT_CONFIG_COUNT=1 \
                GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
                GIT_CONFIG_KEY_1="pair.two" GIT_CONFIG_VALUE_1="value" \
-               git config --get-regexp "pair.*" >actual &&
+               git config --get-regexp "pair.*" >actual 2>error &&
        cat >expect <<-EOF &&
        pair.one value
        EOF
-       test_cmp expect actual
+       test_cmp expect actual &&
+       test_must_be_empty error
 '
 
 test_expect_success 'git config ignores pairs with zero count' '
        test_must_fail env \
                GIT_CONFIG_COUNT=0 GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
-               git config pair.one >error &&
+               git config pair.one 2>error &&
        test_must_be_empty error
 '
 
 test_expect_success 'git config ignores pairs with empty count' '
        test_must_fail env \
                GIT_CONFIG_COUNT= GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \
-               git config pair.one >error &&
+               git config pair.one 2>error &&
        test_must_be_empty error
 '
 
@@ -1571,11 +1612,11 @@ test_expect_success 'git config --edit respects core.editor' '
 # malformed configuration files
 test_expect_success 'barf on syntax error' '
        cat >.git/config <<-\EOF &&
-       # broken section line
+       # broken key=value
        [section]
        key garbage
        EOF
-       test_must_fail git config --get section.key >actual 2>error &&
+       test_must_fail git config --get section.key 2>error &&
        test_i18ngrep " line 3 " error
 '
 
@@ -1585,17 +1626,17 @@ test_expect_success 'barf on incomplete section header' '
        [section
        key = value
        EOF
-       test_must_fail git config --get section.key >actual 2>error &&
+       test_must_fail git config --get section.key 2>error &&
        test_i18ngrep " line 2 " error
 '
 
 test_expect_success 'barf on incomplete string' '
        cat >.git/config <<-\EOF &&
-       # broken section line
+       # broken value string
        [section]
        key = "value string
        EOF
-       test_must_fail git config --get section.key >actual 2>error &&
+       test_must_fail git config --get section.key 2>error &&
        test_i18ngrep " line 3 " error
 '
 
@@ -1627,6 +1668,21 @@ test_expect_success 'urlmatch' '
        test_cmp expect actual
 '
 
+test_expect_success 'urlmatch with --show-scope' '
+       cat >.git/config <<-\EOF &&
+       [http "https://weak.example.com"]
+               sslVerify = false
+               cookieFile = /tmp/cookie.txt
+       EOF
+
+       cat >expect <<-EOF &&
+       local   http.cookiefile /tmp/cookie.txt
+       local   http.sslverify false
+       EOF
+       git config --get-urlmatch --show-scope HTTP https://weak.example.com >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'urlmatch favors more specific URLs' '
        cat >.git/config <<-\EOF &&
        [http "https://example.com/"]
@@ -2014,6 +2070,12 @@ test_expect_success '--show-origin blob ref' '
        test_cmp expect output
 '
 
+test_expect_success '--show-origin with --default' '
+       git config --show-origin --default foo some.key >actual &&
+       echo "command line:     foo" >expect &&
+       test_cmp expect actual
+'
+
 test_expect_success '--show-scope with --list' '
        cat >expect <<-EOF &&
        global  user.global=true
@@ -2082,6 +2144,12 @@ test_expect_success '--show-scope with --show-origin' '
        test_cmp expect output
 '
 
+test_expect_success '--show-scope with --default' '
+       git config --show-scope --default foo some.key >actual &&
+       echo "command   foo" >expect &&
+       test_cmp expect actual
+'
+
 test_expect_success 'override global and system config' '
        test_when_finished rm -f \"\$HOME\"/.gitconfig &&
        cat >"$HOME"/.gitconfig <<-EOF &&
index 1b6437ec0794e887e1d14452c516c487d0bb007f..e5a0d65caa3e4cc363319826f37a4254bfc99b33 100755 (executable)
@@ -52,6 +52,28 @@ test_expect_success 'shared=all' '
        test 2 = $(git config core.sharedrepository)
 '
 
+test_expect_failure 'template can set core.bare' '
+       test_when_finished "rm -rf subdir" &&
+       test_when_finished "rm -rf templates" &&
+       test_config core.bare true &&
+       umask 0022 &&
+       mkdir -p templates/ &&
+       cp .git/config templates/config &&
+       git init --template=templates subdir &&
+       test_path_exists subdir/HEAD
+'
+
+test_expect_success 'template can set core.bare but overridden by command line' '
+       test_when_finished "rm -rf subdir" &&
+       test_when_finished "rm -rf templates" &&
+       test_config core.bare true &&
+       umask 0022 &&
+       mkdir -p templates/ &&
+       cp .git/config templates/config &&
+       git init --no-bare --template=templates subdir &&
+       test_path_exists subdir/.git/HEAD
+'
+
 test_expect_success POSIXPERM 'update-server-info honors core.sharedRepository' '
        : > a1 &&
        git add a1 &&
@@ -89,7 +111,7 @@ do
                rm -f .git/info/refs &&
                git update-server-info &&
                actual="$(test_modebits .git/info/refs)" &&
-               verbose test "x$actual" = "x-$y"
+               test "x$actual" = "x-$y"
 
        '
 
@@ -99,7 +121,7 @@ do
                rm -f .git/info/refs &&
                git update-server-info &&
                actual="$(test_modebits .git/info/refs)" &&
-               verbose test "x$actual" = "x-$x"
+               test "x$actual" = "x-$x"
 
        '
 
diff --git a/t/t1419-exclude-refs.sh b/t/t1419-exclude-refs.sh
new file mode 100755 (executable)
index 0000000..5d8c86b
--- /dev/null
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+test_description='test exclude_patterns functionality in main ref store'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+for_each_ref__exclude () {
+       GIT_TRACE2_PERF=1 test-tool ref-store main \
+               for-each-ref--exclude "$@" >actual.raw
+       cut -d ' ' -f 2 actual.raw
+}
+
+for_each_ref () {
+       git for-each-ref --format='%(refname)' "$@"
+}
+
+assert_jumps () {
+       local nr="$1"
+       local trace="$2"
+
+       grep -q "name:jumps_made value:$nr$" $trace
+}
+
+assert_no_jumps () {
+       ! assert_jumps ".*" "$1"
+}
+
+test_expect_success 'setup' '
+       test_commit --no-tag base &&
+       base="$(git rev-parse HEAD)" &&
+
+       for name in foo bar baz quux
+       do
+               for i in 1 2 3
+               do
+                       echo "create refs/heads/$name/$i $base" || return 1
+               done || return 1
+       done >in &&
+       echo "delete refs/heads/main" >>in &&
+
+       git update-ref --stdin <in &&
+       git pack-refs --all
+'
+
+test_expect_success 'excluded region in middle' '
+       for_each_ref__exclude refs/heads refs/heads/foo >actual 2>perf &&
+       for_each_ref refs/heads/bar refs/heads/baz refs/heads/quux >expect &&
+
+       test_cmp expect actual &&
+       assert_jumps 1 perf
+'
+
+test_expect_success 'excluded region at beginning' '
+       for_each_ref__exclude refs/heads refs/heads/bar >actual 2>perf &&
+       for_each_ref refs/heads/baz refs/heads/foo refs/heads/quux >expect &&
+
+       test_cmp expect actual &&
+       assert_jumps 1 perf
+'
+
+test_expect_success 'excluded region at end' '
+       for_each_ref__exclude refs/heads refs/heads/quux >actual 2>perf &&
+       for_each_ref refs/heads/foo refs/heads/bar refs/heads/baz >expect &&
+
+       test_cmp expect actual &&
+       assert_jumps 1 perf
+'
+
+test_expect_success 'disjoint excluded regions' '
+       for_each_ref__exclude refs/heads refs/heads/bar refs/heads/quux >actual 2>perf &&
+       for_each_ref refs/heads/baz refs/heads/foo >expect &&
+
+       test_cmp expect actual &&
+       assert_jumps 2 perf
+'
+
+test_expect_success 'adjacent, non-overlapping excluded regions' '
+       for_each_ref__exclude refs/heads refs/heads/bar refs/heads/baz >actual 2>perf &&
+       for_each_ref refs/heads/foo refs/heads/quux >expect &&
+
+       test_cmp expect actual &&
+       assert_jumps 1 perf
+'
+
+test_expect_success 'overlapping excluded regions' '
+       for_each_ref__exclude refs/heads refs/heads/ba refs/heads/baz >actual 2>perf &&
+       for_each_ref refs/heads/foo refs/heads/quux >expect &&
+
+       test_cmp expect actual &&
+       assert_jumps 1 perf
+'
+
+test_expect_success 'several overlapping excluded regions' '
+       for_each_ref__exclude refs/heads \
+               refs/heads/bar refs/heads/baz refs/heads/foo >actual 2>perf &&
+       for_each_ref refs/heads/quux >expect &&
+
+       test_cmp expect actual &&
+       assert_jumps 1 perf
+'
+
+test_expect_success 'non-matching excluded section' '
+       for_each_ref__exclude refs/heads refs/heads/does/not/exist >actual 2>perf &&
+       for_each_ref >expect &&
+
+       test_cmp expect actual &&
+       assert_no_jumps perf
+'
+
+test_expect_success 'meta-characters are discarded' '
+       for_each_ref__exclude refs/heads "refs/heads/ba*" >actual 2>perf &&
+       for_each_ref >expect &&
+
+       test_cmp expect actual &&
+       assert_no_jumps perf
+'
+
+test_done
index bca46378b256f824708a0fb5bcb0afe3f1de1056..5805d47eb96c1eb72c761e50a8ba4670f5d7947a 100755 (executable)
@@ -989,10 +989,7 @@ test_expect_success 'fsck error and recovery on invalid object type' '
 
                garbage_blob=$(git hash-object --stdin -w -t garbage --literally </dev/null) &&
 
-               cat >err.expect <<-\EOF &&
-               fatal: invalid object type
-               EOF
-               test_must_fail git fsck >out 2>err &&
+               test_must_fail git fsck 2>err &&
                grep -e "^error" -e "^fatal" err >errors &&
                test_line_count = 1 errors &&
                grep "$garbage_blob: object is of unknown type '"'"'garbage'"'"':" err
@@ -1039,9 +1036,9 @@ test_expect_success 'fsck detects problems in worktree index' '
        test_cmp expect actual
 '
 
-test_expect_success 'fsck reports problems in main index without filename' '
+test_expect_success 'fsck reports problems in current worktree index without filename' '
        test_when_finished "rm -f .git/index && git read-tree HEAD" &&
-       echo "this object will be removed to break the main index" >file &&
+       echo "this object will be removed to break current worktree index" >file &&
        git add file &&
        blob=$(git rev-parse :file) &&
        remove_object $blob &&
index de1d48f3ba29116d073b0a5573a2031fae7fcc1d..dd811b7fb467c4f3f27ef1be14427e022f73caeb 100755 (executable)
@@ -302,14 +302,14 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:"
        |EOF
        END_EXPECT
 
-       test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
+       test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
        test_cmp expect actual
 '
 
 test_expect_success 'test --parseopt invalid opt-spec' '
        test_write_lines x -- "=, x" >spec &&
        echo "fatal: missing opt-spec before option flags" >expect &&
-       test_must_fail git rev-parse --parseopt -- >out <spec 2>err &&
+       test_must_fail git rev-parse --parseopt -- <spec 2>err &&
        test_cmp expect err
 '
 
@@ -339,7 +339,7 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l
        |EOF
        END_EXPECT
 
-       test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
+       test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
        test_cmp expect actual
 '
 
index d94c72c672b05e2fe3fb7f3a99d907b2021795e7..b9af6b3ac035a04858ae0c7e0963166af665bd81 100755 (executable)
@@ -5,6 +5,7 @@ test_description='test <branch>@{upstream} syntax'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 
@@ -97,7 +98,8 @@ test_expect_success 'my-side@{u} resolves to correct commit' '
        commit_subject my-side >actual &&
        test_cmp expect actual &&
        echo 5 >expect &&
-       commit_subject my-side@{u} >actual
+       commit_subject my-side@{u} >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'not-tracking@{u} fails' '
index 87a42864145f85ed539b9d1cbb9a3dd5f71fc708..e841309d0eab1022f3442c23795f884ad98a8280 100755 (executable)
@@ -4,6 +4,7 @@ test_description='test various @{X} syntax combinations together'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 check() {
index d868a0811056c83810bdd468d85e6f3a90622da7..a835a196aa81be9e7aa79f38c3977a03b71b5336 100755 (executable)
@@ -4,6 +4,7 @@ test_description='test <branch>@{push} syntax'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 resolve () {
index 3506f627b6cf20f11e4cfd78b309e9e9acc07148..8b0234cf2d5d96980403d65b844639715acfe91b 100755 (executable)
@@ -156,25 +156,15 @@ test_expect_success 'git hook run a hook with a bad shebang' '
        mkdir bad-hooks &&
        write_script bad-hooks/test-hook "/bad/path/no/spaces" </dev/null &&
 
-       # TODO: We should emit the same (or at least a more similar)
-       # error on MINGW (essentially Git for Windows) and all other
-       # platforms.. See the OS-specific code in start_command()
-       if test_have_prereq !MINGW
-       then
-               cat >expect <<-\EOF
-               fatal: cannot run bad-hooks/test-hook: ...
-               EOF
-       else
-               cat >expect <<-\EOF
-               error: cannot spawn bad-hooks/test-hook: ...
-               EOF
-       fi &&
        test_expect_code 1 git \
                -c core.hooksPath=bad-hooks \
                hook run test-hook >out 2>err &&
        test_must_be_empty out &&
-       sed -e "s/test-hook: .*/test-hook: .../" <err >actual &&
-       test_cmp expect actual
+
+       # TODO: We should emit the same (or at least a more similar)
+       # error on MINGW (essentially Git for Windows) and all other
+       # platforms.. See the OS-specific code in start_command()
+       grep -E "^(error|fatal): cannot (exec|spawn) .*bad-hooks/test-hook" err
 '
 
 test_expect_success 'stdin to hooks' '
index 2c8c926b4d73a32a23380ec347e6c89c5a8e9657..95405886640a4fb304a565ccc4a166f450c0f5c8 100755 (executable)
@@ -16,7 +16,7 @@ test_expect_success 'setup ambiguous refs' '
 '
 
 test_expect_success 'checkout ambiguous ref succeeds' '
-       git checkout ambiguity >stdout 2>stderr
+       git checkout ambiguity 2>stderr
 '
 
 test_expect_success 'checkout produces ambiguity warning' '
@@ -37,7 +37,7 @@ test_expect_success 'checkout reports switch to branch' '
 '
 
 test_expect_success 'checkout vague ref succeeds' '
-       git checkout vagueness >stdout 2>stderr &&
+       git checkout vagueness 2>stderr &&
        test_set_prereq VAGUENESS_SUCCESS
 '
 
index 034f62c13c5949cd4b8dbadf14013f7ce980db31..ecfacf0f7f3a5fa7c03fa837891c745dec10dda6 100755 (executable)
@@ -77,7 +77,7 @@ test_expect_success 'checkout --overwrite-ignore should succeed if only ignored
        echo autogenerated information >some_dir/ignore &&
        echo ignore >.git/info/exclude &&
        git checkout --overwrite-ignore df_conflict &&
-       ! test_path_is_dir some_dir
+       test_path_is_file some_dir
 '
 
 test_done
index dca35aa3e3e264002703932e56add4322b475fcf..a8bbc60954f5f0d41815582a32d85f70e4dc2b8c 100755 (executable)
@@ -5,6 +5,7 @@ test_description='tests for git branch --track'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '
index be394f1131ac191476dfa228be6fc6f35e0cecd0..c01492f33f860db2d6ae8764c94c084429abeef5 100755 (executable)
@@ -197,4 +197,15 @@ test_expect_success '"add -u non-existent" should fail' '
        ! grep "non-existent" actual
 '
 
+test_expect_success '"commit -a" implies "add -u" if index becomes empty' '
+       git rm -rf \* &&
+       git commit -m clean-slate &&
+       test_commit file1 &&
+       rm file1.t &&
+       test_tick &&
+       git commit -a -m remove &&
+       git ls-tree HEAD: >out &&
+       test_must_be_empty out
+'
+
 test_done
index d587e0b20db22423ef1a1d204076c50b769e0375..051363acbbc784ec5b2cc3d0c6ddfc3af87cdd6c 100755 (executable)
@@ -298,17 +298,24 @@ test_expect_success '"add" no auto-vivify with --detach and <branch> omitted' '
        test_must_fail git -C mish/mash symbolic-ref HEAD
 '
 
-test_expect_success '"add" -b/-B mutually exclusive' '
-       test_must_fail git worktree add -b poodle -B poodle bamboo main
-'
-
-test_expect_success '"add" -b/--detach mutually exclusive' '
-       test_must_fail git worktree add -b poodle --detach bamboo main
-'
+# Helper function to test mutually exclusive options.
+#
+# Note: Quoted arguments containing spaces are not supported.
+test_wt_add_excl () {
+       local opts="$*" &&
+       test_expect_success "'worktree add' with '$opts' has mutually exclusive options" '
+               test_must_fail git worktree add $opts 2>actual &&
+               grep -E "fatal:( options)? .* cannot be used together" actual
+       '
+}
 
-test_expect_success '"add" -B/--detach mutually exclusive' '
-       test_must_fail git worktree add -B poodle --detach bamboo main
-'
+test_wt_add_excl -b poodle -B poodle bamboo main
+test_wt_add_excl -b poodle --detach bamboo main
+test_wt_add_excl -B poodle --detach bamboo main
+test_wt_add_excl --orphan --detach bamboo
+test_wt_add_excl --orphan --no-checkout bamboo
+test_wt_add_excl --orphan bamboo main
+test_wt_add_excl --orphan -b bamboo wtdir/ main
 
 test_expect_success '"add -B" fails if the branch is checked out' '
        git rev-parse newmain >before &&
@@ -326,10 +333,111 @@ test_expect_success 'add -B' '
 '
 
 test_expect_success 'add --quiet' '
+       test_when_finished "git worktree remove -f -f another-worktree" &&
        git worktree add --quiet another-worktree main 2>actual &&
        test_must_be_empty actual
 '
 
+test_expect_success 'add --quiet -b' '
+       test_when_finished "git branch -D quietnewbranch" &&
+       test_when_finished "git worktree remove -f -f another-worktree" &&
+       git worktree add --quiet -b quietnewbranch another-worktree 2>actual &&
+       test_must_be_empty actual
+'
+
+test_expect_success '"add --orphan"' '
+       test_when_finished "git worktree remove -f -f orphandir" &&
+       git worktree add --orphan -b neworphan orphandir &&
+       echo refs/heads/neworphan >expected &&
+       git -C orphandir symbolic-ref HEAD >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success '"add --orphan (no -b)"' '
+       test_when_finished "git worktree remove -f -f neworphan" &&
+       git worktree add --orphan neworphan &&
+       echo refs/heads/neworphan >expected &&
+       git -C neworphan symbolic-ref HEAD >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success '"add --orphan --quiet"' '
+       test_when_finished "git worktree remove -f -f orphandir" &&
+       git worktree add --quiet --orphan -b neworphan orphandir 2>log.actual &&
+       test_must_be_empty log.actual &&
+       echo refs/heads/neworphan >expected &&
+       git -C orphandir symbolic-ref HEAD >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success '"add --orphan" fails if the branch already exists' '
+       test_when_finished "git branch -D existingbranch" &&
+       git worktree add -b existingbranch orphandir main &&
+       git worktree remove orphandir &&
+       test_must_fail git worktree add --orphan -b existingbranch orphandir
+'
+
+test_expect_success '"add --orphan" with empty repository' '
+       test_when_finished "rm -rf empty_repo" &&
+       echo refs/heads/newbranch >expected &&
+       GIT_DIR="empty_repo" git init --bare &&
+       git -C empty_repo worktree add --orphan -b newbranch worktreedir &&
+       git -C empty_repo/worktreedir symbolic-ref HEAD >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success '"add" worktree with orphan branch and lock' '
+       git worktree add --lock --orphan -b orphanbr orphan-with-lock &&
+       test_when_finished "git worktree unlock orphan-with-lock || :" &&
+       test -f .git/worktrees/orphan-with-lock/locked
+'
+
+test_expect_success '"add" worktree with orphan branch, lock, and reason' '
+       lock_reason="why not" &&
+       git worktree add --detach --lock --reason "$lock_reason" orphan-with-lock-reason main &&
+       test_when_finished "git worktree unlock orphan-with-lock-reason || :" &&
+       test -f .git/worktrees/orphan-with-lock-reason/locked &&
+       echo "$lock_reason" >expect &&
+       test_cmp expect .git/worktrees/orphan-with-lock-reason/locked
+'
+
+# Note: Quoted arguments containing spaces are not supported.
+test_wt_add_orphan_hint () {
+       local context="$1" &&
+       local use_branch=$2 &&
+       shift 2 &&
+       local opts="$*" &&
+       test_expect_success "'worktree add' show orphan hint in bad/orphan HEAD w/ $context" '
+               test_when_finished "rm -rf repo" &&
+               git init repo &&
+               (cd repo && test_commit commit) &&
+               git -C repo switch --orphan noref &&
+               test_must_fail git -C repo worktree add $opts foobar/ 2>actual &&
+               ! grep "error: unknown switch" actual &&
+               grep "hint: If you meant to create a worktree containing a new orphan branch" actual &&
+               if [ $use_branch -eq 1 ]
+               then
+                       grep -E "^hint: +git worktree add --orphan -b [^ ]+ [^ ]+$" actual
+               else
+                       grep -E "^hint: +git worktree add --orphan [^ ]+$" actual
+               fi
+
+       '
+}
+
+test_wt_add_orphan_hint 'no opts' 0
+test_wt_add_orphan_hint '-b' 1 -b foobar_branch
+test_wt_add_orphan_hint '-B' 1 -B foobar_branch
+
+test_expect_success "'worktree add' doesn't show orphan hint in bad/orphan HEAD w/ --quiet" '
+       test_when_finished "rm -rf repo" &&
+       git init repo &&
+       (cd repo && test_commit commit) &&
+       test_must_fail git -C repo worktree add --quiet foobar_branch foobar/ 2>actual &&
+       ! grep "error: unknown switch" actual &&
+       ! grep "hint: If you meant to create a worktree containing a new orphan branch" actual
+'
+
 test_expect_success 'local clone from linked checkout' '
        git clone --local here here-clone &&
        ( cd here-clone && git fsck )
@@ -446,6 +554,14 @@ setup_remote_repo () {
        )
 }
 
+test_expect_success '"add" <path> <remote/branch> w/ no HEAD' '
+       test_when_finished rm -rf repo_upstream repo_local foo &&
+       setup_remote_repo repo_upstream repo_local &&
+       git -C repo_local config --bool core.bare true &&
+       git -C repo_local branch -D main &&
+       git -C repo_local worktree add ./foo repo_upstream/foo
+'
+
 test_expect_success '--no-track avoids setting up tracking' '
        test_when_finished rm -rf repo_upstream repo_local foo &&
        setup_remote_repo repo_upstream repo_local &&
@@ -528,6 +644,35 @@ test_expect_success 'git worktree add --guess-remote sets up tracking' '
                test_cmp_rev refs/remotes/repo_a/foo refs/heads/foo
        )
 '
+test_expect_success 'git worktree add --guess-remote sets up tracking (quiet)' '
+       test_when_finished rm -rf repo_a repo_b foo &&
+       setup_remote_repo repo_a repo_b &&
+       (
+               cd repo_b &&
+               git worktree add --quiet --guess-remote ../foo 2>actual &&
+               test_must_be_empty actual
+       ) &&
+       (
+               cd foo &&
+               test_branch_upstream foo repo_a foo &&
+               test_cmp_rev refs/remotes/repo_a/foo refs/heads/foo
+       )
+'
+
+test_expect_success 'git worktree --no-guess-remote (quiet)' '
+       test_when_finished rm -rf repo_a repo_b foo &&
+       setup_remote_repo repo_a repo_b &&
+       (
+               cd repo_b &&
+               git worktree add --quiet --no-guess-remote ../foo
+       ) &&
+       (
+               cd foo &&
+               test_must_fail git config "branch.foo.remote" &&
+               test_must_fail git config "branch.foo.merge" &&
+               test_cmp_rev ! refs/remotes/repo_a/foo refs/heads/foo
+       )
+'
 
 test_expect_success 'git worktree add with worktree.guessRemote sets up tracking' '
        test_when_finished rm -rf repo_a repo_b foo &&
@@ -560,6 +705,348 @@ test_expect_success 'git worktree --no-guess-remote option overrides config' '
        )
 '
 
+test_dwim_orphan () {
+       local info_text="No possible source branch, inferring '--orphan'" &&
+       local fetch_error_text="fatal: No local or remote refs exist despite at least one remote" &&
+       local orphan_hint="hint: If you meant to create a worktree containing a new orphan branch" &&
+       local invalid_ref_regex="^fatal: invalid reference: " &&
+       local bad_combo_regex="^fatal: '[-a-z]*' and '[-a-z]*' cannot be used together" &&
+
+       local git_ns="repo" &&
+       local dashc_args="-C $git_ns" &&
+       local use_cd=0 &&
+
+       local bad_head=0 &&
+       local empty_repo=1 &&
+       local local_ref=0 &&
+       local use_quiet=0 &&
+       local remote=0 &&
+       local remote_ref=0 &&
+       local use_detach=0 &&
+       local use_new_branch=0 &&
+
+       local outcome="$1" &&
+       local outcome_text &&
+       local success &&
+       shift &&
+       local args="" &&
+       local context="" &&
+       case "$outcome" in
+       "infer")
+               success=1 &&
+               outcome_text='"add" DWIM infer --orphan'
+               ;;
+       "no_infer")
+               success=1 &&
+               outcome_text='"add" DWIM doesnt infer --orphan'
+               ;;
+       "fetch_error")
+               success=0 &&
+               outcome_text='"add" error need fetch'
+               ;;
+       "fatal_orphan_bad_combo")
+               success=0 &&
+               outcome_text='"add" error inferred "--orphan" gives illegal opts combo'
+               ;;
+       "warn_bad_head")
+               success=0 &&
+               outcome_text='"add" error, warn on bad HEAD, hint use orphan'
+               ;;
+       *)
+               echo "test_dwim_orphan(): invalid outcome: '$outcome'" >&2 &&
+               return 1
+               ;;
+       esac &&
+       while [ $# -gt 0 ]
+       do
+               case "$1" in
+               # How and from where to create the worktree
+               "-C_repo")
+                       use_cd=0 &&
+                       git_ns="repo" &&
+                       dashc_args="-C $git_ns" &&
+                       context="$context, 'git -C repo'"
+                       ;;
+               "-C_wt")
+                       use_cd=0 &&
+                       git_ns="wt" &&
+                       dashc_args="-C $git_ns" &&
+                       context="$context, 'git -C wt'"
+                       ;;
+               "cd_repo")
+                       use_cd=1 &&
+                       git_ns="repo" &&
+                       dashc_args="" &&
+                       context="$context, 'cd repo && git'"
+                       ;;
+               "cd_wt")
+                       use_cd=1 &&
+                       git_ns="wt" &&
+                       dashc_args="" &&
+                       context="$context, 'cd wt && git'"
+                       ;;
+
+               # Bypass the "pull first" warning
+               "force")
+                       args="$args --force" &&
+                       context="$context, --force"
+                       ;;
+
+               # Try to use remote refs when DWIM
+               "guess_remote")
+                       args="$args --guess-remote" &&
+                       context="$context, --guess-remote"
+                       ;;
+               "no_guess_remote")
+                       args="$args --no-guess-remote" &&
+                       context="$context, --no-guess-remote"
+                       ;;
+
+               # Whether there is at least one local branch present
+               "local_ref")
+                       empty_repo=0 &&
+                       local_ref=1 &&
+                       context="$context, >=1 local branches"
+                       ;;
+               "no_local_ref")
+                       empty_repo=0 &&
+                       context="$context, 0 local branches"
+                       ;;
+
+               # Whether the HEAD points at a valid ref (skip this opt when no refs)
+               "good_head")
+                       # requires: local_ref
+                       context="$context, valid HEAD"
+                       ;;
+               "bad_head")
+                       bad_head=1 &&
+                       context="$context, invalid (or orphan) HEAD"
+                       ;;
+
+               # Whether the code path is tested with the base add command, -b, or --detach
+               "no_-b")
+                       use_new_branch=0 &&
+                       context="$context, no --branch"
+                       ;;
+               "-b")
+                       use_new_branch=1 &&
+                       context="$context, --branch"
+                       ;;
+               "detach")
+                       use_detach=1 &&
+                       context="$context, --detach"
+                       ;;
+
+               # Whether to check that all output is suppressed (except errors)
+               # or that the output is as expected
+               "quiet")
+                       use_quiet=1 &&
+                       args="$args --quiet" &&
+                       context="$context, --quiet"
+                       ;;
+               "no_quiet")
+                       use_quiet=0 &&
+                       context="$context, no --quiet (expect output)"
+                       ;;
+
+               # Whether there is at least one remote attached to the repo
+               "remote")
+                       empty_repo=0 &&
+                       remote=1 &&
+                       context="$context, >=1 remotes"
+                       ;;
+               "no_remote")
+                       empty_repo=0 &&
+                       remote=0 &&
+                       context="$context, 0 remotes"
+                       ;;
+
+               # Whether there is at least one valid remote ref
+               "remote_ref")
+                       # requires: remote
+                       empty_repo=0 &&
+                       remote_ref=1 &&
+                       context="$context, >=1 fetched remote branches"
+                       ;;
+               "no_remote_ref")
+                       empty_repo=0 &&
+                       remote_ref=0 &&
+                       context="$context, 0 fetched remote branches"
+                       ;;
+
+               # Options or flags that become illegal when --orphan is inferred
+               "no_checkout")
+                       args="$args --no-checkout" &&
+                       context="$context, --no-checkout"
+                       ;;
+               "track")
+                       args="$args --track" &&
+                       context="$context, --track"
+                       ;;
+
+               # All other options are illegal
+               *)
+                       echo "test_dwim_orphan(): invalid arg: '$1'" >&2 &&
+                       return 1
+                       ;;
+               esac &&
+               shift
+       done &&
+       context="${context#', '}" &&
+       if [ $use_new_branch -eq 1 ]
+       then
+               args="$args -b foo"
+       elif [ $use_detach -eq 1 ]
+       then
+               args="$args --detach"
+       else
+               context="DWIM (no --branch), $context"
+       fi &&
+       if [ $empty_repo -eq 1 ]
+       then
+               context="empty repo, $context"
+       fi &&
+       args="$args ../foo" &&
+       context="${context%', '}" &&
+       test_expect_success "$outcome_text w/ $context" '
+               test_when_finished "rm -rf repo" &&
+               git init repo &&
+               if [ $local_ref -eq 1 ] && [ "$git_ns" = "repo" ]
+               then
+                       (cd repo && test_commit commit) &&
+                       if [ $bad_head -eq 1 ]
+                       then
+                               git -C repo symbolic-ref HEAD refs/heads/badbranch
+                       fi
+               elif [ $local_ref -eq 1 ] && [ "$git_ns" = "wt" ]
+               then
+                       test_when_finished "git -C repo worktree remove -f ../wt" &&
+                       git -C repo worktree add --orphan -b main ../wt &&
+                       (cd wt && test_commit commit) &&
+                       if [ $bad_head -eq 1 ]
+                       then
+                               git -C wt symbolic-ref HEAD refs/heads/badbranch
+                       fi
+               elif [ $local_ref -eq 0 ] && [ "$git_ns" = "wt" ]
+               then
+                       test_when_finished "git -C repo worktree remove -f ../wt" &&
+                       git -C repo worktree add --orphan -b orphanbranch ../wt
+               fi &&
+
+               if [ $remote -eq 1 ]
+               then
+                       test_when_finished "rm -rf upstream" &&
+                       git init upstream &&
+                       (cd upstream && test_commit commit) &&
+                       git -C upstream switch -c foo &&
+                       git -C repo remote add upstream ../upstream
+               fi &&
+
+               if [ $remote_ref -eq 1 ]
+               then
+                       git -C repo fetch
+               fi &&
+               if [ $success -eq 1 ]
+               then
+                       test_when_finished git -C repo worktree remove ../foo
+               fi &&
+               (
+                       if [ $use_cd -eq 1 ]
+                       then
+                               cd $git_ns
+                       fi &&
+                       if [ "$outcome" = "infer" ]
+                       then
+                               git $dashc_args worktree add $args 2>actual &&
+                               if [ $use_quiet -eq 1 ]
+                               then
+                                       test_must_be_empty actual
+                               else
+                                       grep "$info_text" actual
+                               fi
+                       elif [ "$outcome" = "no_infer" ]
+                       then
+                               git $dashc_args worktree add $args 2>actual &&
+                               if [ $use_quiet -eq 1 ]
+                               then
+                                       test_must_be_empty actual
+                               else
+                                       ! grep "$info_text" actual
+                               fi
+                       elif [ "$outcome" = "fetch_error" ]
+                       then
+                               test_must_fail git $dashc_args worktree add $args 2>actual &&
+                               grep "$fetch_error_text" actual
+                       elif [ "$outcome" = "fatal_orphan_bad_combo" ]
+                       then
+                               test_must_fail git $dashc_args worktree add $args 2>actual &&
+                               if [ $use_quiet -eq 1 ]
+                               then
+                                       ! grep "$info_text" actual
+                               else
+                                       grep "$info_text" actual
+                               fi &&
+                               grep "$bad_combo_regex" actual
+                       elif [ "$outcome" = "warn_bad_head" ]
+                       then
+                               test_must_fail git $dashc_args worktree add $args 2>actual &&
+                               if [ $use_quiet -eq 1 ]
+                               then
+                                       grep "$invalid_ref_regex" actual &&
+                                       ! grep "$orphan_hint" actual
+                               else
+                                       headpath=$(git $dashc_args rev-parse --path-format=absolute --git-path HEAD) &&
+                                       headcontents=$(cat "$headpath") &&
+                                       grep "HEAD points to an invalid (or orphaned) reference" actual &&
+                                       grep "HEAD path: .$headpath." actual &&
+                                       grep "HEAD contents: .$headcontents." actual &&
+                                       grep "$orphan_hint" actual &&
+                                       ! grep "$info_text" actual
+                               fi &&
+                               grep "$invalid_ref_regex" actual
+                       else
+                               # Unreachable
+                               false
+                       fi
+               ) &&
+               if [ $success -ne 1 ]
+               then
+                       test_path_is_missing foo
+               fi
+       '
+}
+
+for quiet_mode in "no_quiet" "quiet"
+do
+       for changedir_type in "cd_repo" "cd_wt" "-C_repo" "-C_wt"
+       do
+               dwim_test_args="$quiet_mode $changedir_type"
+               test_dwim_orphan 'infer' $dwim_test_args no_-b
+               test_dwim_orphan 'no_infer' $dwim_test_args no_-b local_ref good_head
+               test_dwim_orphan 'infer' $dwim_test_args no_-b no_local_ref no_remote no_remote_ref no_guess_remote
+               test_dwim_orphan 'infer' $dwim_test_args no_-b no_local_ref remote no_remote_ref no_guess_remote
+               test_dwim_orphan 'fetch_error' $dwim_test_args no_-b no_local_ref remote no_remote_ref guess_remote
+               test_dwim_orphan 'infer' $dwim_test_args no_-b no_local_ref remote no_remote_ref guess_remote force
+               test_dwim_orphan 'no_infer' $dwim_test_args no_-b no_local_ref remote remote_ref guess_remote
+
+               test_dwim_orphan 'infer' $dwim_test_args -b
+               test_dwim_orphan 'no_infer' $dwim_test_args -b local_ref good_head
+               test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref no_remote no_remote_ref no_guess_remote
+               test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref remote no_remote_ref no_guess_remote
+               test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref remote no_remote_ref guess_remote
+               test_dwim_orphan 'infer' $dwim_test_args -b no_local_ref remote remote_ref guess_remote
+
+               test_dwim_orphan 'warn_bad_head' $dwim_test_args no_-b local_ref bad_head
+               test_dwim_orphan 'warn_bad_head' $dwim_test_args -b local_ref bad_head
+               test_dwim_orphan 'warn_bad_head' $dwim_test_args detach local_ref bad_head
+       done
+
+       test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode no_-b no_checkout
+       test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode no_-b track
+       test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode -b no_checkout
+       test_dwim_orphan 'fatal_orphan_bad_combo' $quiet_mode -b track
+done
+
 post_checkout_hook () {
        test_when_finished "rm -rf .git/hooks" &&
        mkdir .git/hooks &&
index 019a40df2ca99480c547910026bf97102d54a23c..469443d8ae8c44483c7dbea8dd3c3fc2baef0745 100755 (executable)
@@ -58,7 +58,7 @@ test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in bisect' '
        git -C wt-4 bisect good wt-1 &&
 
        test_must_fail git branch -f wt-4 HEAD 2>err &&
-       grep "cannot force update the branch '\''wt-4'\'' checked out at.*wt-4" err
+       grep "cannot force update the branch '\''wt-4'\'' used by worktree at.*wt-4" err
 '
 
 test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase (apply)' '
@@ -68,7 +68,7 @@ test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase (app
        test_must_fail git -C wt-2 rebase --apply conflict-2 &&
 
        test_must_fail git branch -f wt-2 HEAD 2>err &&
-       grep "cannot force update the branch '\''wt-2'\'' checked out at.*wt-2" err
+       grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err
 '
 
 test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase (merge)' '
@@ -78,7 +78,7 @@ test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase (mer
        test_must_fail git -C wt-2 rebase conflict-2 &&
 
        test_must_fail git branch -f wt-2 HEAD 2>err &&
-       grep "cannot force update the branch '\''wt-2'\'' checked out at.*wt-2" err
+       grep "cannot force update the branch '\''wt-2'\'' used by worktree at.*wt-2" err
 '
 
 test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase with --update-refs' '
@@ -90,7 +90,7 @@ test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase with
        for i in 3 4
        do
                test_must_fail git branch -f can-be-updated HEAD 2>err &&
-               grep "cannot force update the branch '\''can-be-updated'\'' checked out at.*wt-3" err ||
+               grep "cannot force update the branch '\''can-be-updated'\'' used by worktree at.*wt-3" err ||
                        return 1
        done
 '
@@ -150,7 +150,7 @@ test_expect_success 'refuse to overwrite when in error states' '
        for i in 1 2
        do
                test_must_fail git branch -f fake-$i HEAD 2>err &&
-               grep "cannot force update the branch '\''fake-$i'\'' checked out at" err ||
+               grep "cannot force update the branch '\''fake-$i'\'' used by worktree at" err ||
                        return 1
        done
 '
index dd7770e85de8660061116d42aa32b8d20fe52f95..7308a3d4e25a8be915c6e2157b31c21a3585bd0c 100755 (executable)
@@ -299,6 +299,39 @@ test_expect_success '--recurse-submodules does not support --error-unmatch' '
        test_i18ngrep "does not support --error-unmatch" actual
 '
 
+test_expect_success '--recurse-submodules parses submodule repo config' '
+       test_config -C submodule index.sparse "invalid non-boolean value" &&
+       test_must_fail git ls-files --recurse-submodules 2>err &&
+       grep "bad boolean config value" err
+'
+
+test_expect_success '--recurse-submodules parses submodule worktree config' '
+       test_config -C submodule extensions.worktreeConfig true &&
+       test_config -C submodule --worktree index.sparse "invalid non-boolean value" &&
+
+       test_must_fail git ls-files --recurse-submodules 2>err &&
+       grep "bad boolean config value" err
+'
+
+test_expect_success '--recurse-submodules submodules ignore super project worktreeConfig extension' '
+       # Enable worktree config in both super project & submodule, set an
+       # invalid config in the submodule worktree config
+       test_config extensions.worktreeConfig true &&
+       test_config -C submodule extensions.worktreeConfig true &&
+       test_config -C submodule --worktree index.sparse "invalid non-boolean value" &&
+
+       # Now, disable the worktree config in the submodule. Note that we need
+       # to manually re-enable extensions.worktreeConfig when the test is
+       # finished, otherwise the test_unconfig of index.sparse will not work.
+       test_unconfig -C submodule extensions.worktreeConfig &&
+       test_when_finished "git -C submodule config extensions.worktreeConfig true" &&
+
+       # With extensions.worktreeConfig disabled in the submodule, the invalid
+       # worktree config is not picked up.
+       git ls-files --recurse-submodules 2>err &&
+       ! grep "bad boolean config value" err
+'
+
 test_incompatible_with_recurse_submodules () {
        test_expect_success "--recurse-submodules and $1 are incompatible" "
                test_must_fail git ls-files --recurse-submodules $1 2>actual &&
index ef6fb53f7f1cf53f6cf8c3727bc0b957ea7d9484..6e6ea0b6f3ca256eb3903b08ca7025e3508ecb0b 100755 (executable)
@@ -38,6 +38,41 @@ test_expect_success 'git ls-files --format objectname v.s. -s' '
        test_cmp expect actual
 '
 
+test_expect_success 'git ls-files --format objecttype' '
+       git ls-files --format="%(objectname)" o1.txt o4.txt o6.txt >objectname &&
+       git cat-file --batch-check="%(objecttype)" >expect <objectname &&
+       git ls-files --format="%(objecttype)" o1.txt o4.txt o6.txt >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format objectsize' '
+       cat>expect <<-\EOF &&
+26
+29
+27
+26
+-
+26
+       EOF
+       git ls-files --format="%(objectsize)" >actual &&
+
+       test_cmp expect actual
+'
+
+test_expect_success 'git ls-files --format objectsize:padded' '
+       cat>expect <<-\EOF &&
+     26
+     29
+     27
+     26
+      -
+     26
+       EOF
+       git ls-files --format="%(objectsize:padded)" >actual &&
+
+       test_cmp expect actual
+'
+
 test_expect_success 'git ls-files --format v.s. --eol' '
        git ls-files --eol >tmp &&
        sed -e "s/      / /g" -e "s/  */ /g" tmp >expect 2>err &&
index 217006d1bfb55df9f1e5874641226c9ad703b828..5af2dac0e4b8d5fde4d6a11dae240086473e0571 100755 (executable)
@@ -154,6 +154,14 @@ EOF
        test_output
 '
 
+test_expect_success 'ls-tree --no-full-name' '
+       git -C path0 ls-tree --no-full-name $tree a >current &&
+       cat >expected <<-EOF &&
+       040000 tree X   a
+       EOF
+       test_output
+'
+
 test_expect_success 'ls-tree --full-tree' '
        (
                cd path1/b/c &&
index 5a8a48287c18bfb3518a90677c02a13bb1ac23f3..daf1666df7adb9594c50445764440ad339f43645 100755 (executable)
@@ -8,6 +8,7 @@ test_description='git branch assorted tests'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-rebase.sh
 
@@ -239,6 +240,21 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
        git worktree prune
 '
 
+test_expect_success 'git branch -M fails if updating any linked working tree fails' '
+       git worktree add -b baz bazdir1 &&
+       git worktree add -f bazdir2 baz &&
+       touch .git/worktrees/bazdir1/HEAD.lock &&
+       test_must_fail git branch -M baz bam &&
+       test $(git -C bazdir2 rev-parse --abbrev-ref HEAD) = bam &&
+       git branch -M bam baz &&
+       rm .git/worktrees/bazdir1/HEAD.lock &&
+       touch .git/worktrees/bazdir2/HEAD.lock &&
+       test_must_fail git branch -M baz bam &&
+       test $(git -C bazdir1 rev-parse --abbrev-ref HEAD) = bam &&
+       rm -rf bazdir1 bazdir2 &&
+       git worktree prune
+'
+
 test_expect_success 'git branch -M baz bam should succeed within a worktree in which baz is checked out' '
        git checkout -b baz &&
        git worktree add -f bazdir baz &&
@@ -283,6 +299,20 @@ test_expect_success 'git branch -M and -C fail on detached HEAD' '
        test_cmp expect err
 '
 
+test_expect_success 'git branch -m should work with orphan branches' '
+       test_when_finished git checkout - &&
+       test_when_finished git worktree remove -f wt &&
+       git worktree add wt --detach &&
+       # rename orphan in another worktreee
+       git -C wt checkout --orphan orphan-foo-wt &&
+       git branch -m orphan-foo-wt orphan-bar-wt &&
+       test orphan-bar-wt=$(git -C orphan-worktree branch --show-current) &&
+       # rename orphan in the current worktree
+       git checkout --orphan orphan-foo &&
+       git branch -m orphan-foo orphan-bar &&
+       test orphan-bar=$(git branch --show-current)
+'
+
 test_expect_success 'git branch -d on orphan HEAD (merged)' '
        test_when_finished git checkout main &&
        git checkout --orphan orphan &&
index ea7cfd1951d8b2173c8fe13f1bc307ff9e7cfa1c..b17f388f56dfea819e70a04cf25000f0fb4b3658 100755 (executable)
@@ -119,6 +119,22 @@ test_expect_success 'show branch --remotes' '
        test_must_be_empty actual.out
 '
 
+test_expect_success 'show-branch --sparse' '
+       test_when_finished "git checkout branch10 && git branch -D branchA" &&
+       git checkout -b branchA branch10 &&
+       git merge -s ours -m "merge 1 and 10 to make A" branch1 &&
+       git commit --allow-empty -m "another" &&
+
+       git show-branch --sparse >out &&
+       grep "merge 1 and 10 to make A" out &&
+
+       git show-branch >out &&
+       ! grep "merge 1 and 10 to make A" out &&
+
+       git show-branch --no-sparse >out &&
+       ! grep "merge 1 and 10 to make A" out
+'
+
 test_expect_success 'setup show branch --list' '
        sed "s/^> //" >expect <<-\EOF
        >   [branch1] branch1
@@ -197,6 +213,15 @@ done <<\EOF
 --reflog --current
 EOF
 
+# unnegatable options
+for opt in topo-order date-order reflog
+do
+       test_expect_success "show-branch --no-$opt (should fail)" '
+               test_must_fail git show-branch --no-$opt 2>err &&
+               grep "unknown option .no-$opt." err
+       '
+done
+
 test_expect_success 'error descriptions on non-existent branch' '
        cat >expect <<-EOF &&
        error: No branch named '\''non-existent'\'.'
@@ -221,4 +246,22 @@ test_expect_success 'fatal descriptions on non-existent branch' '
        test_cmp expect actual
 '
 
+test_expect_success 'error descriptions on orphan branch' '
+       test_when_finished git worktree remove -f wt &&
+       git worktree add wt --detach &&
+       git -C wt checkout --orphan orphan-branch &&
+       test_branch_op_in_wt() {
+               test_orphan_error() {
+                       test_must_fail git $* 2>actual &&
+                       test_i18ngrep "No commit on branch .orphan-branch. yet.$" actual
+               } &&
+               test_orphan_error -C wt branch $1 $2 &&                # implicit branch
+               test_orphan_error -C wt branch $1 orphan-branch $2 &&  # explicit branch
+               test_orphan_error branch $1 orphan-branch $2           # different worktree
+       } &&
+       test_branch_op_in_wt --edit-description &&
+       test_branch_op_in_wt --set-upstream-to=ne &&
+       test_branch_op_in_wt -c new-branch
+'
+
 test_done
index 93f8295339cfcd018dd7b8c28e1dc726b0c96157..758963b189d8d9fc7ad50f4fa06bf431c4fe6e80 100755 (executable)
@@ -55,9 +55,17 @@ cat >expect <<'EOF'
 EOF
 test_expect_success 'git branch -r shows remote branches' '
        git branch -r >actual &&
+       test_cmp expect actual &&
+
+       git branch --remotes >actual &&
        test_cmp expect actual
 '
 
+test_expect_success 'git branch --no-remotes is rejected' '
+       test_must_fail git branch --no-remotes 2>err &&
+       grep "unknown option .no-remotes." err
+'
+
 cat >expect <<'EOF'
   branch-one
   branch-two
@@ -68,9 +76,17 @@ cat >expect <<'EOF'
 EOF
 test_expect_success 'git branch -a shows local and remote branches' '
        git branch -a >actual &&
+       test_cmp expect actual &&
+
+       git branch --all >actual &&
        test_cmp expect actual
 '
 
+test_expect_success 'git branch --no-all is rejected' '
+       test_must_fail git branch --no-all 2>err &&
+       grep "unknown option .no-all." err
+'
+
 cat >expect <<'EOF'
 two
 one
index 3399344f25dc859ad743b3914a3f5c37e92bffbb..594e3e43e129a8848b5f2e65538087ca978743d6 100755 (executable)
@@ -9,6 +9,7 @@ This script aims to check the behavior of those corner cases.
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 expect_branch() {
index 07a0ff93defebe395fe49344834b2fc627c7f81d..7326adb70f743c422d75386320febf2d8ecaab84 100755 (executable)
@@ -19,101 +19,138 @@ test_expect_success 'enable reflogs' '
        git config core.logallrefupdates true
 '
 
-test_expect_success \
-    'prepare a trivial repository' \
-    'echo Hello > A &&
-     git update-index --add A &&
-     git commit -m "Initial commit." &&
-     HEAD=$(git rev-parse --verify HEAD)'
+test_expect_success 'prepare a trivial repository' '
+       echo Hello > A &&
+       git update-index --add A &&
+       git commit -m "Initial commit." &&
+       HEAD=$(git rev-parse --verify HEAD)
+'
 
 SHA1=
 
-test_expect_success \
-    'see if git show-ref works as expected' \
-    'git branch a &&
-     SHA1=$(cat .git/refs/heads/a) &&
-     echo "$SHA1 refs/heads/a" >expect &&
-     git show-ref a >result &&
-     test_cmp expect result'
-
-test_expect_success \
-    'see if a branch still exists when packed' \
-    'git branch b &&
-     git pack-refs --all &&
-     rm -f .git/refs/heads/b &&
-     echo "$SHA1 refs/heads/b" >expect &&
-     git show-ref b >result &&
-     test_cmp expect result'
+test_expect_success 'see if git show-ref works as expected' '
+       git branch a &&
+       SHA1=$(cat .git/refs/heads/a) &&
+       echo "$SHA1 refs/heads/a" >expect &&
+       git show-ref a >result &&
+       test_cmp expect result
+'
+
+test_expect_success 'see if a branch still exists when packed' '
+       git branch b &&
+       git pack-refs --all &&
+       rm -f .git/refs/heads/b &&
+       echo "$SHA1 refs/heads/b" >expect &&
+       git show-ref b >result &&
+       test_cmp expect result
+'
 
 test_expect_success 'git branch c/d should barf if branch c exists' '
-     git branch c &&
-     git pack-refs --all &&
-     rm -f .git/refs/heads/c &&
-     test_must_fail git branch c/d
+       git branch c &&
+       git pack-refs --all &&
+       rm -f .git/refs/heads/c &&
+       test_must_fail git branch c/d
 '
 
-test_expect_success \
-    'see if a branch still exists after git pack-refs --prune' \
-    'git branch e &&
-     git pack-refs --all --prune &&
-     echo "$SHA1 refs/heads/e" >expect &&
-     git show-ref e >result &&
-     test_cmp expect result'
+test_expect_success 'see if a branch still exists after git pack-refs --prune' '
+       git branch e &&
+       git pack-refs --all --prune &&
+       echo "$SHA1 refs/heads/e" >expect &&
+       git show-ref e >result &&
+       test_cmp expect result
+'
 
 test_expect_success 'see if git pack-refs --prune remove ref files' '
-     git branch f &&
-     git pack-refs --all --prune &&
-     ! test -f .git/refs/heads/f
+       git branch f &&
+       git pack-refs --all --prune &&
+       ! test -f .git/refs/heads/f
 '
 
 test_expect_success 'see if git pack-refs --prune removes empty dirs' '
-     git branch r/s/t &&
-     git pack-refs --all --prune &&
-     ! test -e .git/refs/heads/r
+       git branch r/s/t &&
+       git pack-refs --all --prune &&
+       ! test -e .git/refs/heads/r
 '
 
-test_expect_success \
-    'git branch g should work when git branch g/h has been deleted' \
-    'git branch g/h &&
-     git pack-refs --all --prune &&
-     git branch -d g/h &&
-     git branch g &&
-     git pack-refs --all &&
-     git branch -d g'
+test_expect_success 'git branch g should work when git branch g/h has been deleted' '
+       git branch g/h &&
+       git pack-refs --all --prune &&
+       git branch -d g/h &&
+       git branch g &&
+       git pack-refs --all &&
+       git branch -d g
+'
 
 test_expect_success 'git branch i/j/k should barf if branch i exists' '
-     git branch i &&
-     git pack-refs --all --prune &&
-     test_must_fail git branch i/j/k
+       git branch i &&
+       git pack-refs --all --prune &&
+       test_must_fail git branch i/j/k
+'
+
+test_expect_success 'test git branch k after branch k/l/m and k/lm have been deleted' '
+       git branch k/l &&
+       git branch k/lm &&
+       git branch -d k/l &&
+       git branch k/l/m &&
+       git branch -d k/l/m &&
+       git branch -d k/lm &&
+       git branch k
 '
 
-test_expect_success \
-    'test git branch k after branch k/l/m and k/lm have been deleted' \
-    'git branch k/l &&
-     git branch k/lm &&
-     git branch -d k/l &&
-     git branch k/l/m &&
-     git branch -d k/l/m &&
-     git branch -d k/lm &&
-     git branch k'
-
-test_expect_success \
-    'test git branch n after some branch deletion and pruning' \
-    'git branch n/o &&
-     git branch n/op &&
-     git branch -d n/o &&
-     git branch n/o/p &&
-     git branch -d n/op &&
-     git pack-refs --all --prune &&
-     git branch -d n/o/p &&
-     git branch n'
-
-test_expect_success \
-       'see if up-to-date packed refs are preserved' \
-       'git branch q &&
-        git pack-refs --all --prune &&
-        git update-ref refs/heads/q refs/heads/q &&
-        ! test -f .git/refs/heads/q'
+test_expect_success 'test git branch n after some branch deletion and pruning' '
+       git branch n/o &&
+       git branch n/op &&
+       git branch -d n/o &&
+       git branch n/o/p &&
+       git branch -d n/op &&
+       git pack-refs --all --prune &&
+       git branch -d n/o/p &&
+       git branch n
+'
+
+test_expect_success 'test excluded refs are not packed' '
+       git branch dont_pack1 &&
+       git branch dont_pack2 &&
+       git branch pack_this &&
+       git pack-refs --all --exclude "refs/heads/dont_pack*" &&
+       test -f .git/refs/heads/dont_pack1 &&
+       test -f .git/refs/heads/dont_pack2 &&
+       ! test -f .git/refs/heads/pack_this'
+
+test_expect_success 'test --no-exclude refs clears excluded refs' '
+       git branch dont_pack3 &&
+       git branch dont_pack4 &&
+       git pack-refs --all --exclude "refs/heads/dont_pack*" --no-exclude &&
+       ! test -f .git/refs/heads/dont_pack3 &&
+       ! test -f .git/refs/heads/dont_pack4'
+
+test_expect_success 'test only included refs are packed' '
+       git branch pack_this1 &&
+       git branch pack_this2 &&
+       git tag dont_pack5 &&
+       git pack-refs --include "refs/heads/pack_this*" &&
+       test -f .git/refs/tags/dont_pack5 &&
+       ! test -f .git/refs/heads/pack_this1 &&
+       ! test -f .git/refs/heads/pack_this2'
+
+test_expect_success 'test --no-include refs clears included refs' '
+       git branch pack1 &&
+       git branch pack2 &&
+       git pack-refs --include "refs/heads/pack*" --no-include &&
+       test -f .git/refs/heads/pack1 &&
+       test -f .git/refs/heads/pack2'
+
+test_expect_success 'test --exclude takes precedence over --include' '
+       git branch dont_pack5 &&
+       git pack-refs --include "refs/heads/pack*" --exclude "refs/heads/pack*" &&
+       test -f .git/refs/heads/dont_pack5'
+
+test_expect_success 'see if up-to-date packed refs are preserved' '
+       git branch q &&
+       git pack-refs --all --prune &&
+       git update-ref refs/heads/q refs/heads/q &&
+       ! test -f .git/refs/heads/q
+'
 
 test_expect_success 'pack, prune and repack' '
        git tag foo &&
index 79b0640c004e23f5346d9bfe1ba9998791633887..e9e03ca4b5eb16e6c40815a25197e3e22bb37561 100755 (executable)
@@ -8,6 +8,7 @@ test_description='git rebase --merge test'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 T="A quick brown fox
index ff0afad63e2c5b1c03495046961eb27e2a593ed0..96a56aafbed67ca7e47ac173c00afdbe17b000ad 100755 (executable)
@@ -1596,6 +1596,32 @@ test_expect_success 'static check of bad command' '
        test C = $(git cat-file commit HEAD^ | sed -ne \$p)
 '
 
+test_expect_success 'the first command cannot be a fixup' '
+       rebase_setup_and_clean fixup-first &&
+
+       cat >orig <<-EOF &&
+       fixup $(git log -1 --format="%h %s" B)
+       pick $(git log -1 --format="%h %s" C)
+       EOF
+
+       (
+               set_replace_editor orig &&
+               test_must_fail git rebase -i A 2>actual
+       ) &&
+       grep "cannot .fixup. without a previous commit" actual &&
+       grep "You can fix this with .git rebase --edit-todo.." actual &&
+       # verify that the todo list has not been truncated
+       grep -v "^#" .git/rebase-merge/git-rebase-todo >actual &&
+       test_cmp orig actual &&
+
+       test_must_fail git rebase --edit-todo 2>actual &&
+       grep "cannot .fixup. without a previous commit" actual &&
+       grep "You can fix this with .git rebase --edit-todo.." actual &&
+       # verify that the todo list has not been truncated
+       grep -v "^#" .git/rebase-merge/git-rebase-todo >actual &&
+       test_cmp orig actual
+'
+
 test_expect_success 'tabs and spaces are accepted in the todolist' '
        rebase_setup_and_clean indented-comment &&
        write_script add-indent.sh <<-\EOF &&
index 2d0789e554bf00a604a347ab0e9c7b3781e4a96a..fb7b68990cc33a6cbd08ba7031d405713db87446 100755 (executable)
@@ -115,15 +115,23 @@ test_expect_success '--skip after failed fixup cleans commit message' '
        test_when_finished "test_might_fail git rebase --abort" &&
        git checkout -b with-conflicting-fixup &&
        test_commit wants-fixup &&
-       test_commit "fixup! wants-fixup" wants-fixup.t 1 wants-fixup-1 &&
-       test_commit "fixup! wants-fixup" wants-fixup.t 2 wants-fixup-2 &&
-       test_commit "fixup! wants-fixup" wants-fixup.t 3 wants-fixup-3 &&
+       test_commit "fixup 1" wants-fixup.t 1 wants-fixup-1 &&
+       test_commit "fixup 2" wants-fixup.t 2 wants-fixup-2 &&
+       test_commit "fixup 3" wants-fixup.t 3 wants-fixup-3 &&
        test_must_fail env FAKE_LINES="1 fixup 2 squash 4" \
                git rebase -i HEAD~4 &&
 
        : now there is a conflict, and comments in the commit message &&
-       git show HEAD >out &&
-       grep "fixup! wants-fixup" out &&
+       test_commit_message HEAD <<-\EOF &&
+       # This is a combination of 2 commits.
+       # This is the 1st commit message:
+
+       wants-fixup
+
+       # The commit message #2 will be skipped:
+
+       # fixup 1
+       EOF
 
        : skip and continue &&
        echo "cp \"\$1\" .git/copy.txt" | write_script copy-editor.sh &&
@@ -133,33 +141,49 @@ test_expect_success '--skip after failed fixup cleans commit message' '
        test_path_is_missing .git/copy.txt &&
 
        : now the comments in the commit message should have been cleaned up &&
-       git show HEAD >out &&
-       ! grep "fixup! wants-fixup" out &&
+       test_commit_message HEAD -m wants-fixup &&
 
        : now, let us ensure that "squash" is handled correctly &&
        git reset --hard wants-fixup-3 &&
-       test_must_fail env FAKE_LINES="1 squash 4 squash 2 squash 4" \
+       test_must_fail env FAKE_LINES="1 squash 2 squash 1 squash 3 squash 1" \
                git rebase -i HEAD~4 &&
 
-       : the first squash failed, but there are two more in the chain &&
+       : the second squash failed, but there are two more in the chain &&
        (test_set_editor "$PWD/copy-editor.sh" &&
         test_must_fail git rebase --skip) &&
 
        : not the final squash, no need to edit the commit message &&
        test_path_is_missing .git/copy.txt &&
 
-       : The first squash was skipped, therefore: &&
-       git show HEAD >out &&
-       test_i18ngrep "# This is a combination of 2 commits" out &&
-       test_i18ngrep "# This is the commit message #2:" out &&
+       : The first and third squashes succeeded, therefore: &&
+       test_commit_message HEAD <<-\EOF &&
+       # This is a combination of 3 commits.
+       # This is the 1st commit message:
+
+       wants-fixup
+
+       # This is the commit message #2:
+
+       fixup 1
+
+       # This is the commit message #3:
+
+       fixup 2
+       EOF
 
        (test_set_editor "$PWD/copy-editor.sh" && git rebase --skip) &&
-       git show HEAD >out &&
-       test_i18ngrep ! "# This is a combination" out &&
+       test_commit_message HEAD <<-\EOF &&
+       wants-fixup
+
+       fixup 1
+
+       fixup 2
+       EOF
 
        : Final squash failed, but there was still a squash &&
-       test_i18ngrep "# This is a combination of 2 commits" .git/copy.txt &&
-       test_i18ngrep "# This is the commit message #2:" .git/copy.txt
+       head -n1 .git/copy.txt >first-line &&
+       test_i18ngrep "# This is a combination of 3 commits" first-line &&
+       test_i18ngrep "# This is the commit message #3:" .git/copy.txt
 '
 
 test_expect_success 'setup rerere database' '
index 48b76f82325da49d521bf4603566ebcbc3653ddc..1b3e97c8755f3d8b41549e70cf67529298118182 100755 (executable)
@@ -74,9 +74,9 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' '
        test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-main main &&
        : first pick results in no changes &&
        git rebase --skip &&
-       verbose test "$(commit_message HEAD~2)" = "topic_4" &&
-       verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
-       verbose test "$(commit_message HEAD)" = "Empty commit"
+       test "$(commit_message HEAD~2)" = "topic_4" &&
+       test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
+       test "$(commit_message HEAD)" = "Empty commit"
 '
 
 test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit' '
@@ -85,9 +85,9 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit'
        test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-main --root &&
        : first pick results in no changes &&
        git rebase --skip &&
-       verbose test "$(commit_message HEAD~2)" = "topic_4" &&
-       verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
-       verbose test "$(commit_message HEAD)" = "Empty commit"
+       test "$(commit_message HEAD~2)" = "topic_4" &&
+       test "$(commit_message HEAD~)" = "files_subtree/topic_5" &&
+       test "$(commit_message HEAD)" = "Empty commit"
 '
 
 test_done
index f03599c63b969d6216f7370e1a24b0160bc6ab69..96ae0edf1e17275825c2f6fdd57f09431834ed77 100755 (executable)
@@ -578,4 +578,12 @@ test_expect_success '--rebase-merges with message matched with onto label' '
        EOF
 '
 
+test_expect_success 'progress shows the correct total' '
+       git checkout -b progress H &&
+       git rebase --rebase-merges --force-rebase --verbose A 2> err &&
+       # Expecting "Rebasing (N/14)" here, no bogus total number
+       grep "^Rebasing.*/14.$" err >progress &&
+       test_line_count = 14 progress
+'
+
 test_done
index dd3b301fa7ab2bbd48297bc26d1b21b8b00fa82b..7929e2e2e3a8fc1240af3991f85172c16dcbd2cf 100755 (executable)
@@ -21,21 +21,6 @@ TEST_PASSES_SANITIZE_LEAK=true
 
 EMPTY=""
 
-# test_commit_message <rev> -m <msg>
-# test_commit_message <rev> <path>
-# Verify that the commit message of <rev> matches
-# <msg> or the content of <path>.
-test_commit_message () {
-       git show --no-patch --pretty=format:%B "$1" >actual &&
-       case "$2" in
-       -m)
-               echo "$3" >expect &&
-               test_cmp expect actual ;;
-       *)
-               test_cmp "$2" actual ;;
-       esac
-}
-
 get_author () {
        rev="$1" &&
        git log -1 --pretty=format:"%an %ae %at" "$rev"
index 0458a58b4b58ccb5a7fb5af378a5e2908126c111..78c3eac54b599ef9cded9a042f4346621798b645 100755 (executable)
@@ -16,46 +16,43 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 GIT_AUTHOR_EMAIL=bogus_email_address
 export GIT_AUTHOR_EMAIL
 
-test_expect_success \
-    'prepare repository with topic branch, and check cherry finds the 2 patches from there' \
-    'echo First > A &&
-     git update-index --add A &&
-     test_tick &&
-     git commit -m "Add A." &&
-
-     git checkout -b my-topic-branch &&
-
-     echo Second > B &&
-     git update-index --add B &&
-     test_tick &&
-     git commit -m "Add B." &&
-
-     echo AnotherSecond > C &&
-     git update-index --add C &&
-     test_tick &&
-     git commit -m "Add C." &&
-
-     git checkout -f main &&
-     rm -f B C &&
-
-     echo Third >> A &&
-     git update-index A &&
-     test_tick &&
-     git commit -m "Modify A." &&
-
-     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
+test_expect_success 'prepare repository with topic branch, and check cherry finds the 2 patches from there' '
+       echo First > A &&
+       git update-index --add A &&
+       test_tick &&
+       git commit -m "Add A." &&
+
+       git checkout -b my-topic-branch &&
+
+       echo Second > B &&
+       git update-index --add B &&
+       test_tick &&
+       git commit -m "Add B." &&
+
+       echo AnotherSecond > C &&
+       git update-index --add C &&
+       test_tick &&
+       git commit -m "Add C." &&
+
+       git checkout -f main &&
+       rm -f B C &&
+
+       echo Third >> A &&
+       git update-index A &&
+       test_tick &&
+       git commit -m "Modify A." &&
+
+       expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* + .*"
 '
 
-test_expect_success \
-    'check that cherry with limit returns only the top patch'\
-    'expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
+test_expect_success 'check that cherry with limit returns only the top patch' '
+       expr "$(echo $(git cherry main my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
 '
 
-test_expect_success \
-    'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \
-    'git cherry-pick my-topic-branch^0 &&
-     echo $(git cherry main my-topic-branch) &&
-     expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
+test_expect_success 'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' '
+       git cherry-pick my-topic-branch^0 &&
+       echo $(git cherry main my-topic-branch) &&
+       expr "$(echo $(git cherry main my-topic-branch) )" : "+ [^ ]* - .*"
 '
 
 test_expect_success 'cherry ignores whitespace' '
index 2f3e3e2416921c28b27b75dc9f76c20b40401d4d..e2ef6193233dd0b7a2341c391695aabd73d03200 100755 (executable)
@@ -1,14 +1,6 @@
 #!/bin/sh
 
-test_description='test cherry-pick and revert with renames
-
-  --
-   + rename2: renames oops to opos
-  +  rename1: renames oops to spoo
-  +  added:   adds extra line to oops
-  ++ initial: has lines in oops
-
-'
+test_description='miscellaneous basic tests for cherry-pick and revert'
 
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
@@ -63,6 +55,14 @@ test_expect_success 'revert --nonsense' '
        test_i18ngrep "[Uu]sage:" msg
 '
 
+# the following two test cherry-pick and revert with renames
+#
+# --
+#  + rename2: renames oops to opos
+# +  rename1: renames oops to spoo
+# +  added:   adds extra line to oops
+# ++ initial: has lines in oops
+
 test_expect_success 'cherry-pick after renaming branch' '
 
        git checkout rename2 &&
index 82dd768944fa5d566f32d7076ad2e36bd0f53cf7..7623689da24501a7bb7cd7224035f854eeab43ff 100755 (executable)
@@ -24,17 +24,17 @@ test_mode_in_index () {
        esac
 }
 
-test_expect_success \
-    'Test of git add' \
-    'touch foo && git add foo'
+test_expect_success 'Test of git add' '
+       touch foo && git add foo
+'
 
-test_expect_success \
-    'Post-check that foo is in the index' \
-    'git ls-files foo | grep foo'
+test_expect_success 'Post-check that foo is in the index' '
+       git ls-files foo | grep foo
+'
 
-test_expect_success \
-    'Test that "git add -- -q" works' \
-    'touch -- -q && git add -- -q'
+test_expect_success 'Test that "git add -- -q" works' '
+       touch -- -q && git add -- -q
+'
 
 BATCH_CONFIGURATION='-c core.fsync=loose-object -c core.fsyncmethod=batch'
 
@@ -284,14 +284,14 @@ test_expect_success POSIXPERM,SANITY 'git add (add.ignore-errors = false)' '
 rm -f foo2
 
 test_expect_success POSIXPERM,SANITY '--no-ignore-errors overrides config' '
-       git config add.ignore-errors 1 &&
-       git reset --hard &&
-       date >foo1 &&
-       date >foo2 &&
-       chmod 0 foo2 &&
-       test_must_fail git add --verbose --no-ignore-errors . &&
-       ! ( git ls-files foo1 | grep foo1 ) &&
-       git config add.ignore-errors 0
+       git config add.ignore-errors 1 &&
+       git reset --hard &&
+       date >foo1 &&
+       date >foo2 &&
+       chmod 0 foo2 &&
+       test_must_fail git add --verbose --no-ignore-errors . &&
+       ! ( git ls-files foo1 | grep foo1 ) &&
+       git config add.ignore-errors 0
 '
 rm -f foo2
 
index 3982b6b49dc45673bf6dcf1cb984a2ff8fedf252..34aabb7f5f6a543b31f89650f63b8783e9071271 100755 (executable)
@@ -734,6 +734,44 @@ test_expect_success 'colors can be overridden' '
        test_cmp expect actual
 '
 
+test_expect_success 'brackets appear without color' '
+       git reset --hard &&
+       test_when_finished "git rm -f bracket-test" &&
+       test_write_lines context old more-context >bracket-test &&
+       git add bracket-test &&
+       test_write_lines context new more-context another-one >bracket-test &&
+
+       test_write_lines quit >input &&
+       git add -i >actual <input &&
+
+       sed "s/^|//" >expect <<-\EOF &&
+       |           staged     unstaged path
+       |  1:        +3/-0        +2/-1 bracket-test
+       |
+       |*** Commands ***
+       |  1: [s]tatus    2: [u]pdate     3: [r]evert     4: [a]dd untracked
+       |  5: [p]atch     6: [d]iff       7: [q]uit       8: [h]elp
+       |What now> Bye.
+       EOF
+
+       test_cmp expect actual
+'
+
+test_expect_success 'colors can be skipped with color.ui=false' '
+       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 &&
+
+       test_write_lines help quit >input &&
+       force_color git \
+               -c color.ui=false \
+               add -i >actual.raw <input &&
+       test_decode_color <actual.raw >actual &&
+       test_cmp actual.raw actual
+'
+
 test_expect_success 'colorized diffs respect diff.wsErrorHighlight' '
        git reset --hard &&
 
index 376cc8f4ab8429b0488ad23b0f9731c9af237124..0b3dfeaea20048426be4d032dd6dc7e66359dc67 100755 (executable)
@@ -1211,19 +1211,19 @@ test_expect_success 'stash with file including $IFS character' '
 '
 
 test_expect_success 'stash with pathspec matching multiple paths' '
-       echo original >file &&
-       echo original >other-file &&
-       git commit -m "two" file other-file &&
-       echo modified >file &&
-       echo modified >other-file &&
-       git stash push -- "*file" &&
-       echo original >expect &&
-       test_cmp expect file &&
-       test_cmp expect other-file &&
-       git stash pop &&
-       echo modified >expect &&
-       test_cmp expect file &&
-       test_cmp expect other-file
+       echo original >file &&
+       echo original >other-file &&
+       git commit -m "two" file other-file &&
+       echo modified >file &&
+       echo modified >other-file &&
+       git stash push -- "*file" &&
+       echo original >expect &&
+       test_cmp expect file &&
+       test_cmp expect other-file &&
+       git stash pop &&
+       echo modified >expect &&
+       test_cmp expect file &&
+       test_cmp expect other-file
 '
 
 test_expect_success 'stash push -p with pathspec shows no changes only once' '
index bfcaae390f3ad95584ce9cf78b62cc81c33adf67..8d50331b8c8e431853bbdf377813ed288007961b 100755 (executable)
@@ -5,6 +5,9 @@
 
 test_description='Test built-in diff output engine.
 
+We happen to know that all diff plumbing and diff Porcelain share the
+same command line parser, so testing one should be sufficient; pick
+diff-files as a representative.
 '
 
 TEST_PASSES_SANITIZE_LEAK=true
@@ -16,9 +19,11 @@ Line 2
 line 3'
 cat path0 >path1
 chmod +x path1
+mkdir path2
+>path2/path3
 
 test_expect_success 'update-index --add two files with and without +x.' '
-       git update-index --add path0 path1
+       git update-index --add path0 path1 path2/path3
 '
 
 mv path0 path0-
@@ -91,4 +96,31 @@ test_expect_success 'git diff-files --patch --no-patch does not show the patch'
        test_must_be_empty err
 '
 
+
+# Smudge path2/path3 so that dirstat has something to show
+date >path2/path3
+
+for format in stat raw numstat shortstat summary \
+       dirstat cumulative dirstat-by-file \
+       patch-with-raw patch-with-stat compact-summary
+do
+       test_expect_success "--no-patch in 'git diff-files --no-patch --$format' is a no-op" '
+               git diff-files --no-patch "--$format" >actual &&
+               git diff-files "--$format" >expect &&
+               test_cmp expect actual
+       '
+
+       test_expect_success "--no-patch clears all previous ones" '
+               git diff-files --$format -s -p >actual &&
+               git diff-files -p >expect &&
+               test_cmp expect actual
+       '
+
+       test_expect_success "--no-patch in 'git diff --no-patch --$format' is a no-op" '
+               git diff --no-patch "--$format" >actual &&
+               git diff "--$format" >expect &&
+               test_cmp expect actual
+       '
+done
+
 test_done
index ea52e5b91b75e3df741cbc12b927cacd6ee08afb..7afc883ec374e1c4b747ed80ba64575d05017502 100755 (executable)
@@ -284,132 +284,131 @@ cmp_diff_files_output () {
     test_cmp "$1" .test-tmp
 }
 
-test_expect_success \
-    'diff-tree of known trees.' \
-    'git diff-tree $tree_O $tree_A >.test-a &&
-     cmp -s .test-a .test-plain-OA'
-
-test_expect_success \
-    'diff-tree of known trees.' \
-    'git diff-tree -r $tree_O $tree_A >.test-a &&
-     cmp -s .test-a .test-recursive-OA'
-
-test_expect_success \
-    'diff-tree of known trees.' \
-    'git diff-tree $tree_O $tree_B >.test-a &&
-     cmp -s .test-a .test-plain-OB'
-
-test_expect_success \
-    'diff-tree of known trees.' \
-    'git diff-tree -r $tree_O $tree_B >.test-a &&
-     cmp -s .test-a .test-recursive-OB'
-
-test_expect_success \
-    'diff-tree of known trees.' \
-    'git diff-tree $tree_A $tree_B >.test-a &&
-     cmp -s .test-a .test-plain-AB'
-
-test_expect_success \
-    'diff-tree of known trees.' \
-    'git diff-tree -r $tree_A $tree_B >.test-a &&
-     cmp -s .test-a .test-recursive-AB'
-
-test_expect_success \
-    'diff-tree --stdin of known trees.' \
-    'echo $tree_A $tree_B | git diff-tree --stdin > .test-a &&
-     echo $tree_A $tree_B > .test-plain-ABx &&
-     cat .test-plain-AB >> .test-plain-ABx &&
-     cmp -s .test-a .test-plain-ABx'
-
-test_expect_success \
-    'diff-tree --stdin of known trees.' \
-    'echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a &&
-     echo $tree_A $tree_B > .test-recursive-ABx &&
-     cat .test-recursive-AB >> .test-recursive-ABx &&
-     cmp -s .test-a .test-recursive-ABx'
-
-test_expect_success \
-    'diff-cache O with A in cache' \
-    'git read-tree $tree_A &&
-     git diff-index --cached $tree_O >.test-a &&
-     cmp -s .test-a .test-recursive-OA'
-
-test_expect_success \
-    'diff-cache O with B in cache' \
-    'git read-tree $tree_B &&
-     git diff-index --cached $tree_O >.test-a &&
-     cmp -s .test-a .test-recursive-OB'
-
-test_expect_success \
-    'diff-cache A with B in cache' \
-    'git read-tree $tree_B &&
-     git diff-index --cached $tree_A >.test-a &&
-     cmp -s .test-a .test-recursive-AB'
-
-test_expect_success \
-    'diff-files with O in cache and A checked out' \
-    'rm -fr Z [A-Z][A-Z] &&
-     git read-tree $tree_A &&
-     git checkout-index -f -a &&
-     git read-tree --reset $tree_O &&
-     test_must_fail git update-index --refresh -q &&
-     git diff-files >.test-a &&
-     cmp_diff_files_output .test-a .test-recursive-OA'
-
-test_expect_success \
-    'diff-files with O in cache and B checked out' \
-    'rm -fr Z [A-Z][A-Z] &&
-     git read-tree $tree_B &&
-     git checkout-index -f -a &&
-     git read-tree --reset $tree_O &&
-     test_must_fail git update-index --refresh -q &&
-     git diff-files >.test-a &&
-     cmp_diff_files_output .test-a .test-recursive-OB'
-
-test_expect_success \
-    'diff-files with A in cache and B checked out' \
-    'rm -fr Z [A-Z][A-Z] &&
-     git read-tree $tree_B &&
-     git checkout-index -f -a &&
-     git read-tree --reset $tree_A &&
-     test_must_fail git update-index --refresh -q &&
-     git diff-files >.test-a &&
-     cmp_diff_files_output .test-a .test-recursive-AB'
+test_expect_success 'diff-tree of known trees.' '
+       git diff-tree $tree_O $tree_A >.test-a &&
+       cmp -s .test-a .test-plain-OA
+'
+
+test_expect_success 'diff-tree of known trees.' '
+       git diff-tree -r $tree_O $tree_A >.test-a &&
+       cmp -s .test-a .test-recursive-OA
+'
+
+test_expect_success 'diff-tree of known trees.' '
+       git diff-tree $tree_O $tree_B >.test-a &&
+       cmp -s .test-a .test-plain-OB
+'
+
+test_expect_success 'diff-tree of known trees.' '
+       git diff-tree -r $tree_O $tree_B >.test-a &&
+       cmp -s .test-a .test-recursive-OB
+'
+
+test_expect_success 'diff-tree of known trees.' '
+       git diff-tree $tree_A $tree_B >.test-a &&
+       cmp -s .test-a .test-plain-AB
+'
+
+test_expect_success 'diff-tree of known trees.' '
+       git diff-tree -r $tree_A $tree_B >.test-a &&
+       cmp -s .test-a .test-recursive-AB
+'
+
+test_expect_success 'diff-tree --stdin of known trees.' '
+       echo $tree_A $tree_B | git diff-tree --stdin > .test-a &&
+       echo $tree_A $tree_B > .test-plain-ABx &&
+       cat .test-plain-AB >> .test-plain-ABx &&
+       cmp -s .test-a .test-plain-ABx
+'
+
+test_expect_success 'diff-tree --stdin of known trees.' '
+       echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a &&
+       echo $tree_A $tree_B > .test-recursive-ABx &&
+       cat .test-recursive-AB >> .test-recursive-ABx &&
+       cmp -s .test-a .test-recursive-ABx
+'
+
+test_expect_success 'diff-cache O with A in cache' '
+       git read-tree $tree_A &&
+       git diff-index --cached $tree_O >.test-a &&
+       cmp -s .test-a .test-recursive-OA
+'
+
+test_expect_success 'diff-cache O with B in cache' '
+       git read-tree $tree_B &&
+       git diff-index --cached $tree_O >.test-a &&
+       cmp -s .test-a .test-recursive-OB
+'
+
+test_expect_success 'diff-cache A with B in cache' '
+       git read-tree $tree_B &&
+       git diff-index --cached $tree_A >.test-a &&
+       cmp -s .test-a .test-recursive-AB
+'
+
+test_expect_success 'diff-files with O in cache and A checked out' '
+       rm -fr Z [A-Z][A-Z] &&
+       git read-tree $tree_A &&
+       git checkout-index -f -a &&
+       git read-tree --reset $tree_O &&
+       test_must_fail git update-index --refresh -q &&
+       git diff-files >.test-a &&
+       cmp_diff_files_output .test-a .test-recursive-OA
+'
+
+test_expect_success 'diff-files with O in cache and B checked out' '
+       rm -fr Z [A-Z][A-Z] &&
+       git read-tree $tree_B &&
+       git checkout-index -f -a &&
+       git read-tree --reset $tree_O &&
+       test_must_fail git update-index --refresh -q &&
+       git diff-files >.test-a &&
+       cmp_diff_files_output .test-a .test-recursive-OB
+'
+
+test_expect_success 'diff-files with A in cache and B checked out' '
+       rm -fr Z [A-Z][A-Z] &&
+       git read-tree $tree_B &&
+       git checkout-index -f -a &&
+       git read-tree --reset $tree_A &&
+       test_must_fail git update-index --refresh -q &&
+       git diff-files >.test-a &&
+       cmp_diff_files_output .test-a .test-recursive-AB
+'
 
 ################################################################
 # Now we have established the baseline, we do not have to
 # rely on individual object ID values that much.
 
-test_expect_success \
-    'diff-tree O A == diff-tree -R A O' \
-    'git diff-tree $tree_O $tree_A >.test-a &&
-    git diff-tree -R $tree_A $tree_O >.test-b &&
-    cmp -s .test-a .test-b'
-
-test_expect_success \
-    'diff-tree -r O A == diff-tree -r -R A O' \
-    'git diff-tree -r $tree_O $tree_A >.test-a &&
-    git diff-tree -r -R $tree_A $tree_O >.test-b &&
-    cmp -s .test-a .test-b'
-
-test_expect_success \
-    'diff-tree B A == diff-tree -R A B' \
-    'git diff-tree $tree_B $tree_A >.test-a &&
-    git diff-tree -R $tree_A $tree_B >.test-b &&
-    cmp -s .test-a .test-b'
-
-test_expect_success \
-    'diff-tree -r B A == diff-tree -r -R A B' \
-    'git diff-tree -r $tree_B $tree_A >.test-a &&
-    git diff-tree -r -R $tree_A $tree_B >.test-b &&
-    cmp -s .test-a .test-b'
-
-test_expect_success \
-    'diff can read from stdin' \
-    'test_must_fail git diff --no-index -- MN - < NN |
-        grep -v "^index" | sed "s#/-#/NN#" >.test-a &&
-    test_must_fail git diff --no-index -- MN NN |
-        grep -v "^index" >.test-b &&
-    test_cmp .test-a .test-b'
+test_expect_success 'diff-tree O A == diff-tree -R A O' '
+       git diff-tree $tree_O $tree_A >.test-a &&
+       git diff-tree -R $tree_A $tree_O >.test-b &&
+       cmp -s .test-a .test-b
+'
+
+test_expect_success 'diff-tree -r O A == diff-tree -r -R A O' '
+       git diff-tree -r $tree_O $tree_A >.test-a &&
+       git diff-tree -r -R $tree_A $tree_O >.test-b &&
+       cmp -s .test-a .test-b
+'
+
+test_expect_success 'diff-tree B A == diff-tree -R A B' '
+       git diff-tree $tree_B $tree_A >.test-a &&
+       git diff-tree -R $tree_A $tree_B >.test-b &&
+       cmp -s .test-a .test-b
+'
+
+test_expect_success 'diff-tree -r B A == diff-tree -r -R A B' '
+       git diff-tree -r $tree_B $tree_A >.test-a &&
+       git diff-tree -r -R $tree_A $tree_B >.test-b &&
+       cmp -s .test-a .test-b'
+
+test_expect_success 'diff can read from stdin' '
+       test_must_fail git diff --no-index -- MN - < NN |
+               grep -v "^index" | sed "s#/-#/NN#" >.test-a &&
+       test_must_fail git diff --no-index -- MN NN |
+               grep -v "^index" >.test-b &&
+       test_cmp .test-a .test-b
+'
 
 test_done
index 181e9683a7955e18fcd149cd179c58c9f28d940a..ebe091828c878eb2d3ea3ab6f0f2e371e4d34329 100755 (executable)
@@ -11,20 +11,20 @@ TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
-test_expect_success \
-    'prepare reference tree' \
-    'COPYING_test_data >COPYING &&
-     echo frotz >rezrov &&
-    git update-index --add COPYING rezrov &&
-    tree=$(git write-tree) &&
-    echo $tree'
-
-test_expect_success \
-    'prepare work tree' \
-    'sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
-    sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
-    rm -f COPYING &&
-    git update-index --add --remove COPYING COPYING.?'
+test_expect_success 'prepare reference tree' '
+       COPYING_test_data >COPYING &&
+       echo frotz >rezrov &&
+       git update-index --add COPYING rezrov &&
+       tree=$(git write-tree) &&
+       echo $tree
+'
+
+test_expect_success 'prepare work tree' '
+       sed -e 's/HOWEVER/However/' <COPYING >COPYING.1 &&
+       sed -e 's/GPL/G.P.L/g' <COPYING >COPYING.2 &&
+       rm -f COPYING &&
+       git update-index --add --remove COPYING COPYING.?
+'
 
 # tree has COPYING and rezrov.  work tree has COPYING.1 and COPYING.2,
 # both are slightly edited, and unchanged rezrov.  So we say you
@@ -57,14 +57,14 @@ rename to COPYING.2
 +      This file is licensed under the G.P.L v2, or a later version
 EOF
 
-test_expect_success \
-    'validate output from rename/copy detection (#1)' \
-    'compare_diff_patch current expected'
+test_expect_success 'validate output from rename/copy detection (#1)' '
+       compare_diff_patch current expected
+'
 
-test_expect_success \
-    'prepare work tree again' \
-    'mv COPYING.2 COPYING &&
-     git update-index --add --remove COPYING COPYING.1 COPYING.2'
+test_expect_success 'prepare work tree again' '
+       mv COPYING.2 COPYING &&
+       git update-index --add --remove COPYING COPYING.1 COPYING.2
+'
 
 # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,
 # both are slightly edited, and unchanged rezrov.  So we say you
@@ -95,14 +95,14 @@ copy to COPYING.1
 + However, in order to allow a migration to GPLv3 if that seems like
 EOF
 
-test_expect_success \
-    'validate output from rename/copy detection (#2)' \
-    'compare_diff_patch current expected'
+test_expect_success 'validate output from rename/copy detection (#2)' '
+       compare_diff_patch current expected
+'
 
-test_expect_success \
-    'prepare work tree once again' \
-    'COPYING_test_data >COPYING &&
-     git update-index --add --remove COPYING COPYING.1'
+test_expect_success 'prepare work tree once again' '
+       COPYING_test_data >COPYING &&
+       git update-index --add --remove COPYING COPYING.1
+'
 
 # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,
 # but COPYING is not edited.  We say you copy-and-edit COPYING.1; this
@@ -123,8 +123,8 @@ copy to COPYING.1
 + However, in order to allow a migration to GPLv3 if that seems like
 EOF
 
-test_expect_success \
-    'validate output from rename/copy detection (#3)' \
-    'compare_diff_patch current expected'
+test_expect_success 'validate output from rename/copy detection (#3)' '
+       compare_diff_patch current expected
+'
 
 test_done
index 8def4d4aee9d2f2b39469fd550020fedab1d0ee7..1d70d4d221b7536c430852e9014c9372743a4a2a 100755 (executable)
@@ -14,21 +14,21 @@ TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-diff.sh
 
-test_expect_success SYMLINKS \
-    'prepare reference tree' \
-    'echo xyzzy | tr -d '\\\\'012 >yomin &&
-     ln -s xyzzy frotz &&
-    git update-index --add frotz yomin &&
-    tree=$(git write-tree) &&
-    echo $tree'
+test_expect_success SYMLINKS 'prepare reference tree' '
+       echo xyzzy | tr -d '\\\\'012 >yomin &&
+       ln -s xyzzy frotz &&
+       git update-index --add frotz yomin &&
+       tree=$(git write-tree) &&
+       echo $tree
+'
 
-test_expect_success SYMLINKS \
-    'prepare work tree' \
-    'mv frotz rezrov &&
-     rm -f yomin &&
-     ln -s xyzzy nitfol &&
-     ln -s xzzzy bozbar &&
-    git update-index --add --remove frotz rezrov nitfol bozbar yomin'
+test_expect_success SYMLINKS 'prepare work tree' '
+       mv frotz rezrov &&
+       rm -f yomin &&
+       ln -s xyzzy nitfol &&
+       ln -s xzzzy bozbar &&
+       git update-index --add --remove frotz rezrov nitfol bozbar yomin
+'
 
 # tree has frotz pointing at xyzzy, and yomin that contains xyzzy to
 # confuse things.  work tree has rezrov (xyzzy) nitfol (xyzzy) and
@@ -36,9 +36,9 @@ test_expect_success SYMLINKS \
 # rezrov and nitfol are rename/copy of frotz and bozbar should be
 # a new creation.
 
-test_expect_success SYMLINKS 'setup diff output' "
-    GIT_DIFF_OPTS=--unified=0 git diff-index -C -p $tree >current &&
-    cat >expected <<\EOF
+test_expect_success SYMLINKS 'setup diff output' '
+       GIT_DIFF_OPTS=--unified=0 git diff-index -C -p $tree >current &&
+       cat >expected <<\EOF
 diff --git a/bozbar b/bozbar
 new file mode 120000
 --- /dev/null
@@ -62,10 +62,10 @@ deleted file mode 100644
 -xyzzy
 \ No newline at end of file
 EOF
-"
+'
 
-test_expect_success SYMLINKS \
-    'validate diff output' \
-    'compare_diff_patch current expected'
+test_expect_success SYMLINKS 'validate diff output' '
+       compare_diff_patch current expected
+'
 
 test_done
index 42a2b9a13b7a5bd6cf28cfbe9bbfb9a5a3e5f3e6..c8d555771d5072f95185f48898b59a7e88ddcd26 100755 (executable)
@@ -63,6 +63,25 @@ do
                test_i18ngrep ! fatal msg &&
                test_i18ngrep ! error msg
        '
+
+       test_expect_success "builtin $p pattern compiles on bare repo with --attr-source" '
+               test_when_finished "rm -rf bare.git" &&
+               git checkout -B master &&
+               git add . &&
+               echo "*.java diff=notexist" >.gitattributes &&
+               git add .gitattributes &&
+               git commit -am "changing gitattributes" &&
+               git checkout -B branchA &&
+               echo "*.java diff=$p" >.gitattributes &&
+               git add .gitattributes &&
+               git commit -am "changing gitattributes" &&
+               git clone --bare --no-local . bare.git &&
+               git -C bare.git symbolic-ref HEAD refs/heads/master &&
+               test_expect_code 1 git -C bare.git --attr-source=branchA \
+                       diff --exit-code HEAD:A.java HEAD:B.java 2>msg &&
+               test_i18ngrep ! fatal msg &&
+               test_i18ngrep ! error msg
+       '
 done
 
 test_expect_success 'last regexp must not be negated' '
index 1c89050a974c7b101056865a4b48e7f18a90d29e..6fed993ea0b34dddae94356354c889ada9f16497 100755 (executable)
@@ -24,7 +24,7 @@ test_expect_success setup '
 test_expect_success 'detect rewrite' '
 
        actual=$(git diff-files -B --summary test) &&
-       verbose expr "$actual" : " rewrite test ([0-9]*%)$"
+       expr "$actual" : " rewrite test ([0-9]*%)$"
 
 '
 
index 7fec2cb9cd783f5aeff27236c8e54ddb2241e1be..70224c3da1494262eb4b2a46c58e001d74f37a9e 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/sh
 
 test_description='diff --dirstat tests'
+
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 # set up two commits where the second commit has these files
index 4e9fa0403d3631fdeafd0e90e3ae80894930c2e9..6781cc90786e3eb247b83f107a5407d50ba139f3 100755 (executable)
@@ -205,4 +205,64 @@ test_expect_success POSIXPERM,SYMLINKS 'diff --no-index normalizes: mode not lik
        test_cmp expected actual
 '
 
+test_expect_success "diff --no-index treats '-' as stdin" '
+       cat >expect <<-EOF &&
+       diff --git a/- b/a/1
+       index $ZERO_OID..$(git hash-object --stdin <a/1) 100644
+       --- a/-
+       +++ b/a/1
+       @@ -1 +1 @@
+       -x
+       +1
+       EOF
+
+       test_write_lines x | test_expect_code 1 \
+               git -c core.abbrev=no diff --no-index -- - a/1 >actual &&
+       test_cmp expect actual &&
+
+       test_write_lines 1 | git diff --no-index -- a/1 - >actual &&
+       test_must_be_empty actual
+'
+
+test_expect_success 'diff --no-index refuses to diff stdin and a directory' '
+       test_must_fail git diff --no-index -- - a </dev/null 2>err &&
+       grep "fatal: cannot compare stdin to a directory" err
+'
+
+test_expect_success PIPE 'diff --no-index refuses to diff a named pipe and a directory' '
+       test_when_finished "rm -f pipe" &&
+       mkfifo pipe &&
+       test_must_fail git diff --no-index -- pipe a 2>err &&
+       grep "fatal: cannot compare a named pipe to a directory" err
+'
+
+test_expect_success PIPE,SYMLINKS 'diff --no-index reads from pipes' '
+       test_when_finished "rm -f old new new-link" &&
+       mkfifo old &&
+       mkfifo new &&
+       ln -s new new-link &&
+       {
+               (test_write_lines a b c >old) &
+       } &&
+       test_when_finished "kill $! || :" &&
+       {
+               (test_write_lines a x c >new) &
+       } &&
+       test_when_finished "kill $! || :" &&
+
+       cat >expect <<-EOF &&
+       diff --git a/old b/new-link
+       --- a/old
+       +++ b/new-link
+       @@ -1,3 +1,3 @@
+        a
+       -b
+       +x
+        c
+       EOF
+
+       test_expect_code 1 git diff --no-index old new-link >actual &&
+       test_cmp expect actual
+'
+
 test_done
index 9aaa068ed9bc9a7853ce8331ec5d66107a50b94b..a90b46b678ca35a6af71769149bcfa7cc2317a39 100755 (executable)
@@ -24,7 +24,7 @@ test_expect_success '-G matches' '
 
 test_expect_success '-S --pickaxe-regex' '
        git diff --name-only -S0 --pickaxe-regex HEAD^ >out &&
-       verbose test 4096-zeroes.txt = "$(cat out)"
+       test 4096-zeroes.txt = "$(cat out)"
 '
 
 test_done
index f60f5cbd65f049e1d3148bae352f3c6032454f2e..7af3a08862dec8a17b113191a3dbea56b0995cd3 100755 (executable)
@@ -151,7 +151,7 @@ test_expect_success 'diff does not fetch anything if inexact rename detection is
 
        # Ensure no fetches.
        GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD &&
-       ! test_path_exists trace
+       test_path_is_missing trace
 '
 
 test_expect_success 'diff --break-rewrites fetches only if necessary, and batches blobs if it does' '
@@ -171,7 +171,7 @@ test_expect_success 'diff --break-rewrites fetches only if necessary, and batche
 
        # Ensure no fetches.
        GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD &&
-       ! test_path_exists trace &&
+       test_path_is_missing trace &&
 
        # But with --break-rewrites, ensure that there is exactly 1 negotiation
        # by checking that there is only 1 "done" line sent. ("done" marks the
index 65ac7df2d745c4f7a698baf23cc71c2a80221c3e..a22a90d552a8ac8beb61d02b6e373a43951be7a1 100755 (executable)
@@ -74,7 +74,7 @@ test_expect_success SYMLINKS 'symlink escape when creating new files' '
        error: affected file ${SQ}renamed-symlink/create-me${SQ} is beyond a symbolic link
        EOF
        test_cmp expected_stderr stderr &&
-       ! test_path_exists .git/create-me
+       test_path_is_missing .git/create-me
 '
 
 test_expect_success SYMLINKS 'symlink escape when modifying file' '
@@ -126,4 +126,19 @@ test_expect_success SYMLINKS 'symlink escape when deleting file' '
        test_path_is_file .git/delete-me
 '
 
+test_expect_success SYMLINKS '--reject removes .rej symlink if it exists' '
+       test_when_finished "git reset --hard && git clean -dfx" &&
+
+       test_commit file &&
+       echo modified >file.t &&
+       git diff -- file.t >patch &&
+       echo modified-again >file.t &&
+
+       ln -s foo file.t.rej &&
+       test_must_fail git apply patch --reject 2>err &&
+       test_i18ngrep "Rejected hunk" err &&
+       test_path_is_missing foo &&
+       test_path_is_file file.t.rej
+'
+
 test_done
index 58742d4fc5d5208808004cc17eb566abbf385461..20cc1209f6259c703fc3ed3e9c193be24b429a3f 100755 (executable)
@@ -17,7 +17,7 @@ test_expect_success EXPENSIVE 'git apply rejects patches that are too large' '
                EOF
                test-tool genzeros
        } | test_copy_bytes $sz | test_must_fail git apply 2>err &&
-       grep "git apply: failed to read" err
+       grep "patch too large" err
 '
 
 test_done
index ae73aef922f950f9a289085a5417c84654bbcd8f..af4a123cd223ef5a3cdff9c97cf6af35abe53854 100755 (executable)
@@ -187,6 +187,21 @@ test_expect_success 'git config log.follow does not die with no paths' '
        git log --
 '
 
+test_expect_success 'git log --follow rejects unsupported pathspec magic' '
+       test_must_fail git log --follow ":(top,glob,icase)ichi" 2>stderr &&
+       # check full error message; we want to be sure we mention both
+       # of the rejected types (glob,icase), but not the allowed one (top)
+       echo "fatal: pathspec magic not supported by --follow: ${SQ}glob${SQ}, ${SQ}icase${SQ}" >expect &&
+       test_cmp expect stderr
+'
+
+test_expect_success 'log.follow disabled with unsupported pathspec magic' '
+       test_config log.follow true &&
+       git log --format=%s ":(glob,icase)ichi" >actual &&
+       echo third >expect &&
+       test_cmp expect actual
+'
+
 test_expect_success 'git config log.follow is overridden by --no-follow' '
        test_config log.follow true &&
        git log --no-follow --pretty="format:%s" ichi >actual &&
@@ -2343,10 +2358,10 @@ test_expect_success 'log --decorate does not include things outside filter' '
 '
 
 test_expect_success 'log --end-of-options' '
-       git update-ref refs/heads/--source HEAD &&
-       git log --end-of-options --source >actual &&
-       git log >expect &&
-       test_cmp expect actual
+       git update-ref refs/heads/--source HEAD &&
+       git log --end-of-options --source >actual &&
+       git log >expect &&
+       test_cmp expect actual
 '
 
 test_expect_success 'set up commits with different authors' '
index fa7f987284b117607fa051c91dd439749da546d4..2016132f5161743018a09a663224806a93496730 100755 (executable)
@@ -466,7 +466,7 @@ test_expect_success 'gitmailmap(5) example output: example #1' '
        Author Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@laptop.(none)>
        Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
 
-       Author Jane D <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>
+       Author Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@desktop.(none)>
        Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
        EOF
        git -C doc log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
@@ -494,7 +494,7 @@ test_expect_success 'gitmailmap(5) example output: example #2' '
        Author Jane Doe <jane@laptop.(none)> maps to Jane Doe <jane@example.com>
        Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
 
-       Author Jane D <jane@desktop.(none)> maps to Jane Doe <jane@example.com>
+       Author Jane D. <jane@desktop.(none)> maps to Jane Doe <jane@example.com>
        Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
        EOF
        git -C doc log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
index 4cf8a7766768bfed03c7016ffdf70c10802c0708..dd9035aa384937bfec5793fe2f591032282837ac 100755 (executable)
@@ -1012,10 +1012,25 @@ test_expect_success '%(describe:tags) vs git describe --tags' '
 
 test_expect_success '%(describe:abbrev=...) vs git describe --abbrev=...' '
        test_when_finished "git tag -d tagname" &&
+
+       # Case 1: We have commits between HEAD and the most recent tag
+       #         reachable from it
+       test_commit --no-tag file &&
+       git describe --abbrev=15 >expect &&
+       git log -1 --format="%(describe:abbrev=15)" >actual &&
+       test_cmp expect actual &&
+
+       # Make sure the hash used is at least 15 digits long
+       sed -e "s/^.*-g\([0-9a-f]*\)$/\1/" <actual >hexpart &&
+       test 16 -le $(wc -c <hexpart) &&
+
+       # Case 2: We have a tag at HEAD, describe directly gives the
+       #         name of the tag
        git tag -a -m tagged tagname &&
        git describe --abbrev=15 >expect &&
        git log -1 --format="%(describe:abbrev=15)" >actual &&
-       test_cmp expect actual
+       test_cmp expect actual &&
+       test tagname = $(cat actual)
 '
 
 test_expect_success 'log --pretty with space stealing' '
index 33ecf82c7f98d3b9fb59422e614eb47cfe54fecb..9167b0351f221205cf2700a318b8041513e34248 100755 (executable)
@@ -16,29 +16,29 @@ Line 2
 Line 3
 '
 
-test_expect_success \
-    'add a file path0 and commit.' \
-    'git add path0 &&
-     git commit -m "Add path0"'
+test_expect_success 'add a file path0 and commit.' '
+       git add path0 &&
+       git commit -m "Add path0"
+'
 
 echo >path0 'New line 1
 New line 2
 New line 3
 '
-test_expect_success \
-    'Change path0.' \
-    'git add path0 &&
-     git commit -m "Change path0"'
+test_expect_success 'Change path0.' '
+       git add path0 &&
+       git commit -m "Change path0"
+'
 
 cat <path0 >path1
-test_expect_success \
-    'copy path0 to path1.' \
-    'git add path1 &&
-     git commit -m "Copy path1 from path0"'
+test_expect_success 'copy path0 to path1.' '
+       git add path1 &&
+       git commit -m "Copy path1 from path0"
+'
 
-test_expect_success \
-    'find the copy path0 -> path1 harder' \
-    'git log --follow --name-status --pretty="format:%s"  path1 > current'
+test_expect_success 'find the copy path0 -> path1 harder' '
+       git log --follow --name-status --pretty="format:%s"  path1 > current
+'
 
 cat >expected <<\EOF
 Copy path1 from path0
@@ -51,8 +51,8 @@ Add path0
 A      path0
 EOF
 
-test_expect_success \
-    'validate the output.' \
-    'compare_diff_patch current expected'
+test_expect_success 'validate the output.' '
+       compare_diff_patch current expected
+'
 
 test_done
index e89e1f54b6caed2e97d04aaf4672a0491a398acf..85e90acb0919d6bff674263aff7f2d5140bc0495 100755 (executable)
@@ -8,8 +8,9 @@ TEST_PASSES_SANITIZE_LEAK=true
 test_expect_success 'setup' '
        test_commit foo &&
 
-       git cat-file commit HEAD |
-       sed "/^author /s/>/>-<>/" >broken_email.commit &&
+       git cat-file commit HEAD >ok.commit &&
+       sed "s/>/>-<>/" <ok.commit >broken_email.commit &&
+
        git hash-object --literally -w -t commit broken_email.commit >broken_email.hash &&
        git update-ref refs/heads/broken_email $(cat broken_email.hash)
 '
@@ -43,6 +44,11 @@ test_expect_success 'git log --format with broken author email' '
        test_must_be_empty actual.err
 '
 
+test_expect_success '--until handles broken email' '
+       git rev-list --until=1980-01-01 broken_email >actual &&
+       test_must_be_empty actual
+'
+
 munge_author_date () {
        git cat-file commit "$1" >commit.orig &&
        sed "s/^\(author .*>\) [0-9]*/\1 $2/" <commit.orig >commit.munge &&
@@ -86,4 +92,45 @@ test_expect_success 'absurdly far-in-future date' '
        git log -1 --format=%ad $commit
 '
 
+test_expect_success 'create commits with whitespace committer dates' '
+       # It is important that this subject line is numeric, since we want to
+       # be sure we are not confused by skipping whitespace and accidentally
+       # parsing the subject as a timestamp.
+       #
+       # Do not use munge_author_date here. Besides not hitting the committer
+       # line, it leaves the timezone intact, and we want nothing but
+       # whitespace.
+       #
+       # We will make two munged commits here. The first, ws_commit, will
+       # be purely spaces. The second contains a vertical tab, which is
+       # considered a space by strtoumax(), but not by our isspace().
+       test_commit 1234567890 &&
+       git cat-file commit HEAD >commit.orig &&
+       sed "s/>.*/>    /" <commit.orig >commit.munge &&
+       ws_commit=$(git hash-object --literally -w -t commit commit.munge) &&
+       sed "s/>.*/>   $(printf "\013")/" <commit.orig >commit.munge &&
+       vt_commit=$(git hash-object --literally -w -t commit commit.munge)
+'
+
+test_expect_success '--until treats whitespace date as sentinel' '
+       echo $ws_commit >expect &&
+       git rev-list --until=1980-01-01 $ws_commit >actual &&
+       test_cmp expect actual &&
+
+       echo $vt_commit >expect &&
+       git rev-list --until=1980-01-01 $vt_commit >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'pretty-printer handles whitespace date' '
+       # as with the %ad test above, we will show these as the empty string,
+       # not the 1970 epoch date. This is intentional; see 7d9a281941 (t4212:
+       # test bogus timestamps with git-log, 2014-02-24) for more discussion.
+       echo : >expect &&
+       git log -1 --format="%at:%ct" $ws_commit >actual &&
+       test_cmp expect actual &&
+       git log -1 --format="%at:%ct" $vt_commit >actual &&
+       test_cmp expect actual
+'
+
 test_done
index c52c8a21fae6d0593cc120485e8d6eaa8a95ccbc..57c4f26e4613a97644ad5822b1f6a0c4572a33a4 100755 (executable)
@@ -334,4 +334,22 @@ test_expect_success 'turn tree to file' '
        test_cmp expect actual
 '
 
+test_expect_success 'merge-tree respects core.useReplaceRefs=false' '
+       test_commit merge-to &&
+       test_commit valid base &&
+       git reset --hard HEAD^ &&
+       test_commit malicious base &&
+
+       test_when_finished "git replace -d $(git rev-parse valid^0)" &&
+       git replace valid^0 malicious^0 &&
+
+       tree=$(git -c core.useReplaceRefs=true merge-tree --write-tree merge-to valid) &&
+       merged=$(git cat-file -p $tree:base) &&
+       test malicious = $merged &&
+
+       tree=$(git -c core.useReplaceRefs=false merge-tree --write-tree merge-to valid) &&
+       merged=$(git cat-file -p $tree:base) &&
+       test valid = $merged
+'
+
 test_done
index f8a0f309e2dec0f2ab864851730446bdc7102818..745089479ca3a87e36239e196466aadb0b886848 100755 (executable)
@@ -208,7 +208,7 @@ test_expect_success 'unpack with OFS_DELTA' '
 '
 
 test_expect_success 'unpack with OFS_DELTA (core.fsyncmethod=batch)' '
-       check_unpack test-3-${packname_3} obj-list "$BATCH_CONFIGURATION"
+       check_unpack test-3-${packname_3} obj-list "$BATCH_CONFIGURATION"
 '
 
 test_expect_success 'compare delta flavors' '
@@ -263,97 +263,97 @@ test_expect_success 'survive missing objects/pack directory' '
        )
 '
 
-test_expect_success \
-    'verify pack' \
-    'git verify-pack   test-1-${packname_1}.idx \
-                       test-2-${packname_2}.idx \
-                       test-3-${packname_3}.idx'
-
-test_expect_success \
-    'verify pack -v' \
-    'git verify-pack -v        test-1-${packname_1}.idx \
-                       test-2-${packname_2}.idx \
-                       test-3-${packname_3}.idx'
-
-test_expect_success \
-    'verify-pack catches mismatched .idx and .pack files' \
-    'cat test-1-${packname_1}.idx >test-3.idx &&
-     cat test-2-${packname_2}.pack >test-3.pack &&
-     if git verify-pack test-3.idx
-     then false
-     else :;
-     fi'
-
-test_expect_success \
-    'verify-pack catches a corrupted pack signature' \
-    'cat test-1-${packname_1}.pack >test-3.pack &&
-     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
-     if git verify-pack test-3.idx
-     then false
-     else :;
-     fi'
-
-test_expect_success \
-    'verify-pack catches a corrupted pack version' \
-    'cat test-1-${packname_1}.pack >test-3.pack &&
-     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
-     if git verify-pack test-3.idx
-     then false
-     else :;
-     fi'
-
-test_expect_success \
-    'verify-pack catches a corrupted type/size of the 1st packed object data' \
-    'cat test-1-${packname_1}.pack >test-3.pack &&
-     echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
-     if git verify-pack test-3.idx
-     then false
-     else :;
-     fi'
-
-test_expect_success \
-    'verify-pack catches a corrupted sum of the index file itself' \
-    'l=$(wc -c <test-3.idx) &&
-     l=$(expr $l - 20) &&
-     cat test-1-${packname_1}.pack >test-3.pack &&
-     printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
-     if git verify-pack test-3.pack
-     then false
-     else :;
-     fi'
-
-test_expect_success \
-    'build pack index for an existing pack' \
-    'cat test-1-${packname_1}.pack >test-3.pack &&
-     git index-pack -o tmp.idx test-3.pack &&
-     cmp tmp.idx test-1-${packname_1}.idx &&
-
-     git index-pack --promisor=message test-3.pack &&
-     cmp test-3.idx test-1-${packname_1}.idx &&
-     echo message >expect &&
-     test_cmp expect test-3.promisor &&
-
-     cat test-2-${packname_2}.pack >test-3.pack &&
-     git index-pack -o tmp.idx test-2-${packname_2}.pack &&
-     cmp tmp.idx test-2-${packname_2}.idx &&
-
-     git index-pack test-3.pack &&
-     cmp test-3.idx test-2-${packname_2}.idx &&
-
-     cat test-3-${packname_3}.pack >test-3.pack &&
-     git index-pack -o tmp.idx test-3-${packname_3}.pack &&
-     cmp tmp.idx test-3-${packname_3}.idx &&
-
-     git index-pack test-3.pack &&
-     cmp test-3.idx test-3-${packname_3}.idx &&
-
-     cat test-1-${packname_1}.pack >test-4.pack &&
-     rm -f test-4.keep &&
-     git index-pack --keep=why test-4.pack &&
-     cmp test-1-${packname_1}.idx test-4.idx &&
-     test -f test-4.keep &&
-
-     :'
+test_expect_success 'verify pack' '
+       git verify-pack test-1-${packname_1}.idx \
+               test-2-${packname_2}.idx \
+               test-3-${packname_3}.idx
+'
+
+test_expect_success 'verify pack -v' '
+       git verify-pack -v test-1-${packname_1}.idx \
+               test-2-${packname_2}.idx \
+               test-3-${packname_3}.idx
+'
+
+test_expect_success 'verify-pack catches mismatched .idx and .pack files' '
+       cat test-1-${packname_1}.idx >test-3.idx &&
+       cat test-2-${packname_2}.pack >test-3.pack &&
+       if git verify-pack test-3.idx
+       then false
+       else :;
+       fi
+'
+
+test_expect_success 'verify-pack catches a corrupted pack signature' '
+       cat test-1-${packname_1}.pack >test-3.pack &&
+       echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
+       if git verify-pack test-3.idx
+       then false
+       else :;
+       fi
+'
+
+test_expect_success 'verify-pack catches a corrupted pack version' '
+       cat test-1-${packname_1}.pack >test-3.pack &&
+       echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
+       if git verify-pack test-3.idx
+       then false
+       else :;
+       fi
+'
+
+test_expect_success 'verify-pack catches a corrupted type/size of the 1st packed object data' '
+       cat test-1-${packname_1}.pack >test-3.pack &&
+       echo | dd of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
+       if git verify-pack test-3.idx
+       then false
+       else :;
+       fi
+'
+
+test_expect_success 'verify-pack catches a corrupted sum of the index file itself' '
+       l=$(wc -c <test-3.idx) &&
+       l=$(expr $l - 20) &&
+       cat test-1-${packname_1}.pack >test-3.pack &&
+       printf "%20s" "" | dd of=test-3.idx count=20 bs=1 conv=notrunc seek=$l &&
+       if git verify-pack test-3.pack
+       then false
+       else :;
+       fi
+'
+
+test_expect_success 'build pack index for an existing pack' '
+       cat test-1-${packname_1}.pack >test-3.pack &&
+       git index-pack -o tmp.idx test-3.pack &&
+       cmp tmp.idx test-1-${packname_1}.idx &&
+
+       git index-pack --promisor=message test-3.pack &&
+       cmp test-3.idx test-1-${packname_1}.idx &&
+       echo message >expect &&
+       test_cmp expect test-3.promisor &&
+
+       cat test-2-${packname_2}.pack >test-3.pack &&
+       git index-pack -o tmp.idx test-2-${packname_2}.pack &&
+       cmp tmp.idx test-2-${packname_2}.idx &&
+
+       git index-pack test-3.pack &&
+       cmp test-3.idx test-2-${packname_2}.idx &&
+
+       cat test-3-${packname_3}.pack >test-3.pack &&
+       git index-pack -o tmp.idx test-3-${packname_3}.pack &&
+       cmp tmp.idx test-3-${packname_3}.idx &&
+
+       git index-pack test-3.pack &&
+       cmp test-3.idx test-3-${packname_3}.idx &&
+
+       cat test-1-${packname_1}.pack >test-4.pack &&
+       rm -f test-4.keep &&
+       git index-pack --keep=why test-4.pack &&
+       cmp test-1-${packname_1}.idx test-4.idx &&
+       test -f test-4.keep &&
+
+       :
+'
 
 test_expect_success 'unpacking with --strict' '
 
@@ -589,141 +589,6 @@ test_expect_success 'prefetch objects' '
        test_line_count = 1 donelines
 '
 
-test_expect_success 'setup for --stdin-packs tests' '
-       git init stdin-packs &&
-       (
-               cd stdin-packs &&
-
-               test_commit A &&
-               test_commit B &&
-               test_commit C &&
-
-               for id in A B C
-               do
-                       git pack-objects .git/objects/pack/pack-$id \
-                               --incremental --revs <<-EOF || exit 1
-                       refs/tags/$id
-                       EOF
-               done &&
-
-               ls -la .git/objects/pack
-       )
-'
-
-test_expect_success '--stdin-packs with excluded packs' '
-       (
-               cd stdin-packs &&
-
-               PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
-               PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
-               PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
-
-               git pack-objects test --stdin-packs <<-EOF &&
-               $PACK_A
-               ^$PACK_B
-               $PACK_C
-               EOF
-
-               (
-                       git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
-                       git show-index <$(ls .git/objects/pack/pack-C-*.idx)
-               ) >expect.raw &&
-               git show-index <$(ls test-*.idx) >actual.raw &&
-
-               cut -d" " -f2 <expect.raw | sort >expect &&
-               cut -d" " -f2 <actual.raw | sort >actual &&
-               test_cmp expect actual
-       )
-'
-
-test_expect_success '--stdin-packs is incompatible with --filter' '
-       (
-               cd stdin-packs &&
-               test_must_fail git pack-objects --stdin-packs --stdout \
-                       --filter=blob:none </dev/null 2>err &&
-               test_i18ngrep "cannot use --filter with --stdin-packs" err
-       )
-'
-
-test_expect_success '--stdin-packs is incompatible with --revs' '
-       (
-               cd stdin-packs &&
-               test_must_fail git pack-objects --stdin-packs --revs out \
-                       </dev/null 2>err &&
-               test_i18ngrep "cannot use internal rev list with --stdin-packs" err
-       )
-'
-
-test_expect_success '--stdin-packs with loose objects' '
-       (
-               cd stdin-packs &&
-
-               PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
-               PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
-               PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
-
-               test_commit D && # loose
-
-               git pack-objects test2 --stdin-packs --unpacked <<-EOF &&
-               $PACK_A
-               ^$PACK_B
-               $PACK_C
-               EOF
-
-               (
-                       git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
-                       git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
-                       git rev-list --objects --no-object-names \
-                               refs/tags/C..refs/tags/D
-
-               ) >expect.raw &&
-               ls -la . &&
-               git show-index <$(ls test2-*.idx) >actual.raw &&
-
-               cut -d" " -f2 <expect.raw | sort >expect &&
-               cut -d" " -f2 <actual.raw | sort >actual &&
-               test_cmp expect actual
-       )
-'
-
-test_expect_success '--stdin-packs with broken links' '
-       (
-               cd stdin-packs &&
-
-               # make an unreachable object with a bogus parent
-               git cat-file -p HEAD >commit &&
-               sed "s/$(git rev-parse HEAD^)/$(test_oid zero)/" <commit |
-               git hash-object -w -t commit --stdin >in &&
-
-               git pack-objects .git/objects/pack/pack-D <in &&
-
-               PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
-               PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
-               PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
-               PACK_D="$(basename .git/objects/pack/pack-D-*.pack)" &&
-
-               git pack-objects test3 --stdin-packs --unpacked <<-EOF &&
-               $PACK_A
-               ^$PACK_B
-               $PACK_C
-               $PACK_D
-               EOF
-
-               (
-                       git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
-                       git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
-                       git show-index <$(ls .git/objects/pack/pack-D-*.idx) &&
-                       git rev-list --objects --no-object-names \
-                               refs/tags/C..refs/tags/D
-               ) >expect.raw &&
-               git show-index <$(ls test3-*.idx) >actual.raw &&
-
-               cut -d" " -f2 <expect.raw | sort >expect &&
-               cut -d" " -f2 <actual.raw | sort >actual &&
-               test_cmp expect actual
-       )
-'
-
 test_expect_success 'negative window clamps to 0' '
        git pack-objects --progress --window=-1 neg-window <obj-list 2>stderr &&
        check_deltas stderr = 0
index 3ccaaeb397774da8978c5406840ec307ffe7564d..226490d60df3a61b6b9831118562c4a88bae1cc9 100755 (executable)
@@ -8,55 +8,55 @@ test_description='mmap sliding window tests'
 TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
-test_expect_success \
-    'setup' \
-    'rm -f .git/index* &&
-     for i in a b c
-     do
-         echo $i >$i &&
-        test-tool genrandom "$i" 32768 >>$i &&
-         git update-index --add $i || return 1
-     done &&
-     echo d >d && cat c >>d && git update-index --add d &&
-     tree=$(git write-tree) &&
-     commit1=$(git commit-tree $tree </dev/null) &&
-     git update-ref HEAD $commit1 &&
-     git repack -a -d &&
-     test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
-     pack1=$(ls .git/objects/pack/*.pack) &&
-     test -f "$pack1"'
-
-test_expect_success \
-    'verify-pack -v, defaults' \
-    'git verify-pack -v "$pack1"'
-
-test_expect_success \
-    'verify-pack -v, packedGitWindowSize == 1 page' \
-    'git config core.packedGitWindowSize 512 &&
-     git verify-pack -v "$pack1"'
-
-test_expect_success \
-    'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' \
-    'git config core.packedGitWindowSize 512 &&
-     git config core.packedGitLimit 512 &&
-     git verify-pack -v "$pack1"'
-
-test_expect_success \
-    'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \
-    'git config core.packedGitWindowSize 512 &&
-     git config core.packedGitLimit 512 &&
-     commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
-     git update-ref HEAD $commit2 &&
-     git repack -a -d &&
-     test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
-     pack2=$(ls .git/objects/pack/*.pack) &&
-     test -f "$pack2" &&
-     test "$pack1" \!= "$pack2"'
-
-test_expect_success \
-    'verify-pack -v, defaults' \
-    'git config --unset core.packedGitWindowSize &&
-     git config --unset core.packedGitLimit &&
-     git verify-pack -v "$pack2"'
+test_expect_success 'setup' '
+       rm -f .git/index* &&
+       for i in a b c
+       do
+       echo $i >$i &&
+       test-tool genrandom "$i" 32768 >>$i &&
+       git update-index --add $i || return 1
+       done &&
+       echo d >d && cat c >>d && git update-index --add d &&
+       tree=$(git write-tree) &&
+       commit1=$(git commit-tree $tree </dev/null) &&
+       git update-ref HEAD $commit1 &&
+       git repack -a -d &&
+       test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
+       pack1=$(ls .git/objects/pack/*.pack) &&
+       test -f "$pack1"
+'
+
+test_expect_success 'verify-pack -v, defaults' '
+       git verify-pack -v "$pack1"
+'
+
+test_expect_success 'verify-pack -v, packedGitWindowSize == 1 page' '
+       git config core.packedGitWindowSize 512 &&
+       git verify-pack -v "$pack1"
+'
+
+test_expect_success 'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' '
+       git config core.packedGitWindowSize 512 &&
+       git config core.packedGitLimit 512 &&
+       git verify-pack -v "$pack1"
+'
+
+test_expect_success 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' '
+       git config core.packedGitWindowSize 512 &&
+       git config core.packedGitLimit 512 &&
+       commit2=$(git commit-tree $tree -p $commit1 </dev/null) &&
+       git update-ref HEAD $commit2 &&
+       git repack -a -d &&
+       test "$(git count-objects)" = "0 objects, 0 kilobytes" &&
+       pack2=$(ls .git/objects/pack/*.pack) &&
+       test -f "$pack2" &&
+       test "$pack1" \!= "$pack2"
+'
+
+test_expect_success 'verify-pack -v, defaults' '
+       git config --unset core.packedGitWindowSize &&
+       git config --unset core.packedGitLimit &&
+       git verify-pack -v "$pack2"
+'
 
 test_done
index 2926e8dfc41223cc0030685beec8f6612db25a4d..61469ef4a681200044f45f0a98f54f39dec2a4c2 100755 (executable)
@@ -59,304 +59,304 @@ do_corrupt_object() {
 
 printf '\0' > zero
 
-test_expect_success \
-    'initial setup validation' \
-    'create_test_files &&
-     create_new_pack &&
-     git prune-packed &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'create corruption in header of first object' \
-    'do_corrupt_object $blob_1 0 < zero &&
-     test_must_fail git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_1 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and loose copy of first delta allows for partial recovery' \
-    'git prune-packed &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_2 &&
-     mv tmp ${pack}.idx &&
-     test_must_fail git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'create corruption in data of first object' \
-    'create_new_pack &&
-     git prune-packed &&
-     chmod +w ${pack}.pack &&
-     perl -i.bak -pe "s/ base /abcdef/" ${pack}.pack &&
-     test_must_fail git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_1 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and loose copy of second object allows for partial recovery' \
-    'git prune-packed &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_2 &&
-     mv tmp ${pack}.idx &&
-     test_must_fail git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'create corruption in header of first delta' \
-    'create_new_pack &&
-     git prune-packed &&
-     do_corrupt_object $blob_2 0 < zero &&
-     git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_2 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and then a repack "clears" the corruption' \
-    'do_repack &&
-     git prune-packed &&
-     git verify-pack ${pack}.pack &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'create corruption in data of first delta' \
-    'create_new_pack &&
-     git prune-packed &&
-     chmod +w ${pack}.pack &&
-     perl -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack &&
-     git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_2 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and then a repack "clears" the corruption' \
-    'do_repack &&
-     git prune-packed &&
-     git verify-pack ${pack}.pack &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'corruption in delta base reference of first delta (OBJ_REF_DELTA)' \
-    'create_new_pack &&
-     git prune-packed &&
-     do_corrupt_object $blob_2 2 < zero &&
-     git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_2 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and then a repack "clears" the corruption' \
-    'do_repack &&
-     git prune-packed &&
-     git verify-pack ${pack}.pack &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'corruption #0 in delta base reference of first delta (OBJ_OFS_DELTA)' \
-    'create_new_pack --delta-base-offset &&
-     git prune-packed &&
-     do_corrupt_object $blob_2 2 < zero &&
-     git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_2 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and then a repack "clears" the corruption' \
-    'do_repack --delta-base-offset &&
-     git prune-packed &&
-     git verify-pack ${pack}.pack &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'corruption #1 in delta base reference of first delta (OBJ_OFS_DELTA)' \
-    'create_new_pack --delta-base-offset &&
-     git prune-packed &&
-     printf "\001" | do_corrupt_object $blob_2 2 &&
-     git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_2 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and then a repack "clears" the corruption' \
-    'do_repack --delta-base-offset &&
-     git prune-packed &&
-     git verify-pack ${pack}.pack &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and a redundant pack allows for full recovery too' \
-    'do_corrupt_object $blob_2 2 < zero &&
-     git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null &&
-     mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_1 &&
-     git hash-object -t blob -w file_2 &&
-     printf "$blob_1\n$blob_2\n" | git pack-objects .git/objects/pack/pack &&
-     git prune-packed &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'corruption of delta base reference pointing to wrong object' \
-    'create_new_pack --delta-base-offset &&
-     git prune-packed &&
-     printf "\220\033" | do_corrupt_object $blob_3 2 &&
-     git cat-file blob $blob_1 >/dev/null &&
-     git cat-file blob $blob_2 >/dev/null &&
-     test_must_fail git cat-file blob $blob_3 >/dev/null'
-
-test_expect_success \
-    '... but having a loose copy allows for full recovery' \
-    'mv ${pack}.idx tmp &&
-     git hash-object -t blob -w file_3 &&
-     mv tmp ${pack}.idx &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    '... and then a repack "clears" the corruption' \
-    'do_repack --delta-base-offset --no-reuse-delta &&
-     git prune-packed &&
-     git verify-pack ${pack}.pack &&
-     git cat-file blob $blob_1 > /dev/null &&
-     git cat-file blob $blob_2 > /dev/null &&
-     git cat-file blob $blob_3 > /dev/null'
-
-test_expect_success \
-    'corrupting header to have too small output buffer fails unpack' \
-    'create_new_pack &&
-     git prune-packed &&
-     printf "\262\001" | do_corrupt_object $blob_1 0 &&
-     test_must_fail git cat-file blob $blob_1 > /dev/null &&
-     test_must_fail git cat-file blob $blob_2 > /dev/null &&
-     test_must_fail git cat-file blob $blob_3 > /dev/null'
+test_expect_success 'initial setup validation' '
+       create_test_files &&
+       create_new_pack &&
+       git prune-packed &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in header of first object' '
+       do_corrupt_object $blob_1 0 < zero &&
+       test_must_fail git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_1 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and loose copy of first delta allows for partial recovery' '
+       git prune-packed &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_2 &&
+       mv tmp ${pack}.idx &&
+       test_must_fail git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in data of first object' '
+       create_new_pack &&
+       git prune-packed &&
+       chmod +w ${pack}.pack &&
+       perl -i.bak -pe "s/ base /abcdef/" ${pack}.pack &&
+       test_must_fail git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_1 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and loose copy of second object allows for partial recovery' '
+       git prune-packed &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_2 &&
+       mv tmp ${pack}.idx &&
+       test_must_fail git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in header of first delta' '
+       create_new_pack &&
+       git prune-packed &&
+       do_corrupt_object $blob_2 0 < zero &&
+       git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_2 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+       do_repack &&
+       git prune-packed &&
+       git verify-pack ${pack}.pack &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'create corruption in data of first delta' '
+       create_new_pack &&
+       git prune-packed &&
+       chmod +w ${pack}.pack &&
+       perl -i.bak -pe "s/ delta1 /abcdefgh/" ${pack}.pack &&
+       git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_2 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+       do_repack &&
+       git prune-packed &&
+       git verify-pack ${pack}.pack &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption in delta base reference of first delta (OBJ_REF_DELTA)' '
+       create_new_pack &&
+       git prune-packed &&
+       do_corrupt_object $blob_2 2 < zero &&
+       git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_2 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+       do_repack &&
+       git prune-packed &&
+       git verify-pack ${pack}.pack &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption #0 in delta base reference of first delta (OBJ_OFS_DELTA)' '
+       create_new_pack --delta-base-offset &&
+       git prune-packed &&
+       do_corrupt_object $blob_2 2 < zero &&
+       git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_2 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+       do_repack --delta-base-offset &&
+       git prune-packed &&
+       git verify-pack ${pack}.pack &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption #1 in delta base reference of first delta (OBJ_OFS_DELTA)' '
+       create_new_pack --delta-base-offset &&
+       git prune-packed &&
+       printf "\001" | do_corrupt_object $blob_2 2 &&
+       git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_2 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+       do_repack --delta-base-offset &&
+       git prune-packed &&
+       git verify-pack ${pack}.pack &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and a redundant pack allows for full recovery too' '
+       do_corrupt_object $blob_2 2 < zero &&
+       git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null &&
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_1 &&
+       git hash-object -t blob -w file_2 &&
+       printf "$blob_1\n$blob_2\n" | git pack-objects .git/objects/pack/pack &&
+       git prune-packed &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corruption of delta base reference pointing to wrong object' '
+       create_new_pack --delta-base-offset &&
+       git prune-packed &&
+       printf "\220\033" | do_corrupt_object $blob_3 2 &&
+       git cat-file blob $blob_1 >/dev/null &&
+       git cat-file blob $blob_2 >/dev/null &&
+       test_must_fail git cat-file blob $blob_3 >/dev/null
+'
+
+test_expect_success '... but having a loose copy allows for full recovery' '
+       mv ${pack}.idx tmp &&
+       git hash-object -t blob -w file_3 &&
+       mv tmp ${pack}.idx &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success '... and then a repack "clears" the corruption' '
+       do_repack --delta-base-offset --no-reuse-delta &&
+       git prune-packed &&
+       git verify-pack ${pack}.pack &&
+       git cat-file blob $blob_1 > /dev/null &&
+       git cat-file blob $blob_2 > /dev/null &&
+       git cat-file blob $blob_3 > /dev/null
+'
+
+test_expect_success 'corrupting header to have too small output buffer fails unpack' '
+       create_new_pack &&
+       git prune-packed &&
+       printf "\262\001" | do_corrupt_object $blob_1 0 &&
+       test_must_fail git cat-file blob $blob_1 > /dev/null &&
+       test_must_fail git cat-file blob $blob_2 > /dev/null &&
+       test_must_fail git cat-file blob $blob_3 > /dev/null
+'
 
 # \0 - empty base
 # \1 - one byte in result
 # \1 - one literal byte (X)
-test_expect_success \
-    'apply good minimal delta' \
-    'printf "\0\1\1X" > minimal_delta &&
-     test-tool delta -p /dev/null minimal_delta /dev/null'
+test_expect_success 'apply good minimal delta' '
+       printf "\0\1\1X" > minimal_delta &&
+       test-tool delta -p /dev/null minimal_delta /dev/null
+'
 
 # \0 - empty base
 # \1 - 1 byte in result
 # \2 - two literal bytes (one too many)
-test_expect_success \
-    'apply delta with too many literal bytes' \
-    'printf "\0\1\2XX" > too_big_literal &&
-     test_must_fail test-tool delta -p /dev/null too_big_literal /dev/null'
+test_expect_success 'apply delta with too many literal bytes' '
+       printf "\0\1\2XX" > too_big_literal &&
+       test_must_fail test-tool delta -p /dev/null too_big_literal /dev/null
+'
 
 # \4 - four bytes in base
 # \1 - one byte in result
 # \221 - copy, one byte offset, one byte size
 #   \0 - copy from offset 0
 #   \2 - copy two bytes (one too many)
-test_expect_success \
-    'apply delta with too many copied bytes' \
-    'printf "\4\1\221\0\2" > too_big_copy &&
-     printf base >base &&
-     test_must_fail test-tool delta -p base too_big_copy /dev/null'
+test_expect_success 'apply delta with too many copied bytes' '
+       printf "\4\1\221\0\2" > too_big_copy &&
+       printf base >base &&
+       test_must_fail test-tool delta -p base too_big_copy /dev/null
+'
 
 # \0 - empty base
 # \2 - two bytes in result
 # \2 - two literal bytes (we are short one)
-test_expect_success \
-    'apply delta with too few literal bytes' \
-    'printf "\0\2\2X" > truncated_delta &&
-     test_must_fail test-tool delta -p /dev/null truncated_delta /dev/null'
+test_expect_success 'apply delta with too few literal bytes' '
+       printf "\0\2\2X" > truncated_delta &&
+       test_must_fail test-tool delta -p /dev/null truncated_delta /dev/null
+'
 
 # \0 - empty base
 # \1 - one byte in result
 # \221 - copy, one byte offset, one byte size
 #   \0 - copy from offset 0
 #   \1 - copy one byte (we are short one)
-test_expect_success \
-    'apply delta with too few bytes in base' \
-    'printf "\0\1\221\0\1" > truncated_base &&
-     test_must_fail test-tool delta -p /dev/null truncated_base /dev/null'
+test_expect_success 'apply delta with too few bytes in base' '
+       printf "\0\1\221\0\1" > truncated_base &&
+       test_must_fail test-tool delta -p /dev/null truncated_base /dev/null
+'
 
 # \4 - four bytes in base
 # \2 - two bytes in result
@@ -366,20 +366,20 @@ test_expect_success \
 #
 # Note that the literal byte is necessary to get past the uninteresting minimum
 # delta size check.
-test_expect_success \
-    'apply delta with truncated copy parameters' \
-    'printf "\4\2\1X\221" > truncated_copy_delta &&
-     printf base >base &&
-     test_must_fail test-tool delta -p base truncated_copy_delta /dev/null'
+test_expect_success 'apply delta with truncated copy parameters' '
+       printf "\4\2\1X\221" > truncated_copy_delta &&
+       printf base >base &&
+       test_must_fail test-tool delta -p base truncated_copy_delta /dev/null
+'
 
 # \0 - empty base
 # \1 - one byte in result
 # \1 - one literal byte (X)
 # \1 - trailing garbage command
-test_expect_success \
-    'apply delta with trailing garbage literal' \
-    'printf "\0\1\1X\1" > tail_garbage_literal &&
-     test_must_fail test-tool delta -p /dev/null tail_garbage_literal /dev/null'
+test_expect_success 'apply delta with trailing garbage literal' '
+       printf "\0\1\1X\1" > tail_garbage_literal &&
+       test_must_fail test-tool delta -p /dev/null tail_garbage_literal /dev/null
+'
 
 # \4 - four bytes in base
 # \1 - one byte in result
@@ -387,19 +387,19 @@ test_expect_success \
 # \221 - copy, one byte offset, one byte size
 #   \0 - copy from offset 0
 #   \1 - copy 1 byte
-test_expect_success \
-    'apply delta with trailing garbage copy' \
-    'printf "\4\1\1X\221\0\1" > tail_garbage_copy &&
-     printf base >base &&
-     test_must_fail test-tool delta -p /dev/null tail_garbage_copy /dev/null'
+test_expect_success 'apply delta with trailing garbage copy' '
+       printf "\4\1\1X\221\0\1" > tail_garbage_copy &&
+       printf base >base &&
+       test_must_fail test-tool delta -p /dev/null tail_garbage_copy /dev/null
+'
 
 # \0 - empty base
 # \1 - one byte in result
 # \1 - one literal byte (X)
 # \0 - bogus opcode
-test_expect_success \
-    'apply delta with trailing garbage opcode' \
-    'printf "\0\1\1X\0" > tail_garbage_opcode &&
-     test_must_fail test-tool delta -p /dev/null tail_garbage_opcode /dev/null'
+test_expect_success 'apply delta with trailing garbage opcode' '
+       printf "\0\1\1X\0" > tail_garbage_opcode &&
+       test_must_fail test-tool delta -p /dev/null tail_garbage_opcode /dev/null
+'
 
 test_done
index 5500dd084264d170d00629171502484cbb349a0c..b4df545e5ab602a869cfde5d13090e40c6d003a5 100755 (executable)
@@ -16,7 +16,7 @@ add_blob() {
        before=$(git count-objects | sed "s/ .*//") &&
        BLOB=$(echo aleph_0 | git hash-object -w --stdin) &&
        BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
-       verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
        test_path_is_file $BLOB_FILE &&
        test-tool chmtime =+0 $BLOB_FILE
 }
@@ -51,23 +51,23 @@ test_expect_success 'prune stale packs' '
 test_expect_success 'prune --expire' '
        add_blob &&
        git prune --expire=1.hour.ago &&
-       verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
        test_path_is_file $BLOB_FILE &&
        test-tool chmtime =-86500 $BLOB_FILE &&
        git prune --expire 1.day &&
-       verbose test $before = $(git count-objects | sed "s/ .*//") &&
+       test $before = $(git count-objects | sed "s/ .*//") &&
        test_path_is_missing $BLOB_FILE
 '
 
 test_expect_success 'gc: implicit prune --expire' '
        add_blob &&
        test-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&
-       git gc &&
-       verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
+       git gc --no-cruft &&
+       test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
        test_path_is_file $BLOB_FILE &&
        test-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&
-       git gc &&
-       verbose test $before = $(git count-objects | sed "s/ .*//") &&
+       git gc --no-cruft &&
+       test $before = $(git count-objects | sed "s/ .*//") &&
        test_path_is_missing $BLOB_FILE
 '
 
@@ -86,7 +86,7 @@ test_expect_success 'gc: refuse to start with invalid gc.pruneExpire' '
 
 test_expect_success 'gc: start with ok gc.pruneExpire' '
        git config gc.pruneExpire 2.days.ago &&
-       git gc
+       git gc --no-cruft
 '
 
 test_expect_success 'prune: prune nonsense parameters' '
@@ -137,44 +137,44 @@ test_expect_success 'gc --no-prune' '
        add_blob &&
        test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
        git config gc.pruneExpire 2.days.ago &&
-       git gc --no-prune &&
-       verbose test 1 = $(git count-objects | sed "s/ .*//") &&
+       git gc --no-prune --no-cruft &&
+       test 1 = $(git count-objects | sed "s/ .*//") &&
        test_path_is_file $BLOB_FILE
 '
 
 test_expect_success 'gc respects gc.pruneExpire' '
        git config gc.pruneExpire 5002.days.ago &&
-       git gc &&
+       git gc --no-cruft &&
        test_path_is_file $BLOB_FILE &&
        git config gc.pruneExpire 5000.days.ago &&
-       git gc &&
+       git gc --no-cruft &&
        test_path_is_missing $BLOB_FILE
 '
 
 test_expect_success 'gc --prune=<date>' '
        add_blob &&
        test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
-       git gc --prune=5002.days.ago &&
+       git gc --prune=5002.days.ago --no-cruft &&
        test_path_is_file $BLOB_FILE &&
-       git gc --prune=5000.days.ago &&
+       git gc --prune=5000.days.ago --no-cruft &&
        test_path_is_missing $BLOB_FILE
 '
 
 test_expect_success 'gc --prune=never' '
        add_blob &&
-       git gc --prune=never &&
+       git gc --prune=never --no-cruft &&
        test_path_is_file $BLOB_FILE &&
-       git gc --prune=now &&
+       git gc --prune=now --no-cruft &&
        test_path_is_missing $BLOB_FILE
 '
 
 test_expect_success 'gc respects gc.pruneExpire=never' '
        git config gc.pruneExpire never &&
        add_blob &&
-       git gc &&
+       git gc --no-cruft &&
        test_path_is_file $BLOB_FILE &&
        git config gc.pruneExpire now &&
-       git gc &&
+       git gc --no-cruft &&
        test_path_is_missing $BLOB_FILE
 '
 
@@ -192,10 +192,10 @@ test_expect_success 'gc: prune old objects after local clone' '
        git clone --no-hardlinks . aclone &&
        (
                cd aclone &&
-               verbose test 1 = $(git count-objects | sed "s/ .*//") &&
+               test 1 = $(git count-objects | sed "s/ .*//") &&
                test_path_is_file $BLOB_FILE &&
-               git gc --prune &&
-               verbose test 0 = $(git count-objects | sed "s/ .*//") &&
+               git gc --prune --no-cruft &&
+               test 0 = $(git count-objects | sed "s/ .*//") &&
                test_path_is_missing $BLOB_FILE
        )
 '
@@ -237,7 +237,7 @@ test_expect_success 'clean pack garbage with gc' '
        >.git/objects/pack/fake2.keep &&
        >.git/objects/pack/fake2.idx &&
        >.git/objects/pack/fake3.keep &&
-       git gc &&
+       git gc --no-cruft &&
        git count-objects -v 2>stderr &&
        grep "^warning:" stderr | sort >actual &&
        cat >expected <<\EOF &&
@@ -350,4 +350,18 @@ test_expect_success 'old reachable-from-recent retained with bitmaps' '
        test_must_fail git cat-file -e $to_drop
 '
 
+test_expect_success 'gc.recentObjectsHook' '
+       add_blob &&
+       test-tool chmtime =-86500 $BLOB_FILE &&
+
+       write_script precious-objects <<-EOF &&
+       echo $BLOB
+       EOF
+       test_config gc.recentObjectsHook ./precious-objects &&
+
+       git prune --expire=now &&
+
+       git cat-file -p $BLOB
+'
+
 test_done
index 846c5ca7d341ccb1705e4bded2c910c430337f3f..0d50c6b4bca4c0a005ad05f262e4dfc91eb73d53 100755 (executable)
@@ -12,18 +12,17 @@ TEST_PASSES_SANITIZE_LEAK=true
 
 # Create A-B chain
 #
-test_expect_success \
-    'setup base' \
-    'test_write_lines a b c d e f g h i >text &&
-     echo side >side &&
-     git update-index --add text side &&
-     A=$(echo A | git commit-tree $(git write-tree)) &&
+test_expect_success 'setup base' '
+       test_write_lines a b c d e f g h i >text &&
+       echo side >side &&
+       git update-index --add text side &&
+       A=$(echo A | git commit-tree $(git write-tree)) &&
 
-     echo m >>text &&
-     git update-index text &&
-     B=$(echo B | git commit-tree $(git write-tree) -p $A) &&
-     git update-ref HEAD $B
-    '
+       echo m >>text &&
+       git update-index text &&
+       B=$(echo B | git commit-tree $(git write-tree) -p $A) &&
+       git update-ref HEAD $B
+'
 
 # Create repository with C whose parent is B.
 # Repository contains C, C^{tree}, C:text, B, B^{tree}.
@@ -31,52 +30,49 @@ test_expect_success \
 # Repository is missing A (parent of B).
 # Repository is missing A:side.
 #
-test_expect_success \
-    'setup patch_clone' \
-    'base_objects=$(pwd)/.git/objects &&
-     (mkdir patch_clone &&
-      cd patch_clone &&
-      git init &&
-      echo "$base_objects" >.git/objects/info/alternates &&
-      echo q >>text &&
-      git read-tree $B &&
-      git update-index text &&
-      git update-ref HEAD $(echo C | git commit-tree $(git write-tree) -p $B) &&
-      rm .git/objects/info/alternates &&
+test_expect_success 'setup patch_clone' '
+       base_objects=$(pwd)/.git/objects &&
+       (mkdir patch_clone &&
+       cd patch_clone &&
+       git init &&
+       echo "$base_objects" >.git/objects/info/alternates &&
+       echo q >>text &&
+       git read-tree $B &&
+       git update-index text &&
+       git update-ref HEAD $(echo C | git commit-tree $(git write-tree) -p $B) &&
+       rm .git/objects/info/alternates &&
 
-      git --git-dir=../.git cat-file commit $B |
-      git hash-object -t commit -w --stdin &&
+       git --git-dir=../.git cat-file commit $B |
+       git hash-object -t commit -w --stdin &&
 
-      git --git-dir=../.git cat-file tree "$B^{tree}" |
-      git hash-object -t tree -w --stdin
-     ) &&
-     C=$(git --git-dir=patch_clone/.git rev-parse HEAD)
-    '
+       git --git-dir=../.git cat-file tree "$B^{tree}" |
+       git hash-object -t tree -w --stdin
+       ) &&
+       C=$(git --git-dir=patch_clone/.git rev-parse HEAD)
+'
 
 # Clone patch_clone indirectly by cloning base and fetching.
 #
-test_expect_success \
-    'indirectly clone patch_clone' \
-    '(mkdir user_clone &&
-      cd user_clone &&
-      git init &&
-      git pull ../.git &&
-      test $(git rev-parse HEAD) = $B &&
+test_expect_success 'indirectly clone patch_clone' '
+       (mkdir user_clone &&
+        cd user_clone &&
+        git init &&
+        git pull ../.git &&
+        test $(git rev-parse HEAD) = $B &&
 
-      git pull ../patch_clone/.git &&
-      test $(git rev-parse HEAD) = $C
-     )
-    '
+        git pull ../patch_clone/.git &&
+        test $(git rev-parse HEAD) = $C
+       )
+'
 
 # Cloning the patch_clone directly should fail.
 #
-test_expect_success \
-    'clone of patch_clone is incomplete' \
-    '(mkdir user_direct &&
-      cd user_direct &&
-      git init &&
-      test_must_fail git fetch ../patch_clone/.git
-     )
-    '
+test_expect_success 'clone of patch_clone is incomplete' '
+       (mkdir user_direct &&
+        cd user_direct &&
+        git init &&
+        test_must_fail git fetch ../patch_clone/.git
+       )
+'
 
 test_done
index 526a5a506eb5b6f1cc46a2ade9118447505c3aa3..78c1c6c923d62d1047b654e680d61a2ddf4f2269 100755 (executable)
@@ -9,6 +9,10 @@ test_description='exercise basic bitmap functionality'
 # their place.
 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
 
+# Likewise, allow individual tests to control whether or not they use
+# the boundary-based traversal.
+sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
+
 objpath () {
        echo ".git/objects/$(echo "$1" | sed -e 's|\(..\)|\1/|')"
 }
@@ -457,6 +461,13 @@ test_bitmap_cases () {
 
 test_bitmap_cases
 
+GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1
+export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
+
+test_bitmap_cases
+
+sane_unset GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL
+
 test_expect_success 'incremental repack fails when bitmaps are requested' '
        test_commit more-1 &&
        test_must_fail git repack -d 2>err &&
@@ -468,6 +479,33 @@ test_expect_success 'incremental repack can disable bitmaps' '
        git repack -d --no-write-bitmap-index
 '
 
+test_expect_success 'boundary-based traversal is used when requested' '
+       git repack -a -d --write-bitmap-index &&
+
+       for argv in \
+               "git -c pack.useBitmapBoundaryTraversal=true" \
+               "git -c feature.experimental=true" \
+               "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1 git"
+       do
+               eval "GIT_TRACE2_EVENT=1 $argv rev-list --objects \
+                       --use-bitmap-index second..other 2>perf" &&
+               grep "\"region_enter\".*\"label\":\"haves/boundary\"" perf ||
+                       return 1
+       done &&
+
+       for argv in \
+               "git -c pack.useBitmapBoundaryTraversal=false" \
+               "git -c feature.experimental=true -c pack.useBitmapBoundaryTraversal=false" \
+               "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=0 git -c pack.useBitmapBoundaryTraversal=true" \
+               "GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=0 git -c feature.experimental=true"
+       do
+               eval "GIT_TRACE2_EVENT=1 $argv rev-list --objects \
+                       --use-bitmap-index second..other 2>perf" &&
+               grep "\"region_enter\".*\"label\":\"haves/classic\"" perf ||
+                       return 1
+       done
+'
+
 test_bitmap_cases "pack.writeBitmapLookupTable"
 
 test_expect_success 'verify writing bitmap lookup table when enabled' '
index b6e12115786fda5b3b89ad63f2761192593c7f1b..4df76173a8d774b56f60f12c7ee23372d11b7143 100755 (executable)
@@ -24,12 +24,10 @@ test_expect_success 'usage shown with an error on unknown sub-command' '
        test_cmp expect actual
 '
 
+objdir=".git/objects"
+
 test_expect_success 'setup full repo' '
-       mkdir full &&
-       cd "$TRASH_DIRECTORY/full" &&
-       git init &&
-       git config core.commitGraph true &&
-       objdir=".git/objects"
+       git init full
 '
 
 test_expect_success POSIXPERM 'tweak umask for modebit tests' '
@@ -37,31 +35,28 @@ test_expect_success POSIXPERM 'tweak umask for modebit tests' '
 '
 
 test_expect_success 'verify graph with no graph file' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph verify
+       git -C full commit-graph verify
 '
 
 test_expect_success 'write graph with no packs' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write --object-dir $objdir &&
-       test_path_is_missing $objdir/info/commit-graph
+       git -C full commit-graph write --object-dir $objdir &&
+       test_path_is_missing full/$objdir/info/commit-graph
 '
 
 test_expect_success 'exit with correct error on bad input to --stdin-packs' '
-       cd "$TRASH_DIRECTORY/full" &&
        echo doesnotexist >in &&
-       test_expect_code 1 git commit-graph write --stdin-packs <in 2>stderr &&
+       test_expect_code 1 git -C full commit-graph write --stdin-packs \
+               <in 2>stderr &&
        test_i18ngrep "error adding pack" stderr
 '
 
 test_expect_success 'create commits and repack' '
-       cd "$TRASH_DIRECTORY/full" &&
        for i in $(test_seq 3)
        do
-               test_commit $i &&
-               git branch commits/$i || return 1
+               test_commit -C full $i &&
+               git -C full branch commits/$i || return 1
        done &&
-       git repack
+       git -C full repack
 '
 
 . "$TEST_DIRECTORY"/lib-commit-graph.sh
@@ -69,117 +64,106 @@ test_expect_success 'create commits and repack' '
 graph_git_behavior 'no graph' full commits/3 commits/1
 
 test_expect_success 'exit with correct error on bad input to --stdin-commits' '
-       cd "$TRASH_DIRECTORY/full" &&
        # invalid, non-hex OID
-       echo HEAD >in &&
-       test_expect_code 1 git commit-graph write --stdin-commits <in 2>stderr &&
+       echo HEAD | test_expect_code 1 git -C full commit-graph write \
+               --stdin-commits 2>stderr &&
        test_i18ngrep "unexpected non-hex object ID: HEAD" stderr &&
        # non-existent OID
-       echo $ZERO_OID >in &&
-       test_expect_code 1 git commit-graph write --stdin-commits <in 2>stderr &&
+       echo $ZERO_OID | test_expect_code 1 git -C full commit-graph write \
+               --stdin-commits 2>stderr &&
        test_i18ngrep "invalid object" stderr &&
        # valid commit and tree OID
-       git rev-parse HEAD HEAD^{tree} >in &&
-       git commit-graph write --stdin-commits <in &&
-       graph_read_expect 3 generation_data
+       git -C full rev-parse HEAD HEAD^{tree} >in &&
+       git -C full commit-graph write --stdin-commits <in &&
+       graph_read_expect -C full 3 generation_data
 '
 
 test_expect_success 'write graph' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "3" generation_data
+       git -C full commit-graph write &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 3 generation_data
 '
 
 test_expect_success POSIXPERM 'write graph has correct permissions' '
-       test_path_is_file $objdir/info/commit-graph &&
+       test_path_is_file full/$objdir/info/commit-graph &&
        echo "-r--r--r--" >expect &&
-       test_modebits $objdir/info/commit-graph >actual &&
+       test_modebits full/$objdir/info/commit-graph >actual &&
        test_cmp expect actual
 '
 
 graph_git_behavior 'graph exists' full commits/3 commits/1
 
 test_expect_success 'Add more commits' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git reset --hard commits/1 &&
+       git -C full reset --hard commits/1 &&
        for i in $(test_seq 4 5)
        do
-               test_commit $i &&
-               git branch commits/$i || return 1
+               test_commit -C full $i &&
+               git -C full branch commits/$i || return 1
        done &&
-       git reset --hard commits/2 &&
+       git -C full reset --hard commits/2 &&
        for i in $(test_seq 6 7)
        do
-               test_commit $i &&
-               git branch commits/$i || return 1
+               test_commit -C full $i &&
+               git -C full branch commits/$i || return 1
        done &&
-       git reset --hard commits/2 &&
-       git merge commits/4 &&
-       git branch merge/1 &&
-       git reset --hard commits/4 &&
-       git merge commits/6 &&
-       git branch merge/2 &&
-       git reset --hard commits/3 &&
-       git merge commits/5 commits/7 &&
-       git branch merge/3 &&
-       git repack
+       git -C full reset --hard commits/2 &&
+       git -C full merge commits/4 &&
+       git -C full branch merge/1 &&
+       git -C full reset --hard commits/4 &&
+       git -C full merge commits/6 &&
+       git -C full branch merge/2 &&
+       git -C full reset --hard commits/3 &&
+       git -C full merge commits/5 commits/7 &&
+       git -C full branch merge/3 &&
+       git -C full repack
 '
 
 test_expect_success 'commit-graph write progress off for redirected stderr' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write 2>err &&
+       git -C full commit-graph write 2>err &&
        test_must_be_empty err
 '
 
 test_expect_success 'commit-graph write force progress on for stderr' '
-       cd "$TRASH_DIRECTORY/full" &&
-       GIT_PROGRESS_DELAY=0 git commit-graph write --progress 2>err &&
+       GIT_PROGRESS_DELAY=0 git -C full commit-graph write --progress 2>err &&
        test_file_not_empty err
 '
 
 test_expect_success 'commit-graph write with the --no-progress option' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write --no-progress 2>err &&
+       git -C full commit-graph write --no-progress 2>err &&
        test_must_be_empty err
 '
 
 test_expect_success 'commit-graph write --stdin-commits progress off for redirected stderr' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git rev-parse commits/5 >in &&
-       git commit-graph write --stdin-commits <in 2>err &&
+       git -C full rev-parse commits/5 >in &&
+       git -C full commit-graph write --stdin-commits <in 2>err &&
        test_must_be_empty err
 '
 
 test_expect_success 'commit-graph write --stdin-commits force progress on for stderr' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git rev-parse commits/5 >in &&
-       GIT_PROGRESS_DELAY=0 git commit-graph write --stdin-commits --progress <in 2>err &&
+       git -C full rev-parse commits/5 >in &&
+       GIT_PROGRESS_DELAY=0 git -C full commit-graph write --stdin-commits \
+               --progress <in 2>err &&
        test_i18ngrep "Collecting commits from input" err
 '
 
 test_expect_success 'commit-graph write --stdin-commits with the --no-progress option' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git rev-parse commits/5 >in &&
-       git commit-graph write --stdin-commits --no-progress <in 2>err &&
+       git -C full rev-parse commits/5 >in &&
+       git -C full commit-graph write --stdin-commits --no-progress <in 2>err &&
        test_must_be_empty err
 '
 
 test_expect_success 'commit-graph verify progress off for redirected stderr' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph verify 2>err &&
+       git -C full commit-graph verify 2>err &&
        test_must_be_empty err
 '
 
 test_expect_success 'commit-graph verify force progress on for stderr' '
-       cd "$TRASH_DIRECTORY/full" &&
-       GIT_PROGRESS_DELAY=0 git commit-graph verify --progress 2>err &&
+       GIT_PROGRESS_DELAY=0 git -C full commit-graph verify --progress 2>err &&
        test_file_not_empty err
 '
 
 test_expect_success 'commit-graph verify with the --no-progress option' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph verify --no-progress 2>err &&
+       git -C full commit-graph verify --no-progress 2>err &&
        test_must_be_empty err
 '
 
@@ -194,10 +178,9 @@ test_expect_success 'commit-graph verify with the --no-progress option' '
 # 1
 
 test_expect_success 'write graph with merges' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "10" "generation_data extra_edges"
+       git -C full commit-graph write &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 10 "generation_data extra_edges"
 '
 
 graph_git_behavior 'merge 1 vs 2' full merge/1 merge/2
@@ -205,12 +188,11 @@ graph_git_behavior 'merge 1 vs 3' full merge/1 merge/3
 graph_git_behavior 'merge 2 vs 3' full merge/2 merge/3
 
 test_expect_success 'Add one more commit' '
-       cd "$TRASH_DIRECTORY/full" &&
-       test_commit 8 &&
-       git branch commits/8 &&
-       ls $objdir/pack | grep idx >existing-idx &&
-       git repack &&
-       ls $objdir/pack| grep idx | grep -v -f existing-idx >new-idx
+       test_commit -C full 8 &&
+       git -C full branch commits/8 &&
+       ls full/$objdir/pack | grep idx >existing-idx &&
+       git -C full repack &&
+       ls full/$objdir/pack| grep idx | grep -v -f existing-idx >new-idx
 '
 
 # Current graph structure:
@@ -229,114 +211,101 @@ graph_git_behavior 'mixed mode, commit 8 vs merge 1' full commits/8 merge/1
 graph_git_behavior 'mixed mode, commit 8 vs merge 2' full commits/8 merge/2
 
 test_expect_success 'write graph with new commit' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "11" "generation_data extra_edges"
+       git -C full commit-graph write &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 11 "generation_data extra_edges"
 '
 
 graph_git_behavior 'full graph, commit 8 vs merge 1' full commits/8 merge/1
 graph_git_behavior 'full graph, commit 8 vs merge 2' full commits/8 merge/2
 
 test_expect_success 'write graph with nothing new' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "11" "generation_data extra_edges"
+       git -C full commit-graph write &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 11 "generation_data extra_edges"
 '
 
 graph_git_behavior 'cleared graph, commit 8 vs merge 1' full commits/8 merge/1
 graph_git_behavior 'cleared graph, commit 8 vs merge 2' full commits/8 merge/2
 
 test_expect_success 'build graph from latest pack with closure' '
-       cd "$TRASH_DIRECTORY/full" &&
-       cat new-idx | git commit-graph write --stdin-packs &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "9" "generation_data extra_edges"
+       git -C full commit-graph write --stdin-packs <new-idx &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 9 "generation_data extra_edges"
 '
 
 graph_git_behavior 'graph from pack, commit 8 vs merge 1' full commits/8 merge/1
 graph_git_behavior 'graph from pack, commit 8 vs merge 2' full commits/8 merge/2
 
 test_expect_success 'build graph from commits with closure' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git tag -a -m "merge" tag/merge merge/2 &&
-       git rev-parse tag/merge >commits-in &&
-       git rev-parse merge/1 >>commits-in &&
-       cat commits-in | git commit-graph write --stdin-commits &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "6" "generation_data"
+       git -C full tag -a -m "merge" tag/merge merge/2 &&
+       git -C full rev-parse tag/merge >commits-in &&
+       git -C full rev-parse merge/1 >>commits-in &&
+       git -C full commit-graph write --stdin-commits <commits-in &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 6 "generation_data"
 '
 
 graph_git_behavior 'graph from commits, commit 8 vs merge 1' full commits/8 merge/1
 graph_git_behavior 'graph from commits, commit 8 vs merge 2' full commits/8 merge/2
 
 test_expect_success 'build graph from commits with append' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git rev-parse merge/3 | git commit-graph write --stdin-commits --append &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "10" "generation_data extra_edges"
+       git -C full rev-parse merge/3 >in &&
+       git -C full commit-graph write --stdin-commits --append <in &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 10 "generation_data extra_edges"
 '
 
 graph_git_behavior 'append graph, commit 8 vs merge 1' full commits/8 merge/1
 graph_git_behavior 'append graph, commit 8 vs merge 2' full commits/8 merge/2
 
 test_expect_success 'build graph using --reachable' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit-graph write --reachable &&
-       test_path_is_file $objdir/info/commit-graph &&
-       graph_read_expect "11" "generation_data extra_edges"
+       git -C full commit-graph write --reachable &&
+       test_path_is_file full/$objdir/info/commit-graph &&
+       graph_read_expect -C full 11 "generation_data extra_edges"
 '
 
 graph_git_behavior 'append graph, commit 8 vs merge 1' full commits/8 merge/1
 graph_git_behavior 'append graph, commit 8 vs merge 2' full commits/8 merge/2
 
 test_expect_success 'setup bare repo' '
-       cd "$TRASH_DIRECTORY" &&
-       git clone --bare --no-local full bare &&
-       cd bare &&
-       git config core.commitGraph true &&
-       baredir="./objects"
+       git clone --bare --no-local full bare
 '
 
 graph_git_behavior 'bare repo, commit 8 vs merge 1' bare commits/8 merge/1
 graph_git_behavior 'bare repo, commit 8 vs merge 2' bare commits/8 merge/2
 
 test_expect_success 'write graph in bare repo' '
-       cd "$TRASH_DIRECTORY/bare" &&
-       git commit-graph write &&
-       test_path_is_file $baredir/info/commit-graph &&
-       graph_read_expect "11" "generation_data extra_edges"
+       git -C bare commit-graph write &&
+       test_path_is_file bare/objects/info/commit-graph &&
+       graph_read_expect -C bare 11 "generation_data extra_edges"
 '
 
 graph_git_behavior 'bare repo with graph, commit 8 vs merge 1' bare commits/8 merge/1
 graph_git_behavior 'bare repo with graph, commit 8 vs merge 2' bare commits/8 merge/2
 
 test_expect_success 'perform fast-forward merge in full repo' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git checkout -b merge-5-to-8 commits/5 &&
-       git merge commits/8 &&
-       git show-ref -s merge-5-to-8 >output &&
-       git show-ref -s commits/8 >expect &&
+       git -C full checkout -b merge-5-to-8 commits/5 &&
+       git -C full merge commits/8 &&
+       git -C full show-ref -s merge-5-to-8 >output &&
+       git -C full show-ref -s commits/8 >expect &&
        test_cmp expect output
 '
 
 test_expect_success 'check that gc computes commit-graph' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git commit --allow-empty -m "blank" &&
-       git commit-graph write --reachable &&
-       cp $objdir/info/commit-graph commit-graph-before-gc &&
-       git reset --hard HEAD~1 &&
-       git config gc.writeCommitGraph true &&
-       git gc &&
-       cp $objdir/info/commit-graph commit-graph-after-gc &&
+       test_commit -C full --no-tag blank &&
+       git -C full commit-graph write --reachable &&
+       cp full/$objdir/info/commit-graph commit-graph-before-gc &&
+       git -C full reset --hard HEAD~1 &&
+       test_config -C full gc.writeCommitGraph true &&
+       git -C full gc &&
+       cp full/$objdir/info/commit-graph commit-graph-after-gc &&
        ! test_cmp_bin commit-graph-before-gc commit-graph-after-gc &&
-       git commit-graph write --reachable &&
-       test_cmp_bin commit-graph-after-gc $objdir/info/commit-graph
+       git -C full commit-graph write --reachable &&
+       test_cmp_bin commit-graph-after-gc full/$objdir/info/commit-graph
 '
 
 test_expect_success 'replace-objects invalidates commit-graph' '
-       cd "$TRASH_DIRECTORY" &&
        test_when_finished rm -rf replace &&
        git clone full replace &&
        (
@@ -359,7 +328,6 @@ test_expect_success 'replace-objects invalidates commit-graph' '
 '
 
 test_expect_success 'commit grafts invalidate commit-graph' '
-       cd "$TRASH_DIRECTORY" &&
        test_when_finished rm -rf graft &&
        git clone --template= full graft &&
        (
@@ -384,7 +352,6 @@ test_expect_success 'commit grafts invalidate commit-graph' '
 '
 
 test_expect_success 'replace-objects invalidates commit-graph' '
-       cd "$TRASH_DIRECTORY" &&
        test_when_finished rm -rf shallow &&
        git clone --depth 2 "file://$TRASH_DIRECTORY/full" shallow &&
        (
@@ -427,24 +394,25 @@ test_expect_success 'warn on improper hash version' '
 '
 
 test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'lower layers have overflow chunk' '
-       cd "$TRASH_DIRECTORY/full" &&
        UNIX_EPOCH_ZERO="@0 +0000" &&
        FUTURE_DATE="@4147483646 +0000" &&
-       rm -f .git/objects/info/commit-graph &&
-       test_commit --date "$FUTURE_DATE" future-1 &&
-       test_commit --date "$UNIX_EPOCH_ZERO" old-1 &&
-       git commit-graph write --reachable &&
-       test_commit --date "$FUTURE_DATE" future-2 &&
-       test_commit --date "$UNIX_EPOCH_ZERO" old-2 &&
-       git commit-graph write --reachable --split=no-merge &&
-       test_commit extra &&
-       git commit-graph write --reachable --split=no-merge &&
-       git commit-graph write --reachable &&
-       graph_read_expect 16 "generation_data generation_data_overflow extra_edges" &&
-       mv .git/objects/info/commit-graph commit-graph-upgraded &&
-       git commit-graph write --reachable &&
-       graph_read_expect 16 "generation_data generation_data_overflow extra_edges" &&
-       test_cmp .git/objects/info/commit-graph commit-graph-upgraded
+       rm -f full/.git/objects/info/commit-graph &&
+       test_commit -C full --date "$FUTURE_DATE" future-1 &&
+       test_commit -C full --date "$UNIX_EPOCH_ZERO" old-1 &&
+       git -C full commit-graph write --reachable &&
+       test_commit -C full --date "$FUTURE_DATE" future-2 &&
+       test_commit -C full --date "$UNIX_EPOCH_ZERO" old-2 &&
+       git -C full commit-graph write --reachable --split=no-merge &&
+       test_commit -C full extra &&
+       git -C full commit-graph write --reachable --split=no-merge &&
+       git -C full commit-graph write --reachable &&
+       graph_read_expect -C full 16 \
+               "generation_data generation_data_overflow extra_edges" &&
+       mv full/.git/objects/info/commit-graph commit-graph-upgraded &&
+       git -C full commit-graph write --reachable &&
+       graph_read_expect -C full 16 \
+               "generation_data generation_data_overflow extra_edges" &&
+       test_cmp full/.git/objects/info/commit-graph commit-graph-upgraded
 '
 
 # the verify tests below expect the commit-graph to contain
@@ -454,10 +422,11 @@ test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'lower layers have overflow ch
 # and the tests will likely break.
 
 test_expect_success 'git commit-graph verify' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git rev-parse commits/8 | git -c commitGraph.generationVersion=1 commit-graph write --stdin-commits &&
-       git commit-graph verify >output &&
-       graph_read_expect 9 extra_edges 1
+       git -C full rev-parse commits/8 >in &&
+       git -C full -c commitGraph.generationVersion=1 commit-graph write \
+               --stdin-commits <in &&
+       git -C full commit-graph verify >output &&
+       graph_read_expect -C full 9 extra_edges 1
 '
 
 NUM_COMMITS=9
@@ -495,25 +464,24 @@ GRAPH_BYTE_OCTOPUS=$(($GRAPH_OCTOPUS_DATA_OFFSET + 4))
 GRAPH_BYTE_FOOTER=$(($GRAPH_OCTOPUS_DATA_OFFSET + 4 * $NUM_OCTOPUS_EDGES))
 
 corrupt_graph_setup() {
-       cd "$TRASH_DIRECTORY/full" &&
-       test_when_finished mv commit-graph-backup $objdir/info/commit-graph &&
-       cp $objdir/info/commit-graph commit-graph-backup &&
-       chmod u+w $objdir/info/commit-graph
+       test_when_finished mv commit-graph-backup full/$objdir/info/commit-graph &&
+       cp full/$objdir/info/commit-graph commit-graph-backup &&
+       chmod u+w full/$objdir/info/commit-graph
 }
 
 corrupt_graph_verify() {
        grepstr=$1
-       test_must_fail git commit-graph verify 2>test_err &&
+       test_must_fail git -C full commit-graph verify 2>test_err &&
        grep -v "^+" test_err >err &&
        test_i18ngrep "$grepstr" err &&
        if test "$2" != "no-copy"
        then
-               cp $objdir/info/commit-graph commit-graph-pre-write-test
+               cp full/$objdir/info/commit-graph commit-graph-pre-write-test
        fi &&
-       git status --short &&
-       GIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE=true git commit-graph write &&
-       chmod u+w $objdir/info/commit-graph &&
-       git commit-graph verify
+       git -C full status --short &&
+       GIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE=true git -C full commit-graph write &&
+       chmod u+w full/$objdir/info/commit-graph &&
+       git -C full commit-graph verify
 }
 
 # usage: corrupt_graph_and_verify <position> <data> <string> [<zero_pos>]
@@ -527,24 +495,24 @@ corrupt_graph_and_verify() {
        data="${2:-\0}"
        grepstr=$3
        corrupt_graph_setup &&
-       orig_size=$(wc -c < $objdir/info/commit-graph) &&
+       orig_size=$(wc -c <full/$objdir/info/commit-graph) &&
        zero_pos=${4:-${orig_size}} &&
-       printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
-       dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" if=/dev/null &&
-       test-tool genzeros $(($orig_size - $zero_pos)) >>"$objdir/info/commit-graph" &&
+       printf "$data" | dd of="full/$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
+       dd of="full/$objdir/info/commit-graph" bs=1 seek="$zero_pos" if=/dev/null &&
+       test-tool genzeros $(($orig_size - $zero_pos)) >>"full/$objdir/info/commit-graph" &&
        corrupt_graph_verify "$grepstr"
 
 }
 
 test_expect_success POSIXPERM,SANITY 'detect permission problem' '
        corrupt_graph_setup &&
-       chmod 000 $objdir/info/commit-graph &&
+       chmod 000 full/$objdir/info/commit-graph &&
        corrupt_graph_verify "Could not open" "no-copy"
 '
 
 test_expect_success 'detect too small' '
        corrupt_graph_setup &&
-       echo "a small graph" >$objdir/info/commit-graph &&
+       echo "a small graph" >full/$objdir/info/commit-graph &&
        corrupt_graph_verify "too small"
 '
 
@@ -655,33 +623,40 @@ test_expect_success 'detect incorrect chunk count' '
 '
 
 test_expect_success 'git fsck (checks commit-graph when config set to true)' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git fsck &&
+       git -C full fsck &&
        corrupt_graph_and_verify $GRAPH_BYTE_FOOTER "\00" \
                "incorrect checksum" &&
-       cp commit-graph-pre-write-test $objdir/info/commit-graph &&
-       test_must_fail git -c core.commitGraph=true fsck
+       cp commit-graph-pre-write-test full/$objdir/info/commit-graph &&
+       test_must_fail git -C full -c core.commitGraph=true fsck
 '
 
 test_expect_success 'git fsck (ignores commit-graph when config set to false)' '
-       cd "$TRASH_DIRECTORY/full" &&
-       git fsck &&
+       git -C full fsck &&
        corrupt_graph_and_verify $GRAPH_BYTE_FOOTER "\00" \
                "incorrect checksum" &&
-       cp commit-graph-pre-write-test $objdir/info/commit-graph &&
-       git -c core.commitGraph=false fsck
+       cp commit-graph-pre-write-test full/$objdir/info/commit-graph &&
+       git -C full -c core.commitGraph=false fsck
 '
 
 test_expect_success 'git fsck (checks commit-graph when config unset)' '
-       cd "$TRASH_DIRECTORY/full" &&
-       test_when_finished "git config core.commitGraph true" &&
+       test_when_finished "git -C full config core.commitGraph true" &&
 
-       git fsck &&
+       git -C full fsck &&
        corrupt_graph_and_verify $GRAPH_BYTE_FOOTER "\00" \
                "incorrect checksum" &&
-       test_unconfig core.commitGraph &&
-       cp commit-graph-pre-write-test $objdir/info/commit-graph &&
-       test_must_fail git fsck
+       test_unconfig -C full core.commitGraph &&
+       cp commit-graph-pre-write-test full/$objdir/info/commit-graph &&
+       test_must_fail git -C full fsck
+'
+
+test_expect_success 'git fsck shows commit-graph output with --progress' '
+       git -C "$TRASH_DIRECTORY/full" fsck --progress 2>err &&
+       grep "Verifying commits in commit graph" err
+'
+
+test_expect_success 'git fsck suppresses commit-graph output with --no-progress' '
+       git -C "$TRASH_DIRECTORY/full" fsck --no-progress 2>err &&
+       ! grep "Verifying commits in commit graph" err
 '
 
 test_expect_success 'setup non-the_repository tests' '
@@ -782,32 +757,33 @@ test_expect_success 'corrupt commit-graph write (missing tree)' '
 #
 
 test_expect_success 'set up and verify repo with generation data overflow chunk' '
-       objdir=".git/objects" &&
        UNIX_EPOCH_ZERO="@0 +0000" &&
        FUTURE_DATE="@2147483646 +0000" &&
-       cd "$TRASH_DIRECTORY" &&
-       mkdir repo &&
-       cd repo &&
-       git init &&
-       test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
-       test_commit 2 &&
-       test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
-       git commit-graph write --reachable &&
-       graph_read_expect 3 generation_data &&
-       test_commit --date "$FUTURE_DATE" 4 &&
-       test_commit 5 &&
-       test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
-       git branch left &&
-       git reset --hard 3 &&
-       test_commit 7 &&
-       test_commit --date "$FUTURE_DATE" 8 &&
-       test_commit 9 &&
-       git branch right &&
-       git reset --hard 3 &&
-       test_merge M left right &&
-       git commit-graph write --reachable &&
-       graph_read_expect 10 "generation_data generation_data_overflow" &&
-       git commit-graph verify
+
+       git init repo &&
+       (
+               cd repo &&
+
+               test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
+               test_commit 2 &&
+               test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
+               git commit-graph write --reachable &&
+               graph_read_expect 3 generation_data &&
+               test_commit --date "$FUTURE_DATE" 4 &&
+               test_commit 5 &&
+               test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
+               git branch left &&
+               git reset --hard 3 &&
+               test_commit 7 &&
+               test_commit --date "$FUTURE_DATE" 8 &&
+               test_commit 9 &&
+               git branch right &&
+               git reset --hard 3 &&
+               test_merge M left right &&
+               git commit-graph write --reachable &&
+               graph_read_expect 10 "generation_data generation_data_overflow" &&
+               git commit-graph verify
+       )
 '
 
 graph_git_behavior 'generation data overflow chunk repo' repo left right
index 499d5d4c78590ae16879d8dbd386259d847efb76..1bcc02004d7d1acbce8306bdeb5439f4da689ccb 100755 (executable)
@@ -183,6 +183,18 @@ test_expect_success 'write midx with --stdin-packs' '
 
 compare_results_with_midx "mixed mode (one pack + extra)"
 
+test_expect_success 'write with no objects and preferred pack' '
+       test_when_finished "rm -rf empty" &&
+       git init empty &&
+       test_must_fail git -C empty multi-pack-index write \
+               --stdin-packs --preferred-pack=does-not-exist </dev/null 2>err &&
+       cat >expect <<-EOF &&
+       warning: unknown preferred pack: ${SQ}does-not-exist${SQ}
+       error: no pack files to index.
+       EOF
+       test_cmp expect err
+'
+
 test_expect_success 'write progress off for redirected stderr' '
        git multi-pack-index --object-dir=$objdir write 2>err &&
        test_line_count = 0 err
@@ -473,6 +485,18 @@ test_expect_success 'git-fsck incorrect offset' '
        git -c core.multiPackIndex=false fsck
 '
 
+test_expect_success 'git fsck shows MIDX output with --progress' '
+       git fsck --progress 2>err &&
+       grep "Verifying OID order in multi-pack-index" err &&
+       grep "Verifying object offsets" err
+'
+
+test_expect_success 'git fsck suppresses MIDX output with --no-progress' '
+       git fsck --no-progress 2>err &&
+       ! grep "Verifying OID order in multi-pack-index" err &&
+       ! grep "Verifying object offsets" err
+'
+
 test_expect_success 'corrupt MIDX is not reused' '
        corrupt_midx_and_verify $MIDX_BYTE_OFFSET "\377" $objdir \
                "incorrect object offset" &&
index 669ddc645faccfc402b04044ed75676592e64356..36c4141e67b8f0f5aaf87443ab0c00f2bbd67836 100755 (executable)
@@ -351,7 +351,8 @@ test_expect_success 'add octopus merge' '
        git branch merge/octopus &&
        git commit-graph write --reachable --split &&
        git commit-graph verify --progress 2>err &&
-       test_line_count = 3 err &&
+       test_line_count = 1 err &&
+       grep "Verifying commits in commit graph: 100% (18/18)" err &&
        test_i18ngrep ! warning err &&
        test_line_count = 3 $graphdir/commit-graph-chain
 '
index d042d26f2b393d52049ba3c9972e2516b03ed239..431a603ca0e61d7085f28333c6a28c120ea45828 100755 (executable)
@@ -1,17 +1,20 @@
 #!/bin/sh
 
 test_description='on-disk reverse index'
+
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 # The below tests want control over the 'pack.writeReverseIndex' setting
 # themselves to assert various combinations of it with other options.
-sane_unset GIT_TEST_WRITE_REV_INDEX
+sane_unset GIT_TEST_NO_WRITE_REV_INDEX
 
 packdir=.git/objects/pack
 
 test_expect_success 'setup' '
        test_commit base &&
 
+       test_config pack.writeReverseIndex false &&
        pack=$(git pack-objects --all $packdir/pack) &&
        rev=$packdir/pack-$pack.rev &&
 
@@ -94,6 +97,17 @@ test_expect_success 'reverse index is not generated when available on disk' '
                --batch-check="%(objectsize:disk)" <tip
 '
 
+test_expect_success 'reverse index is ignored when pack.readReverseIndex is false' '
+       test_index_pack true &&
+       test_path_is_file $rev &&
+
+       test_config pack.readReverseIndex false &&
+
+       git rev-parse HEAD >tip &&
+       GIT_TEST_REV_INDEX_DIE_ON_DISK=1 git cat-file \
+               --batch-check="%(objectsize:disk)" <tip
+'
+
 test_expect_success 'revindex in-memory vs on-disk' '
        git init repo &&
        test_when_finished "rm -fr repo" &&
@@ -117,4 +131,78 @@ test_expect_success 'revindex in-memory vs on-disk' '
                test_cmp on-disk in-core
        )
 '
+
+test_expect_success 'fsck succeeds on good rev-index' '
+       test_when_finished rm -fr repo &&
+       git init repo &&
+       (
+               cd repo &&
+
+               test_commit commit &&
+               git -c pack.writeReverseIndex=true repack -ad &&
+               git fsck 2>err &&
+               test_must_be_empty err
+       )
+'
+
+test_expect_success 'set up rev-index corruption tests' '
+       git init corrupt &&
+       (
+               cd corrupt &&
+
+               test_commit commit &&
+               git -c pack.writeReverseIndex=true repack -ad &&
+
+               revfile=$(ls .git/objects/pack/pack-*.rev) &&
+               chmod a+w $revfile &&
+               cp $revfile $revfile.bak
+       )
+'
+
+corrupt_rev_and_verify () {
+       (
+               pos="$1" &&
+               value="$2" &&
+               error="$3" &&
+
+               cd corrupt &&
+               revfile=$(ls .git/objects/pack/pack-*.rev) &&
+
+               # Reset to original rev-file.
+               cp $revfile.bak $revfile &&
+
+               printf "$value" | dd of=$revfile bs=1 seek="$pos" conv=notrunc &&
+               test_must_fail git fsck 2>err &&
+               grep "$error" err
+       )
+}
+
+test_expect_success 'fsck catches invalid checksum' '
+       revfile=$(ls corrupt/.git/objects/pack/pack-*.rev) &&
+       orig_size=$(wc -c <$revfile) &&
+       hashpos=$((orig_size - 10)) &&
+       corrupt_rev_and_verify $hashpos bogus \
+               "invalid checksum"
+'
+
+test_expect_success 'fsck catches invalid row position' '
+       corrupt_rev_and_verify 14 "\07" \
+               "invalid rev-index position"
+'
+
+test_expect_success 'fsck catches invalid header: magic number' '
+       corrupt_rev_and_verify 1 "\07" \
+               "reverse-index file .* has unknown signature"
+'
+
+test_expect_success 'fsck catches invalid header: version' '
+       corrupt_rev_and_verify 7 "\02" \
+               "reverse-index file .* has unsupported version"
+'
+
+test_expect_success 'fsck catches invalid header: hash function' '
+       corrupt_rev_and_verify 11 "\03" \
+               "reverse-index file .* has unsupported hash id"
+'
+
 test_done
index 0882cbb6e4a4e4803fd1874699e03a2c0940fb13..70d1b58709a91199bf6d589e141897ca96204547 100755 (executable)
@@ -434,4 +434,83 @@ test_expect_success 'tagged commits are selected for bitmapping' '
        )
 '
 
+corrupt_file () {
+       chmod a+w "$1" &&
+       printf "bogus" | dd of="$1" bs=1 seek="12" conv=notrunc
+}
+
+test_expect_success 'git fsck correctly identifies good and bad bitmaps' '
+       git init valid &&
+       test_when_finished rm -rf valid &&
+
+       test_commit_bulk 20 &&
+       git repack -adbf &&
+
+       # Move pack-bitmap aside so it is not deleted
+       # in next repack.
+       packbitmap=$(ls .git/objects/pack/pack-*.bitmap) &&
+       mv "$packbitmap" "$packbitmap.bak" &&
+
+       test_commit_bulk 10 &&
+       git repack -b --write-midx &&
+       midxbitmap=$(ls .git/objects/pack/multi-pack-index-*.bitmap) &&
+
+       # Copy MIDX bitmap to backup. Copy pack bitmap from backup.
+       cp "$midxbitmap" "$midxbitmap.bak" &&
+       cp "$packbitmap.bak" "$packbitmap" &&
+
+       # fsck works at first
+       git fsck 2>err &&
+       test_must_be_empty err &&
+
+       corrupt_file "$packbitmap" &&
+       test_must_fail git fsck 2>err &&
+       grep "bitmap file '\''$packbitmap'\'' has invalid checksum" err &&
+
+       cp "$packbitmap.bak" "$packbitmap" &&
+       corrupt_file "$midxbitmap" &&
+       test_must_fail git fsck 2>err &&
+       grep "bitmap file '\''$midxbitmap'\'' has invalid checksum" err &&
+
+       corrupt_file "$packbitmap" &&
+       test_must_fail git fsck 2>err &&
+       grep "bitmap file '\''$midxbitmap'\'' has invalid checksum" err &&
+       grep "bitmap file '\''$packbitmap'\'' has invalid checksum" err
+'
+
+test_expect_success 'corrupt MIDX with bitmap causes fallback' '
+       git init corrupt-midx-bitmap &&
+       (
+               cd corrupt-midx-bitmap &&
+
+               test_commit first &&
+               git repack -d &&
+               test_commit second &&
+               git repack -d &&
+
+               git multi-pack-index write --bitmap &&
+               checksum=$(midx_checksum $objdir) &&
+               for f in $midx $midx-$checksum.bitmap
+               do
+                       mv $f $f.bak || return 1
+               done &&
+
+               # pack everything together, invalidating the MIDX
+               git repack -ad &&
+               # then restore the now-stale MIDX
+               for f in $midx $midx-$checksum.bitmap
+               do
+                       mv $f.bak $f || return 1
+               done &&
+
+               git rev-list --count --objects --use-bitmap-index HEAD >out 2>err &&
+               # should attempt opening the broken pack twice (once
+               # from the attempt to load it via the stale bitmap, and
+               # again when attempting to load it from the stale MIDX)
+               # before falling back to the non-MIDX case
+               test 2 -eq $(grep -c "could not open pack" err) &&
+               test 6 -eq $(cat out)
+       )
+'
+
 test_done
index 57e4d9c6998c2b690881984f5809fba6525bd4cc..e9c521c061c3eae86619f4eb931d40f5e3127d35 100755 (executable)
@@ -37,39 +37,39 @@ test_expect_success 'lower layers have overflow chunk' '
 graph_git_behavior 'overflow' '' HEAD~2 HEAD
 
 test_expect_success 'set up and verify repo with generation data overflow chunk' '
-       mkdir repo &&
-       cd repo &&
-       git init &&
-       test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
-       test_commit 2 &&
-       test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
-       git commit-graph write --reachable &&
-       graph_read_expect 3 generation_data &&
-       test_commit --date "$FUTURE_DATE" 4 &&
-       test_commit 5 &&
-       test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
-       git branch left &&
-       git reset --hard 3 &&
-       test_commit 7 &&
-       test_commit --date "$FUTURE_DATE" 8 &&
-       test_commit 9 &&
-       git branch right &&
-       git reset --hard 3 &&
-       test_merge M left right &&
-       git commit-graph write --reachable &&
-       graph_read_expect 10 "generation_data generation_data_overflow" &&
-       git commit-graph verify
+       git init repo &&
+       (
+               cd repo &&
+               test_commit --date "$UNIX_EPOCH_ZERO" 1 &&
+               test_commit 2 &&
+               test_commit --date "$UNIX_EPOCH_ZERO" 3 &&
+               git commit-graph write --reachable &&
+               graph_read_expect 3 generation_data &&
+               test_commit --date "$FUTURE_DATE" 4 &&
+               test_commit 5 &&
+               test_commit --date "$UNIX_EPOCH_ZERO" 6 &&
+               git branch left &&
+               git reset --hard 3 &&
+               test_commit 7 &&
+               test_commit --date "$FUTURE_DATE" 8 &&
+               test_commit 9 &&
+               git branch right &&
+               git reset --hard 3 &&
+               test_merge M left right &&
+               git commit-graph write --reachable &&
+               graph_read_expect 10 "generation_data generation_data_overflow" &&
+               git commit-graph verify
+       )
 '
 
 graph_git_behavior 'overflow 2' repo left right
 
 test_expect_success 'single commit with generation data exceeding UINT32_MAX' '
        git init repo-uint32-max &&
-       cd repo-uint32-max &&
-       test_commit --date "@4294967297 +0000" 1 &&
-       git commit-graph write --reachable &&
-       graph_read_expect 1 "generation_data" &&
-       git commit-graph verify
+       test_commit -C repo-uint32-max --date "@4294967297 +0000" 1 &&
+       git -C repo-uint32-max commit-graph write --reachable &&
+       graph_read_expect -C repo-uint32-max 1 "generation_data" &&
+       git -C repo-uint32-max commit-graph verify
 '
 
 test_done
index 303f7a5d842d36edb191bb05ec61df9a6af8d7c9..45667d4999a97f7ec3221a89bcba579ef3871b3d 100755 (executable)
@@ -739,4 +739,175 @@ test_expect_success 'cruft objects are freshend via loose' '
        )
 '
 
+test_expect_success 'gc.recentObjectsHook' '
+       git init repo &&
+       test_when_finished "rm -fr repo" &&
+       (
+               cd repo &&
+
+               # Create a handful of objects.
+               #
+               #   - one reachable commit, "base", designated for the reachable
+               #     pack
+               #   - one unreachable commit, "cruft.discard", which is marked
+               #     for deletion
+               #   - one unreachable commit, "cruft.old", which would be marked
+               #     for deletion, but is rescued as an extra cruft tip
+               #   - one unreachable commit, "cruft.new", which is not marked
+               #     for deletion
+               test_commit base &&
+               git branch -M main &&
+
+               git checkout --orphan discard &&
+               git rm -fr . &&
+               test_commit --no-tag cruft.discard &&
+
+               git checkout --orphan old &&
+               git rm -fr . &&
+               test_commit --no-tag cruft.old &&
+               cruft_old="$(git rev-parse HEAD)" &&
+
+               git checkout --orphan new &&
+               git rm -fr . &&
+               test_commit --no-tag cruft.new &&
+               cruft_new="$(git rev-parse HEAD)" &&
+
+               git checkout main &&
+               git branch -D discard old new &&
+               git reflog expire --all --expire=all &&
+
+               # mark cruft.old with an mtime that is many minutes
+               # older than the expiration period, and mark cruft.new
+               # with an mtime that is in the future (and thus not
+               # eligible for pruning).
+               test-tool chmtime -2000 "$objdir/$(test_oid_to_path $cruft_old)" &&
+               test-tool chmtime +1000 "$objdir/$(test_oid_to_path $cruft_new)" &&
+
+               # Write the list of cruft objects we expect to
+               # accumulate, which is comprised of everything reachable
+               # from cruft.old and cruft.new, but not cruft.discard.
+               git rev-list --objects --no-object-names \
+                       $cruft_old $cruft_new >cruft.raw &&
+               sort cruft.raw >cruft.expect &&
+
+               # Write the script to list extra tips, which are limited
+               # to cruft.old, in this case.
+               write_script extra-tips <<-EOF &&
+               echo $cruft_old
+               EOF
+               git config gc.recentObjectsHook ./extra-tips &&
+
+               git repack --cruft --cruft-expiration=now -d &&
+
+               mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+               git show-index <${mtimes%.mtimes}.idx >cruft &&
+               cut -d" " -f2 cruft | sort >cruft.actual &&
+               test_cmp cruft.expect cruft.actual &&
+
+               # Ensure that the "old" objects are removed after
+               # dropping the gc.recentObjectsHook hook.
+               git config --unset gc.recentObjectsHook &&
+               git repack --cruft --cruft-expiration=now -d &&
+
+               mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+               git show-index <${mtimes%.mtimes}.idx >cruft &&
+               cut -d" " -f2 cruft | sort >cruft.actual &&
+
+               git rev-list --objects --no-object-names $cruft_new >cruft.raw &&
+               cp cruft.expect cruft.old &&
+               sort cruft.raw >cruft.expect &&
+               test_cmp cruft.expect cruft.actual &&
+
+               # ensure objects which are no longer in the cruft pack were
+               # removed from the repository
+               for object in $(comm -13 cruft.expect cruft.old)
+               do
+                       test_must_fail git cat-file -t $object || return 1
+               done
+       )
+'
+
+test_expect_success 'multi-valued gc.recentObjectsHook' '
+       git init repo &&
+       test_when_finished "rm -fr repo" &&
+       (
+               cd repo &&
+
+               test_commit base &&
+               git branch -M main &&
+
+               git checkout --orphan cruft.a &&
+               git rm -fr . &&
+               test_commit --no-tag cruft.a &&
+               cruft_a="$(git rev-parse HEAD)" &&
+
+               git checkout --orphan cruft.b &&
+               git rm -fr . &&
+               test_commit --no-tag cruft.b &&
+               cruft_b="$(git rev-parse HEAD)" &&
+
+               git checkout main &&
+               git branch -D cruft.a cruft.b &&
+               git reflog expire --all --expire=all &&
+
+               echo "echo $cruft_a" | write_script extra-tips.a &&
+               echo "echo $cruft_b" | write_script extra-tips.b &&
+               echo "false" | write_script extra-tips.c &&
+
+               git rev-list --objects --no-object-names $cruft_a $cruft_b \
+                       >cruft.raw &&
+               sort cruft.raw >cruft.expect &&
+
+               # ensure that each extra cruft tip is saved by its
+               # respective hook
+               git config --add gc.recentObjectsHook ./extra-tips.a &&
+               git config --add gc.recentObjectsHook ./extra-tips.b &&
+               git repack --cruft --cruft-expiration=now -d &&
+
+               mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+               git show-index <${mtimes%.mtimes}.idx >cruft &&
+               cut -d" " -f2 cruft | sort >cruft.actual &&
+               test_cmp cruft.expect cruft.actual &&
+
+               # ensure that a dirty exit halts cruft pack generation
+               git config --add gc.recentObjectsHook ./extra-tips.c &&
+               test_must_fail git repack --cruft --cruft-expiration=now -d 2>err &&
+               grep "unable to enumerate additional recent objects" err &&
+
+               # and that the existing cruft pack is left alone
+               test_path_is_file "$mtimes"
+       )
+'
+
+test_expect_success 'additional cruft blobs via gc.recentObjectsHook' '
+       git init repo &&
+       test_when_finished "rm -fr repo" &&
+       (
+               cd repo &&
+
+               test_commit base &&
+
+               blob=$(echo "unreachable" | git hash-object -w --stdin) &&
+
+               # mark the unreachable blob we wrote above as having
+               # aged out of the retention period
+               test-tool chmtime -2000 "$objdir/$(test_oid_to_path $blob)" &&
+
+               # Write the script to list extra tips, which is just the
+               # extra blob as above.
+               write_script extra-tips <<-EOF &&
+               echo $blob
+               EOF
+               git config gc.recentObjectsHook ./extra-tips &&
+
+               git repack --cruft --cruft-expiration=now -d &&
+
+               mtimes="$(ls .git/objects/pack/pack-*.mtimes)" &&
+               git show-index <${mtimes%.mtimes}.idx >cruft &&
+               cut -d" " -f2 cruft >actual &&
+               echo $blob >expect &&
+               test_cmp expect actual
+       )
+'
+
 test_done
diff --git a/t/t5331-pack-objects-stdin.sh b/t/t5331-pack-objects-stdin.sh
new file mode 100755 (executable)
index 0000000..acab316
--- /dev/null
@@ -0,0 +1,240 @@
+#!/bin/sh
+
+test_description='pack-objects --stdin'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+packed_objects () {
+       git show-index <"$1" >tmp-object-list &&
+       cut -d' ' -f2 tmp-object-list | sort &&
+       rm tmp-object-list
+ }
+
+test_expect_success 'setup for --stdin-packs tests' '
+       git init stdin-packs &&
+       (
+               cd stdin-packs &&
+
+               test_commit A &&
+               test_commit B &&
+               test_commit C &&
+
+               for id in A B C
+               do
+                       git pack-objects .git/objects/pack/pack-$id \
+                               --incremental --revs <<-EOF || exit 1
+                       refs/tags/$id
+                       EOF
+               done &&
+
+               ls -la .git/objects/pack
+       )
+'
+
+test_expect_success '--stdin-packs with excluded packs' '
+       (
+               cd stdin-packs &&
+
+               PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
+               PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
+               PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
+
+               git pack-objects test --stdin-packs <<-EOF &&
+               $PACK_A
+               ^$PACK_B
+               $PACK_C
+               EOF
+
+               (
+                       git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
+                       git show-index <$(ls .git/objects/pack/pack-C-*.idx)
+               ) >expect.raw &&
+               git show-index <$(ls test-*.idx) >actual.raw &&
+
+               cut -d" " -f2 <expect.raw | sort >expect &&
+               cut -d" " -f2 <actual.raw | sort >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success '--stdin-packs is incompatible with --filter' '
+       (
+               cd stdin-packs &&
+               test_must_fail git pack-objects --stdin-packs --stdout \
+                       --filter=blob:none </dev/null 2>err &&
+               test_i18ngrep "cannot use --filter with --stdin-packs" err
+       )
+'
+
+test_expect_success '--stdin-packs is incompatible with --revs' '
+       (
+               cd stdin-packs &&
+               test_must_fail git pack-objects --stdin-packs --revs out \
+                       </dev/null 2>err &&
+               test_i18ngrep "cannot use internal rev list with --stdin-packs" err
+       )
+'
+
+test_expect_success '--stdin-packs with loose objects' '
+       (
+               cd stdin-packs &&
+
+               PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
+               PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
+               PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
+
+               test_commit D && # loose
+
+               git pack-objects test2 --stdin-packs --unpacked <<-EOF &&
+               $PACK_A
+               ^$PACK_B
+               $PACK_C
+               EOF
+
+               (
+                       git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
+                       git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
+                       git rev-list --objects --no-object-names \
+                               refs/tags/C..refs/tags/D
+
+               ) >expect.raw &&
+               ls -la . &&
+               git show-index <$(ls test2-*.idx) >actual.raw &&
+
+               cut -d" " -f2 <expect.raw | sort >expect &&
+               cut -d" " -f2 <actual.raw | sort >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success '--stdin-packs with broken links' '
+       (
+               cd stdin-packs &&
+
+               # make an unreachable object with a bogus parent
+               git cat-file -p HEAD >commit &&
+               sed "s/$(git rev-parse HEAD^)/$(test_oid zero)/" <commit |
+               git hash-object -w -t commit --stdin >in &&
+
+               git pack-objects .git/objects/pack/pack-D <in &&
+
+               PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
+               PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
+               PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
+               PACK_D="$(basename .git/objects/pack/pack-D-*.pack)" &&
+
+               git pack-objects test3 --stdin-packs --unpacked <<-EOF &&
+               $PACK_A
+               ^$PACK_B
+               $PACK_C
+               $PACK_D
+               EOF
+
+               (
+                       git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
+                       git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
+                       git show-index <$(ls .git/objects/pack/pack-D-*.idx) &&
+                       git rev-list --objects --no-object-names \
+                               refs/tags/C..refs/tags/D
+               ) >expect.raw &&
+               git show-index <$(ls test3-*.idx) >actual.raw &&
+
+               cut -d" " -f2 <expect.raw | sort >expect &&
+               cut -d" " -f2 <actual.raw | sort >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success 'pack-objects --stdin with duplicate packfile' '
+       test_when_finished "rm -fr repo" &&
+
+       git init repo &&
+       (
+               cd repo &&
+               test_commit "commit" &&
+               git repack -ad &&
+
+               {
+                       basename .git/objects/pack/pack-*.pack &&
+                       basename .git/objects/pack/pack-*.pack
+               } >packfiles &&
+
+               git pack-objects --stdin-packs generated-pack <packfiles &&
+               packed_objects .git/objects/pack/pack-*.idx >expect &&
+               packed_objects generated-pack-*.idx >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success 'pack-objects --stdin with same packfile excluded and included' '
+       test_when_finished "rm -fr repo" &&
+
+       git init repo &&
+       (
+               cd repo &&
+               test_commit "commit" &&
+               git repack -ad &&
+
+               {
+                       basename .git/objects/pack/pack-*.pack &&
+                       printf "^%s\n" "$(basename .git/objects/pack/pack-*.pack)"
+               } >packfiles &&
+
+               git pack-objects --stdin-packs generated-pack <packfiles &&
+               packed_objects generated-pack-*.idx >packed-objects &&
+               test_must_be_empty packed-objects
+       )
+'
+
+test_expect_success 'pack-objects --stdin with packfiles from alternate object database' '
+       test_when_finished "rm -fr shared member" &&
+
+       # Set up a shared repository with a single packfile.
+       git init shared &&
+       test_commit -C shared "shared-objects" &&
+       git -C shared repack -ad &&
+       basename shared/.git/objects/pack/pack-*.pack >packfile &&
+
+       # Set up a repository that is connected to the shared repository. This
+       # repository has no objects on its own, but we still expect to be able
+       # to pack objects from its alternate.
+       git clone --shared shared member &&
+       git -C member pack-objects --stdin-packs generated-pack <packfile &&
+       test_cmp shared/.git/objects/pack/pack-*.pack member/generated-pack-*.pack
+'
+
+test_expect_success 'pack-objects --stdin with packfiles from main and alternate object database' '
+       test_when_finished "rm -fr shared member" &&
+
+       # Set up a shared repository with a single packfile.
+       git init shared &&
+       test_commit -C shared "shared-commit" &&
+       git -C shared repack -ad &&
+
+       # Set up a repository that is connected to the shared repository. This
+       # repository has a second packfile so that we can verify that it is
+       # possible to write packs that include packfiles from different object
+       # databases.
+       git clone --shared shared member &&
+       test_commit -C member "local-commit" &&
+       git -C member repack -dl &&
+
+       {
+               basename shared/.git/objects/pack/pack-*.pack &&
+               basename member/.git/objects/pack/pack-*.pack
+       } >packfiles &&
+
+       {
+               packed_objects shared/.git/objects/pack/pack-*.idx &&
+               packed_objects member/.git/objects/pack/pack-*.idx
+       } | sort >expected-objects &&
+
+       git -C member pack-objects --stdin-packs generated-pack <packfiles &&
+       packed_objects member/generated-pack-*.idx >actual-objects &&
+       test_cmp expected-objects actual-objects
+'
+
+test_done
index 8c8af99b844be1ad571f55364891db10fc172d98..43cbcd5d497ecaef33c97032e7c5a8729fb4c01c 100755 (executable)
@@ -55,7 +55,7 @@ check_fsync_events () {
 
        cat >expect &&
        sed -n \
-               -e '/^{"event":"data",.*"category":"fsync",/ {
+               -e '/^{"event":"counter",.*"category":"fsync",/ {
                        s/.*"category":"fsync",//;
                        s/}$//;
                        p;
@@ -78,8 +78,8 @@ test_expect_success 'unpack big object in stream (core.fsyncmethod=batch)' '
                flush_count=1
        fi &&
        check_fsync_events trace2.txt <<-EOF &&
-       "key":"fsync/writeout-only","value":"6"
-       "key":"fsync/hardware-flush","value":"$flush_count"
+       "name":"writeout-only","count":6
+       "name":"hardware-flush","count":$flush_count
        EOF
 
        test_dir_is_empty dest.git/objects/pack &&
index cc078896673ae221754a5b65102b559b872dcfd9..51737eeafeeefa0c1b1f075081f4c5c4b95de64e 100755 (executable)
@@ -5,6 +5,7 @@ test_description='tracking branch update checks for git push'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '
index dc44da9c7978ab37e503614cb7524e8c6ba81632..4f289063ced85dc2beabde28788c191a20bf9634 100755 (executable)
@@ -1118,59 +1118,6 @@ test_expect_success 'fetching with auto-gc does not lock up' '
        )
 '
 
-test_expect_success 'fetch aligned output' '
-       git clone . full-output &&
-       test_commit looooooooooooong-tag &&
-       (
-               cd full-output &&
-               git -c fetch.output=full fetch origin >actual 2>&1 &&
-               grep -e "->" actual | cut -c 22- >../actual
-       ) &&
-       cat >expect <<-\EOF &&
-       main                 -> origin/main
-       looooooooooooong-tag -> looooooooooooong-tag
-       EOF
-       test_cmp expect actual
-'
-
-test_expect_success 'fetch compact output' '
-       git clone . compact &&
-       test_commit extraaa &&
-       (
-               cd compact &&
-               git -c fetch.output=compact fetch origin >actual 2>&1 &&
-               grep -e "->" actual | cut -c 22- >../actual
-       ) &&
-       cat >expect <<-\EOF &&
-       main       -> origin/*
-       extraaa    -> *
-       EOF
-       test_cmp expect actual
-'
-
-test_expect_success '--no-show-forced-updates' '
-       mkdir forced-updates &&
-       (
-               cd forced-updates &&
-               git init &&
-               test_commit 1 &&
-               test_commit 2
-       ) &&
-       git clone forced-updates forced-update-clone &&
-       git clone forced-updates no-forced-update-clone &&
-       git -C forced-updates reset --hard HEAD~1 &&
-       (
-               cd forced-update-clone &&
-               git fetch --show-forced-updates origin 2>output &&
-               test_i18ngrep "(forced update)" output
-       ) &&
-       (
-               cd no-forced-update-clone &&
-               git fetch --no-show-forced-updates origin 2>output &&
-               test_i18ngrep ! "(forced update)" output
-       )
-'
-
 for section in fetch transfer
 do
        test_expect_success "$section.hideRefs affects connectivity check" '
index 20d063fb9ae72c4df77a00dd5d5cb6da65640238..151c76eb09b7831edd803e6cad27dddc4b5489ec 100755 (executable)
@@ -15,6 +15,19 @@ generate_references () {
        done
 }
 
+test_expect_success 'set up fake upload-pack' '
+       # This can be used to simulate an upload-pack that just shows the
+       # contents of the "input" file (prepared with the test-tool pkt-line
+       # helper), and does not do any negotiation (since ls-remote does not
+       # need it).
+       write_script cat-input <<-\EOF
+       # send our initial advertisement/response
+       cat input
+       # soak up the flush packet from the client
+       cat
+       EOF
+'
+
 test_expect_success 'dies when no remote found' '
        test_must_fail git ls-remote
 '
@@ -231,22 +244,25 @@ test_expect_success 'protocol v2 supports hiderefs' '
 
 test_expect_success 'ls-remote --symref' '
        git fetch origin &&
-       echo "ref: refs/heads/main      HEAD" >expect &&
+       echo "ref: refs/heads/main      HEAD" >expect.v2 &&
        generate_references \
                HEAD \
-               refs/heads/main >>expect &&
+               refs/heads/main >>expect.v2 &&
+       echo "ref: refs/remotes/origin/main     refs/remotes/origin/HEAD" >>expect.v2 &&
        oid=$(git rev-parse HEAD) &&
-       echo "$oid      refs/remotes/origin/HEAD" >>expect &&
+       echo "$oid      refs/remotes/origin/HEAD" >>expect.v2 &&
        generate_references \
                refs/remotes/origin/main \
                refs/tags/mark \
                refs/tags/mark1.1 \
                refs/tags/mark1.10 \
-               refs/tags/mark1.2 >>expect &&
-       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
-       # protocol v0 here.
-       GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref >actual &&
-       test_cmp expect actual
+               refs/tags/mark1.2 >>expect.v2 &&
+       # v0 does not show non-HEAD symrefs
+       grep -v "ref: refs/remotes" <expect.v2 >expect.v0 &&
+       git -c protocol.version=0 ls-remote --symref >actual.v0 &&
+       test_cmp expect.v0 actual.v0 &&
+       git -c protocol.version=2 ls-remote --symref >actual.v2 &&
+       test_cmp expect.v2 actual.v2
 '
 
 test_expect_success 'ls-remote with filtered symref (refname)' '
@@ -255,76 +271,41 @@ test_expect_success 'ls-remote with filtered symref (refname)' '
        ref: refs/heads/main    HEAD
        $rev    HEAD
        EOF
-       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
-       # protocol v0 here.
-       GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref . HEAD >actual &&
+       git ls-remote --symref . HEAD >actual &&
        test_cmp expect actual
 '
 
-test_expect_failure 'ls-remote with filtered symref (--heads)' '
+test_expect_success 'ls-remote with filtered symref (--heads)' '
        git symbolic-ref refs/heads/foo refs/tags/mark &&
-       cat >expect <<-EOF &&
+       cat >expect.v2 <<-EOF &&
        ref: refs/tags/mark     refs/heads/foo
        $rev    refs/heads/foo
        $rev    refs/heads/main
        EOF
-       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
-       # protocol v0 here.
-       GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual &&
-       test_cmp expect actual
+       grep -v "^ref: refs/tags/" <expect.v2 >expect.v0 &&
+       git -c protocol.version=0 ls-remote --symref --heads . >actual.v0 &&
+       test_cmp expect.v0 actual.v0 &&
+       git -c protocol.version=2 ls-remote --symref --heads . >actual.v2 &&
+       test_cmp expect.v2 actual.v2
 '
 
-test_expect_success 'ls-remote --symref omits filtered-out matches' '
-       cat >expect <<-EOF &&
-       $rev    refs/heads/foo
-       $rev    refs/heads/main
+test_expect_success 'indicate no refs in v0 standards-compliant empty remote' '
+       # Git does not produce an output like this, but it does match the
+       # standard and is produced by other implementations like JGit. So
+       # hard-code the case we care about.
+       #
+       # The actual capabilities do not matter; there are none that would
+       # change how ls-remote behaves.
+       oid=0000000000000000000000000000000000000000 &&
+       test-tool pkt-line pack >input.q <<-EOF &&
+       $oid capabilities^{}Qcaps-go-here
+       0000
        EOF
-       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
-       # protocol v0 here.
-       GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual &&
-       test_cmp expect actual &&
-       GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref . "refs/heads/*" >actual &&
-       test_cmp expect actual
-'
-
-test_lazy_prereq GIT_DAEMON '
-       test_bool_env GIT_TEST_GIT_DAEMON true
-'
+       q_to_nul <input.q >input &&
 
-# This test spawns a daemon, so run it only if the user would be OK with
-# testing with git-daemon.
-test_expect_success PIPE,JGIT,GIT_DAEMON 'indicate no refs in standards-compliant empty remote' '
-       test_set_port JGIT_DAEMON_PORT &&
-       JGIT_DAEMON_PID= &&
-       git init --bare empty.git &&
-       >empty.git/git-daemon-export-ok &&
-       mkfifo jgit_daemon_output &&
-       {
-               jgit daemon --port="$JGIT_DAEMON_PORT" . >jgit_daemon_output &
-               JGIT_DAEMON_PID=$!
-       } &&
-       test_when_finished kill "$JGIT_DAEMON_PID" &&
-       {
-               read line &&
-               case $line in
-               Exporting*)
-                       ;;
-               *)
-                       echo "Expected: Exporting" &&
-                       false;;
-               esac &&
-               read line &&
-               case $line in
-               "Listening on"*)
-                       ;;
-               *)
-                       echo "Expected: Listening on" &&
-                       false;;
-               esac
-       } <jgit_daemon_output &&
        # --exit-code asks the command to exit with 2 when no
        # matching refs are found.
-       test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git
+       test_expect_code 2 git ls-remote --exit-code --upload-pack=./cat-input .
 '
 
 test_expect_success 'ls-remote works outside repository' '
@@ -345,8 +326,8 @@ test_expect_success 'ls-remote --sort fails gracefully outside repository' '
 test_expect_success 'ls-remote patterns work with all protocol versions' '
        git for-each-ref --format="%(objectname)        %(refname)" \
                refs/heads/main refs/remotes/origin/main >expect &&
-       git -c protocol.version=1 ls-remote . main >actual.v1 &&
-       test_cmp expect actual.v1 &&
+       git -c protocol.version=0 ls-remote . main >actual.v0 &&
+       test_cmp expect actual.v0 &&
        git -c protocol.version=2 ls-remote . main >actual.v2 &&
        test_cmp expect actual.v2
 '
@@ -354,10 +335,49 @@ test_expect_success 'ls-remote patterns work with all protocol versions' '
 test_expect_success 'ls-remote prefixes work with all protocol versions' '
        git for-each-ref --format="%(objectname)        %(refname)" \
                refs/heads/ refs/tags/ >expect &&
-       git -c protocol.version=1 ls-remote --heads --tags . >actual.v1 &&
-       test_cmp expect actual.v1 &&
+       git -c protocol.version=0 ls-remote --heads --tags . >actual.v0 &&
+       test_cmp expect actual.v0 &&
        git -c protocol.version=2 ls-remote --heads --tags . >actual.v2 &&
        test_cmp expect actual.v2
 '
 
+test_expect_success 'v0 clients can handle multiple symrefs' '
+       # Modern versions of Git will not return multiple symref capabilities
+       # for v0, so we have to hard-code the response. Note that we will
+       # always use both v0 and object-format=sha1 here, as the hard-coded
+       # response reflects a server that only supports those.
+       oid=1234567890123456789012345678901234567890 &&
+       symrefs="symref=refs/remotes/origin/HEAD:refs/remotes/origin/main" &&
+       symrefs="$symrefs symref=HEAD:refs/heads/main" &&
+
+       # Likewise we want to make sure our parser is not fooled by the string
+       # "symref" appearing as part of an earlier cap. But there is no way to
+       # do that via upload-pack, as arbitrary strings can appear only in a
+       # "symref" value itself (where we skip past the values as a whole)
+       # and "agent" (which always appears after "symref", so putting our
+       # parser in a confused state is less interesting).
+       caps="some other caps including a-fake-symref-cap" &&
+
+       test-tool pkt-line pack >input.q <<-EOF &&
+       $oid HEADQ$caps $symrefs
+       $oid refs/heads/main
+       $oid refs/remotes/origin/HEAD
+       $oid refs/remotes/origin/main
+       0000
+       EOF
+       q_to_nul <input.q >input &&
+
+       cat >expect <<-EOF &&
+       ref: refs/heads/main    HEAD
+       $oid    HEAD
+       $oid    refs/heads/main
+       ref: refs/remotes/origin/main   refs/remotes/origin/HEAD
+       $oid    refs/remotes/origin/HEAD
+       $oid    refs/remotes/origin/main
+       EOF
+
+       git ls-remote --symref --upload-pack=./cat-input . >actual &&
+       test_cmp expect actual
+'
+
 test_done
index 19ebefa5aceb1afd3916f903971013e985836329..87163d77456e5c2738c48dcdde282e2ea7b65a4d 100755 (executable)
@@ -120,6 +120,17 @@ test_expect_success setup '
 
 '
 
+for cmd in push fetch
+do
+       for opt in ipv4 ipv6
+       do
+               test_expect_success "reject 'git $cmd --no-$opt'" '
+                       test_must_fail git $cmd --no-$opt 2>err &&
+                       grep "unknown option .no-$opt" err
+               '
+       done
+done
+
 test_expect_success 'fetch without wildcard' '
        mk_empty testrepo &&
        (
index a448e169bd029f21ec77cd89dc087c8e637578f8..6d4944a72826401d3e698ad4c1b6982c4a233eae 100755 (executable)
@@ -5,6 +5,7 @@ test_description='pushing to a mirror repository'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 D=$(pwd)
index c9acc076353a6ae784ced36a4927cda352950521..1b8d609879504daa09bd62826f223e7eb55bf0d5 100755 (executable)
@@ -61,12 +61,20 @@ test_expect_success 'push -u :topic_2' '
        check_config topic_2 upstream refs/heads/other2
 '
 
-test_expect_success 'push -u --all' '
+test_expect_success 'push -u --all(the same behavior with--branches)' '
        git branch all1 &&
        git branch all2 &&
        git push -u --all &&
        check_config all1 upstream refs/heads/all1 &&
-       check_config all2 upstream refs/heads/all2
+       check_config all2 upstream refs/heads/all2 &&
+       git config --get-regexp branch.all* > expect &&
+       git config --remove-section branch.all1 &&
+       git config --remove-section branch.all2 &&
+       git push -u --branches &&
+       check_config all1 upstream refs/heads/all1 &&
+       check_config all2 upstream refs/heads/all2 &&
+       git config --get-regexp branch.all* > actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'push -u HEAD' '
index 45815f737850b61684f648af9d984ac16ea0944e..3a28f1ded5fdcce6b2a55aa6122e27489d942265 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='tagopt variable affects "git fetch" and is overridden by commandline.'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 setup_clone () {
index dcdbe26a08e1e3db99338a740e10011981b292af..26e933f93ae7f72261046495f25f63af8c31349d 100755 (executable)
@@ -1180,4 +1180,17 @@ test_expect_success 'fetch --all with --recurse-submodules with multiple' '
        test_line_count = 2 fetch-subs
 '
 
+test_expect_success "fetch --all with --no-recurse-submodules only fetches superproject" '
+       test_when_finished "rm -rf src_clone" &&
+
+       git clone --recurse-submodules src src_clone &&
+       (
+               cd src_clone &&
+               git remote add secondary ../src &&
+               git config submodule.recurse true &&
+               git fetch --all --no-recurse-submodules 2>../fetch-log
+       ) &&
+       ! grep "Fetching submodule" fetch-log
+'
+
 test_done
index 70431122a40360c265dc28627c4208dc360c000c..04b47ad84a86ab3407ba26f069d934ed7dcb5dec 100755 (executable)
@@ -117,7 +117,10 @@ test_expect_success 'atomic push fails if one branch fails' '
                test_commit five &&
                git checkout main &&
                test_commit six &&
-               test_must_fail git push --atomic --all up
+               test_must_fail git push --atomic --all up >output-all 2>&1 &&
+               # --all and --branches have the same behavior when be combined with --atomic
+               test_must_fail git push --atomic --branches up >output-branches 2>&1 &&
+               test_cmp output-all output-branches
        ) &&
        test_refs main HEAD@{7} &&
        test_refs second HEAD@{4}
index 0908534f2561f4bc68319f4dc4ffc464ba4e4a90..21b7767cbd313b48a13888c28f5e757e59b394db 100755 (executable)
@@ -611,6 +611,33 @@ test_expect_success 'client falls back from v2 to v0 to match server' '
        grep symref=HEAD:refs/heads/ trace
 '
 
+test_expect_success 'create empty http-accessible SHA-256 repository' '
+       mkdir "$HTTPD_DOCUMENT_ROOT_PATH/sha256.git" &&
+       (cd "$HTTPD_DOCUMENT_ROOT_PATH/sha256.git" &&
+        git --bare init --object-format=sha256
+       )
+'
+
+test_expect_success 'clone empty SHA-256 repository with protocol v2' '
+       rm -fr sha256 &&
+       echo sha256 >expected &&
+       git -c protocol.version=2 clone "$HTTPD_URL/smart/sha256.git" &&
+       git -C sha256 rev-parse --show-object-format >actual &&
+       test_cmp actual expected &&
+       git ls-remote "$HTTPD_URL/smart/sha256.git" >actual &&
+       test_must_be_empty actual
+'
+
+test_expect_success 'clone empty SHA-256 repository with protocol v0' '
+       rm -fr sha256 &&
+       echo sha256 >expected &&
+       GIT_TRACE=1 GIT_TRACE_PACKET=1 git -c protocol.version=0 clone "$HTTPD_URL/smart/sha256.git" &&
+       git -C sha256 rev-parse --show-object-format >actual &&
+       test_cmp actual expected &&
+       git ls-remote "$HTTPD_URL/smart/sha256.git" >actual &&
+       test_must_be_empty actual
+'
+
 test_expect_success 'passing hostname resolution information works' '
        BOGUS_HOST=gitbogusexamplehost.invalid &&
        BOGUS_HTTPD_URL=$HTTPD_PROTO://$BOGUS_HOST:$LIB_HTTPD_PORT &&
index f45a43b4b5e5897145c6f9da1244ee992886b355..ab8a721ccc7db4611fd2f44ae60d9506ea011a01 100755 (executable)
@@ -5,6 +5,12 @@ test_description='test http auth header and credential helper interop'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
 
+enable_cgipassauth
+if ! test_have_prereq CGIPASSAUTH
+then
+       skip_all="no CGIPassAuth support"
+       test_done
+fi
 start_httpd
 
 test_expect_success 'setup_credential_helper' '
index 09097eff3f46033a26c9b60c94bb8cb79f3fad2c..4e917bf87d2d4213019797ffa4d12215ffeb05f5 100755 (executable)
@@ -121,7 +121,7 @@ test_expect_success "fetch.recurseSubmodules option triggers recursive fetch (bu
        sub_oid=$(git -C child rev-parse HEAD) &&
        git -C super/sub cat-file -e $sub_oid &&
        # Check that the submodule worktree did not update
-       ! test_path_is_file super/sub/merge_strategy_5.t
+       test_path_is_missing super/sub/merge_strategy_5.t
 '
 
 test_expect_success "fetch.recurseSubmodules takes precedence over submodule.recurse" '
@@ -134,7 +134,7 @@ test_expect_success "fetch.recurseSubmodules takes precedence over submodule.rec
        sub_oid=$(git -C child rev-parse HEAD) &&
        git -C super/sub cat-file -e $sub_oid &&
        # Check that the submodule worktree did not update
-       ! test_path_is_file super/sub/merge_strategy_6.t
+       test_path_is_missing super/sub/merge_strategy_6.t
 '
 
 test_expect_success 'pull --rebase --recurse-submodules (remote superproject submodule changes, local submodule changes)' '
diff --git a/t/t5574-fetch-output.sh b/t/t5574-fetch-output.sh
new file mode 100755 (executable)
index 0000000..90e6dcb
--- /dev/null
@@ -0,0 +1,293 @@
+#!/bin/sh
+
+test_description='git fetch output format'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+test_expect_success 'fetch with invalid output format configuration' '
+       test_when_finished "rm -rf clone" &&
+       git clone . clone &&
+
+       test_must_fail git -C clone -c fetch.output fetch origin 2>actual.err &&
+       cat >expect <<-EOF &&
+       error: missing value for ${SQ}fetch.output${SQ}
+       fatal: unable to parse ${SQ}fetch.output${SQ} from command-line config
+       EOF
+       test_cmp expect actual.err &&
+
+       test_must_fail git -C clone -c fetch.output= fetch origin 2>actual.err &&
+       cat >expect <<-EOF &&
+       fatal: invalid value for ${SQ}fetch.output${SQ}: ${SQ}${SQ}
+       EOF
+       test_cmp expect actual.err &&
+
+       test_must_fail git -C clone -c fetch.output=garbage fetch origin 2>actual.err &&
+       cat >expect <<-EOF &&
+       fatal: invalid value for ${SQ}fetch.output${SQ}: ${SQ}garbage${SQ}
+       EOF
+       test_cmp expect actual.err
+'
+
+test_expect_success 'fetch aligned output' '
+       git clone . full-output &&
+       test_commit looooooooooooong-tag &&
+       (
+               cd full-output &&
+               git -c fetch.output=full fetch origin >actual 2>&1 &&
+               grep -e "->" actual | cut -c 22- >../actual
+       ) &&
+       cat >expect <<-\EOF &&
+       main                 -> origin/main
+       looooooooooooong-tag -> looooooooooooong-tag
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'fetch compact output' '
+       git clone . compact &&
+       test_commit extraaa &&
+       (
+               cd compact &&
+               git -c fetch.output=compact fetch origin >actual 2>&1 &&
+               grep -e "->" actual | cut -c 22- >../actual
+       ) &&
+       cat >expect <<-\EOF &&
+       main       -> origin/*
+       extraaa    -> *
+       EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'fetch porcelain output' '
+       test_when_finished "rm -rf porcelain" &&
+
+       # Set up a bunch of references that we can use to demonstrate different
+       # kinds of flag symbols in the output format.
+       MAIN_OLD=$(git rev-parse HEAD) &&
+       git branch "fast-forward" &&
+       git branch "deleted-branch" &&
+       git checkout -b force-updated &&
+       test_commit --no-tag force-update-old &&
+       FORCE_UPDATED_OLD=$(git rev-parse HEAD) &&
+       git checkout main &&
+
+       # Clone and pre-seed the repositories. We fetch references into two
+       # namespaces so that we can test that rejected and force-updated
+       # references are reported properly.
+       refspecs="refs/heads/*:refs/unforced/* +refs/heads/*:refs/forced/*" &&
+       git clone . porcelain &&
+       git -C porcelain fetch origin $refspecs &&
+
+       # Now that we have set up the client repositories we can change our
+       # local references.
+       git branch new-branch &&
+       git branch -d deleted-branch &&
+       git checkout fast-forward &&
+       test_commit --no-tag fast-forward-new &&
+       FAST_FORWARD_NEW=$(git rev-parse HEAD) &&
+       git checkout force-updated &&
+       git reset --hard HEAD~ &&
+       test_commit --no-tag force-update-new &&
+       FORCE_UPDATED_NEW=$(git rev-parse HEAD) &&
+
+       cat >expect <<-EOF &&
+       - $MAIN_OLD $ZERO_OID refs/forced/deleted-branch
+       - $MAIN_OLD $ZERO_OID refs/unforced/deleted-branch
+         $MAIN_OLD $FAST_FORWARD_NEW refs/unforced/fast-forward
+       ! $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/unforced/force-updated
+       * $ZERO_OID $MAIN_OLD refs/unforced/new-branch
+         $MAIN_OLD $FAST_FORWARD_NEW refs/forced/fast-forward
+       + $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/forced/force-updated
+       * $ZERO_OID $MAIN_OLD refs/forced/new-branch
+         $MAIN_OLD $FAST_FORWARD_NEW refs/remotes/origin/fast-forward
+       + $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/remotes/origin/force-updated
+       * $ZERO_OID $MAIN_OLD refs/remotes/origin/new-branch
+       EOF
+
+       # Execute a dry-run fetch first. We do this to assert that the dry-run
+       # and non-dry-run fetches produces the same output. Execution of the
+       # fetch is expected to fail as we have a rejected reference update.
+       test_must_fail git -C porcelain fetch \
+               --porcelain --dry-run --prune origin $refspecs >actual &&
+       test_cmp expect actual &&
+
+       # And now we perform a non-dry-run fetch.
+       test_must_fail git -C porcelain fetch \
+               --porcelain --prune origin $refspecs >actual 2>stderr &&
+       test_cmp expect actual &&
+       test_must_be_empty stderr
+'
+
+test_expect_success 'fetch porcelain with multiple remotes' '
+       test_when_finished "rm -rf porcelain" &&
+
+       git switch --create multiple-remotes &&
+       git clone . porcelain &&
+       git -C porcelain remote add second-remote "$PWD" &&
+       git -C porcelain fetch second-remote &&
+
+       test_commit --no-tag multi-commit &&
+       old_commit=$(git rev-parse HEAD~) &&
+       new_commit=$(git rev-parse HEAD) &&
+
+       cat >expect <<-EOF &&
+         $old_commit $new_commit refs/remotes/origin/multiple-remotes
+         $old_commit $new_commit refs/remotes/second-remote/multiple-remotes
+       EOF
+
+       git -C porcelain fetch --porcelain --all >actual 2>stderr &&
+       test_cmp expect actual &&
+       test_must_be_empty stderr
+'
+
+test_expect_success 'fetch porcelain refuses to work with submodules' '
+       test_when_finished "rm -rf porcelain" &&
+
+       cat >expect <<-EOF &&
+       fatal: options ${SQ}--porcelain${SQ} and ${SQ}--recurse-submodules${SQ} cannot be used together
+       EOF
+
+       git init porcelain &&
+       test_must_fail git -C porcelain fetch --porcelain --recurse-submodules=yes 2>stderr &&
+       test_cmp expect stderr &&
+
+       test_must_fail git -C porcelain fetch --porcelain --recurse-submodules=on-demand 2>stderr &&
+       test_cmp expect stderr
+'
+
+test_expect_success 'fetch porcelain overrides fetch.output config' '
+       test_when_finished "rm -rf porcelain" &&
+
+       git switch --create config-override &&
+       git clone . porcelain &&
+       test_commit new-commit &&
+       old_commit=$(git rev-parse HEAD~) &&
+       new_commit=$(git rev-parse HEAD) &&
+
+       cat >expect <<-EOF &&
+         $old_commit $new_commit refs/remotes/origin/config-override
+       * $ZERO_OID $new_commit refs/tags/new-commit
+       EOF
+
+       git -C porcelain -c fetch.output=compact fetch --porcelain >stdout 2>stderr &&
+       test_must_be_empty stderr &&
+       test_cmp expect stdout
+'
+
+test_expect_success 'fetch --no-porcelain overrides previous --porcelain' '
+       test_when_finished "rm -rf no-porcelain" &&
+
+       git switch --create no-porcelain &&
+       git clone . no-porcelain &&
+       test_commit --no-tag no-porcelain &&
+       old_commit=$(git rev-parse --short HEAD~) &&
+       new_commit=$(git rev-parse --short HEAD) &&
+
+       cat >expect <<-EOF &&
+       From $(test-tool path-utils real_path .)/.
+          $old_commit..$new_commit  no-porcelain -> origin/no-porcelain
+       EOF
+
+       git -C no-porcelain fetch --porcelain --no-porcelain >stdout 2>stderr &&
+       test_cmp expect stderr &&
+       test_must_be_empty stdout
+'
+
+test_expect_success 'fetch output with HEAD' '
+       test_when_finished "rm -rf head" &&
+       git clone . head &&
+
+       git -C head fetch --dry-run origin HEAD >actual.out 2>actual.err &&
+       cat >expect <<-EOF &&
+       From $(test-tool path-utils real_path .)/.
+        * branch            HEAD       -> FETCH_HEAD
+       EOF
+       test_must_be_empty actual.out &&
+       test_cmp expect actual.err &&
+
+       git -C head fetch origin HEAD >actual.out 2>actual.err &&
+       test_must_be_empty actual.out &&
+       test_cmp expect actual.err &&
+
+       git -C head fetch --dry-run origin HEAD:foo >actual.out 2>actual.err &&
+       cat >expect <<-EOF &&
+       From $(test-tool path-utils real_path .)/.
+        * [new ref]         HEAD       -> foo
+       EOF
+       test_must_be_empty actual.out &&
+       test_cmp expect actual.err &&
+
+       git -C head fetch origin HEAD:foo >actual.out 2>actual.err &&
+       test_must_be_empty actual.out &&
+       test_cmp expect actual.err
+'
+
+test_expect_success 'fetch porcelain output with HEAD' '
+       test_when_finished "rm -rf head" &&
+       git clone . head &&
+       COMMIT_ID=$(git rev-parse HEAD) &&
+
+       git -C head fetch --porcelain --dry-run origin HEAD >actual &&
+       cat >expect <<-EOF &&
+       * $ZERO_OID $COMMIT_ID FETCH_HEAD
+       EOF
+       test_cmp expect actual &&
+
+       git -C head fetch --porcelain origin HEAD >actual &&
+       test_cmp expect actual &&
+
+       git -C head fetch --porcelain --dry-run origin HEAD:foo >actual &&
+       cat >expect <<-EOF &&
+       * $ZERO_OID $COMMIT_ID refs/heads/foo
+       EOF
+       test_cmp expect actual &&
+
+       git -C head fetch --porcelain origin HEAD:foo >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'fetch output with object ID' '
+       test_when_finished "rm -rf object-id" &&
+       git clone . object-id &&
+       commit=$(git rev-parse HEAD) &&
+
+       git -C object-id fetch --dry-run origin $commit:object-id >actual.out 2>actual.err &&
+       cat >expect <<-EOF &&
+       From $(test-tool path-utils real_path .)/.
+        * [new ref]         $commit -> object-id
+       EOF
+       test_must_be_empty actual.out &&
+       test_cmp expect actual.err &&
+
+       git -C object-id fetch origin $commit:object-id >actual.out 2>actual.err &&
+       test_must_be_empty actual.out &&
+       test_cmp expect actual.err
+'
+
+test_expect_success '--no-show-forced-updates' '
+       mkdir forced-updates &&
+       (
+               cd forced-updates &&
+               git init &&
+               test_commit 1 &&
+               test_commit 2
+       ) &&
+       git clone forced-updates forced-update-clone &&
+       git clone forced-updates no-forced-update-clone &&
+       git -C forced-updates reset --hard HEAD~1 &&
+       (
+               cd forced-update-clone &&
+               git fetch --show-forced-updates origin 2>output &&
+               test_i18ngrep "(forced update)" output
+       ) &&
+       (
+               cd no-forced-update-clone &&
+               git fetch --no-show-forced-updates origin 2>output &&
+               test_i18ngrep ! "(forced update)" output
+       )
+'
+
+test_done
diff --git a/t/t5583-push-branches.sh b/t/t5583-push-branches.sh
new file mode 100755 (executable)
index 0000000..e7e1b6d
--- /dev/null
@@ -0,0 +1,115 @@
+#!/bin/sh
+
+test_description='check the consisitency of behavior of --all and --branches'
+
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+delete_refs() {
+       dir=$1
+       shift
+       rm -rf deletes
+       for arg in $*
+       do
+               echo "delete ${arg}" >>deletes
+       done
+       git -C $dir update-ref --stdin < deletes
+}
+
+test_expect_success 'setup bare remote' '
+       git init --bare remote-1 &&
+       git -C remote-1 config gc.auto 0 &&
+       test_commit one &&
+       git push remote-1 HEAD
+'
+
+test_expect_success 'setup different types of references' '
+       cat >refs <<-EOF &&
+       update refs/heads/branch-1 HEAD
+       update refs/heads/branch-2 HEAD
+       EOF
+
+       git tag -a -m "annotated" annotated-1 HEAD &&
+       git tag -a -m "annotated" annotated-2 HEAD &&
+       git update-ref --stdin < refs
+'
+
+test_expect_success '--all and --branches have the same behavior' '
+       test_when_finished "delete_refs remote-1 \
+                          refs/heads/branch-1 \
+                          refs/heads/branch-2" &&
+       git push remote-1 --all &&
+       commit=$(git rev-parse HEAD) &&
+       cat >expect <<-EOF &&
+       $commit refs/heads/branch-1
+       $commit refs/heads/branch-2
+       $commit refs/heads/main
+       EOF
+
+       git -C remote-1 show-ref --heads >actual.all &&
+       delete_refs remote-1 refs/heads/branch-1 refs/heads/branch-2 &&
+       git push remote-1 --branches &&
+       git -C remote-1 show-ref --heads >actual.branches &&
+       test_cmp actual.all actual.branches &&
+       test_cmp expect actual.all
+'
+
+test_expect_success '--all or --branches can not be combined with refspecs' '
+       test_must_fail git push remote-1 --all main >actual.all 2>&1 &&
+       test_must_fail git push remote-1 --branches main >actual.branches 2>&1 &&
+       test_cmp actual.all actual.branches &&
+       grep "be combined with refspecs" actual.all
+'
+
+test_expect_success '--all or --branches can not be combined with --mirror' '
+       test_must_fail git push remote-1 --all --mirror >actual.all 2>&1 &&
+       test_must_fail git push remote-1 --branches --mirror >actual.branches 2>&1 &&
+       test_cmp actual.all actual.branches &&
+       grep "cannot be used together" actual.all
+'
+
+test_expect_success '--all or --branches can not be combined with --tags' '
+       test_must_fail git push remote-1 --all --tags >actual.all 2>&1 &&
+       test_must_fail git push remote-1 --branches --tags >actual.branches 2>&1 &&
+       test_cmp actual.all actual.branches &&
+       grep "cannot be used together" actual.all
+'
+
+
+test_expect_success '--all or --branches can not be combined with --delete' '
+       test_must_fail git push remote-1 --all --delete >actual.all 2>&1 &&
+       test_must_fail git push remote-1 --branches --delete >actual.branches 2>&1 &&
+       test_cmp actual.all actual.branches &&
+       grep "cannot be used together" actual.all
+'
+
+test_expect_success '--all or --branches combines with --follow-tags have same behavior' '
+       test_when_finished "delete_refs remote-1 \
+                          refs/heads/branch-1 \
+                          refs/heads/branch-2 \
+                          refs/tags/annotated-1 \
+                          refs/tags/annotated-2" &&
+       git push remote-1 --all --follow-tags &&
+       git -C remote-1 show-ref > actual.all &&
+       cat >expect <<-EOF &&
+       $commit refs/heads/branch-1
+       $commit refs/heads/branch-2
+       $commit refs/heads/main
+       $(git rev-parse annotated-1) refs/tags/annotated-1
+       $(git rev-parse annotated-2) refs/tags/annotated-2
+       EOF
+
+       delete_refs remote-1 \
+                   refs/heads/branch-1 \
+                   refs/heads/branch-2 \
+                   refs/tags/annotated-1 \
+                   refs/tags/annotated-2 &&
+       git push remote-1 --branches --follow-tags &&
+       git -C remote-1 show-ref >actual.branches &&
+       test_cmp actual.all actual.branches &&
+       test_cmp expect actual.all
+'
+
+test_done
index 27f9f7763895ec98761800d2a3e4ad2adf33aeb9..5890319b97b8269ee2957315a3670a7c0cfa8caf 100755 (executable)
@@ -120,6 +120,16 @@ test_expect_success 'prefers -c config over --template config' '
 
 '
 
+test_expect_failure 'prefers --template config even for core.bare' '
+
+       template="$TRASH_DIRECTORY/template-with-bare-config" &&
+       mkdir "$template" &&
+       git config --file "$template/config" core.bare true &&
+       git clone "--template=$template" parent clone-bare-config &&
+       test "$(git -C clone-bare-config config --local core.bare)" = "true" &&
+       test_path_is_file clone-bare-config/HEAD
+'
+
 test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
 
        test_config_global clone.defaultRemoteName from_config &&
index f519d2a87a7d84e482284998cbca338a0dfba419..8759fc285337e2bbc43fc746aa7c97bdc91a5b91 100755 (executable)
@@ -257,8 +257,8 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
        test_commit -C submodule mycommit &&
 
        test_create_repo src_with_sub &&
-       test_config -C src_with_sub uploadpack.allowfilter 1 &&
-       test_config -C src_with_sub uploadpack.allowanysha1inwant 1 &&
+       git -C src_with_sub config uploadpack.allowfilter 1 &&
+       git -C src_with_sub config uploadpack.allowanysha1inwant 1 &&
 
        test_config_global protocol.file.allow always &&
 
@@ -270,6 +270,12 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
        test_when_finished rm -rf dst
 '
 
+test_expect_success 'lazily fetched .gitmodules works' '
+       git clone --filter="blob:none" --no-checkout "file://$(pwd)/src_with_sub" dst &&
+       git -C dst fetch &&
+       test_when_finished rm -rf dst
+'
+
 test_expect_success 'partial clone with transfer.fsckobjects=1 uses index-pack --fsck-objects' '
        git init src &&
        test_commit -C src x &&
index 6c8d4c6cf1c8e0f98e2a6cccfec798c19b1954a0..a73b4d4ff6a0d26e925ae7f6a0e8e34a1e138836 100755 (executable)
@@ -244,15 +244,28 @@ test_expect_success 'push with ssh:// using protocol v1' '
        grep "push< version 1" log
 '
 
+test_expect_success 'clone propagates object-format from empty repo' '
+       test_when_finished "rm -fr src256 dst256" &&
+
+       echo sha256 >expect &&
+       git init --object-format=sha256 src256 &&
+       git clone --no-local src256 dst256 &&
+       git -C dst256 rev-parse --show-object-format >actual &&
+
+       test_cmp expect actual
+'
+
 # Test protocol v1 with 'http://' transport
 #
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd
 
-test_expect_success 'create repo to be served by http:// transport' '
+test_expect_success 'create repos to be served by http:// transport' '
        git init "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" &&
        git -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" config http.receivepack true &&
-       test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" one
+       test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" one &&
+       git init --object-format=sha256 "$HTTPD_DOCUMENT_ROOT_PATH/sha256" &&
+       git -C "$HTTPD_DOCUMENT_ROOT_PATH/sha256" config http.receivepack true
 '
 
 test_expect_success 'clone with http:// using protocol v1' '
@@ -269,6 +282,20 @@ test_expect_success 'clone with http:// using protocol v1' '
        grep "git< version 1" log
 '
 
+test_expect_success 'clone with http:// using protocol v1 with empty SHA-256 repo' '
+       GIT_TRACE_PACKET=1 GIT_TRACE_CURL=1 git -c protocol.version=1 \
+               clone "$HTTPD_URL/smart/sha256" sha256 2>log &&
+
+       echo sha256 >expect &&
+       git -C sha256 rev-parse --show-object-format >actual &&
+       test_cmp expect actual &&
+
+       # Client requested to use protocol v1
+       grep "Git-Protocol: version=1" log &&
+       # Server responded using protocol v1
+       grep "git< version 1" log
+'
+
 test_expect_success 'fetch with http:// using protocol v1' '
        test_commit -C "$HTTPD_DOCUMENT_ROOT_PATH/http_parent" two &&
 
index 41d0ca00b1c025beaadedf195586fb81db835bbb..573eb97a0f7f06e45d3358e65be8b55816ea47b3 100755 (executable)
@@ -493,7 +493,7 @@ test_expect_success 'empty email' '
        test_tick &&
        C=$(GIT_AUTHOR_EMAIL= git commit-tree HEAD^{tree} </dev/null) &&
        A=$(git show --pretty=format:%an,%ae,%ad%n -s $C) &&
-       verbose test "$A" = "$GIT_AUTHOR_NAME,,Thu Apr 7 15:14:13 2005 -0700"
+       test "$A" = "$GIT_AUTHOR_NAME,,Thu Apr 7 15:14:13 2005 -0700"
 '
 
 test_expect_success 'del LF before empty (1)' '
index 05162512a09d422a9592a112a1d613d34be4f5ed..a57f1ae2baa4a72e88183fcaa3b55802a80599ef 100755 (executable)
@@ -48,7 +48,9 @@ test_expect_success setup '
                        git add file-$i &&
                        test_tick &&
                        git commit -m side-$i || exit
-               done
+               done &&
+
+               git update-ref refs/heads/-dashed-branch HEAD
        )
 '
 
@@ -60,6 +62,12 @@ check side-1 ^side-7 -- file-2
 check side-3 ^side-4 -- file-3
 check side-3 ^side-2
 check side-3 ^side-2 -- file-1
+check --all
+check --all --not --branches
+check --glob=refs/heads
+check --glob=refs/heads --
+check --glob=refs/heads -- file-1
+check --end-of-options -dashed-branch
 
 test_expect_success 'not only --stdin' '
        cat >expect <<-EOF &&
@@ -78,4 +86,45 @@ test_expect_success 'not only --stdin' '
        test_cmp expect actual
 '
 
+test_expect_success 'pseudo-opt with missing value' '
+       cat >input <<-EOF &&
+       --glob
+       refs/heads
+       EOF
+
+       cat >expect <<-EOF &&
+       fatal: Option ${SQ}--glob${SQ} requires a value
+       EOF
+
+       test_must_fail git rev-list --stdin <input 2>error &&
+       test_cmp expect error
+'
+
+test_expect_success 'pseudo-opt with invalid value' '
+       cat >input <<-EOF &&
+       --no-walk=garbage
+       EOF
+
+       cat >expect <<-EOF &&
+       error: invalid argument to --no-walk
+       fatal: invalid option ${SQ}--no-walk=garbage${SQ} in --stdin mode
+       EOF
+
+       test_must_fail git rev-list --stdin <input 2>error &&
+       test_cmp expect error
+'
+
+test_expect_success 'unknown option without --end-of-options' '
+       cat >input <<-EOF &&
+       -dashed-branch
+       EOF
+
+       cat >expect <<-EOF &&
+       fatal: invalid option ${SQ}-dashed-branch${SQ} in --stdin mode
+       EOF
+
+       test_must_fail git rev-list --stdin <input 2>error &&
+       test_cmp expect error
+'
+
 test_done
index dface8bcfe2641ee07ee36309d1c333224879283..3e6bcbf30cdaf0e623ae73858a4f98838e03255c 100755 (executable)
@@ -619,6 +619,12 @@ test_expect_success TTY 'create --quiet disables all bundle progress' '
        test_must_be_empty err
 '
 
+test_expect_success 'bundle progress with --no-quiet' '
+       GIT_PROGRESS_DELAY=0 \
+               git bundle create --no-quiet out.bundle --all 2>err &&
+       grep "%" err
+'
+
 test_expect_success 'read bundle over stdin' '
        git bundle create some.bundle HEAD &&
 
index a313849406ddb4b7f104ee06eabc9068d5551425..7ddbd96e58e71d0ef5cae0334b0ff005c7a5cb25 100755 (executable)
@@ -5,6 +5,7 @@ test_description='remote tracking stats'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 advance () {
index 2500acc2ef80f9679105adfa73a805d06e14180c..c9925edf20e7b82ed286b97b9d7247f884c20a62 100755 (executable)
@@ -62,59 +62,59 @@ HASH6=
 HASH7=
 
 test_expect_success 'set up buggy branch' '
-     echo "line 1" >>hello &&
-     echo "line 2" >>hello &&
-     echo "line 3" >>hello &&
-     echo "line 4" >>hello &&
-     add_and_commit_file hello "4 lines" &&
-     HASH1=$(git rev-parse --verify HEAD) &&
-     echo "line BUG" >>hello &&
-     echo "line 6" >>hello &&
-     echo "line 7" >>hello &&
-     echo "line 8" >>hello &&
-     add_and_commit_file hello "4 more lines with a BUG" &&
-     HASH2=$(git rev-parse --verify HEAD) &&
-     echo "line 9" >>hello &&
-     echo "line 10" >>hello &&
-     add_and_commit_file hello "2 more lines" &&
-     HASH3=$(git rev-parse --verify HEAD) &&
-     echo "line 11" >>hello &&
-     add_and_commit_file hello "1 more line" &&
-     HASH4=$(git rev-parse --verify HEAD) &&
-     sed -e "s/BUG/5/" hello >hello.new &&
-     mv hello.new hello &&
-     add_and_commit_file hello "BUG fixed" &&
-     HASH5=$(git rev-parse --verify HEAD) &&
-     echo "line 12" >>hello &&
-     echo "line 13" >>hello &&
-     add_and_commit_file hello "2 more lines" &&
-     HASH6=$(git rev-parse --verify HEAD) &&
-     echo "line 14" >>hello &&
-     echo "line 15" >>hello &&
-     echo "line 16" >>hello &&
-     add_and_commit_file hello "again 3 more lines" &&
-     HASH7=$(git rev-parse --verify HEAD)
+       echo "line 1" >>hello &&
+       echo "line 2" >>hello &&
+       echo "line 3" >>hello &&
+       echo "line 4" >>hello &&
+       add_and_commit_file hello "4 lines" &&
+       HASH1=$(git rev-parse --verify HEAD) &&
+       echo "line BUG" >>hello &&
+       echo "line 6" >>hello &&
+       echo "line 7" >>hello &&
+       echo "line 8" >>hello &&
+       add_and_commit_file hello "4 more lines with a BUG" &&
+       HASH2=$(git rev-parse --verify HEAD) &&
+       echo "line 9" >>hello &&
+       echo "line 10" >>hello &&
+       add_and_commit_file hello "2 more lines" &&
+       HASH3=$(git rev-parse --verify HEAD) &&
+       echo "line 11" >>hello &&
+       add_and_commit_file hello "1 more line" &&
+       HASH4=$(git rev-parse --verify HEAD) &&
+       sed -e "s/BUG/5/" hello >hello.new &&
+       mv hello.new hello &&
+       add_and_commit_file hello "BUG fixed" &&
+       HASH5=$(git rev-parse --verify HEAD) &&
+       echo "line 12" >>hello &&
+       echo "line 13" >>hello &&
+       add_and_commit_file hello "2 more lines" &&
+       HASH6=$(git rev-parse --verify HEAD) &&
+       echo "line 14" >>hello &&
+       echo "line 15" >>hello &&
+       echo "line 16" >>hello &&
+       add_and_commit_file hello "again 3 more lines" &&
+       HASH7=$(git rev-parse --verify HEAD)
 '
 
 test_expect_success 'replace the author' '
-     git cat-file commit $HASH2 | grep "author A U Thor" &&
-     R=$(git cat-file commit $HASH2 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
-     git cat-file commit $R | grep "author O Thor" &&
-     git update-ref refs/replace/$HASH2 $R &&
-     git show HEAD~5 | grep "O Thor" &&
-     git show $HASH2 | grep "O Thor"
+       git cat-file commit $HASH2 | grep "author A U Thor" &&
+       R=$(git cat-file commit $HASH2 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
+       git cat-file commit $R | grep "author O Thor" &&
+       git update-ref refs/replace/$HASH2 $R &&
+       git show HEAD~5 | grep "O Thor" &&
+       git show $HASH2 | grep "O Thor"
 '
 
 test_expect_success 'test --no-replace-objects option' '
-     git cat-file commit $HASH2 | grep "author O Thor" &&
-     git --no-replace-objects cat-file commit $HASH2 | grep "author A U Thor" &&
-     git show $HASH2 | grep "O Thor" &&
-     git --no-replace-objects show $HASH2 | grep "A U Thor"
+       git cat-file commit $HASH2 | grep "author O Thor" &&
+       git --no-replace-objects cat-file commit $HASH2 | grep "author A U Thor" &&
+       git show $HASH2 | grep "O Thor" &&
+       git --no-replace-objects show $HASH2 | grep "A U Thor"
 '
 
 test_expect_success 'test GIT_NO_REPLACE_OBJECTS env variable' '
-     GIT_NO_REPLACE_OBJECTS=1 git cat-file commit $HASH2 | grep "author A U Thor" &&
-     GIT_NO_REPLACE_OBJECTS=1 git show $HASH2 | grep "A U Thor"
+       GIT_NO_REPLACE_OBJECTS=1 git cat-file commit $HASH2 | grep "author A U Thor" &&
+       GIT_NO_REPLACE_OBJECTS=1 git show $HASH2 | grep "A U Thor"
 '
 
 test_expect_success 'test core.usereplacerefs config option' '
@@ -132,64 +132,64 @@ tagger T A Gger <> 0 +0000
 EOF
 
 test_expect_success 'tag replaced commit' '
-     git update-ref refs/tags/mytag $(git mktag <tag.sig)
+       git update-ref refs/tags/mytag $(git mktag <tag.sig)
 '
 
 test_expect_success '"git fsck" works' '
-     git fsck main >fsck_main.out &&
-     test_i18ngrep "dangling commit $R" fsck_main.out &&
-     test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_main.out &&
-     test -z "$(git fsck)"
+       git fsck main >fsck_main.out &&
+       test_i18ngrep "dangling commit $R" fsck_main.out &&
+       test_i18ngrep "dangling tag $(git show-ref -s refs/tags/mytag)" fsck_main.out &&
+       test -z "$(git fsck)"
 '
 
 test_expect_success 'repack, clone and fetch work' '
-     git repack -a -d &&
-     git clone --no-hardlinks . clone_dir &&
-     (
-         cd clone_dir &&
-         git show HEAD~5 | grep "A U Thor" &&
-         git show $HASH2 | grep "A U Thor" &&
-         git cat-file commit $R &&
-         git repack -a -d &&
-         test_must_fail git cat-file commit $R &&
-         git fetch ../ "refs/replace/*:refs/replace/*" &&
-         git show HEAD~5 | grep "O Thor" &&
-         git show $HASH2 | grep "O Thor" &&
-         git cat-file commit $R
-     )
+       git repack -a -d &&
+       git clone --no-hardlinks . clone_dir &&
+       (
+               cd clone_dir &&
+               git show HEAD~5 | grep "A U Thor" &&
+               git show $HASH2 | grep "A U Thor" &&
+               git cat-file commit $R &&
+               git repack -a -d &&
+               test_must_fail git cat-file commit $R &&
+               git fetch ../ "refs/replace/*:refs/replace/*" &&
+               git show HEAD~5 | grep "O Thor" &&
+               git show $HASH2 | grep "O Thor" &&
+               git cat-file commit $R
+       )
 '
 
 test_expect_success '"git replace" listing and deleting' '
-     test "$HASH2" = "$(git replace -l)" &&
-     test "$HASH2" = "$(git replace)" &&
-     aa=${HASH2%??????????????????????????????????????} &&
-     test "$HASH2" = "$(git replace --list "$aa*")" &&
-     test_must_fail git replace -d $R &&
-     test_must_fail git replace --delete &&
-     test_must_fail git replace -l -d $HASH2 &&
-     git replace -d $HASH2 &&
-     git show $HASH2 | grep "A U Thor" &&
-     test -z "$(git replace -l)"
+       test "$HASH2" = "$(git replace -l)" &&
+       test "$HASH2" = "$(git replace)" &&
+       aa=${HASH2%??????????????????????????????????????} &&
+       test "$HASH2" = "$(git replace --list "$aa*")" &&
+       test_must_fail git replace -d $R &&
+       test_must_fail git replace --delete &&
+       test_must_fail git replace -l -d $HASH2 &&
+       git replace -d $HASH2 &&
+       git show $HASH2 | grep "A U Thor" &&
+       test -z "$(git replace -l)"
 '
 
 test_expect_success '"git replace" replacing' '
-     git replace $HASH2 $R &&
-     git show $HASH2 | grep "O Thor" &&
-     test_must_fail git replace $HASH2 $R &&
-     git replace -f $HASH2 $R &&
-     test_must_fail git replace -f &&
-     test "$HASH2" = "$(git replace)"
+       git replace $HASH2 $R &&
+       git show $HASH2 | grep "O Thor" &&
+       test_must_fail git replace $HASH2 $R &&
+       git replace -f $HASH2 $R &&
+       test_must_fail git replace -f &&
+       test "$HASH2" = "$(git replace)"
 '
 
 test_expect_success '"git replace" resolves sha1' '
-     SHORTHASH2=$(git rev-parse --short=8 $HASH2) &&
-     git replace -d $SHORTHASH2 &&
-     git replace $SHORTHASH2 $R &&
-     git show $HASH2 | grep "O Thor" &&
-     test_must_fail git replace $HASH2 $R &&
-     git replace -f $HASH2 $R &&
-     test_must_fail git replace --force &&
-     test "$HASH2" = "$(git replace)"
+       SHORTHASH2=$(git rev-parse --short=8 $HASH2) &&
+       git replace -d $SHORTHASH2 &&
+       git replace $SHORTHASH2 $R &&
+       git show $HASH2 | grep "O Thor" &&
+       test_must_fail git replace $HASH2 $R &&
+       git replace -f $HASH2 $R &&
+       test_must_fail git replace --force &&
+       test "$HASH2" = "$(git replace)"
 '
 
 # This creates a side branch where the bug in H2
@@ -207,79 +207,79 @@ test_expect_success '"git replace" resolves sha1' '
 # Then we replace H6 with P6.
 #
 test_expect_success 'create parallel branch without the bug' '
-     git replace -d $HASH2 &&
-     git show $HASH2 | grep "A U Thor" &&
-     git checkout $HASH1 &&
-     git cherry-pick $HASH2 &&
-     git show $HASH5 | git apply &&
-     git commit --amend -m "hello: 4 more lines WITHOUT the bug" hello &&
-     PARA2=$(git rev-parse --verify HEAD) &&
-     git cherry-pick $HASH3 &&
-     PARA3=$(git rev-parse --verify HEAD) &&
-     git cherry-pick $HASH4 &&
-     PARA4=$(git rev-parse --verify HEAD) &&
-     git cherry-pick $HASH6 &&
-     PARA6=$(git rev-parse --verify HEAD) &&
-     git replace $HASH6 $PARA6 &&
-     git checkout main &&
-     cur=$(git rev-parse --verify HEAD) &&
-     test "$cur" = "$HASH7" &&
-     git log --pretty=oneline | grep $PARA2 &&
-     git remote add cloned ./clone_dir
+       git replace -d $HASH2 &&
+       git show $HASH2 | grep "A U Thor" &&
+       git checkout $HASH1 &&
+       git cherry-pick $HASH2 &&
+       git show $HASH5 | git apply &&
+       git commit --amend -m "hello: 4 more lines WITHOUT the bug" hello &&
+       PARA2=$(git rev-parse --verify HEAD) &&
+       git cherry-pick $HASH3 &&
+       PARA3=$(git rev-parse --verify HEAD) &&
+       git cherry-pick $HASH4 &&
+       PARA4=$(git rev-parse --verify HEAD) &&
+       git cherry-pick $HASH6 &&
+       PARA6=$(git rev-parse --verify HEAD) &&
+       git replace $HASH6 $PARA6 &&
+       git checkout main &&
+       cur=$(git rev-parse --verify HEAD) &&
+       test "$cur" = "$HASH7" &&
+       git log --pretty=oneline | grep $PARA2 &&
+       git remote add cloned ./clone_dir
 '
 
 test_expect_success 'push to cloned repo' '
-     git push cloned $HASH6^:refs/heads/parallel &&
-     (
-         cd clone_dir &&
-         git checkout parallel &&
-         git log --pretty=oneline | grep $PARA2
-     )
+       git push cloned $HASH6^:refs/heads/parallel &&
+       (
+               cd clone_dir &&
+               git checkout parallel &&
+               git log --pretty=oneline | grep $PARA2
+       )
 '
 
 test_expect_success 'push branch with replacement' '
-     git cat-file commit $PARA3 | grep "author A U Thor" &&
-     S=$(git cat-file commit $PARA3 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
-     git cat-file commit $S | grep "author O Thor" &&
-     git replace $PARA3 $S &&
-     git show $HASH6~2 | grep "O Thor" &&
-     git show $PARA3 | grep "O Thor" &&
-     git push cloned $HASH6^:refs/heads/parallel2 &&
-     (
-         cd clone_dir &&
-         git checkout parallel2 &&
-         git log --pretty=oneline | grep $PARA3 &&
-         git show $PARA3 | grep "A U Thor"
-     )
+       git cat-file commit $PARA3 | grep "author A U Thor" &&
+       S=$(git cat-file commit $PARA3 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
+       git cat-file commit $S | grep "author O Thor" &&
+       git replace $PARA3 $S &&
+       git show $HASH6~2 | grep "O Thor" &&
+       git show $PARA3 | grep "O Thor" &&
+       git push cloned $HASH6^:refs/heads/parallel2 &&
+       (
+               cd clone_dir &&
+               git checkout parallel2 &&
+               git log --pretty=oneline | grep $PARA3 &&
+               git show $PARA3 | grep "A U Thor"
+       )
 '
 
 test_expect_success 'fetch branch with replacement' '
-     git branch tofetch $HASH6 &&
-     (
-         cd clone_dir &&
-         git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
-         git log --pretty=oneline parallel3 >output.txt &&
-         ! grep $PARA3 output.txt &&
-         git show $PARA3 >para3.txt &&
-         grep "A U Thor" para3.txt &&
-         git fetch origin "refs/replace/*:refs/replace/*" &&
-         git log --pretty=oneline parallel3 >output.txt &&
-         grep $PARA3 output.txt &&
-         git show $PARA3 >para3.txt &&
-         grep "O Thor" para3.txt
-     )
+       git branch tofetch $HASH6 &&
+       (
+               cd clone_dir &&
+               git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
+               git log --pretty=oneline parallel3 >output.txt &&
+               ! grep $PARA3 output.txt &&
+               git show $PARA3 >para3.txt &&
+               grep "A U Thor" para3.txt &&
+               git fetch origin "refs/replace/*:refs/replace/*" &&
+               git log --pretty=oneline parallel3 >output.txt &&
+               grep $PARA3 output.txt &&
+               git show $PARA3 >para3.txt &&
+               grep "O Thor" para3.txt
+       )
 '
 
 test_expect_success 'bisect and replacements' '
-     git bisect start $HASH7 $HASH1 &&
-     test "$PARA3" = "$(git rev-parse --verify HEAD)" &&
-     git bisect reset &&
-     GIT_NO_REPLACE_OBJECTS=1 git bisect start $HASH7 $HASH1 &&
-     test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
-     git bisect reset &&
-     git --no-replace-objects bisect start $HASH7 $HASH1 &&
-     test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
-     git bisect reset
+       git bisect start $HASH7 $HASH1 &&
+       test "$PARA3" = "$(git rev-parse --verify HEAD)" &&
+       git bisect reset &&
+       GIT_NO_REPLACE_OBJECTS=1 git bisect start $HASH7 $HASH1 &&
+       test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
+       git bisect reset &&
+       git --no-replace-objects bisect start $HASH7 $HASH1 &&
+       test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
+       git bisect reset
 '
 
 test_expect_success 'index-pack and replacements' '
index c9afcef2018b052a81600487c33846e2917c982f..0a5c4875407e5ec504831cdcb5d2c6e438d622f1 100755 (executable)
@@ -85,6 +85,7 @@ check_describe e-1-gHASH --tags HEAD^^
 check_describe c-2-gHASH --tags HEAD^^2
 check_describe B --tags HEAD^^2^
 check_describe e --tags HEAD^^^
+check_describe e --tags --exact-match HEAD^^^
 
 check_describe heads/main --all HEAD
 check_describe tags/c-6-gHASH --all HEAD^
@@ -96,6 +97,13 @@ check_describe A-3-gHASH --long HEAD^^2
 check_describe c-7-gHASH --tags
 check_describe e-3-gHASH --first-parent --tags
 
+check_describe c-7-gHASH --tags --no-exact-match HEAD
+check_describe e-3-gHASH --first-parent --tags --no-exact-match HEAD
+
+test_expect_success '--exact-match failure' '
+       test_must_fail git describe --exact-match HEAD 2>err
+'
+
 test_expect_success 'describe --contains defaults to HEAD without commit-ish' '
        echo "A^0" >expect &&
        git checkout A &&
index 457cc167c774a0e4551cfc98c4f9aec6a17e1416..f70c395e75f556d72936c78dbd9bfa9a2554a58f 100755 (executable)
@@ -65,7 +65,8 @@ test_expect_success 'setup .gitattributes' '
        fileValue label=foo
        fileWrongLabel label☺
        EOF
-       git add .gitattributes &&
+       echo fileSetLabel label1 >sub/.gitattributes &&
+       git add .gitattributes sub/.gitattributes &&
        git commit -m "add attributes"
 '
 
@@ -78,7 +79,17 @@ test_expect_success 'check specific set attr' '
        test_cmp expect actual
 '
 
-test_expect_success 'check specific set attr (2)' '
+test_expect_success 'check set attr with pathspec pattern' '
+       echo sub/fileSetLabel >expect &&
+
+       git ls-files ":(attr:label)sub" >actual &&
+       test_cmp expect actual &&
+
+       git ls-files ":(attr:label)sub/" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'check specific set attr in tree-ish' '
        cat <<-\EOF >expect &&
        HEAD:fileSetLabel
        HEAD:sub/fileSetLabel
@@ -87,6 +98,16 @@ test_expect_success 'check specific set attr (2)' '
        test_cmp expect actual
 '
 
+test_expect_success 'check specific set attr with pathspec pattern in tree-ish' '
+       echo HEAD:sub/fileSetLabel >expect &&
+
+       git grep -l content HEAD ":(attr:label)sub" >actual &&
+       test_cmp expect actual &&
+
+       git grep -l content HEAD ":(attr:label)sub/" >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'check specific unset attr' '
        cat <<-\EOF >expect &&
        fileUnsetLabel
@@ -137,6 +158,7 @@ test_expect_success 'check unspecified attr' '
        fileC
        fileNoLabel
        fileWrongLabel
+       sub/.gitattributes
        sub/fileA
        sub/fileAB
        sub/fileAC
@@ -161,6 +183,7 @@ test_expect_success 'check unspecified attr (2)' '
        HEAD:fileC
        HEAD:fileNoLabel
        HEAD:fileWrongLabel
+       HEAD:sub/.gitattributes
        HEAD:sub/fileA
        HEAD:sub/fileAB
        HEAD:sub/fileAC
@@ -180,6 +203,7 @@ test_expect_success 'check multiple unspecified attr' '
        fileC
        fileNoLabel
        fileWrongLabel
+       sub/.gitattributes
        sub/fileC
        sub/fileNoLabel
        sub/fileWrongLabel
@@ -253,4 +277,22 @@ test_expect_success 'backslash cannot be used as a value' '
        test_i18ngrep "for value matching" actual
 '
 
+test_expect_success 'reading from .gitattributes in a subdirectory (1)' '
+       git ls-files ":(attr:label1)" >actual &&
+       test_write_lines "sub/fileSetLabel" >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'reading from .gitattributes in a subdirectory (2)' '
+       git ls-files ":(attr:label1)sub" >actual &&
+       test_write_lines "sub/fileSetLabel" >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'reading from .gitattributes in a subdirectory (3)' '
+       git ls-files ":(attr:label1)sub/" >actual &&
+       test_write_lines "sub/fileSetLabel" >expect &&
+       test_cmp expect actual
+'
+
 test_done
index 5c00607608a847525650db93807d72bb235abd5f..5b434ab451cf614752210a7e6ed6e420363f1963 100755 (executable)
@@ -6,6 +6,7 @@
 test_description='for-each-ref test'
 
 . ./test-lib.sh
+GNUPGHOME_NOT_USED=$GNUPGHOME
 . "$TEST_DIRECTORY"/lib-gpg.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
@@ -447,6 +448,41 @@ test_expect_success 'exercise glob patterns with prefixes' '
        test_cmp expected actual
 '
 
+cat >expected <<\EOF
+refs/tags/bar
+refs/tags/baz
+refs/tags/testtag
+EOF
+
+test_expect_success 'exercise patterns with prefix exclusions' '
+       for tag in foo/one foo/two foo/three bar baz
+       do
+               git tag "$tag" || return 1
+       done &&
+       test_when_finished "git tag -d foo/one foo/two foo/three bar baz" &&
+       git for-each-ref --format="%(refname)" \
+               refs/tags/ --exclude=refs/tags/foo >actual &&
+       test_cmp expected actual
+'
+
+cat >expected <<\EOF
+refs/tags/bar
+refs/tags/baz
+refs/tags/foo/one
+refs/tags/testtag
+EOF
+
+test_expect_success 'exercise patterns with pattern exclusions' '
+       for tag in foo/one foo/two foo/three bar baz
+       do
+               git tag "$tag" || return 1
+       done &&
+       test_when_finished "git tag -d foo/one foo/two foo/three bar baz" &&
+       git for-each-ref --format="%(refname)" \
+               refs/tags/ --exclude="refs/tags/foo/t*" >actual &&
+       test_cmp expected actual
+'
+
 cat >expected <<\EOF
 'refs/heads/main'
 'refs/remotes/origin/main'
@@ -561,6 +597,144 @@ test_expect_success 'color.ui=always does not override tty check' '
        test_cmp expected.bare actual
 '
 
+test_expect_success 'setup for describe atom tests' '
+       git init -b master describe-repo &&
+       (
+               cd describe-repo &&
+
+               test_commit --no-tag one &&
+               git tag tagone &&
+
+               test_commit --no-tag two &&
+               git tag -a -m "tag two" tagtwo
+       )
+'
+
+test_expect_success 'describe atom vs git describe' '
+       (
+               cd describe-repo &&
+
+               git for-each-ref --format="%(objectname)" \
+                       refs/tags/ >obj &&
+               while read hash
+               do
+                       if desc=$(git describe $hash)
+                       then
+                               : >expect-contains-good
+                       else
+                               : >expect-contains-bad
+                       fi &&
+                       echo "$hash $desc" || return 1
+               done <obj >expect &&
+               test_path_exists expect-contains-good &&
+               test_path_exists expect-contains-bad &&
+
+               git for-each-ref --format="%(objectname) %(describe)" \
+                       refs/tags/ >actual 2>err &&
+               test_cmp expect actual &&
+               test_must_be_empty err
+       )
+'
+
+test_expect_success 'describe:tags vs describe --tags' '
+       (
+               cd describe-repo &&
+               git describe --tags >expect &&
+               git for-each-ref --format="%(describe:tags)" \
+                               refs/heads/master >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success 'describe:abbrev=... vs describe --abbrev=...' '
+       (
+               cd describe-repo &&
+
+               # Case 1: We have commits between HEAD and the most
+               #         recent tag reachable from it
+               test_commit --no-tag file &&
+               git describe --abbrev=14 >expect &&
+               git for-each-ref --format="%(describe:abbrev=14)" \
+                       refs/heads/master >actual &&
+               test_cmp expect actual &&
+
+               # Make sure the hash used is atleast 14 digits long
+               sed -e "s/^.*-g\([0-9a-f]*\)$/\1/" <actual >hexpart &&
+               test 15 -le $(wc -c <hexpart) &&
+
+               # Case 2: We have a tag at HEAD, describe directly gives
+               #         the name of the tag
+               git tag -a -m tagged tagname &&
+               git describe --abbrev=14 >expect &&
+               git for-each-ref --format="%(describe:abbrev=14)" \
+                       refs/heads/master >actual &&
+               test_cmp expect actual &&
+               test tagname = $(cat actual)
+       )
+'
+
+test_expect_success 'describe:match=... vs describe --match ...' '
+       (
+               cd describe-repo &&
+               git tag -a -m "tag foo" tag-foo &&
+               git describe --match "*-foo" >expect &&
+               git for-each-ref --format="%(describe:match="*-foo")" \
+                       refs/heads/master >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success 'describe:exclude:... vs describe --exclude ...' '
+       (
+               cd describe-repo &&
+               git tag -a -m "tag bar" tag-bar &&
+               git describe --exclude "*-bar" >expect &&
+               git for-each-ref --format="%(describe:exclude="*-bar")" \
+                       refs/heads/master >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success 'deref with describe atom' '
+       (
+               cd describe-repo &&
+               cat >expect <<-\EOF &&
+
+               tagname
+               tagname
+               tagname
+
+               tagtwo
+               EOF
+               git for-each-ref --format="%(*describe)" >actual &&
+               test_cmp expect actual
+       )
+'
+
+test_expect_success 'err on bad describe atom arg' '
+       (
+               cd describe-repo &&
+
+               # The bad arg is the only arg passed to describe atom
+               cat >expect <<-\EOF &&
+               fatal: unrecognized %(describe) argument: baz
+               EOF
+               test_must_fail git for-each-ref --format="%(describe:baz)" \
+                       refs/heads/master 2>actual &&
+               test_cmp expect actual &&
+
+               # The bad arg is in the middle of the option string
+               # passed to the describe atom
+               cat >expect <<-\EOF &&
+               fatal: unrecognized %(describe) argument: qux=1,abbrev=14
+               EOF
+               test_must_fail git for-each-ref \
+                       --format="%(describe:tags,qux=1,abbrev=14)" \
+                       ref/heads/master 2>actual &&
+               test_cmp expect actual
+       )
+'
+
 cat >expected <<\EOF
 heads/main
 tags/main
@@ -1522,4 +1696,195 @@ test_expect_success 'git for-each-ref with non-existing refs' '
        test_must_be_empty actual
 '
 
+GRADE_FORMAT="%(signature:grade)%0a%(signature:key)%0a%(signature:signer)%0a%(signature:fingerprint)%0a%(signature:primarykeyfingerprint)"
+TRUSTLEVEL_FORMAT="%(signature:trustlevel)%0a%(signature:key)%0a%(signature:signer)%0a%(signature:fingerprint)%0a%(signature:primarykeyfingerprint)"
+
+test_expect_success GPG 'setup for signature atom using gpg' '
+       git checkout -b signed &&
+
+       test_when_finished "test_unconfig commit.gpgSign" &&
+
+       echo "1" >file &&
+       git add file &&
+       test_tick &&
+       git commit -S -m "file: 1" &&
+       git tag first-signed &&
+
+       echo "2" >file &&
+       test_tick &&
+       git commit -a -m "file: 2" &&
+       git tag second-unsigned &&
+
+       git config commit.gpgSign 1 &&
+       echo "3" >file &&
+       test_tick &&
+       git commit -a --no-gpg-sign -m "file: 3" &&
+       git tag third-unsigned &&
+
+       test_tick &&
+       git rebase -f HEAD^^ && git tag second-signed HEAD^ &&
+       git tag third-signed &&
+
+       echo "4" >file &&
+       test_tick &&
+       git commit -a -SB7227189 -m "file: 4" &&
+       git tag fourth-signed &&
+
+       echo "5" >file &&
+       test_tick &&
+       git commit -a --no-gpg-sign -m "file: 5" &&
+       git tag fifth-unsigned &&
+
+       echo "6" >file &&
+       test_tick &&
+       git commit -a --no-gpg-sign -m "file: 6" &&
+
+       test_tick &&
+       git rebase -f HEAD^^ &&
+       git tag fifth-signed HEAD^ &&
+       git tag sixth-signed &&
+
+       echo "7" >file &&
+       test_tick &&
+       git commit -a --no-gpg-sign -m "file: 7" &&
+       git tag seventh-unsigned
+'
+
+test_expect_success GPGSSH 'setup for signature atom using ssh' '
+       test_when_finished "test_unconfig gpg.format user.signingkey" &&
+
+       test_config gpg.format ssh &&
+       test_config user.signingkey "${GPGSSH_KEY_PRIMARY}" &&
+       echo "8" >file &&
+       test_tick &&
+       git add file &&
+       git commit -S -m "file: 8" &&
+       git tag eighth-signed-ssh
+'
+
+test_expect_success GPG2 'bare signature atom' '
+       git verify-commit first-signed 2>out.raw &&
+       grep -Ev "checking the trustdb|PGP trust model" out.raw >out &&
+       head -3 out >expect &&
+       tail -1 out >>expect &&
+       echo  >>expect &&
+       git for-each-ref refs/tags/first-signed \
+               --format="%(signature)" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success GPG 'show good signature with custom format' '
+       git verify-commit first-signed &&
+       cat >expect <<-\EOF &&
+       G
+       13B6F51ECDDE430D
+       C O Mitter <committer@example.com>
+       73D758744BE721698EC54E8713B6F51ECDDE430D
+       73D758744BE721698EC54E8713B6F51ECDDE430D
+       EOF
+       git for-each-ref refs/tags/first-signed \
+               --format="$GRADE_FORMAT" >actual &&
+       test_cmp expect actual
+'
+test_expect_success GPGSSH 'show good signature with custom format
+                           with ssh' '
+       test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
+       FINGERPRINT=$(ssh-keygen -lf "${GPGSSH_KEY_PRIMARY}" | awk "{print \$2;}") &&
+       cat >expect.tmpl <<-\EOF &&
+       G
+       FINGERPRINT
+       principal with number 1
+       FINGERPRINT
+
+       EOF
+       sed "s|FINGERPRINT|$FINGERPRINT|g" expect.tmpl >expect &&
+       git for-each-ref refs/tags/eighth-signed-ssh \
+               --format="$GRADE_FORMAT" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success GPG 'signature atom with grade option and bad signature' '
+       git cat-file commit third-signed >raw &&
+       sed -e "s/^file: 3/file: 3 forged/" raw >forged1 &&
+       FORGED1=$(git hash-object -w -t commit forged1) &&
+       git update-ref refs/tags/third-signed "$FORGED1" &&
+       test_must_fail git verify-commit "$FORGED1" &&
+
+       cat >expect <<-\EOF &&
+       B
+       13B6F51ECDDE430D
+       C O Mitter <committer@example.com>
+
+
+       EOF
+       git for-each-ref refs/tags/third-signed \
+               --format="$GRADE_FORMAT" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success GPG 'show untrusted signature with custom format' '
+       cat >expect <<-\EOF &&
+       U
+       65A0EEA02E30CAD7
+       Eris Discordia <discord@example.net>
+       F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
+       D4BE22311AD3131E5EDA29A461092E85B7227189
+       EOF
+       git for-each-ref refs/tags/fourth-signed \
+               --format="$GRADE_FORMAT" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success GPG 'show untrusted signature with undefined trust level' '
+       cat >expect <<-\EOF &&
+       undefined
+       65A0EEA02E30CAD7
+       Eris Discordia <discord@example.net>
+       F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
+       D4BE22311AD3131E5EDA29A461092E85B7227189
+       EOF
+       git for-each-ref refs/tags/fourth-signed \
+               --format="$TRUSTLEVEL_FORMAT" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success GPG 'show untrusted signature with ultimate trust level' '
+       cat >expect <<-\EOF &&
+       ultimate
+       13B6F51ECDDE430D
+       C O Mitter <committer@example.com>
+       73D758744BE721698EC54E8713B6F51ECDDE430D
+       73D758744BE721698EC54E8713B6F51ECDDE430D
+       EOF
+       git for-each-ref refs/tags/sixth-signed \
+               --format="$TRUSTLEVEL_FORMAT" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success GPG 'show unknown signature with custom format' '
+       cat >expect <<-\EOF &&
+       E
+       13B6F51ECDDE430D
+
+
+
+       EOF
+       GNUPGHOME="$GNUPGHOME_NOT_USED" git for-each-ref \
+               refs/tags/sixth-signed --format="$GRADE_FORMAT" >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success GPG 'show lack of signature with custom format' '
+       cat >expect <<-\EOF &&
+       N
+
+
+
+
+       EOF
+       git for-each-ref refs/tags/seventh-unsigned \
+               --format="$GRADE_FORMAT" >actual &&
+       test_cmp expect actual
+'
+
 test_done
index 1ce5f490e99d374e039d29e708ee98dfb8988eab..af223e44d679571b3148d265ebb09049275cef3a 100755 (executable)
@@ -45,6 +45,8 @@ test_expect_success 'check signed tags with --points-at' '
        sed -e "s/Z$//" >expect <<-\EOF &&
        refs/heads/side Z
        refs/tags/annotated-tag four
+       refs/tags/doubly-annotated-tag An annotated tag
+       refs/tags/doubly-signed-tag A signed tag
        refs/tags/four Z
        refs/tags/signed-tag four
        EOF
index 5e4e4dd6d9e6b967f8c1d94fe7ce1a79c787a177..9677180a5b3392da63ab32f4462c5ec89a9958f3 100755 (executable)
@@ -56,6 +56,12 @@ test_expect_success setup '
        ) >"$ours+"
        cat "$ours+" >"$ours"
        rm -f "$ours+"
+
+       if test -f ./please-abort
+       then
+               echo >>./please-abort killing myself
+               kill -9 $$
+       fi
        exit "$exit"
        EOF
        chmod +x ./custom-merge
@@ -162,6 +168,23 @@ test_expect_success 'custom merge backend' '
        rm -f $o $a $b
 '
 
+test_expect_success !WINDOWS 'custom merge driver that is killed with a signal' '
+       test_when_finished "rm -f output please-abort" &&
+
+       git reset --hard anchor &&
+       git config --replace-all \
+       merge.custom.driver "./custom-merge %O %A %B 0 %P" &&
+       git config --replace-all \
+       merge.custom.name "custom merge driver for testing" &&
+
+       >./please-abort &&
+       echo "* merge=custom" >.gitattributes &&
+       test_must_fail git merge main &&
+       git ls-files -u >output &&
+       git diff --name-only HEAD >>output &&
+       test_must_be_empty output
+'
+
 test_expect_success 'up-to-date merge without common ancestor' '
        git init repo1 &&
        git init repo2 &&
index d9acb639512ae6bdf30c8bdd4a0b4d498541dd84..69509d0c11db655a12fc6ed20215ed25976c46eb 100755 (executable)
@@ -210,90 +210,95 @@ prepare_cruft_history () {
        git reset HEAD^^
 }
 
-assert_cruft_packs () {
-       find .git/objects/pack -name "*.mtimes" >mtimes &&
-       sed -e 's/\.mtimes$/\.pack/g' mtimes >packs &&
-
-       test_file_not_empty packs &&
-       while read pack
-       do
-               test_path_is_file "$pack" || return 1
-       done <packs
-}
-
 assert_no_cruft_packs () {
        find .git/objects/pack -name "*.mtimes" >mtimes &&
        test_must_be_empty mtimes
 }
 
-test_expect_success 'gc --cruft generates a cruft pack' '
-       test_when_finished "rm -fr crufts" &&
-       git init crufts &&
+for argv in \
+       "gc" \
+       "-c gc.cruftPacks=true gc" \
+       "-c gc.cruftPacks=false gc --cruft"
+do
+       test_expect_success "git $argv generates a cruft pack" '
+               test_when_finished "rm -fr repo" &&
+               git init repo &&
+               (
+                       cd repo &&
+
+                       prepare_cruft_history &&
+                       git $argv &&
+
+                       find .git/objects/pack -name "*.mtimes" >mtimes &&
+                       sed -e 's/\.mtimes$/\.pack/g' mtimes >packs &&
+
+                       test_file_not_empty packs &&
+                       while read pack
+                       do
+                               test_path_is_file "$pack" || return 1
+                       done <packs
+               )
+       '
+done
+
+for argv in \
+       "gc --no-cruft" \
+       "-c gc.cruftPacks=false gc" \
+       "-c gc.cruftPacks=true gc --no-cruft"
+do
+       test_expect_success "git $argv does not generate a cruft pack" '
+               test_when_finished "rm -fr repo" &&
+               git init repo &&
+               (
+                       cd repo &&
+
+                       prepare_cruft_history &&
+                       git $argv &&
+
+                       assert_no_cruft_packs
+               )
+       '
+done
+
+test_expect_success '--keep-largest-pack ignores cruft packs' '
+       test_when_finished "rm -fr repo" &&
+       git init repo &&
        (
-               cd crufts &&
+               cd repo &&
 
+               # Generate a pack for reachable objects (of which there
+               # are 3), and one for unreachable objects (of which
+               # there are 6).
                prepare_cruft_history &&
                git gc --cruft &&
-               assert_cruft_packs
-       )
-'
-
-test_expect_success 'gc.cruftPacks=true generates a cruft pack' '
-       test_when_finished "rm -fr crufts" &&
-       git init crufts &&
-       (
-               cd crufts &&
-
-               prepare_cruft_history &&
-               git -c gc.cruftPacks=true gc &&
-               assert_cruft_packs
-       )
-'
-
-test_expect_success 'feature.experimental=true generates a cruft pack' '
-       git init crufts &&
-       test_when_finished "rm -fr crufts" &&
-       (
-               cd crufts &&
 
-               prepare_cruft_history &&
-               git -c feature.experimental=true gc &&
-               assert_cruft_packs
-       )
-'
+               mtimes="$(find .git/objects/pack -type f -name "pack-*.mtimes")" &&
+               sz="$(test_file_size "${mtimes%.mtimes}.pack")" &&
 
-test_expect_success 'feature.experimental=false allows explicit cruft packs' '
-       git init crufts &&
-       test_when_finished "rm -fr crufts" &&
-       (
-               cd crufts &&
+               # Ensure that the cruft pack gets removed (due to
+               # `--prune=now`) despite it being the largest pack.
+               git -c gc.bigPackThreshold=$sz gc --cruft --prune=now &&
 
-               prepare_cruft_history &&
-               git -c gc.cruftPacks=true -c feature.experimental=false gc &&
-               assert_cruft_packs
+               assert_no_cruft_packs
        )
 '
 
-test_expect_success 'feature.experimental=true can be overridden' '
-       git init crufts &&
-       test_when_finished "rm -fr crufts" &&
+test_expect_success 'gc.bigPackThreshold ignores cruft packs' '
+       test_when_finished "rm -fr repo" &&
+       git init repo &&
        (
-               cd crufts &&
+               cd repo &&
 
+               # Generate a pack for reachable objects (of which there
+               # are 3), and one for unreachable objects (of which
+               # there are 6).
                prepare_cruft_history &&
-               git -c feature.expiremental=true -c gc.cruftPacks=false gc &&
-               assert_no_cruft_packs
-       )
-'
+               git gc --cruft &&
 
-test_expect_success 'feature.experimental=false avoids cruft packs by default' '
-       git init crufts &&
-       test_when_finished "rm -fr crufts" &&
-       (
-               cd crufts &&
+               # Ensure that the cruft pack gets removed (due to
+               # `--prune=now`) despite it being the largest pack.
+               git gc --cruft --prune=now --keep-largest-pack &&
 
-               prepare_cruft_history &&
-               git -c feature.experimental=false gc &&
                assert_no_cruft_packs
        )
 '
index 3968b47ed53b7e55eab26fdf8e34aa1472a1bf78..4521508b83a6560e6d025dca1750838f083fdc89 100755 (executable)
@@ -101,7 +101,7 @@ do
        '
 
        test_expect_success "simultaneous gc ($title)" '
-               git gc --prune=12.hours.ago
+               git gc --no-cruft --prune=12.hours.ago
        '
 
        test_expect_success "finish writing out commit ($title)" '
@@ -131,7 +131,7 @@ do
        '
 
        test_expect_success "simultaneous gc ($title)" '
-               git gc --prune=12.hours.ago
+               git gc --no-cruft --prune=12.hours.ago
        '
 
        # tree should have been refreshed by write-tree
@@ -151,8 +151,8 @@ test_expect_success 'do not complain about existing broken links (commit)' '
        some message
        EOF
        commit=$(git hash-object -t commit -w broken-commit) &&
-       git gc -q 2>stderr &&
-       verbose git cat-file -e $commit &&
+       git gc --no-cruft -q 2>stderr &&
+       git cat-file -e $commit &&
        test_must_be_empty stderr
 '
 
@@ -161,7 +161,7 @@ test_expect_success 'do not complain about existing broken links (tree)' '
        100644 blob $(test_oid 003)     foo
        EOF
        tree=$(git mktree --missing <broken-tree) &&
-       git gc -q 2>stderr &&
+       git gc --no-cruft -q 2>stderr &&
        git cat-file -e $tree &&
        test_must_be_empty stderr
 '
@@ -176,7 +176,7 @@ test_expect_success 'do not complain about existing broken links (tag)' '
        this is a broken tag
        EOF
        tag=$(git hash-object -t tag -w broken-tag) &&
-       git gc -q 2>stderr &&
+       git gc --no-cruft -q 2>stderr &&
        git cat-file -e $tag &&
        test_must_be_empty stderr
 '
index d72cef88264ec3dff713b12253df7a6dd5a4724e..f136ea76f7f8a04c7b2b9c5dbf38ca1a50260819 100755 (executable)
@@ -4,6 +4,10 @@ test_description='git mv in subdirs'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-diff-data.sh
 
+index_at_path () {
+       git ls-files --format='%(objectmode) %(objectname) %(stage)' "$@"
+}
+
 test_expect_success 'mv -f refreshes updated index entry' '
        echo test >bar &&
        git add bar &&
@@ -170,6 +174,13 @@ test_expect_success 'do not move directory over existing directory' '
        test_must_fail git mv path2 path0
 '
 
+test_expect_success 'rename directory to non-existing directory' '
+       mkdir dir-a &&
+       >dir-a/f &&
+       git add dir-a &&
+       git mv dir-a non-existing-dir
+'
+
 test_expect_success 'move into "."' '
        git mv path1/path2/ .
 '
@@ -187,7 +198,8 @@ test_expect_success "Michael Cassar's test case" '
        git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf &&
 
        T=$(git write-tree) &&
-       git ls-tree -r $T | verbose grep partA/outline.txt
+       git ls-tree -r $T >out &&
+       grep partA/outline.txt out
 '
 
 rm -fr papers partA path?
@@ -260,12 +272,12 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
        git init &&
        echo 1 >dirty &&
        git add dirty &&
-       entry="$(git ls-files --stage dirty | cut -f 1)" &&
+       entry="$(index_at_path dirty)" &&
        git mv dirty dirty2 &&
-       test "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" &&
+       test "$entry" = "$(index_at_path dirty2)" &&
        echo 2 >dirty2 &&
        git mv dirty2 dirty &&
-       test "$entry" = "$(git ls-files --stage dirty | cut -f 1)"
+       test "$entry" = "$(index_at_path dirty)"
 '
 
 rm -f dirty dirty2
@@ -342,7 +354,7 @@ test_expect_success 'git mv cannot move a submodule in a file' '
 '
 
 test_expect_success 'git mv moves a submodule with a .git directory and no .gitmodules' '
-       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       entry="$(index_at_path sub)" &&
        git rm .gitmodules &&
        (
                cd sub &&
@@ -353,7 +365,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
        mkdir mod &&
        git mv sub mod/sub &&
        test_path_is_missing sub &&
-       test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+       test "$entry" = "$(index_at_path mod/sub)" &&
        git -C mod/sub status &&
        git update-index --refresh &&
        git diff-files --quiet
@@ -363,7 +375,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
        rm -rf mod &&
        git reset --hard &&
        git submodule update &&
-       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       entry="$(index_at_path sub)" &&
        (
                cd sub &&
                rm -f .git &&
@@ -373,7 +385,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
        mkdir mod &&
        git mv sub mod/sub &&
        test_path_is_missing sub &&
-       test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+       test "$entry" = "$(index_at_path mod/sub)" &&
        git -C mod/sub status &&
        echo mod/sub >expected &&
        git config -f .gitmodules submodule.sub.path >actual &&
@@ -386,11 +398,11 @@ test_expect_success 'git mv moves a submodule with gitfile' '
        rm -rf mod &&
        git reset --hard &&
        git submodule update &&
-       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       entry="$(index_at_path sub)" &&
        mkdir mod &&
        git -C mod mv ../sub/ . &&
        test_path_is_missing sub &&
-       test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+       test "$entry" = "$(index_at_path mod/sub)" &&
        git -C mod/sub status &&
        echo mod/sub >expected &&
        git config -f .gitmodules submodule.sub.path >actual &&
@@ -404,12 +416,12 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '
        git reset --hard &&
        git submodule update &&
        git rm .gitmodules &&
-       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       entry="$(index_at_path sub)" &&
        mkdir mod &&
        git mv sub mod/sub 2>actual.err &&
        test_must_be_empty actual.err &&
        test_path_is_missing sub &&
-       test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+       test "$entry" = "$(index_at_path mod/sub)" &&
        git -C mod/sub status &&
        git update-index --refresh &&
        git diff-files --quiet
@@ -420,7 +432,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta
        git reset --hard &&
        git submodule update &&
        git config -f .gitmodules foo.bar true &&
-       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       entry="$(index_at_path sub)" &&
        mkdir mod &&
        test_must_fail git mv sub mod/sub 2>actual.err &&
        test_file_not_empty actual.err &&
@@ -430,7 +442,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta
        git mv sub mod/sub 2>actual.err &&
        test_must_be_empty actual.err &&
        test_path_is_missing sub &&
-       test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+       test "$entry" = "$(index_at_path mod/sub)" &&
        git -C mod/sub status &&
        git update-index --refresh &&
        git diff-files --quiet
@@ -442,13 +454,13 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule
        git submodule update &&
        git config -f .gitmodules --remove-section submodule.sub &&
        git add .gitmodules &&
-       entry="$(git ls-files --stage sub | cut -f 1)" &&
+       entry="$(index_at_path sub)" &&
        echo "warning: Could not find section in .gitmodules where path=sub" >expect.err &&
        mkdir mod &&
        git mv sub mod/sub 2>actual.err &&
        test_cmp expect.err actual.err &&
        test_path_is_missing sub &&
-       test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
+       test "$entry" = "$(index_at_path mod/sub)" &&
        git -C mod/sub status &&
        git update-index --refresh &&
        git diff-files --quiet
index 0fe6ba93a29f996e7f473fe2fa708956a46d059b..e689db429292e60162d4f8f89905cc8489d7a3e0 100755 (executable)
@@ -2188,4 +2188,23 @@ test_expect_success 'Does --[no-]contains stop at commits? Yes!' '
        test_cmp expected actual
 '
 
+test_expect_success 'If tag is created then tag message file is unlinked' '
+       test_when_finished "git tag -d foo" &&
+       write_script fakeeditor <<-\EOF &&
+       echo Message >.git/TAG_EDITMSG
+       EOF
+       GIT_EDITOR=./fakeeditor git tag -a foo &&
+       test_path_is_missing .git/TAG_EDITMSG
+'
+
+test_expect_success 'If tag cannot be created then tag message file is not unlinked' '
+       test_when_finished "git tag -d foo/bar && rm .git/TAG_EDITMSG" &&
+       write_script fakeeditor <<-\EOF &&
+       echo Message >.git/TAG_EDITMSG
+       EOF
+       git tag foo/bar &&
+       test_must_fail env GIT_EDITOR=./fakeeditor git tag -a foo &&
+       test_path_exists .git/TAG_EDITMSG
+'
+
 test_done
index 638bb04e217600387fdf3f46fb8ba1caacba0f94..89cf98b30c8f96335180bccfe7fe07b7156febc9 100755 (executable)
@@ -10,57 +10,57 @@ TEST_PASSES_SANITIZE_LEAK=true
 . "$TEST_DIRECTORY"/lib-diff-data.sh
 
 test_expect_success 'creating initial files' '
-     mkdir path0 &&
-     COPYING_test_data >path0/COPYING &&
-     git add path0/COPYING &&
-     git commit -m add -a
+       mkdir path0 &&
+       COPYING_test_data >path0/COPYING &&
+       git add path0/COPYING &&
+       git commit -m add -a
 '
 
 test_expect_success 'creating second files' '
-     mkdir path1 &&
-     mkdir path1/path2 &&
-     COPYING_test_data >path1/path2/COPYING &&
-     COPYING_test_data >path1/COPYING &&
-     COPYING_test_data >COPYING &&
-     COPYING_test_data >path0/COPYING-TOO &&
-     git add path1/path2/COPYING &&
-     git add path1/COPYING &&
-     git add COPYING &&
-     git add path0/COPYING-TOO &&
-     git commit -m change -a
+       mkdir path1 &&
+       mkdir path1/path2 &&
+       COPYING_test_data >path1/path2/COPYING &&
+       COPYING_test_data >path1/COPYING &&
+       COPYING_test_data >COPYING &&
+       COPYING_test_data >path0/COPYING-TOO &&
+       git add path1/path2/COPYING &&
+       git add path1/COPYING &&
+       git add COPYING &&
+       git add path0/COPYING-TOO &&
+       git commit -m change -a
 '
 
 test_expect_success 'resetting tree HEAD^' '
-     git reset --hard HEAD^
+       git reset --hard HEAD^
 '
 
 test_expect_success 'checking initial files exist after rewind' '
-     test -d path0 &&
-     test -f path0/COPYING
+       test -d path0 &&
+       test -f path0/COPYING
 '
 
 test_expect_success 'checking lack of path1/path2/COPYING' '
-    ! test -f path1/path2/COPYING
+       ! test -f path1/path2/COPYING
 '
 
 test_expect_success 'checking lack of path1/COPYING' '
-    ! test -f path1/COPYING
+       ! test -f path1/COPYING
 '
 
 test_expect_success 'checking lack of COPYING' '
-     ! test -f COPYING
+       ! test -f COPYING
 '
 
 test_expect_success 'checking checking lack of path1/COPYING-TOO' '
-     ! test -f path0/COPYING-TOO
+       ! test -f path0/COPYING-TOO
 '
 
 test_expect_success 'checking lack of path1/path2' '
-     ! test -d path1/path2
+       ! test -d path1/path2
 '
 
 test_expect_success 'checking lack of path1' '
-     ! test -d path1
+       ! test -d path1
 '
 
 test_done
index 22477f3a312e4a44b0c3f99ee356d29487ed5399..4287863ae6cab9a67564c9328effd68d2c186ab6 100755 (executable)
@@ -71,6 +71,16 @@ check_changes () {
        done | test_cmp .cat_expect -
 }
 
+# no negated form for various type of resets
+for opt in soft mixed hard merge keep
+do
+       test_expect_success "no 'git reset --no-$opt'" '
+               test_when_finished "rm -f err" &&
+               test_must_fail git reset --no-$opt 2>err &&
+               grep "error: unknown option .no-$opt." err
+       '
+done
+
 test_expect_success 'reset --hard message' '
        hex=$(git log -1 --format="%h") &&
        git reset --hard >.actual &&
index eb881be95b615f53867dbe8f56c6b0f9cc7a9d3c..772480a345ffa0703432e070e5e85ec56a322c00 100755 (executable)
@@ -9,17 +9,17 @@ TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
-    printf "line %d\n" 1 2 3 >file1 &&
-    cat file1 >file2 &&
-    git add file1 file2 &&
-    test_tick &&
-    git commit -m "Initial commit" &&
-    git tag initial &&
-    echo line 4 >>file1 &&
-    cat file1 >file2 &&
-    test_tick &&
-    git commit -m "add line 4 to file1" file1 &&
-    git tag second
+       printf "line %d\n" 1 2 3 >file1 &&
+       cat file1 >file2 &&
+       git add file1 file2 &&
+       test_tick &&
+       git commit -m "Initial commit" &&
+       git tag initial &&
+       echo line 4 >>file1 &&
+       cat file1 >file2 &&
+       test_tick &&
+       git commit -m "add line 4 to file1" file1 &&
+       git tag second
 '
 
 # The next test will test the following:
@@ -29,19 +29,19 @@ test_expect_success setup '
 # file1:     C       C     C    D     --merge  D       D     D
 # file2:     C       D     D    D     --merge  C       D     D
 test_expect_success 'reset --merge is ok with changes in file it does not touch' '
-    git reset --merge HEAD^ &&
-    ! grep 4 file1 &&
-    grep 4 file2 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
-    test -z "$(git diff --cached)"
+       git reset --merge HEAD^ &&
+       ! grep 4 file1 &&
+       grep 4 file2 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+       test -z "$(git diff --cached)"
 '
 
 test_expect_success 'reset --merge is ok when switching back' '
-    git reset --merge second &&
-    grep 4 file1 &&
-    grep 4 file2 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
-    test -z "$(git diff --cached)"
+       git reset --merge second &&
+       grep 4 file1 &&
+       grep 4 file2 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+       test -z "$(git diff --cached)"
 '
 
 # The next test will test the following:
@@ -51,21 +51,21 @@ test_expect_success 'reset --merge is ok when switching back' '
 # file1:     C       C     C    D     --keep   D       D     D
 # file2:     C       D     D    D     --keep   C       D     D
 test_expect_success 'reset --keep is ok with changes in file it does not touch' '
-    git reset --hard second &&
-    cat file1 >file2 &&
-    git reset --keep HEAD^ &&
-    ! grep 4 file1 &&
-    grep 4 file2 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
-    test -z "$(git diff --cached)"
+       git reset --hard second &&
+       cat file1 >file2 &&
+       git reset --keep HEAD^ &&
+       ! grep 4 file1 &&
+       grep 4 file2 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+       test -z "$(git diff --cached)"
 '
 
 test_expect_success 'reset --keep is ok when switching back' '
-    git reset --keep second &&
-    grep 4 file1 &&
-    grep 4 file2 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
-    test -z "$(git diff --cached)"
+       git reset --keep second &&
+       grep 4 file1 &&
+       grep 4 file2 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+       test -z "$(git diff --cached)"
 '
 
 # The next test will test the following:
@@ -75,28 +75,28 @@ test_expect_success 'reset --keep is ok when switching back' '
 # file1:     B       B     C    D     --merge  D       D     D
 # file2:     C       D     D    D     --merge  C       D     D
 test_expect_success 'reset --merge discards changes added to index (1)' '
-    git reset --hard second &&
-    cat file1 >file2 &&
-    echo "line 5" >> file1 &&
-    git add file1 &&
-    git reset --merge HEAD^ &&
-    ! grep 4 file1 &&
-    ! grep 5 file1 &&
-    grep 4 file2 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
-    test -z "$(git diff --cached)"
+       git reset --hard second &&
+       cat file1 >file2 &&
+       echo "line 5" >> file1 &&
+       git add file1 &&
+       git reset --merge HEAD^ &&
+       ! grep 4 file1 &&
+       ! grep 5 file1 &&
+       grep 4 file2 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+       test -z "$(git diff --cached)"
 '
 
 test_expect_success 'reset --merge is ok again when switching back (1)' '
-    git reset --hard initial &&
-    echo "line 5" >> file2 &&
-    git add file2 &&
-    git reset --merge second &&
-    ! grep 4 file2 &&
-    ! grep 5 file1 &&
-    grep 4 file1 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
-    test -z "$(git diff --cached)"
+       git reset --hard initial &&
+       echo "line 5" >> file2 &&
+       git add file2 &&
+       git reset --merge second &&
+       ! grep 4 file2 &&
+       ! grep 5 file1 &&
+       grep 4 file1 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+       test -z "$(git diff --cached)"
 '
 
 # The next test will test the following:
@@ -105,10 +105,10 @@ test_expect_success 'reset --merge is ok again when switching back (1)' '
 #           ----------------------------------------------------
 # file1:     B       B     C    D     --keep   (disallowed)
 test_expect_success 'reset --keep fails with changes in index in files it touches' '
-    git reset --hard second &&
-    echo "line 5" >> file1 &&
-    git add file1 &&
-    test_must_fail git reset --keep HEAD^
+       git reset --hard second &&
+       echo "line 5" >> file1 &&
+       git add file1 &&
+       test_must_fail git reset --keep HEAD^
 '
 
 # The next test will test the following:
@@ -118,23 +118,23 @@ test_expect_success 'reset --keep fails with changes in index in files it touche
 # file1:     C       C     C    D     --merge  D       D     D
 # file2:     C       C     D    D     --merge  D       D     D
 test_expect_success 'reset --merge discards changes added to index (2)' '
-    git reset --hard second &&
-    echo "line 4" >> file2 &&
-    git add file2 &&
-    git reset --merge HEAD^ &&
-    ! grep 4 file2 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
-    test -z "$(git diff)" &&
-    test -z "$(git diff --cached)"
+       git reset --hard second &&
+       echo "line 4" >> file2 &&
+       git add file2 &&
+       git reset --merge HEAD^ &&
+       ! grep 4 file2 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+       test -z "$(git diff)" &&
+       test -z "$(git diff --cached)"
 '
 
 test_expect_success 'reset --merge is ok again when switching back (2)' '
-    git reset --hard initial &&
-    git reset --merge second &&
-    ! grep 4 file2 &&
-    grep 4 file1 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
-    test -z "$(git diff --cached)"
+       git reset --hard initial &&
+       git reset --merge second &&
+       ! grep 4 file2 &&
+       grep 4 file1 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+       test -z "$(git diff --cached)"
 '
 
 # The next test will test the following:
@@ -144,21 +144,21 @@ test_expect_success 'reset --merge is ok again when switching back (2)' '
 # file1:     C       C     C    D     --keep   D       D     D
 # file2:     C       C     D    D     --keep   C       D     D
 test_expect_success 'reset --keep keeps changes it does not touch' '
-    git reset --hard second &&
-    echo "line 4" >> file2 &&
-    git add file2 &&
-    git reset --keep HEAD^ &&
-    grep 4 file2 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
-    test -z "$(git diff --cached)"
+       git reset --hard second &&
+       echo "line 4" >> file2 &&
+       git add file2 &&
+       git reset --keep HEAD^ &&
+       grep 4 file2 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse initial)" &&
+       test -z "$(git diff --cached)"
 '
 
 test_expect_success 'reset --keep keeps changes when switching back' '
-    git reset --keep second &&
-    grep 4 file2 &&
-    grep 4 file1 &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
-    test -z "$(git diff --cached)"
+       git reset --keep second &&
+       grep 4 file2 &&
+       grep 4 file1 &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+       test -z "$(git diff --cached)"
 '
 
 # The next test will test the following:
@@ -167,14 +167,14 @@ test_expect_success 'reset --keep keeps changes when switching back' '
 #           ----------------------------------------------------
 # file1:     A       B     B    C     --merge  (disallowed)
 test_expect_success 'reset --merge fails with changes in file it touches' '
-    git reset --hard second &&
-    echo "line 5" >> file1 &&
-    test_tick &&
-    git commit -m "add line 5" file1 &&
-    sed -e "s/line 1/changed line 1/" <file1 >file3 &&
-    mv file3 file1 &&
-    test_must_fail git reset --merge HEAD^ 2>err.log &&
-    grep file1 err.log | grep "not uptodate"
+       git reset --hard second &&
+       echo "line 5" >> file1 &&
+       test_tick &&
+       git commit -m "add line 5" file1 &&
+       sed -e "s/line 1/changed line 1/" <file1 >file3 &&
+       mv file3 file1 &&
+       test_must_fail git reset --merge HEAD^ 2>err.log &&
+       grep file1 err.log | grep "not uptodate"
 '
 
 # The next test will test the following:
@@ -183,36 +183,36 @@ test_expect_success 'reset --merge fails with changes in file it touches' '
 #           ----------------------------------------------------
 # file1:     A       B     B    C     --keep   (disallowed)
 test_expect_success 'reset --keep fails with changes in file it touches' '
-    git reset --hard second &&
-    echo "line 5" >> file1 &&
-    test_tick &&
-    git commit -m "add line 5" file1 &&
-    sed -e "s/line 1/changed line 1/" <file1 >file3 &&
-    mv file3 file1 &&
-    test_must_fail git reset --keep HEAD^ 2>err.log &&
-    grep file1 err.log | grep "not uptodate"
+       git reset --hard second &&
+       echo "line 5" >> file1 &&
+       test_tick &&
+       git commit -m "add line 5" file1 &&
+       sed -e "s/line 1/changed line 1/" <file1 >file3 &&
+       mv file3 file1 &&
+       test_must_fail git reset --keep HEAD^ 2>err.log &&
+       grep file1 err.log | grep "not uptodate"
 '
 
 test_expect_success 'setup 3 different branches' '
-    git reset --hard second &&
-    git branch branch1 &&
-    git branch branch2 &&
-    git branch branch3 &&
-    git checkout branch1 &&
-    echo "line 5 in branch1" >> file1 &&
-    test_tick &&
-    git commit -a -m "change in branch1" &&
-    git checkout branch2 &&
-    echo "line 5 in branch2" >> file1 &&
-    test_tick &&
-    git commit -a -m "change in branch2" &&
-    git tag third &&
-    git checkout branch3 &&
-    echo a new file >file3 &&
-    rm -f file1 &&
-    git add file3 &&
-    test_tick &&
-    git commit -a -m "change in branch3"
+       git reset --hard second &&
+       git branch branch1 &&
+       git branch branch2 &&
+       git branch branch3 &&
+       git checkout branch1 &&
+       echo "line 5 in branch1" >> file1 &&
+       test_tick &&
+       git commit -a -m "change in branch1" &&
+       git checkout branch2 &&
+       echo "line 5 in branch2" >> file1 &&
+       test_tick &&
+       git commit -a -m "change in branch2" &&
+       git tag third &&
+       git checkout branch3 &&
+       echo a new file >file3 &&
+       rm -f file1 &&
+       git add file3 &&
+       test_tick &&
+       git commit -a -m "change in branch3"
 '
 
 # The next test will test the following:
@@ -221,12 +221,12 @@ test_expect_success 'setup 3 different branches' '
 #           ----------------------------------------------------
 # file1:     X       U     B    C     --merge  C       C     C
 test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
-    git checkout third &&
-    test_must_fail git merge branch1 &&
-    git reset --merge HEAD^ &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
-    test -z "$(git diff --cached)" &&
-    test -z "$(git diff)"
+       git checkout third &&
+       test_must_fail git merge branch1 &&
+       git reset --merge HEAD^ &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse second)" &&
+       test -z "$(git diff --cached)" &&
+       test -z "$(git diff)"
 '
 
 # The next test will test the following:
@@ -235,10 +235,10 @@ test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
 #           ----------------------------------------------------
 # file1:     X       U     B    C     --keep   (disallowed)
 test_expect_success '"reset --keep HEAD^" fails with pending merge' '
-    git reset --hard third &&
-    test_must_fail git merge branch1 &&
-    test_must_fail git reset --keep HEAD^ 2>err.log &&
-    test_i18ngrep "middle of a merge" err.log
+       git reset --hard third &&
+       test_must_fail git merge branch1 &&
+       test_must_fail git reset --keep HEAD^ 2>err.log &&
+       test_i18ngrep "middle of a merge" err.log
 '
 
 # The next test will test the following:
@@ -247,12 +247,12 @@ test_expect_success '"reset --keep HEAD^" fails with pending merge' '
 #           ----------------------------------------------------
 # file1:     X       U     B    B     --merge  B       B     B
 test_expect_success '"reset --merge HEAD" is ok with pending merge' '
-    git reset --hard third &&
-    test_must_fail git merge branch1 &&
-    git reset --merge HEAD &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse third)" &&
-    test -z "$(git diff --cached)" &&
-    test -z "$(git diff)"
+       git reset --hard third &&
+       test_must_fail git merge branch1 &&
+       git reset --merge HEAD &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse third)" &&
+       test -z "$(git diff --cached)" &&
+       test -z "$(git diff)"
 '
 
 # The next test will test the following:
@@ -261,36 +261,36 @@ test_expect_success '"reset --merge HEAD" is ok with pending merge' '
 #           ----------------------------------------------------
 # file1:     X       U     B    B     --keep   (disallowed)
 test_expect_success '"reset --keep HEAD" fails with pending merge' '
-    git reset --hard third &&
-    test_must_fail git merge branch1 &&
-    test_must_fail git reset --keep HEAD 2>err.log &&
-    test_i18ngrep "middle of a merge" err.log
+       git reset --hard third &&
+       test_must_fail git merge branch1 &&
+       test_must_fail git reset --keep HEAD 2>err.log &&
+       test_i18ngrep "middle of a merge" err.log
 '
 
 test_expect_success '--merge is ok with added/deleted merge' '
-    git reset --hard third &&
-    rm -f file2 &&
-    test_must_fail git merge branch3 &&
-    ! test -f file2 &&
-    test -f file3 &&
-    git diff --exit-code file3 &&
-    git diff --exit-code branch3 file3 &&
-    git reset --merge HEAD &&
-    ! test -f file3 &&
-    ! test -f file2 &&
-    git diff --exit-code --cached
+       git reset --hard third &&
+       rm -f file2 &&
+       test_must_fail git merge branch3 &&
+       ! test -f file2 &&
+       test -f file3 &&
+       git diff --exit-code file3 &&
+       git diff --exit-code branch3 file3 &&
+       git reset --merge HEAD &&
+       ! test -f file3 &&
+       ! test -f file2 &&
+       git diff --exit-code --cached
 '
 
 test_expect_success '--keep fails with added/deleted merge' '
-    git reset --hard third &&
-    rm -f file2 &&
-    test_must_fail git merge branch3 &&
-    ! test -f file2 &&
-    test -f file3 &&
-    git diff --exit-code file3 &&
-    git diff --exit-code branch3 file3 &&
-    test_must_fail git reset --keep HEAD 2>err.log &&
-    test_i18ngrep "middle of a merge" err.log
+       git reset --hard third &&
+       rm -f file2 &&
+       test_must_fail git merge branch3 &&
+       ! test -f file2 &&
+       test -f file3 &&
+       git diff --exit-code file3 &&
+       git diff --exit-code branch3 file3 &&
+       test_must_fail git reset --keep HEAD 2>err.log &&
+       test_i18ngrep "middle of a merge" err.log
 '
 
 test_done
index 78f25c1c7ead9820ed647711e4749d7e9d444c52..01b7c3503ca882cd292f2eef252a977ac5dcc183 100755 (executable)
@@ -10,9 +10,9 @@ TEST_PASSES_SANITIZE_LEAK=true
 
 
 test_expect_success 'creating initial commits' '
-    test_commit E file1 &&
-    test_commit D file1 &&
-    test_commit C file1
+       test_commit E file1 &&
+       test_commit D file1 &&
+       test_commit C file1
 '
 
 while read W1 I1 H1 T opt W2 I2 H2
@@ -74,13 +74,13 @@ B C C C keep   B C C
 EOF
 
 test_expect_success 'setting up branches to test with unmerged entries' '
-    git reset --hard C &&
-    git branch branch1 &&
-    git branch branch2 &&
-    git checkout branch1 &&
-    test_commit B1 file1 &&
-    git checkout branch2 &&
-    test_commit B file1
+       git reset --hard C &&
+       git branch branch1 &&
+       git branch branch2 &&
+       git checkout branch1 &&
+       test_commit B1 file1 &&
+       git checkout branch2 &&
+       test_commit B file1
 '
 
 while read W1 I1 H1 T opt W2 I2 H2
index 61ad47b0c18d231c60327acda04348895947809c..35b9e6ed6b5ba337d9fb4603281500656313ed1d 100755 (executable)
@@ -372,75 +372,75 @@ test_expect_success 'checkout specific path while in subdirectory' '
 '
 
 test_expect_success 'checkout w/--track sets up tracking' '
-    git config branch.autosetupmerge false &&
-    git checkout main &&
-    git checkout --track -b track1 &&
-    test "$(git config branch.track1.remote)" &&
-    test "$(git config branch.track1.merge)"
+       git config branch.autosetupmerge false &&
+       git checkout main &&
+       git checkout --track -b track1 &&
+       test "$(git config branch.track1.remote)" &&
+       test "$(git config branch.track1.merge)"
 '
 
 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 main &&
-    git checkout -b track2 &&
-    test "$(git config branch.track2.remote)" &&
-    test "$(git config branch.track2.merge)"
+       test_when_finished git config branch.autosetupmerge false &&
+       git config branch.autosetupmerge always &&
+       git checkout main &&
+       git checkout -b track2 &&
+       test "$(git config branch.track2.remote)" &&
+       test "$(git config branch.track2.merge)"
 '
 
 test_expect_success 'checkout w/--track from non-branch HEAD fails' '
-    git checkout main^0 &&
-    test_must_fail git symbolic-ref HEAD &&
-    test_must_fail git checkout --track -b track &&
-    test_must_fail git rev-parse --verify track &&
-    test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
+       git checkout main^0 &&
+       test_must_fail git symbolic-ref HEAD &&
+       test_must_fail git checkout --track -b track &&
+       test_must_fail git rev-parse --verify track &&
+       test_must_fail git symbolic-ref HEAD &&
+       test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'checkout w/--track from tag fails' '
-    git checkout main^0 &&
-    test_must_fail git symbolic-ref HEAD &&
-    test_must_fail git checkout --track -b track frotz &&
-    test_must_fail git rev-parse --verify track &&
-    test_must_fail git symbolic-ref HEAD &&
-    test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
+       git checkout main^0 &&
+       test_must_fail git symbolic-ref HEAD &&
+       test_must_fail git checkout --track -b track frotz &&
+       test_must_fail git rev-parse --verify track &&
+       test_must_fail git symbolic-ref HEAD &&
+       test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
 test_expect_success 'detach a symbolic link HEAD' '
-    git checkout main &&
-    git config --bool core.prefersymlinkrefs yes &&
-    git checkout side &&
-    git checkout main &&
-    it=$(git symbolic-ref HEAD) &&
-    test "z$it" = zrefs/heads/main &&
-    here=$(git rev-parse --verify refs/heads/main) &&
-    git checkout side^ &&
-    test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
+       git checkout main &&
+       git config --bool core.prefersymlinkrefs yes &&
+       git checkout side &&
+       git checkout main &&
+       it=$(git symbolic-ref HEAD) &&
+       test "z$it" = zrefs/heads/main &&
+       here=$(git rev-parse --verify refs/heads/main) &&
+       git checkout side^ &&
+       test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
 '
 
 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 &&
+       git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" &&
+       git update-ref refs/remotes/origin/koala/bear renamer &&
 
-    git checkout --track origin/koala/bear &&
-    test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
+       git checkout --track origin/koala/bear &&
+       test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout main && git branch -D koala/bear &&
+       git checkout main && git branch -D koala/bear &&
 
-    git checkout --track refs/remotes/origin/koala/bear &&
-    test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
+       git checkout --track refs/remotes/origin/koala/bear &&
+       test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
 
-    git checkout main && git branch -D koala/bear &&
+       git checkout main && git branch -D koala/bear &&
 
-    git checkout --track remotes/origin/koala/bear &&
-    test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"
+       git checkout --track remotes/origin/koala/bear &&
+       test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
+       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_must_fail git checkout --track renamer
 '
 
 setup_conflicting_index () {
index c975eb54d234d77b2f13df2a96acd4cbefb93865..0ef7b78457368fd8f0e403907e7d582e97e62248 100755 (executable)
@@ -120,7 +120,7 @@ test_expect_success 'git clean with relative prefix' '
                grep part3 |
                sed -n -e "s|^Would remove ||p"
        ) &&
-       verbose test "$would_clean" = ../src/part3.c
+       test "$would_clean" = ../src/part3.c
 '
 
 test_expect_success 'git clean with absolute path' '
@@ -133,7 +133,7 @@ test_expect_success 'git clean with absolute path' '
                grep part3 |
                sed -n -e "s|^Would remove ||p"
        ) &&
-       verbose test "$would_clean" = ../src/part3.c
+       test "$would_clean" = ../src/part3.c
 '
 
 test_expect_success 'git clean with out of work tree relative path' '
index eae6a46ef3d89f2563d5ec69f83dfd2ad6e7829f..d9fbabb2b9d810d0c39cd504d105bcb8ba3e568c 100755 (executable)
@@ -1351,6 +1351,22 @@ test_expect_success 'clone active submodule without submodule url set' '
        )
 '
 
+test_expect_success 'update submodules without url set in .gitconfig' '
+       test_when_finished "rm -rf multisuper_clone" &&
+       git clone file://"$pwd"/multisuper multisuper_clone &&
+
+       git -C multisuper_clone submodule init &&
+       for s in sub0 sub1 sub2 sub3
+       do
+               key=submodule.$s.url &&
+               git -C multisuper_clone config --local --unset $key &&
+               git -C multisuper_clone config --file .gitmodules --unset $key || return 1
+       done &&
+
+       test_must_fail git -C multisuper_clone submodule update 2>err &&
+       grep "cannot clone submodule .sub[0-3]. without a URL" err
+'
+
 test_expect_success 'clone --recurse-submodules with a pathspec works' '
        test_when_finished "rm -rf multisuper_clone" &&
        cat >expected <<-\EOF &&
index f094e3d7f3642de61a69b3d9131e31707654539c..00651c25cb4089a4d7334ad00f6ebc8e51bafb0f 100755 (executable)
@@ -1179,4 +1179,27 @@ test_expect_success 'submodule update --recursive skip submodules with strategy=
        test_cmp expect.err actual.err
 '
 
+add_submodule_commit_and_validate () {
+       HASH=$(git rev-parse HEAD) &&
+       git update-index --add --cacheinfo 160000,$HASH,sub &&
+       git commit -m "create submodule" &&
+       echo "160000 commit $HASH       sub" >expect &&
+       git ls-tree HEAD -- sub >actual &&
+       test_cmp expect actual
+}
+
+test_expect_success 'commit with staged submodule change' '
+       add_submodule_commit_and_validate
+'
+
+test_expect_success 'commit with staged submodule change with ignoreSubmodules dirty' '
+       test_config diff.ignoreSubmodules dirty &&
+       add_submodule_commit_and_validate
+'
+
+test_expect_success 'commit with staged submodule change with ignoreSubmodules all' '
+       test_config diff.ignoreSubmodules all &&
+       add_submodule_commit_and_validate
+'
+
 test_done
index 38a532d81ccd060d7c42e1a3f413bdfeccf4715b..b5bf7de7cd66c781657173bac3074cacb1107bf1 100755 (executable)
@@ -466,6 +466,25 @@ test_expect_success 'commit --trailer with -c and command' '
        test_cmp expected actual
 '
 
+test_expect_success 'commit --trailer not confused by --- separator' '
+       cat >msg <<-\EOF &&
+       subject
+
+       body with dashes
+       ---
+       in it
+       EOF
+       git commit --allow-empty --trailer="my-trailer: value" -F msg &&
+       {
+               cat msg &&
+               echo &&
+               echo "my-trailer: value"
+       } >expected &&
+       git cat-file commit HEAD >commit.msg &&
+       sed -e "1,/^\$/d" commit.msg >actual &&
+       test_cmp expected actual
+'
+
 test_expect_success 'multiple -m' '
 
        >negative &&
index aed07c5b622e9a244313e781ceba0e6898024d21..6928fd89f5d887b2f7a3feb9263b39d77affe9aa 100755 (executable)
@@ -5,6 +5,7 @@
 
 test_description='git status'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-terminal.sh
 
@@ -91,7 +92,7 @@ test_expect_success 'status --column' '
 # On branch main
 # Your branch and '\''upstream'\'' have diverged,
 # and have 1 and 2 different commits each, respectively.
-#   (use "git pull" to merge the remote branch into yours)
+#   (use "git pull" if you want to integrate the remote branch with yours)
 #
 # Changes to be committed:
 #   (use "git restore --staged <file>..." to unstage)
@@ -122,7 +123,7 @@ cat >expect <<\EOF
 # On branch main
 # Your branch and 'upstream' have diverged,
 # and have 1 and 2 different commits each, respectively.
-#   (use "git pull" to merge the remote branch into yours)
+#   (use "git pull" if you want to integrate the remote branch with yours)
 #
 # Changes to be committed:
 #   (use "git restore --staged <file>..." to unstage)
@@ -269,7 +270,7 @@ test_expect_success 'status with gitignore' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -334,7 +335,7 @@ test_expect_success 'status with gitignore (nothing untracked)' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -404,7 +405,7 @@ test_expect_success 'status -uno' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -466,7 +467,7 @@ test_expect_success 'status -unormal' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -521,7 +522,7 @@ test_expect_success 'status -uall' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -581,7 +582,7 @@ test_expect_success 'status with relative paths' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -649,7 +650,7 @@ test_expect_success TTY 'status with color.ui' '
 On branch <GREEN>main<RESET>
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -772,7 +773,7 @@ test_expect_success 'status without relative paths' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -846,7 +847,6 @@ test_expect_success 'dry-run of partial commit excluding new file in index' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -900,7 +900,7 @@ test_expect_success 'status submodule summary is disabled by default' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -957,7 +957,7 @@ test_expect_success 'status submodule summary' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 1 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -1012,11 +1012,11 @@ test_expect_success 'status -s submodule summary' '
 '
 
 test_expect_success 'status submodule summary (clean submodule): commit' '
-       cat >expect <<EOF &&
+       cat >expect-status <<EOF &&
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
@@ -1032,12 +1032,13 @@ Untracked files:
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
+       sed "/git pull/d" expect-status > expect-commit &&
        git commit -m "commit submodule" &&
        git config status.submodulesummary 10 &&
        test_must_fail git commit --dry-run >output &&
-       test_cmp expect output &&
+       test_cmp expect-commit output &&
        git status >output &&
-       test_cmp expect output
+       test_cmp expect-status output
 '
 
 cat >expect <<EOF
@@ -1064,7 +1065,6 @@ test_expect_success 'commit --dry-run submodule summary (--amend)' '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
 
 Changes to be committed:
   (use "git restore --source=HEAD^1 --staged <file>..." to unstage)
@@ -1116,7 +1116,7 @@ test_expect_success '--ignore-submodules=untracked suppresses submodules with un
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -1225,7 +1225,7 @@ test_expect_success "--ignore-submodules=untracked doesn't suppress submodules w
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -1282,7 +1282,7 @@ test_expect_success "--ignore-submodules=untracked doesn't suppress submodule su
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -1363,7 +1363,7 @@ cat > expect << EOF
 ; On branch main
 ; Your branch and 'upstream' have diverged,
 ; and have 2 and 2 different commits each, respectively.
-;   (use "git pull" to merge the remote branch into yours)
+;   (use "git pull" if you want to integrate the remote branch with yours)
 ;
 ; Changes to be committed:
 ;   (use "git restore --staged <file>..." to unstage)
@@ -1411,7 +1411,7 @@ test_expect_success "--ignore-submodules=all suppresses submodule summary" '
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
@@ -1437,7 +1437,7 @@ test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summar
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
+  (use "git pull" if you want to integrate the remote branch with yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
@@ -1519,8 +1519,8 @@ test_expect_success '"status.branch=true" weaker than "--no-branch"' '
 '
 
 test_expect_success '"status.branch=true" weaker than "--porcelain"' '
-       git -c status.branch=true status --porcelain >actual &&
-       test_cmp expected_nobranch actual
+       git -c status.branch=true status --porcelain >actual &&
+       test_cmp expected_nobranch actual
 '
 
 test_expect_success '"status.branch=false" same as "--no-branch"' '
@@ -1557,7 +1557,6 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu
 On branch main
 Your branch and '\''upstream'\'' have diverged,
 and have 2 and 2 different commits each, respectively.
-  (use "git pull" to merge the remote branch into yours)
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
index 48f86cb3678140ba1b0f914da8ebb442abd754b8..0d2dd29fe6a12c20ffbbe169afabd4c31bc6545c 100755 (executable)
@@ -218,87 +218,101 @@ test_expect_success GPG 'amending already signed commit' '
        ! grep "BAD signature from" actual
 '
 
+test_expect_success GPG2 'bare signature' '
+       git verify-commit fifth-signed 2>expect &&
+       echo >>expect &&
+       git log -1 --format="%GG" fifth-signed >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success GPG 'show good signature with custom format' '
        cat >expect <<-\EOF &&
        G
+       ultimate
        13B6F51ECDDE430D
        C O Mitter <committer@example.com>
        73D758744BE721698EC54E8713B6F51ECDDE430D
        73D758744BE721698EC54E8713B6F51ECDDE430D
        EOF
-       git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
+       git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
        test_cmp expect actual
 '
 
 test_expect_success GPG 'show bad signature with custom format' '
        cat >expect <<-\EOF &&
        B
+       undefined
        13B6F51ECDDE430D
        C O Mitter <committer@example.com>
 
 
        EOF
-       git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" $(cat forged1.commit) >actual &&
+       git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" $(cat forged1.commit) >actual &&
        test_cmp expect actual
 '
 
 test_expect_success GPG 'show untrusted signature with custom format' '
        cat >expect <<-\EOF &&
        U
+       undefined
        65A0EEA02E30CAD7
        Eris Discordia <discord@example.net>
        F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
        D4BE22311AD3131E5EDA29A461092E85B7227189
        EOF
-       git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
+       git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
        test_cmp expect actual
 '
 
 test_expect_success GPG 'show untrusted signature with undefined trust level' '
        cat >expect <<-\EOF &&
+       U
        undefined
        65A0EEA02E30CAD7
        Eris Discordia <discord@example.net>
        F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7
        D4BE22311AD3131E5EDA29A461092E85B7227189
        EOF
-       git log -1 --format="%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
+       git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
        test_cmp expect actual
 '
 
 test_expect_success GPG 'show untrusted signature with ultimate trust level' '
        cat >expect <<-\EOF &&
+       G
        ultimate
        13B6F51ECDDE430D
        C O Mitter <committer@example.com>
        73D758744BE721698EC54E8713B6F51ECDDE430D
        73D758744BE721698EC54E8713B6F51ECDDE430D
        EOF
-       git log -1 --format="%GT%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
+       git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual &&
        test_cmp expect actual
 '
 
 test_expect_success GPG 'show unknown signature with custom format' '
        cat >expect <<-\EOF &&
        E
+       undefined
        65A0EEA02E30CAD7
 
 
 
        EOF
-       GNUPGHOME="$GNUPGHOME_NOT_USED" git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
+       GNUPGHOME="$GNUPGHOME_NOT_USED" git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual &&
        test_cmp expect actual
 '
 
 test_expect_success GPG 'show lack of signature with custom format' '
        cat >expect <<-\EOF &&
        N
+       undefined
 
 
 
 
        EOF
-       git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" seventh-unsigned >actual &&
+       git log -1 --format="%G?%n%GT%n%GK%n%GS%n%GF%n%GP" seventh-unsigned >actual &&
        test_cmp expect actual
 '
 
index 2f16d5787edfb16956312a3be70fb9da1ffadc46..c2ab8a444a832513b9365a2a6eca11535e2ec8fe 100755 (executable)
@@ -774,6 +774,28 @@ EOF
        test_cmp expected actual
 '
 
+test_expect_success 'status when cherry-picking multiple commits' '
+       git reset --hard cherry_branch &&
+       test_when_finished "git cherry-pick --abort" &&
+       test_must_fail git cherry-pick cherry_branch_second one_cherry &&
+       TO_CHERRY_PICK=$(git rev-parse --short CHERRY_PICK_HEAD) &&
+       cat >expected <<EOF &&
+On branch cherry_branch
+You are currently cherry-picking commit $TO_CHERRY_PICK.
+  (fix conflicts and run "git cherry-pick --continue")
+  (use "git cherry-pick --skip" to skip this patch)
+  (use "git cherry-pick --abort" to cancel the cherry-pick operation)
+
+Unmerged paths:
+  (use "git add <file>..." to mark resolution)
+       both modified:   main.txt
+
+no changes added to commit (use "git add" and/or "git commit -a")
+EOF
+       git status --untracked-files=no >actual &&
+       test_cmp expected actual
+'
+
 test_expect_success 'status when cherry-picking after committing conflict resolution' '
        git reset --hard cherry_branch &&
        test_when_finished "git cherry-pick --abort" &&
index fffdb6ff2e751d2441e8f805c475a044bfdd0920..9ab2ae2f3b23807b4ee1eb3fcfaf62d9c1fe7bc3 100755 (executable)
@@ -20,10 +20,19 @@ test_expect_success 'empty name and missing email' '
 '
 
 test_expect_success 'commit rejects all-crud name' '
-       test_must_fail env GIT_AUTHOR_NAME=" .;<>" \
+       test_must_fail env GIT_AUTHOR_NAME=" ,;<>" \
                git commit --allow-empty -m foo
 '
 
+test_expect_success 'commit does not strip trailing dot' '
+       author_name="Pat Doe Jr." &&
+       env GIT_AUTHOR_NAME="$author_name" \
+               git commit --allow-empty -m foo &&
+       git log -1 --format=%an >actual &&
+       echo "$author_name" >expected &&
+       test_cmp actual expected
+'
+
 # We must test the actual error message here, as an unwanted
 # auto-detection could fail for other reasons.
 test_expect_success 'empty configured name does not auto-detect' '
index 060e145957f3ad94933b37ebe6148ffbdf168d37..fdc607277c2fca64a573959b2f3ea7f35a8beaae 100755 (executable)
@@ -639,41 +639,41 @@ test_expect_success 'merge log message' '
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c0, c2, c0, and c1' '
-       git reset --hard c1 &&
-       test_tick &&
-       git merge c0 c2 c0 c1 &&
-       verify_merge file result.1-5 &&
-       verify_parents $c1 $c2
+       git reset --hard c1 &&
+       test_tick &&
+       git merge c0 c2 c0 c1 &&
+       verify_merge file result.1-5 &&
+       verify_parents $c1 $c2
 '
 
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c0, c2, c0, and c1' '
-       git reset --hard c1 &&
-       test_tick &&
-       git merge c0 c2 c0 c1 &&
-       verify_merge file result.1-5 &&
-       verify_parents $c1 $c2
+       git reset --hard c1 &&
+       test_tick &&
+       git merge c0 c2 c0 c1 &&
+       verify_merge file result.1-5 &&
+       verify_parents $c1 $c2
 '
 
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge c1 with c1 and c2' '
-       git reset --hard c1 &&
-       test_tick &&
-       git merge c1 c2 &&
-       verify_merge file result.1-5 &&
-       verify_parents $c1 $c2
+       git reset --hard c1 &&
+       test_tick &&
+       git merge c1 c2 &&
+       verify_merge file result.1-5 &&
+       verify_parents $c1 $c2
 '
 
 test_debug 'git log --graph --decorate --oneline --all'
 
 test_expect_success 'merge fast-forward in a dirty tree' '
-       git reset --hard c0 &&
-       mv file file1 &&
-       cat file1 >file &&
-       rm -f file1 &&
-       git merge c2
+       git reset --hard c0 &&
+       mv file file1 &&
+       cat file1 >file &&
+       rm -f file1 &&
+       git merge c2
 '
 
 test_debug 'git log --graph --decorate --oneline --all'
index 4aabe98139a37eb8bc1d2f3e824048dbdd7f9915..27b66807cd82cbb93c4985905a8de7945cc17cbc 100755 (executable)
@@ -10,6 +10,10 @@ test_description='git repack works correctly'
 commit_and_pack () {
        test_commit "$@" 1>&2 &&
        incrpackid=$(git pack-objects --all --unpacked --incremental .git/objects/pack/pack </dev/null) &&
+       # Remove any loose object(s) created by test_commit, since they have
+       # already been packed. Leaving these around can create subtly different
+       # packs with `pack-objects`'s `--unpacked` option.
+       git prune-packed 1>&2 &&
        echo pack-${incrpackid}.pack
 }
 
@@ -106,6 +110,23 @@ test_expect_success SYMLINKS '--local keeps packs when alternate is objectdir '
        test_cmp expect actual
 '
 
+test_expect_success '--local disables writing bitmaps when connected to alternate ODB' '
+       test_when_finished "rm -rf shared member" &&
+
+       git init shared &&
+       git clone --shared shared member &&
+       (
+               cd member &&
+               test_commit "object" &&
+               GIT_TEST_MULTI_PACK_INDEX=0 git repack -Adl --write-bitmap-index 2>err &&
+               cat >expect <<-EOF &&
+               warning: disabling bitmap writing, as some objects are not being packed
+               EOF
+               test_cmp expect err &&
+               test_path_is_missing .git/objects/pack-*.bitmap
+       )
+'
+
 test_expect_success 'packed obs in alt ODB are repacked even when local repo is packless' '
        mkdir alt_objects/pack &&
        mv .git/objects/pack/* alt_objects/pack &&
@@ -192,6 +213,8 @@ test_expect_success 'repack --keep-pack' '
        test_create_repo keep-pack &&
        (
                cd keep-pack &&
+               # avoid producing different packs due to delta/base choices
+               git config pack.window 0 &&
                P1=$(commit_and_pack 1) &&
                P2=$(commit_and_pack 2) &&
                P3=$(commit_and_pack 3) &&
@@ -203,10 +226,61 @@ test_expect_success 'repack --keep-pack' '
                grep -q $P1 new-counts &&
                grep -q $P4 new-counts &&
                test_line_count = 3 new-counts &&
+               git fsck &&
+
+               P5=$(commit_and_pack --no-tag 5) &&
+               git reset --hard HEAD^ &&
+               git reflog expire --all --expire=all &&
+               rm -f ".git/objects/pack/${P5%.pack}.idx" &&
+               rm -f ".git/objects/info/commit-graph" &&
+               for from in $(find .git/objects/pack -type f -name "${P5%.pack}.*")
+               do
+                       to="$(dirname "$from")/.tmp-1234-$(basename "$from")" &&
+                       mv "$from" "$to" || return 1
+               done &&
+
+               # A .idx file without a .pack should not stop us from
+               # repacking what we can.
+               touch .git/objects/pack/pack-does-not-exist.idx &&
+
+               git repack --cruft -d --keep-pack $P1 --keep-pack $P4 &&
+
+               ls .git/objects/pack/*.pack >newer-counts &&
+               test_cmp new-counts newer-counts &&
                git fsck
        )
 '
 
+test_expect_success 'repacking fails when missing .pack actually means missing objects' '
+       test_create_repo idx-without-pack &&
+       (
+               cd idx-without-pack &&
+
+               # Avoid producing different packs due to delta/base choices
+               git config pack.window 0 &&
+               P1=$(commit_and_pack 1) &&
+               P2=$(commit_and_pack 2) &&
+               P3=$(commit_and_pack 3) &&
+               P4=$(commit_and_pack 4) &&
+               ls .git/objects/pack/*.pack >old-counts &&
+               test_line_count = 4 old-counts &&
+
+               # Remove one .pack file
+               rm .git/objects/pack/$P2 &&
+
+               ls .git/objects/pack/*.pack >before-pack-dir &&
+
+               test_must_fail git fsck &&
+               test_must_fail git repack --cruft -d 2>err &&
+               grep "bad object" err &&
+
+               # Before failing, the repack did not modify the
+               # pack directory.
+               ls .git/objects/pack/*.pack >after-pack-dir &&
+               test_cmp before-pack-dir after-pack-dir
+       )
+'
+
 test_expect_success 'bitmaps are created by default in bare repos' '
        git clone --bare .git bare.git &&
        rm -f bare.git/objects/pack/*.bitmap &&
@@ -443,10 +517,10 @@ test_expect_success '--write-midx -b packs non-kept objects' '
 '
 
 test_expect_success '--write-midx removes stale pack-based bitmaps' '
-       rm -fr repo &&
-       git init repo &&
-       test_when_finished "rm -fr repo" &&
-       (
+       rm -fr repo &&
+       git init repo &&
+       test_when_finished "rm -fr repo" &&
+       (
                cd repo &&
                test_commit base &&
                GIT_TEST_MULTI_PACK_INDEX=0 git repack -Ab &&
@@ -460,7 +534,7 @@ test_expect_success '--write-midx removes stale pack-based bitmaps' '
                test_path_is_file $midx &&
                test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
                test_path_is_missing $pack_bitmap
-       )
+       )
 '
 
 test_expect_success '--write-midx with --pack-kept-objects' '
index ebb267855fe06a0cfb3fa9a4d1cc21157f832d1d..fe6c3e77a3c9add78dadc421be9b0b00b0f6bcd9 100755 (executable)
@@ -113,6 +113,48 @@ test_expect_success 'do not bother loosening old objects' '
        test_must_fail git cat-file -p $obj2
 '
 
+test_expect_success 'gc.recentObjectsHook' '
+       obj1=$(echo one | git hash-object -w --stdin) &&
+       obj2=$(echo two | git hash-object -w --stdin) &&
+       obj3=$(echo three | git hash-object -w --stdin) &&
+       pack1=$(echo $obj1 | git pack-objects .git/objects/pack/pack) &&
+       pack2=$(echo $obj2 | git pack-objects .git/objects/pack/pack) &&
+       pack3=$(echo $obj3 | git pack-objects .git/objects/pack/pack) &&
+       git prune-packed &&
+
+       git cat-file -p $obj1 &&
+       git cat-file -p $obj2 &&
+       git cat-file -p $obj3 &&
+
+       # make an unreachable annotated tag object to ensure we rescue objects
+       # which are reachable from non-pruned unreachable objects
+       obj2_tag="$(git mktag <<-EOF
+       object $obj2
+       type blob
+       tag obj2-tag
+       tagger T A Gger <tagger@example.com> 1234567890 -0000
+       EOF
+       )" &&
+
+       obj2_tag_pack="$(echo $obj2_tag | git pack-objects .git/objects/pack/pack)" &&
+       git prune-packed &&
+
+       write_script precious-objects <<-EOF &&
+       echo $obj2_tag
+       EOF
+       git config gc.recentObjectsHook ./precious-objects &&
+
+       test-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
+       test-tool chmtime =-86400 .git/objects/pack/pack-$pack3.pack &&
+       test-tool chmtime =-86400 .git/objects/pack/pack-$obj2_tag_pack.pack &&
+       git repack -A -d --unpack-unreachable=1.hour.ago &&
+
+       git cat-file -p $obj1 &&
+       git cat-file -p $obj2 &&
+       git cat-file -p $obj2_tag &&
+       test_must_fail git cat-file -p $obj3
+'
+
 test_expect_success 'keep packed objects found only in index' '
        echo my-unique-content >file &&
        git add file &&
index 8821fbd2dd55844e54f55553b442ec419755546c..00f28fb558ced5cbb4c7667f9b6ce597ee7fb782 100755 (executable)
@@ -10,6 +10,12 @@ objdir=.git/objects
 packdir=$objdir/pack
 midx=$objdir/pack/multi-pack-index
 
+packed_objects () {
+       git show-index <"$1" >tmp-object-list &&
+       cut -d' ' -f2 tmp-object-list | sort &&
+       rm tmp-object-list
+ }
+
 test_expect_success '--geometric with no packs' '
        git init geometric &&
        test_when_finished "rm -fr geometric" &&
@@ -281,4 +287,162 @@ test_expect_success '--geometric with pack.packSizeLimit' '
        )
 '
 
+test_expect_success '--geometric --write-midx with packfiles in main and alternate ODB' '
+       test_when_finished "rm -fr shared member" &&
+
+       # Create a shared repository that will serve as the alternate object
+       # database for the member linked to it. It has got some objects on its
+       # own that are packed into a single packfile.
+       git init shared &&
+       test_commit -C shared common-object &&
+       git -C shared repack -ad &&
+
+       # We create member so that its alternates file points to the shared
+       # repository. We then create a commit in it so that git-repack(1) has
+       # something to repack.
+       # of the shared object database.
+       git clone --shared shared member &&
+       test_commit -C member unique-object &&
+       git -C member repack --geometric=2 --write-midx 2>err &&
+       test_must_be_empty err &&
+
+       # We should see that a new packfile was generated.
+       find shared/.git/objects/pack -type f -name "*.pack" >packs &&
+       test_line_count = 1 packs &&
+
+       # We should also see a multi-pack-index. This multi-pack-index should
+       # never refer to any packfiles in the alternate object database.
+       test_path_is_file member/.git/objects/pack/multi-pack-index &&
+       test-tool read-midx member/.git/objects >packs.midx &&
+       grep "^pack-.*\.idx$" packs.midx | sort >actual &&
+       basename member/.git/objects/pack/pack-*.idx >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success '--geometric --with-midx with no local objects' '
+       test_when_finished "rm -fr shared member" &&
+
+       # Create a repository with a single packfile that acts as alternate
+       # object database.
+       git init shared &&
+       test_commit -C shared "shared-objects" &&
+       git -C shared repack -ad &&
+
+       # Create a second repository linked to the first one and perform a
+       # geometric repack on it.
+       git clone --shared shared member &&
+       git -C member repack --geometric 2 --write-midx 2>err &&
+       test_must_be_empty err &&
+
+       # Assert that we wrote neither a new packfile nor a multi-pack-index.
+       # We should not have a packfile because the single packfile in the
+       # alternate object database does not invalidate the geometric sequence.
+       # And we should not have a multi-pack-index because these only index
+       # local packfiles, and there are none.
+       test_dir_is_empty member/$packdir
+'
+
+test_expect_success '--geometric with same pack in main and alternate ODB' '
+       test_when_finished "rm -fr shared member" &&
+
+       # Create a repository with a single packfile that acts as alternate
+       # object database.
+       git init shared &&
+       test_commit -C shared "shared-objects" &&
+       git -C shared repack -ad &&
+
+       # We create the member repository as an exact copy so that it has the
+       # same packfile.
+       cp -r shared member &&
+       test-tool path-utils real_path shared/.git/objects >member/.git/objects/info/alternates &&
+       find shared/.git/objects -type f >expected-files &&
+
+       # Verify that we can repack objects as expected without observing any
+       # error. Having the same packfile in both ODBs used to cause an error
+       # in git-pack-objects(1).
+       git -C member repack --geometric 2 2>err &&
+       test_must_be_empty err &&
+       # Nothing should have changed.
+       find shared/.git/objects -type f >actual-files &&
+       test_cmp expected-files actual-files
+'
+
+test_expect_success '--geometric -l with non-intact geometric sequence across ODBs' '
+       test_when_finished "rm -fr shared member" &&
+
+       git init shared &&
+       test_commit_bulk -C shared --start=1 1 &&
+
+       git clone --shared shared member &&
+       test_commit_bulk -C member --start=2 1 &&
+
+       # Verify that our assumptions actually hold: both generated packfiles
+       # should have three objects and should be non-equal.
+       packed_objects shared/.git/objects/pack/pack-*.idx >shared-objects &&
+       packed_objects member/.git/objects/pack/pack-*.idx >member-objects &&
+       test_line_count = 3 shared-objects &&
+       test_line_count = 3 member-objects &&
+       ! test_cmp shared-objects member-objects &&
+
+       # Perform the geometric repack. With `-l`, we should only see the local
+       # packfile and thus arrive at the conclusion that the geometric
+       # sequence is intact. We thus expect no changes.
+       #
+       # Note that we are tweaking mtimes of the packfiles so that we can
+       # verify they did not change. This is done in order to detect the case
+       # where we do repack objects, but the resulting packfile is the same.
+       test-tool chmtime --verbose =0 member/.git/objects/pack/* >expected-member-packs &&
+       git -C member repack --geometric=2 -l -d &&
+       test-tool chmtime --verbose member/.git/objects/pack/* >actual-member-packs &&
+       test_cmp expected-member-packs actual-member-packs &&
+
+       {
+               packed_objects shared/.git/objects/pack/pack-*.idx &&
+               packed_objects member/.git/objects/pack/pack-*.idx
+       } | sort >expected-objects &&
+
+       # On the other hand, when doing a non-local geometric repack we should
+       # see both packfiles and thus repack them. We expect that the shared
+       # object database was not changed.
+       test-tool chmtime --verbose =0 shared/.git/objects/pack/* >expected-shared-packs &&
+       git -C member repack --geometric=2 -d &&
+       test-tool chmtime --verbose shared/.git/objects/pack/* >actual-shared-packs &&
+       test_cmp expected-shared-packs actual-shared-packs &&
+
+       # Furthermore, we expect that the member repository now has a single
+       # packfile that contains the combined shared and non-shared objects.
+       ls member/.git/objects/pack/pack-*.idx >actual &&
+       test_line_count = 1 actual &&
+       packed_objects member/.git/objects/pack/pack-*.idx >actual-objects &&
+       test_line_count = 6 actual-objects &&
+       test_cmp expected-objects actual-objects
+'
+
+test_expect_success '--geometric -l disables writing bitmaps with non-local packfiles' '
+       test_when_finished "rm -fr shared member" &&
+
+       git init shared &&
+       test_commit_bulk -C shared --start=1 1 &&
+
+       git clone --shared shared member &&
+       test_commit_bulk -C member --start=2 1 &&
+
+       # When performing a geometric repack with `-l` while connected to an
+       # alternate object database that has a packfile we do not have full
+       # coverage of objects. As a result, we expect that writing the bitmap
+       # will be disabled.
+       git -C member repack -l --geometric=2 --write-midx --write-bitmap-index 2>err &&
+       cat >expect <<-EOF &&
+       warning: disabling bitmap writing, as some objects are not being packed
+       EOF
+       test_cmp expect err &&
+       test_path_is_missing member/.git/objects/pack/multi-pack-index-*.bitmap &&
+
+       # On the other hand, when we repack without `-l`, we should see that
+       # the bitmap gets created.
+       git -C member repack --geometric=2 --write-midx --write-bitmap-index 2>err &&
+       test_must_be_empty err &&
+       test_path_is_file member/.git/objects/pack/multi-pack-index-*.bitmap
+'
+
 test_done
index 8143817b19e7962460387b58b7c807e0c995090e..d37c83b4640c31b9f5b4d04251ecafbf08636aa7 100755 (executable)
@@ -594,4 +594,44 @@ test_expect_success 'grep partially-cloned submodule' '
        )
 '
 
+test_expect_success 'check scope of core.useReplaceRefs' '
+       git init base &&
+       git init base/sub &&
+
+       echo A >base/a &&
+       echo B >base/b &&
+       echo C >base/sub/c &&
+       echo D >base/sub/d &&
+
+       git -C base/sub add c d &&
+       git -C base/sub commit -m "Add files" &&
+
+       git -C base submodule add ./sub &&
+       git -C base add a b sub &&
+       git -C base commit -m "Add files and submodule" &&
+
+       A=$(git -C base rev-parse HEAD:a) &&
+       B=$(git -C base rev-parse HEAD:b) &&
+       C=$(git -C base/sub rev-parse HEAD:c) &&
+       D=$(git -C base/sub rev-parse HEAD:d) &&
+
+       git -C base replace $A $B &&
+       git -C base/sub replace $C $D &&
+
+       test_must_fail git -C base grep --cached --recurse-submodules A &&
+       test_must_fail git -C base grep --cached --recurse-submodules C &&
+
+       git -C base config core.useReplaceRefs false &&
+       git -C base grep --recurse-submodules A &&
+       test_must_fail git -C base grep --cached --recurse-submodules C &&
+
+       git -C base/sub config core.useReplaceRefs false &&
+       git -C base grep --cached --recurse-submodules A &&
+       git -C base grep --cached --recurse-submodules C &&
+
+       git -C base config --unset core.useReplaceRefs &&
+       test_must_fail git -C base grep --cached --recurse-submodules A &&
+       git -C base grep --cached --recurse-submodules C
+'
+
 test_done
index 0de83b5d2b07011210eaa3f2f516705a57065f62..a60b05ad3f09f03433e2b7fe96e095966ddb104a 100755 (executable)
@@ -47,7 +47,7 @@ clean_fake_sendmail () {
 
 test_expect_success $PREREQ 'Extract patches' '
        patches=$(git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1) &&
-       threaded_patches=$(git format-patch -o threaded -s --in-reply-to="format" HEAD^1)
+       threaded_patches=$(git format-patch -o threaded --thread=shallow -s --in-reply-to="format" HEAD^1)
 '
 
 # Test no confirm early to ensure remaining tests will not hang
@@ -337,13 +337,14 @@ test_expect_success $PREREQ 'Show all headers' '
 test_expect_success $PREREQ 'Prompting works' '
        clean_fake_sendmail &&
        (echo "to@example.com" &&
-        echo ""
+        echo "my-message-id@example.com"
        ) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
                --smtp-server="$(pwd)/fake.sendmail" \
                $patches \
                2>errors &&
                grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
-               grep "^To: to@example.com\$" msgtxt1
+               grep "^To: to@example.com\$" msgtxt1 &&
+               grep "^In-Reply-To: <my-message-id@example.com>" msgtxt1
 '
 
 test_expect_success $PREREQ,AUTOIDENT 'implicit ident is allowed' '
@@ -374,13 +375,16 @@ test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email'
        )
 '
 
-test_expect_success $PREREQ 'setup tocmd and cccmd scripts' '
+test_expect_success $PREREQ 'setup cmd scripts' '
        write_script tocmd-sed <<-\EOF &&
        sed -n -e "s/^tocmd--//p" "$1"
        EOF
-       write_script cccmd-sed <<-\EOF
+       write_script cccmd-sed <<-\EOF &&
        sed -n -e "s/^cccmd--//p" "$1"
        EOF
+       write_script headercmd-sed <<-\EOF
+       sed -n -e "s/^headercmd--//p" "$1"
+       EOF
 '
 
 test_expect_success $PREREQ 'tocmd works' '
@@ -410,6 +414,70 @@ test_expect_success $PREREQ 'cccmd works' '
        grep "^ cccmd@example.com" msgtxt1
 '
 
+test_expect_success $PREREQ 'headercmd works' '
+       clean_fake_sendmail &&
+       cp $patches headercmd.patch &&
+       echo "headercmd--X-Debbugs-CC: dummy@example.com" >>headercmd.patch &&
+       git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --header-cmd=./headercmd-sed \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               headercmd.patch \
+               &&
+       grep "^X-Debbugs-CC: dummy@example.com" msgtxt1
+'
+
+test_expect_success $PREREQ '--no-header-cmd works' '
+       clean_fake_sendmail &&
+       cp $patches headercmd.patch &&
+       echo "headercmd--X-Debbugs-CC: dummy@example.com" >>headercmd.patch &&
+       git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --header-cmd=./headercmd-sed \
+               --no-header-cmd \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               headercmd.patch \
+               &&
+       ! grep "^X-Debbugs-CC: dummy@example.com" msgtxt1
+'
+
+test_expect_success $PREREQ 'multiline fields are correctly unfolded' '
+       clean_fake_sendmail &&
+       cp $patches headercmd.patch &&
+       write_script headercmd-multiline <<-\EOF &&
+       echo "X-Debbugs-CC: someone@example.com
+FoldedField: This is a tale
+ best told using
+ multiple lines."
+       EOF
+       git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --header-cmd=./headercmd-multiline \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               headercmd.patch &&
+       grep "^FoldedField: This is a tale best told using multiple lines.$" msgtxt1
+'
+
+# Blank lines in the middle of the output of a command are invalid.
+test_expect_success $PREREQ 'malform output reported on blank lines in command output' '
+       clean_fake_sendmail &&
+       cp $patches headercmd.patch &&
+       write_script headercmd-malformed-output <<-\EOF &&
+       echo "X-Debbugs-CC: someone@example.com
+
+SomeOtherField: someone-else@example.com"
+       EOF
+       ! git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --header-cmd=./headercmd-malformed-output \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               headercmd.patch
+'
+
 test_expect_success $PREREQ 'reject long lines' '
        z8=zzzzzzzz &&
        z64=$z8$z8$z8$z8$z8$z8$z8$z8 &&
@@ -540,7 +608,7 @@ test_expect_success $PREREQ "--validate respects relative core.hooksPath path" '
        test_path_is_file my-hooks.ran &&
        cat >expect <<-EOF &&
        fatal: longline.patch: rejected by sendemail-validate hook
-       fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch>'"'"' died with exit code 1
+       fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch> <header>'"'"' died with exit code 1
        warning: no patches were sent
        EOF
        test_cmp expect actual
@@ -559,12 +627,49 @@ test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" '
        test_path_is_file my-hooks.ran &&
        cat >expect <<-EOF &&
        fatal: longline.patch: rejected by sendemail-validate hook
-       fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch>'"'"' died with exit code 1
+       fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch> <header>'"'"' died with exit code 1
        warning: no patches were sent
        EOF
        test_cmp expect actual
 '
 
+test_expect_success $PREREQ "--validate hook supports header argument" '
+       write_script my-hooks/sendemail-validate <<-\EOF &&
+       if test "$#" -ge 2
+       then
+               grep "X-test-header: v1.0" "$2"
+       else
+               echo "No header arg passed"
+               exit 1
+       fi
+       EOF
+       test_config core.hooksPath "my-hooks" &&
+       rm -fr outdir &&
+       git format-patch \
+               --add-header="X-test-header: v1.0" \
+               -n HEAD^1 -o outdir &&
+       git send-email \
+               --dry-run \
+               --to=nobody@example.com \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               --validate \
+               outdir/000?-*.patch
+'
+
+test_expect_success $PREREQ 'clear message-id before parsing a new message' '
+       clean_fake_sendmail &&
+       echo true | write_script my-hooks/sendemail-validate &&
+       test_config core.hooksPath my-hooks &&
+       git send-email --validate --to=recipient@example.com \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               $patches $threaded_patches &&
+       id0=$(grep "^Message-ID: " $threaded_patches) &&
+       id1=$(grep "^Message-ID: " msgtxt1) &&
+       id2=$(grep "^Message-ID: " msgtxt2) &&
+       test "z$id0" = "z$id2" &&
+       test "z$id1" != "z$id2"
+'
+
 for enc in 7bit 8bit quoted-printable base64
 do
        test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" '
@@ -2326,6 +2431,37 @@ test_expect_success $PREREQ 'invoke hook' '
        )
 '
 
+expected_file_counter_output () {
+       total=$1
+       count=0
+       while test $count -ne $total
+       do
+               count=$((count + 1)) &&
+               echo "$count/$total" || return
+       done
+}
+
+test_expect_success $PREREQ '--validate hook allows counting of messages' '
+       test_when_finished "rm -rf my-hooks.log" &&
+       test_config core.hooksPath "my-hooks" &&
+       mkdir -p my-hooks &&
+
+       write_script my-hooks/sendemail-validate <<-\EOF &&
+               num=$GIT_SENDEMAIL_FILE_COUNTER &&
+               tot=$GIT_SENDEMAIL_FILE_TOTAL &&
+               echo "$num/$tot" >>my-hooks.log || exit 1
+       EOF
+
+       >my-hooks.log &&
+       expected_file_counter_output 4 >expect &&
+       git send-email \
+               --from="Example <from@example.com>" \
+               --to=nobody@example.com \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               --validate -3 --cover-letter --force &&
+       test_cmp expect my-hooks.log
+'
+
 test_expect_success $PREREQ 'test that send-email works outside a repo' '
        nongit git send-email \
                --from="Example <nobody@example.com>" \
index fea41b3c3606df1fc6d8111cdd74522532ca8b0b..af28b01fefa49c647b3ab87a395dd8c2dfb70a5a 100755 (executable)
@@ -21,7 +21,7 @@ test_expect_success 'git svn help works anywhere' '
 '
 
 test_expect_success \
-    'initialize git svn' '
+       'initialize git svn' '
        mkdir import &&
        (
                cd import &&
@@ -38,9 +38,9 @@ test_expect_success \
        rm -rf import &&
        git svn init "$svnrepo"'
 
-test_expect_success \
-    'import an SVN revision into git' \
-    'git svn fetch'
+test_expect_success 'import an SVN revision into git' '
+       git svn fetch
+'
 
 test_expect_success "checkout from svn" 'svn co "$svnrepo" "$SVN_TREE"'
 
@@ -233,27 +233,26 @@ test_expect_success POSIXPERM,SYMLINKS "$name" '
 '
 
 test_expect_success 'exit if remote refs are ambigious' '
-        git config --add svn-remote.svn.fetch \
+       git config --add svn-remote.svn.fetch \
                bar:refs/remotes/git-svn &&
        test_must_fail git svn migrate
 '
 
 test_expect_success 'exit if init-ing a would clobber a URL' '
-        svnadmin create "${PWD}/svnrepo2" &&
-        svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
-        git config --unset svn-remote.svn.fetch \
+       svnadmin create "${PWD}/svnrepo2" &&
+       svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
+       git config --unset svn-remote.svn.fetch \
                "^bar:refs/remotes/git-svn$" &&
        test_must_fail git svn init "${svnrepo}2/bar"
         '
 
-test_expect_success \
-  'init allows us to connect to another directory in the same repo' '
-        git svn init --minimize-url -i bar "$svnrepo/bar" &&
-        git config --get svn-remote.svn.fetch \
-                              "^bar:refs/remotes/bar$" &&
-        git config --get svn-remote.svn.fetch \
-                             "^:refs/remotes/git-svn$"
-        '
+test_expect_success 'init allows us to connect to another directory in the same repo' '
+       git svn init --minimize-url -i bar "$svnrepo/bar" &&
+       git config --get svn-remote.svn.fetch \
+               "^bar:refs/remotes/bar$" &&
+       git config --get svn-remote.svn.fetch \
+               "^:refs/remotes/git-svn$"
+'
 
 test_expect_success 'dcommit $rev does not clobber current branch' '
        git svn fetch -i bar &&
index 85d735861fc9f500561e9f5fb4baa131657752c0..b5845e28feef8219ac5405e9e0400a40694eec30 100755 (executable)
@@ -41,51 +41,51 @@ test_expect_success 'init and fetch a moved directory' '
        '
 
 test_expect_success 'init and fetch from one svn-remote' '
-        git config svn-remote.svn.url "$svnrepo" &&
-        git config --add svn-remote.svn.fetch \
-          trunk:refs/remotes/svn/trunk &&
-        git config --add svn-remote.svn.fetch \
-          thunk:refs/remotes/svn/thunk &&
-        git svn fetch -i svn/thunk &&
+       git config svn-remote.svn.url "$svnrepo" &&
+       git config --add svn-remote.svn.fetch \
+               trunk:refs/remotes/svn/trunk &&
+       git config --add svn-remote.svn.fetch \
+               thunk:refs/remotes/svn/thunk &&
+       git svn fetch -i svn/thunk &&
        test "$(git rev-parse --verify refs/remotes/svn/trunk)" \
-          = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" &&
+               = "$(git rev-parse --verify refs/remotes/svn/thunk~1)" &&
        git cat-file blob refs/remotes/svn/thunk:readme >actual &&
        test "$(sed -n -e "3p" actual)" = goodbye
-        '
+'
 
 test_expect_success 'follow deleted parent' '
-        (svn_cmd cp -m "resurrecting trunk as junk" \
-               "$svnrepo"/trunk@2 "$svnrepo"/junk ||
-         svn cp -m "resurrecting trunk as junk" \
-               -r2 "$svnrepo"/trunk "$svnrepo"/junk) &&
-        git config --add svn-remote.svn.fetch \
-          junk:refs/remotes/svn/junk &&
-        git svn fetch -i svn/thunk &&
-        git svn fetch -i svn/junk &&
+       (svn_cmd cp -m "resurrecting trunk as junk" \
+               "$svnrepo"/trunk@2 "$svnrepo"/junk ||
+        svn cp -m "resurrecting trunk as junk" \
+               -r2 "$svnrepo"/trunk "$svnrepo"/junk) &&
+       git config --add svn-remote.svn.fetch \
+               junk:refs/remotes/svn/junk &&
+       git svn fetch -i svn/thunk &&
+       git svn fetch -i svn/junk &&
        test -z "$(git diff svn/junk svn/trunk)" &&
        test "$(git merge-base svn/junk svn/trunk)" \
-          = "$(git rev-parse svn/trunk)"
-        '
+               = "$(git rev-parse svn/trunk)"
+'
 
 test_expect_success 'follow larger parent' '
-        mkdir -p import/trunk/thunk/bump/thud &&
-        echo hi > import/trunk/thunk/bump/thud/file &&
-        svn import -m "import a larger parent" import "$svnrepo"/larger-parent &&
-        svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger &&
-        git svn init --minimize-url -i larger \
-         "$svnrepo"/larger-parent/trunk/thunk/bump/thud &&
-        git svn fetch -i larger &&
+       mkdir -p import/trunk/thunk/bump/thud &&
+       echo hi > import/trunk/thunk/bump/thud/file &&
+       svn import -m "import a larger parent" import "$svnrepo"/larger-parent &&
+       svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger &&
+       git svn init --minimize-url -i larger \
+               "$svnrepo"/larger-parent/trunk/thunk/bump/thud &&
+       git svn fetch -i larger &&
        git svn init --minimize-url -i larger-parent \
-         "$svnrepo"/another-larger/trunk/thunk/bump/thud &&
+               "$svnrepo"/another-larger/trunk/thunk/bump/thud &&
        git svn fetch -i larger-parent &&
-        git rev-parse --verify refs/remotes/larger &&
-        git rev-parse --verify \
-          refs/remotes/larger-parent &&
+       git rev-parse --verify refs/remotes/larger &&
+       git rev-parse --verify \
+               refs/remotes/larger-parent &&
        test "$(git merge-base \
                 refs/remotes/larger-parent \
                 refs/remotes/larger)" = \
-            "$(git rev-parse refs/remotes/larger)"
-        '
+               "$(git rev-parse refs/remotes/larger)"
+'
 
 test_expect_success 'follow higher-level parent' '
        svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
index c5946cb0b8a94cfc8c4e2a30284c3343acb8e876..a44eabf0d80fa8db991d77af4da49f58750cf43a 100755 (executable)
@@ -50,56 +50,56 @@ check_entries () {
        fi
 }
 
-test_expect_success \
-    'New file' \
-    'mkdir A B C D E F &&
-     echo hello1 >A/newfile1.txt &&
-     echo hello2 >B/newfile2.txt &&
-     cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
-     cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png &&
-     git add A/newfile1.txt &&
-     git add B/newfile2.txt &&
-     git add C/newfile3.png &&
-     git add D/newfile4.png &&
-     git commit -a -m "Test: New file" &&
-     id=$(git rev-list --max-count=1 HEAD) &&
-     (cd "$CVSWORK" &&
-     git cvsexportcommit -c $id &&
-     check_entries A "newfile1.txt/1.1/" &&
-     check_entries B "newfile2.txt/1.1/" &&
-     check_entries C "newfile3.png/1.1/-kb" &&
-     check_entries D "newfile4.png/1.1/-kb" &&
-     test_cmp A/newfile1.txt ../A/newfile1.txt &&
-     test_cmp B/newfile2.txt ../B/newfile2.txt &&
-     test_cmp C/newfile3.png ../C/newfile3.png &&
-     test_cmp D/newfile4.png ../D/newfile4.png
-     )'
+test_expect_success 'New file' '
+       mkdir A B C D E F &&
+       echo hello1 >A/newfile1.txt &&
+       echo hello2 >B/newfile2.txt &&
+       cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
+       cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png &&
+       git add A/newfile1.txt &&
+       git add B/newfile2.txt &&
+       git add C/newfile3.png &&
+       git add D/newfile4.png &&
+       git commit -a -m "Test: New file" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -c $id &&
+       check_entries A "newfile1.txt/1.1/" &&
+       check_entries B "newfile2.txt/1.1/" &&
+       check_entries C "newfile3.png/1.1/-kb" &&
+       check_entries D "newfile4.png/1.1/-kb" &&
+       test_cmp A/newfile1.txt ../A/newfile1.txt &&
+       test_cmp B/newfile2.txt ../B/newfile2.txt &&
+       test_cmp C/newfile3.png ../C/newfile3.png &&
+       test_cmp D/newfile4.png ../D/newfile4.png
+       )
+'
 
-test_expect_success \
-    'Remove two files, add two and update two' \
-    'echo Hello1 >>A/newfile1.txt &&
-     rm -f B/newfile2.txt &&
-     rm -f C/newfile3.png &&
-     echo Hello5  >E/newfile5.txt &&
-     cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png &&
-     cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png &&
-     git add E/newfile5.txt &&
-     git add F/newfile6.png &&
-     git commit -a -m "Test: Remove, add and update" &&
-     id=$(git rev-list --max-count=1 HEAD) &&
-     (cd "$CVSWORK" &&
-     git cvsexportcommit -c $id &&
-     check_entries A "newfile1.txt/1.2/" &&
-     check_entries B "" &&
-     check_entries C "" &&
-     check_entries D "newfile4.png/1.2/-kb" &&
-     check_entries E "newfile5.txt/1.1/" &&
-     check_entries F "newfile6.png/1.1/-kb" &&
-     test_cmp A/newfile1.txt ../A/newfile1.txt &&
-     test_cmp D/newfile4.png ../D/newfile4.png &&
-     test_cmp E/newfile5.txt ../E/newfile5.txt &&
-     test_cmp F/newfile6.png ../F/newfile6.png
-     )'
+test_expect_success 'Remove two files, add two and update two' '
+       echo Hello1 >>A/newfile1.txt &&
+       rm -f B/newfile2.txt &&
+       rm -f C/newfile3.png &&
+       echo Hello5  >E/newfile5.txt &&
+       cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png &&
+       cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png &&
+       git add E/newfile5.txt &&
+       git add F/newfile6.png &&
+       git commit -a -m "Test: Remove, add and update" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -c $id &&
+       check_entries A "newfile1.txt/1.2/" &&
+       check_entries B "" &&
+       check_entries C "" &&
+       check_entries D "newfile4.png/1.2/-kb" &&
+       check_entries E "newfile5.txt/1.1/" &&
+       check_entries F "newfile6.png/1.1/-kb" &&
+       test_cmp A/newfile1.txt ../A/newfile1.txt &&
+       test_cmp D/newfile4.png ../D/newfile4.png &&
+       test_cmp E/newfile5.txt ../E/newfile5.txt &&
+       test_cmp F/newfile6.png ../F/newfile6.png
+       )
+'
 
 # Should fail (but only on the git cvsexportcommit stage)
 test_expect_success \
@@ -129,67 +129,67 @@ test_expect_success \
 
 # This test is here because a patch for only binary files will
 # fail with gnu patch, so cvsexportcommit must handle that.
-test_expect_success \
-    'Remove only binary files' \
-    'git reset --hard HEAD^^ &&
-     rm -f D/newfile4.png &&
-     git commit -a -m "test: remove only a binary file" &&
-     id=$(git rev-list --max-count=1 HEAD) &&
-     (cd "$CVSWORK" &&
-     git cvsexportcommit -c $id &&
-     check_entries A "newfile1.txt/1.2/" &&
-     check_entries B "" &&
-     check_entries C "" &&
-     check_entries D "" &&
-     check_entries E "newfile5.txt/1.1/" &&
-     check_entries F "newfile6.png/1.1/-kb" &&
-     test_cmp A/newfile1.txt ../A/newfile1.txt &&
-     test_cmp E/newfile5.txt ../E/newfile5.txt &&
-     test_cmp F/newfile6.png ../F/newfile6.png
-     )'
+test_expect_success 'Remove only binary files' '
+       git reset --hard HEAD^^ &&
+       rm -f D/newfile4.png &&
+       git commit -a -m "test: remove only a binary file" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -c $id &&
+       check_entries A "newfile1.txt/1.2/" &&
+       check_entries B "" &&
+       check_entries C "" &&
+       check_entries D "" &&
+       check_entries E "newfile5.txt/1.1/" &&
+       check_entries F "newfile6.png/1.1/-kb" &&
+       test_cmp A/newfile1.txt ../A/newfile1.txt &&
+       test_cmp E/newfile5.txt ../E/newfile5.txt &&
+       test_cmp F/newfile6.png ../F/newfile6.png
+       )
+'
 
-test_expect_success \
-    'Remove only a text file' \
-    'rm -f A/newfile1.txt &&
-     git commit -a -m "test: remove only a binary file" &&
-     id=$(git rev-list --max-count=1 HEAD) &&
-     (cd "$CVSWORK" &&
-     git cvsexportcommit -c $id &&
-     check_entries A "" &&
-     check_entries B "" &&
-     check_entries C "" &&
-     check_entries D "" &&
-     check_entries E "newfile5.txt/1.1/" &&
-     check_entries F "newfile6.png/1.1/-kb" &&
-     test_cmp E/newfile5.txt ../E/newfile5.txt &&
-     test_cmp F/newfile6.png ../F/newfile6.png
-     )'
+test_expect_success 'Remove only a text file' '
+       rm -f A/newfile1.txt &&
+       git commit -a -m "test: remove only a binary file" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -c $id &&
+       check_entries A "" &&
+       check_entries B "" &&
+       check_entries C "" &&
+       check_entries D "" &&
+       check_entries E "newfile5.txt/1.1/" &&
+       check_entries F "newfile6.png/1.1/-kb" &&
+       test_cmp E/newfile5.txt ../E/newfile5.txt &&
+       test_cmp F/newfile6.png ../F/newfile6.png
+       )
+'
 
-test_expect_success \
-     'New file with spaces in file name' \
-     'mkdir "G g" &&
-      echo ok then >"G g/with spaces.txt" &&
-      git add "G g/with spaces.txt" && \
-      cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
-      git add "G g/with spaces.png" &&
-      git commit -a -m "With spaces" &&
-      id=$(git rev-list --max-count=1 HEAD) &&
-      (cd "$CVSWORK" &&
-      git cvsexportcommit -c $id &&
-      check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
-      )'
+test_expect_success 'New file with spaces in file name' '
+       mkdir "G g" &&
+       echo ok then >"G g/with spaces.txt" &&
+       git add "G g/with spaces.txt" && \
+       cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
+       git add "G g/with spaces.png" &&
+       git commit -a -m "With spaces" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -c $id &&
+       check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
+       )
+'
 
-test_expect_success \
-     'Update file with spaces in file name' \
-     'echo Ok then >>"G g/with spaces.txt" &&
-      cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
-      git add "G g/with spaces.png" &&
-      git commit -a -m "Update with spaces" &&
-      id=$(git rev-list --max-count=1 HEAD) &&
-      (cd "$CVSWORK" &&
-      git cvsexportcommit -c $id &&
-      check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
-      )'
+test_expect_success 'Update file with spaces in file name' '
+       echo Ok then >>"G g/with spaces.txt" &&
+       cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
+       git add "G g/with spaces.png" &&
+       git commit -a -m "Update with spaces" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -c $id &&
+       check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
+       )
+'
 
 # Some filesystems mangle pathnames with UTF-8 characters --
 # check and skip
@@ -202,68 +202,68 @@ if p="Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" &&
 then
 
 # This test contains UTF-8 characters
-test_expect_success !MINGW \
-     'File with non-ascii file name' \
-     'mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
-      echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
-      git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
-      cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
-      git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
-      git commit -a -m "Går det så går det" && \
-      id=$(git rev-list --max-count=1 HEAD) &&
-      (cd "$CVSWORK" &&
-      git cvsexportcommit -v -c $id &&
-      check_entries \
-      "Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \
-      "gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
-      )'
+test_expect_success !MINGW 'File with non-ascii file name' '
+       mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
+       echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
+       git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
+       cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
+       git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
+       git commit -a -m "Går det så går det" && \
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -v -c $id &&
+       check_entries \
+       "Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \
+       "gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
+       )
+'
 
 fi
 
 rm -fr tst
 
-test_expect_success \
-     'Mismatching patch should fail' \
-     'date >>"E/newfile5.txt" &&
-      git add "E/newfile5.txt" &&
-      git commit -a -m "Update one" &&
-      date >>"E/newfile5.txt" &&
-      git add "E/newfile5.txt" &&
-      git commit -a -m "Update two" &&
-      id=$(git rev-list --max-count=1 HEAD) &&
-      (cd "$CVSWORK" &&
-      test_must_fail git cvsexportcommit -c $id
-      )'
-
-test_expect_success FILEMODE \
-     'Retain execute bit' \
-     'mkdir G &&
-      echo executeon >G/on &&
-      chmod +x G/on &&
-      echo executeoff >G/off &&
-      git add G/on &&
-      git add G/off &&
-      git commit -a -m "Execute test" &&
-      (cd "$CVSWORK" &&
-      git cvsexportcommit -c HEAD &&
-      test -x G/on &&
-      ! test -x G/off
-      )'
+test_expect_success 'Mismatching patch should fail' '
+       date >>"E/newfile5.txt" &&
+       git add "E/newfile5.txt" &&
+       git commit -a -m "Update one" &&
+       date >>"E/newfile5.txt" &&
+       git add "E/newfile5.txt" &&
+       git commit -a -m "Update two" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$CVSWORK" &&
+       test_must_fail git cvsexportcommit -c $id
+       )
+'
+
+test_expect_success FILEMODE 'Retain execute bit' '
+       mkdir G &&
+       echo executeon >G/on &&
+       chmod +x G/on &&
+       echo executeoff >G/off &&
+       git add G/on &&
+       git add G/off &&
+       git commit -a -m "Execute test" &&
+       (cd "$CVSWORK" &&
+       git cvsexportcommit -c HEAD &&
+       test -x G/on &&
+       ! test -x G/off
+       )
+'
 
 test_expect_success '-w option should work with relative GIT_DIR' '
-      mkdir W &&
-      echo foobar >W/file1.txt &&
-      echo bazzle >W/file2.txt &&
-      git add W/file1.txt &&
-      git add W/file2.txt &&
-      git commit -m "More updates" &&
-      id=$(git rev-list --max-count=1 HEAD) &&
-      (cd "$GIT_DIR" &&
-      GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id &&
-      check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" &&
-      test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt &&
-      test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt
-      )
+       mkdir W &&
+       echo foobar >W/file1.txt &&
+       echo bazzle >W/file2.txt &&
+       git add W/file1.txt &&
+       git add W/file2.txt &&
+       git commit -m "More updates" &&
+       id=$(git rev-list --max-count=1 HEAD) &&
+       (cd "$GIT_DIR" &&
+       GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id &&
+       check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" &&
+       test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt &&
+       test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt
+       )
 '
 
 test_expect_success 'check files before directories' '
@@ -290,21 +290,20 @@ test_expect_success 'check files before directories' '
 '
 
 test_expect_success 're-commit a removed filename which remains in CVS attic' '
-
-    (cd "$CVSWORK" &&
-     echo >attic_gremlin &&
-     cvs -Q add attic_gremlin &&
-     cvs -Q ci -m "added attic_gremlin" &&
-     rm attic_gremlin &&
-     cvs -Q rm attic_gremlin &&
-     cvs -Q ci -m "removed attic_gremlin") &&
-
-    echo > attic_gremlin &&
-    git add attic_gremlin &&
-    git commit -m "Added attic_gremlin" &&
+       (cd "$CVSWORK" &&
+       echo >attic_gremlin &&
+       cvs -Q add attic_gremlin &&
+       cvs -Q ci -m "added attic_gremlin" &&
+       rm attic_gremlin &&
+       cvs -Q rm attic_gremlin &&
+       cvs -Q ci -m "removed attic_gremlin") &&
+
+       echo > attic_gremlin &&
+       git add attic_gremlin &&
+       git commit -m "Added attic_gremlin" &&
        git cvsexportcommit -w "$CVSWORK" -c HEAD &&
-    (cd "$CVSWORK" && cvs -Q update -d) &&
-    test -f "$CVSWORK/attic_gremlin"
+       (cd "$CVSWORK" && cvs -Q update -d) &&
+       test -f "$CVSWORK/attic_gremlin"
 '
 
 # the state of the CVS sandbox may be indeterminate for ' space'
index aa55b41b9a97eaaadf9910ddfd62e0e349d405c8..ac237a1f906b2a05226c4cc7002763813dc543b7 100755 (executable)
@@ -388,9 +388,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 
        INPUT_END
 
-       test_when_finished "rm -f .git/TEMP_TAG
-               git gc
-               git prune" &&
+       test_when_finished "rm -f .git/TEMP_TAG && git gc --prune=now" &&
        git fast-import <input &&
        test $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d " " ) != "$ZERO_OID" &&
        test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
@@ -406,8 +404,7 @@ test_expect_success 'B: accept empty committer' '
        INPUT_END
 
        test_when_finished "git update-ref -d refs/heads/empty-committer-1
-               git gc
-               git prune" &&
+               git gc --prune=now" &&
        git fast-import <input &&
        out=$(git fsck) &&
        echo "$out" &&
@@ -452,8 +449,7 @@ test_expect_success 'B: accept and fixup committer with no name' '
        INPUT_END
 
        test_when_finished "git update-ref -d refs/heads/empty-committer-2
-               git gc
-               git prune" &&
+               git gc --prune=now" &&
        git fast-import <input &&
        out=$(git fsck) &&
        echo "$out" &&
@@ -1778,8 +1774,7 @@ test_expect_success 'P: verbatim SHA gitlinks' '
        INPUT_END
 
        git branch -D sub &&
-       git gc &&
-       git prune &&
+       git gc --prune=now &&
        git fast-import <input &&
        test $(git rev-parse --verify subuse2) = $(git rev-parse --verify subuse1)
 '
index 379b19f2f85157c83e8259b3ae7df52c44665820..003c0b61d0ff45864630782a509a018ff4079116 100755 (executable)
@@ -66,10 +66,11 @@ test_expect_success 'setup' '
 
 # note that cvs doesn't accept absolute pathnames
 # as argument to co -d
-test_expect_success 'basic checkout' \
-  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
-   test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
-   test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
+test_expect_success 'basic checkout' '
+       GIT_CONFIG="$git_config" cvs -Q co -d cvswork main &&
+       test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" &&
+       test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"
+'
 
 #------------------------
 # PSERVER AUTHENTICATION
@@ -115,35 +116,40 @@ Ah<Z:yZZ30 e
 END VERIFICATION REQUEST
 EOF
 
-test_expect_success 'pserver authentication' \
-  'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'pserver authentication' '
+       cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
-test_expect_success 'pserver authentication failure (non-anonymous user)' \
-  'if cat request-git | git-cvsserver pserver >log 2>&1
-   then
-       false
-   else
-       true
-   fi &&
-   sed -ne \$p log | grep "^I HATE YOU\$"'
+test_expect_success 'pserver authentication failure (non-anonymous user)' '
+       if cat request-git | git-cvsserver pserver >log 2>&1
+       then
+           false
+       else
+           true
+       fi &&
+       sed -ne \$p log | grep "^I HATE YOU\$"
+'
 
-test_expect_success 'pserver authentication success (non-anonymous user with password)' \
-  'cat login-git-ok | git-cvsserver pserver >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'pserver authentication success (non-anonymous user with password)' '
+       cat login-git-ok | git-cvsserver pserver >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
-test_expect_success 'pserver authentication (login)' \
-  'cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'pserver authentication (login)' '
+       cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
-test_expect_success 'pserver authentication failure (login/non-anonymous user)' \
-  'if cat login-git | git-cvsserver pserver >log 2>&1
-   then
-       false
-   else
-       true
-   fi &&
-   sed -ne \$p log | grep "^I HATE YOU\$"'
+test_expect_success 'pserver authentication failure (login/non-anonymous user)' '
+       if cat login-git | git-cvsserver pserver >log 2>&1
+       then
+           false
+       else
+           true
+       fi &&
+       sed -ne \$p log | grep "^I HATE YOU\$"
+'
 
 
 # misuse pserver authentication for testing of req_Root
@@ -165,36 +171,40 @@ END AUTH REQUEST
 Root $WORKDIR
 EOF
 
-test_expect_success 'req_Root failure (relative pathname)' \
-  'if cat request-relative | git-cvsserver pserver >log 2>&1
-   then
-       echo unexpected success
-       false
-   else
-       true
-   fi &&
-   tail log | grep "^error 1 Root must be an absolute pathname$"'
+test_expect_success 'req_Root failure (relative pathname)' '
+       if cat request-relative | git-cvsserver pserver >log 2>&1
+       then
+               echo unexpected success
+               false
+       else
+               true
+       fi &&
+       tail log | grep "^error 1 Root must be an absolute pathname$"
+'
 
-test_expect_success 'req_Root failure (conflicting roots)' \
-  'cat request-conflict | git-cvsserver pserver >log 2>&1 &&
-   tail log | grep "^error 1 Conflicting roots specified$"'
+test_expect_success 'req_Root failure (conflicting roots)' '
+       cat request-conflict | git-cvsserver pserver >log 2>&1 &&
+       tail log | grep "^error 1 Conflicting roots specified$"
+'
 
-test_expect_success 'req_Root (strict paths)' \
-  'cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (strict paths)' '
+       cat request-anonymous | git-cvsserver --strict-paths pserver "$SERVERDIR" >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
 test_expect_success 'req_Root failure (strict-paths)' '
-    ! cat request-anonymous |
-    git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1
+       ! cat request-anonymous |
+       git-cvsserver --strict-paths pserver "$WORKDIR" >log 2>&1
 '
 
-test_expect_success 'req_Root (w/o strict-paths)' \
-  'cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (w/o strict-paths)' '
+       cat request-anonymous | git-cvsserver pserver "$WORKDIR/" >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
 test_expect_success 'req_Root failure (w/o strict-paths)' '
-    ! cat request-anonymous |
-    git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1
+       ! cat request-anonymous |
+       git-cvsserver pserver "$WORKDIR/gitcvs" >log 2>&1
 '
 
 cat >request-base  <<EOF
@@ -206,27 +216,30 @@ END AUTH REQUEST
 Root /gitcvs.git
 EOF
 
-test_expect_success 'req_Root (base-path)' \
-  'cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (base-path)' '
+       cat request-base | git-cvsserver --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
 test_expect_success 'req_Root failure (base-path)' '
-    ! cat request-anonymous |
-    git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1
+       ! cat request-anonymous |
+       git-cvsserver --strict-paths --base-path "$WORKDIR" pserver "$SERVERDIR" >log 2>&1
 '
 
 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false || exit 1
 
-test_expect_success 'req_Root (export-all)' \
-  'cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (export-all)' '
+       cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
-test_expect_success 'req_Root failure (export-all w/o directory list)' \
-  '! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
+test_expect_success 'req_Root failure (export-all w/o directory list)' '
+       ! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
 
-test_expect_success 'req_Root (everything together)' \
-  'cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
-   sed -ne \$p log | grep "^I LOVE YOU\$"'
+test_expect_success 'req_Root (everything together)' '
+       cat request-base | git-cvsserver --export-all --strict-paths --base-path "$WORKDIR/" pserver "$SERVERDIR" >log 2>&1 &&
+       sed -ne \$p log | grep "^I LOVE YOU\$"
+'
 
 GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1
 
@@ -247,45 +260,49 @@ test_expect_success 'gitcvs.enabled = false' \
    test ! -d cvswork2'
 
 rm -fr cvswork2
-test_expect_success 'gitcvs.ext.enabled = true' \
-  'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
-   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
-   test_cmp cvswork cvswork2'
+test_expect_success 'gitcvs.ext.enabled = true' '
+       GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
+       GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
+       GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
+       test_cmp cvswork cvswork2
+'
 
 rm -fr cvswork2
-test_expect_success 'gitcvs.ext.enabled = false' \
-  'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
-   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
-   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
-   then
-     echo unexpected cvs success
-     false
-   else
-     true
-   fi &&
-   grep "GITCVS emulation disabled" cvs.log &&
-   test ! -d cvswork2'
+test_expect_success 'gitcvs.ext.enabled = false' '
+       GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
+       GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
+       if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1
+       then
+               echo unexpected cvs success
+               false
+       else
+               true
+       fi &&
+       grep "GITCVS emulation disabled" cvs.log &&
+       test ! -d cvswork2
+'
 
 rm -fr cvswork2
-test_expect_success 'gitcvs.dbname' \
-  'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
-   GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
-   test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"'
+test_expect_success 'gitcvs.dbname' '
+       GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
+       GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
+       GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
+       test_cmp cvswork cvswork2 &&
+       test -f "$SERVERDIR/gitcvs.ext.main.sqlite" &&
+       cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"
+'
 
 rm -fr cvswork2
-test_expect_success 'gitcvs.ext.dbname' \
-  'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
-   GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
-   GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
-   GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
-   test_cmp cvswork cvswork2 &&
-   test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
-   test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
-   cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"'
+test_expect_success 'gitcvs.ext.dbname' '
+       GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
+       GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
+       GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
+       GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
+       test_cmp cvswork cvswork2 &&
+       test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" &&
+       test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" &&
+       cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"
+'
 
 
 #------------
@@ -299,109 +316,115 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
 GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
 exit 1
 
-test_expect_success 'cvs update (create new file)' \
-  'echo testfile1 >testfile1 &&
-   git add testfile1 &&
-   git commit -q -m "Add testfile1" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
-   test_cmp testfile1 ../testfile1'
+test_expect_success 'cvs update (create new file)' '
+       echo testfile1 >testfile1 &&
+       git add testfile1 &&
+       git commit -q -m "Add testfile1" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
+       test_cmp testfile1 ../testfile1
+'
 
 cd "$WORKDIR"
-test_expect_success 'cvs update (update existing file)' \
-  'echo line 2 >>testfile1 &&
-   git add testfile1 &&
-   git commit -q -m "Append to testfile1" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
-   test_cmp testfile1 ../testfile1'
+test_expect_success 'cvs update (update existing file)' '
+       echo line 2 >>testfile1 &&
+       git add testfile1 &&
+       git commit -q -m "Append to testfile1" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
+       test_cmp testfile1 ../testfile1
+'
 
 cd "$WORKDIR"
 #TODO: cvsserver doesn't support update w/o -d
 test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" '
-   mkdir test &&
-   echo >test/empty &&
-   git add test &&
-   git commit -q -m "Single Subdirectory" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test ! -d test
+       mkdir test &&
+       echo >test/empty &&
+       git add test &&
+       git commit -q -m "Single Subdirectory" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test ! -d test
 '
 
 cd "$WORKDIR"
-test_expect_success 'cvs update (subdirectories)' \
-  '(for dir in A A/B A/B/C A/D E; do
-      mkdir $dir &&
-      echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")"  &&
-      git add $dir || exit 1
-   done) &&
-   git commit -q -m "deep sub directory structure" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update -d &&
-   (for dir in A A/B A/B/C A/D E; do
-      filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
-      if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
-       test_cmp "$dir/$filename" "../$dir/$filename"; then
-        :
-      else
-       exit 1
-      fi
-    done)'
+test_expect_success 'cvs update (subdirectories)' '
+       (for dir in A A/B A/B/C A/D E; do
+               mkdir $dir &&
+               echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")"  &&
+               git add $dir || exit 1
+       done) &&
+       git commit -q -m "deep sub directory structure" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update -d &&
+       (for dir in A A/B A/B/C A/D E; do
+               filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
+               if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
+                       test_cmp "$dir/$filename" "../$dir/$filename"; then
+               :
+               else
+                       exit 1
+               fi
+       done)
+'
 
 cd "$WORKDIR"
-test_expect_success 'cvs update (delete file)' \
-  'git rm testfile1 &&
-   git commit -q -m "Remove testfile1" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test -z "$(grep testfile1 CVS/Entries)" &&
-   test ! -f testfile1'
+test_expect_success 'cvs update (delete file)' '
+       git rm testfile1 &&
+       git commit -q -m "Remove testfile1" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test -z "$(grep testfile1 CVS/Entries)" &&
+       test ! -f testfile1
+'
 
 cd "$WORKDIR"
-test_expect_success 'cvs update (re-add deleted file)' \
-  'echo readded testfile >testfile1 &&
-   git add testfile1 &&
-   git commit -q -m "Re-Add testfile1" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
-   test_cmp testfile1 ../testfile1'
+test_expect_success 'cvs update (re-add deleted file)' '
+       echo readded testfile >testfile1 &&
+       git add testfile1 &&
+       git commit -q -m "Re-Add testfile1" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
+       test_cmp testfile1 ../testfile1
+'
 
 cd "$WORKDIR"
-test_expect_success 'cvs update (merge)' \
-  'echo Line 0 >expected &&
-   for i in 1 2 3 4 5 6 7
-   do
-     echo Line $i >>merge &&
-     echo Line $i >>expected || return 1
-   done &&
-   echo Line 8 >>expected &&
-   git add merge &&
-   git commit -q -m "Merge test (pre-merge)" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
-   test_cmp merge ../merge &&
-   ( echo Line 0 && cat merge ) >merge.tmp &&
-   mv merge.tmp merge &&
-   cd "$WORKDIR" &&
-   echo Line 8 >>merge &&
-   git add merge &&
-   git commit -q -m "Merge test (merge)" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   sleep 1 && touch merge &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test_cmp merge ../expected'
+test_expect_success 'cvs update (merge)' '
+       echo Line 0 >expected &&
+       for i in 1 2 3 4 5 6 7
+       do
+               echo Line $i >>merge &&
+               echo Line $i >>expected || return 1
+       done &&
+       echo Line 8 >>expected &&
+       git add merge &&
+       git commit -q -m "Merge test (pre-merge)" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
+       test_cmp merge ../merge &&
+       ( echo Line 0 && cat merge ) >merge.tmp &&
+       mv merge.tmp merge &&
+       cd "$WORKDIR" &&
+       echo Line 8 >>merge &&
+       git add merge &&
+       git commit -q -m "Merge test (merge)" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       sleep 1 && touch merge &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test_cmp merge ../expected
+'
 
 cd "$WORKDIR"
 
@@ -418,55 +441,58 @@ do
   echo Line $i >>expected.C
 done
 
-test_expect_success 'cvs update (conflict merge)' \
-  '( echo LINE 0 && cat merge ) >merge.tmp &&
-   mv merge.tmp merge &&
-   git add merge &&
-   git commit -q -m "Merge test (conflict)" &&
-   git push gitcvs.git >/dev/null &&
-   cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update &&
-   test_cmp merge ../expected.C'
+test_expect_success 'cvs update (conflict merge)' '
+       ( echo LINE 0 && cat merge ) >merge.tmp &&
+       mv merge.tmp merge &&
+       git add merge &&
+       git commit -q -m "Merge test (conflict)" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test_cmp merge ../expected.C
+'
 
 cd "$WORKDIR"
-test_expect_success 'cvs update (-C)' \
-  'cd cvswork &&
-   GIT_CONFIG="$git_config" cvs -Q update -C &&
-   test_cmp merge ../merge'
+test_expect_success 'cvs update (-C)' '
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs -Q update -C &&
+       test_cmp merge ../merge
+'
 
 cd "$WORKDIR"
-test_expect_success 'cvs update (merge no-op)' \
-   'echo Line 9 >>merge &&
-    cp merge cvswork/merge &&
-    git add merge &&
-    git commit -q -m "Merge test (no-op)" &&
-    git push gitcvs.git >/dev/null &&
-    cd cvswork &&
-    sleep 1 && touch merge &&
-    GIT_CONFIG="$git_config" cvs -Q update &&
-    test_cmp merge ../merge'
+test_expect_success 'cvs update (merge no-op)' '
+       echo Line 9 >>merge &&
+       cp merge cvswork/merge &&
+       git add merge &&
+       git commit -q -m "Merge test (no-op)" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       sleep 1 && touch merge &&
+       GIT_CONFIG="$git_config" cvs -Q update &&
+       test_cmp merge ../merge
+'
 
 cd "$WORKDIR"
 test_expect_success 'cvs update (-p)' '
-    touch really-empty &&
-    echo Line 1 > no-lf &&
-    printf "Line 2" >> no-lf &&
-    git add really-empty no-lf &&
-    git commit -q -m "Update -p test" &&
-    git push gitcvs.git >/dev/null &&
-    cd cvswork &&
-    GIT_CONFIG="$git_config" cvs update &&
-    for i in merge no-lf empty really-empty; do
-       GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out &&
-       test_cmp $i.out ../$i || return 1
-    done
+       touch really-empty &&
+       echo Line 1 > no-lf &&
+       printf "Line 2" >> no-lf &&
+       git add really-empty no-lf &&
+       git commit -q -m "Update -p test" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs update &&
+       for i in merge no-lf empty really-empty; do
+               GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out &&
+               test_cmp $i.out ../$i || return 1
+       done
 '
 
 cd "$WORKDIR"
 test_expect_success 'cvs update (module list supports packed refs)' '
-    GIT_DIR="$SERVERDIR" git pack-refs --all &&
-    GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
-    grep "cvs update: New directory \`main'\''" < out
+       GIT_DIR="$SERVERDIR" git pack-refs --all &&
+       GIT_CONFIG="$git_config" cvs -n up -d 2> out &&
+       grep "cvs update: New directory \`main'\''" < out
 '
 
 #------------
@@ -475,30 +501,30 @@ test_expect_success 'cvs update (module list supports packed refs)' '
 
 cd "$WORKDIR"
 test_expect_success 'cvs status' '
-    mkdir status.dir &&
-    echo Line > status.dir/status.file &&
-    echo Line > status.file &&
-    git add status.dir status.file &&
-    git commit -q -m "Status test" &&
-    git push gitcvs.git >/dev/null &&
-    cd cvswork &&
-    GIT_CONFIG="$git_config" cvs update &&
-    GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
-    test_line_count = 2 ../out
+       mkdir status.dir &&
+       echo Line > status.dir/status.file &&
+       echo Line > status.file &&
+       git add status.dir status.file &&
+       git commit -q -m "Status test" &&
+       git push gitcvs.git >/dev/null &&
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs update &&
+       GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
+       test_line_count = 2 ../out
 '
 
 cd "$WORKDIR"
 test_expect_success 'cvs status (nonrecursive)' '
-    cd cvswork &&
-    GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
-    test_line_count = 1 ../out
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
+       test_line_count = 1 ../out
 '
 
 cd "$WORKDIR"
 test_expect_success 'cvs status (no subdirs in header)' '
-    cd cvswork &&
-    GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
-    ! grep / <../out
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs status | grep ^File: >../out &&
+       ! grep / <../out
 '
 
 #------------
@@ -507,9 +533,9 @@ test_expect_success 'cvs status (no subdirs in header)' '
 
 cd "$WORKDIR"
 test_expect_success 'cvs co -c (shows module database)' '
-    GIT_CONFIG="$git_config" cvs co -c > out &&
-    grep "^main[        ][     ]*main$" <out &&
-    ! grep -v "^main[   ][     ]*main$" <out
+       GIT_CONFIG="$git_config" cvs co -c > out &&
+       grep "^main[     ][     ]*main$" <out &&
+       ! grep -v "^main[        ][     ]*main$" <out
 '
 
 #------------
@@ -575,11 +601,11 @@ expectStat="$?"
 
 cd "$WORKDIR"
 test_expect_success 'cvs log' '
-    cd cvswork &&
-    test x"$expectStat" = x"0" &&
-    GIT_CONFIG="$git_config" cvs log merge >../out &&
-    sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
-    test_cmp ../expect ../actual
+       cd cvswork &&
+       test x"$expectStat" = x"0" &&
+       GIT_CONFIG="$git_config" cvs log merge >../out &&
+sed -e "s%2[0-9][0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]%__DATE__%" ../out > ../actual &&
+       test_cmp ../expect ../actual
 '
 
 #------------
@@ -588,11 +614,11 @@ test_expect_success 'cvs log' '
 
 cd "$WORKDIR"
 test_expect_success 'cvs annotate' '
-    cd cvswork &&
-    GIT_CONFIG="$git_config" cvs annotate merge >../out &&
-    sed -e "s/ .*//" ../out >../actual &&
-    printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect &&
-    test_cmp ../expect ../actual
+       cd cvswork &&
+       GIT_CONFIG="$git_config" cvs annotate merge >../out &&
+       sed -e "s/ .*//" ../out >../actual &&
+       printf "1.%d\n" 3 1 1 1 1 1 1 1 2 4 >../expect &&
+       test_cmp ../expect ../actual
 '
 
 #------------
index dc88d0e064931aab48a3e93002cc67416090282c..a4b3cb94929c9cddfdb5a751f39b42acdb2529ab 100755 (executable)
@@ -330,7 +330,7 @@ test_expect_success 'initial import time from top change time' '
        test_when_finished cleanup_git &&
        (
                cd "$git" &&
-               gittime=$(git show -s --raw --pretty=format:%at HEAD) &&
+               gittime=$(git show -s --pretty=format:%at HEAD) &&
                echo $p4time $gittime &&
                test $p4time = $gittime
        )
index d6c0478d98b85412307a422b142386c180ad030a..8835e16e8110f458885c977d4002685a2fc16662 100755 (executable)
@@ -405,40 +405,40 @@ test_expect_success '__gitdir - remote as argument' '
 
 test_expect_success '__git_dequote - plain unquoted word' '
        __git_dequote unquoted-word &&
-       verbose test unquoted-word = "$dequoted_word"
+       test unquoted-word = "$dequoted_word"
 '
 
 # input:    b\a\c\k\'\\\"s\l\a\s\h\es
 # expected: back'\"slashes
 test_expect_success '__git_dequote - backslash escaped' '
        __git_dequote "b\a\c\k\\'\''\\\\\\\"s\l\a\s\h\es" &&
-       verbose test "back'\''\\\"slashes" = "$dequoted_word"
+       test "back'\''\\\"slashes" = "$dequoted_word"
 '
 
 # input:    sin'gle\' '"quo'ted
 # expected: single\ "quoted
 test_expect_success '__git_dequote - single quoted' '
        __git_dequote "'"sin'gle\\\\' '\\\"quo'ted"'" &&
-       verbose test '\''single\ "quoted'\'' = "$dequoted_word"
+       test '\''single\ "quoted'\'' = "$dequoted_word"
 '
 
 # input:    dou"ble\\" "\"\quot"ed
 # expected: double\ "\quoted
 test_expect_success '__git_dequote - double quoted' '
        __git_dequote '\''dou"ble\\" "\"\quot"ed'\'' &&
-       verbose test '\''double\ "\quoted'\'' = "$dequoted_word"
+       test '\''double\ "\quoted'\'' = "$dequoted_word"
 '
 
 # input: 'open single quote
 test_expect_success '__git_dequote - open single quote' '
        __git_dequote "'\''open single quote" &&
-       verbose test "open single quote" = "$dequoted_word"
+       test "open single quote" = "$dequoted_word"
 '
 
 # input: "open double quote
 test_expect_success '__git_dequote - open double quote' '
        __git_dequote "\"open double quote" &&
-       verbose test "open double quote" = "$dequoted_word"
+       test "open double quote" = "$dequoted_word"
 '
 
 
@@ -616,7 +616,7 @@ test_expect_success '__git_is_configured_remote' '
        test_when_finished "git remote remove remote_2" &&
        git remote add remote_2 git://remote_2 &&
        (
-               verbose __git_is_configured_remote remote_2 &&
+               __git_is_configured_remote remote_2 &&
                test_must_fail __git_is_configured_remote non-existent
        )
 '
@@ -2596,30 +2596,30 @@ test_expect_success 'options with value' '
 test_expect_success 'sourcing the completion script clears cached commands' '
        (
                __git_compute_all_commands &&
-               verbose test -n "$__git_all_commands" &&
+               test -n "$__git_all_commands" &&
                . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
-               verbose test -z "$__git_all_commands"
+               test -z "$__git_all_commands"
        )
 '
 
 test_expect_success 'sourcing the completion script clears cached merge strategies' '
        (
                __git_compute_merge_strategies &&
-               verbose test -n "$__git_merge_strategies" &&
+               test -n "$__git_merge_strategies" &&
                . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
-               verbose test -z "$__git_merge_strategies"
+               test -z "$__git_merge_strategies"
        )
 '
 
 test_expect_success 'sourcing the completion script clears cached --options' '
        (
                __gitcomp_builtin checkout &&
-               verbose test -n "$__gitcomp_builtin_checkout" &&
+               test -n "$__gitcomp_builtin_checkout" &&
                __gitcomp_builtin notes_edit &&
-               verbose test -n "$__gitcomp_builtin_notes_edit" &&
+               test -n "$__gitcomp_builtin_notes_edit" &&
                . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
-               verbose test -z "$__gitcomp_builtin_checkout" &&
-               verbose test -z "$__gitcomp_builtin_notes_edit"
+               test -z "$__gitcomp_builtin_checkout" &&
+               test -z "$__gitcomp_builtin_notes_edit"
        )
 '
 
index 999d46fafe783134aa921c6316f3f6b0a58c5d7f..2f8868caa171d2d3ce78f3672e937ab7f8a3db97 100644 (file)
@@ -542,8 +542,17 @@ test_config () {
                config_dir=$1
                shift
        fi
-       test_when_finished "test_unconfig ${config_dir:+-C '$config_dir'} '$1'" &&
-       git ${config_dir:+-C "$config_dir"} config "$@"
+
+       # If --worktree is provided, use it to configure/unconfigure
+       is_worktree=
+       if test "$1" = --worktree
+       then
+               is_worktree=1
+               shift
+       fi
+
+       test_when_finished "test_unconfig ${config_dir:+-C '$config_dir'} ${is_worktree:+--worktree} '$1'" &&
+       git ${config_dir:+-C "$config_dir"} config ${is_worktree:+--worktree} "$@"
 }
 
 test_config_global () {
@@ -901,6 +910,15 @@ test_path_is_symlink () {
        fi
 }
 
+test_path_is_executable () {
+       test "$#" -ne 1 && BUG "1 param"
+       if ! test -x "$1"
+       then
+               echo "$1 is not executable"
+               false
+       fi
+}
+
 # Check if the directory exists and is empty as expected, barf otherwise.
 test_dir_is_empty () {
        test "$#" -ne 1 && BUG "1 param"
@@ -1227,15 +1245,6 @@ test_i18ngrep () {
        return 1
 }
 
-# Call any command "$@" but be more verbose about its
-# failure. This is handy for commands like "test" which do
-# not output anything when they fail.
-verbose () {
-       "$@" && return 0
-       echo >&4 "command failed: $(git rev-parse --sq-quote "$@")"
-       return 1
-}
-
 # Check if the file expected to be empty is indeed empty, and barfs
 # otherwise.
 
@@ -1282,6 +1291,39 @@ test_cmp_rev () {
        fi
 }
 
+# Tests that a commit message matches the expected text
+#
+# Usage: test_commit_message <rev> [-m <msg> | <file>]
+#
+# When using "-m" <msg> will have a line feed appended. If the second
+# argument is omitted then the expected message is read from stdin.
+
+test_commit_message () {
+       local msg_file=expect.msg
+
+       case $# in
+       3)
+               if test "$2" = "-m"
+               then
+                       printf "%s\n" "$3" >"$msg_file"
+               else
+                       BUG "Usage: test_commit_message <rev> [-m <message> | <file>]"
+               fi
+               ;;
+       2)
+               msg_file="$2"
+               ;;
+       1)
+               cat >"$msg_file"
+               ;;
+       *)
+               BUG "Usage: test_commit_message <rev> [-m <message> | <file>]"
+               ;;
+       esac
+       git show --no-patch --pretty=format:%B "$1" -- >actual.msg &&
+       test_cmp "$msg_file" actual.msg
+}
+
 # Compare paths respecting core.ignoreCase
 test_cmp_fspath () {
        if test "x$1" = "x$2"
diff --git a/tag.c b/tag.c
index 01ed67d6fa6ac214393f887df1c4e9826e5dbe08..fc3834db467dc4e83ca0a24da61a3f39048f3ec2 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "tag.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "tree.h"
 #include "blob.h"
@@ -9,7 +10,6 @@
 #include "gpg-interface.h"
 #include "hex.h"
 #include "packfile.h"
-#include "wrapper.h"
 
 const char *tag_type = "tag";
 
index 50c377134ce602c3a9f8ed1ec6344bd4da7eb18f..ecdebf1afb0d8465717c18409877fe310f980e46 100644 (file)
  */
 
 #include "git-compat-util.h"
+#include "abspath.h"
 #include "path.h"
 #include "tempfile.h"
 #include "sigchain.h"
-#include "wrapper.h"
 
 static VOLATILE_LIST_HEAD(tempfile_list);
 
diff --git a/templates/hooks--sendemail-validate.sample b/templates/hooks--sendemail-validate.sample
new file mode 100755 (executable)
index 0000000..640bcf8
--- /dev/null
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# An example hook script to validate a patch (and/or patch series) before
+# sending it via email.
+#
+# The hook should exit with non-zero status after issuing an appropriate
+# message if it wants to prevent the email(s) from being sent.
+#
+# To enable this hook, rename this file to "sendemail-validate".
+#
+# By default, it will only check that the patch(es) can be applied on top of
+# the default upstream branch without conflicts in a secondary worktree. After
+# validation (successful or not) of the last patch of a series, the worktree
+# will be deleted.
+#
+# The following config variables can be set to change the default remote and
+# remote ref that are used to apply the patches against:
+#
+#   sendemail.validateRemote (default: origin)
+#   sendemail.validateRemoteRef (default: HEAD)
+#
+# Replace the TODO placeholders with appropriate checks according to your
+# needs.
+
+validate_cover_letter () {
+       file="$1"
+       # TODO: Replace with appropriate checks (e.g. spell checking).
+       true
+}
+
+validate_patch () {
+       file="$1"
+       # Ensure that the patch applies without conflicts.
+       git am -3 "$file" || return
+       # TODO: Replace with appropriate checks for this patch
+       # (e.g. checkpatch.pl).
+       true
+}
+
+validate_series () {
+       # TODO: Replace with appropriate checks for the whole series
+       # (e.g. quick build, coding style checks, etc.).
+       true
+}
+
+# main -------------------------------------------------------------------------
+
+if test "$GIT_SENDEMAIL_FILE_COUNTER" = 1
+then
+       remote=$(git config --default origin --get sendemail.validateRemote) &&
+       ref=$(git config --default HEAD --get sendemail.validateRemoteRef) &&
+       worktree=$(mktemp --tmpdir -d sendemail-validate.XXXXXXX) &&
+       git worktree add -fd --checkout "$worktree" "refs/remotes/$remote/$ref" &&
+       git config --replace-all sendemail.validateWorktree "$worktree"
+else
+       worktree=$(git config --get sendemail.validateWorktree)
+fi || {
+       echo "sendemail-validate: error: failed to prepare worktree" >&2
+       exit 1
+}
+
+unset GIT_DIR GIT_WORK_TREE
+cd "$worktree" &&
+
+if grep -q "^diff --git " "$1"
+then
+       validate_patch "$1"
+else
+       validate_cover_letter "$1"
+fi &&
+
+if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL"
+then
+       git config --unset-all sendemail.validateWorktree &&
+       trap 'git worktree remove -ff "$worktree"' EXIT &&
+       validate_series
+fi
index 5adad1925d1a051c38c08f911dd6d5824e5de305..5f9074ad1c0b063a0cb906c2dc6182357adcd5ee 100644 (file)
@@ -1,15 +1,17 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "tmp-objdir.h"
 #include "abspath.h"
 #include "chdir-notify.h"
 #include "dir.h"
 #include "environment.h"
+#include "object-file.h"
+#include "path.h"
 #include "sigchain.h"
 #include "string-list.h"
 #include "strbuf.h"
 #include "strvec.h"
 #include "quote.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 struct tmp_objdir {
        struct strbuf path;
diff --git a/trace.c b/trace.c
index 81318a2455df4c9c3c0725bdd31314788cee4a17..971a68abe84bf02656bf9cd5eab584833f3da9f7 100644 (file)
--- a/trace.c
+++ b/trace.c
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "environment.h"
 #include "quote.h"
 #include "setup.h"
-#include "wrapper.h"
+#include "trace.h"
 
 struct trace_key trace_default_key = { "GIT_TRACE", 0, 0, 0 };
 struct trace_key trace_perf_key = TRACE_KEY_INIT(PERFORMANCE);
index e8ba62c0c3dc8293bd973f7d5c39d024f5eb85f7..6dc74dff4c73205d332a227b0caf2497b71f7538 100644 (file)
--- a/trace2.c
+++ b/trace2.c
@@ -2,11 +2,13 @@
 #include "config.h"
 #include "json-writer.h"
 #include "quote.h"
+#include "repository.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "thread-utils.h"
 #include "version.h"
 #include "trace.h"
+#include "trace2.h"
 #include "trace2/tr2_cfg.h"
 #include "trace2/tr2_cmd_name.h"
 #include "trace2/tr2_ctr.h"
@@ -274,7 +276,6 @@ void trace2_cmd_exit_fl(const char *file, int line, int code)
        if (!trace2_enabled)
                return;
 
-       trace_git_fsync_stats();
        trace2_collect_process_info(TRACE2_PROCESS_INFO_EXIT);
 
        tr2main_exit_code = code;
@@ -632,7 +633,7 @@ void trace2_thread_exit_fl(const char *file, int line)
 }
 
 void trace2_def_param_fl(const char *file, int line, const char *param,
-                        const char *value)
+                        const char *value, const struct key_value_info *kvi)
 {
        struct tr2_tgt *tgt_j;
        int j;
@@ -642,7 +643,7 @@ void trace2_def_param_fl(const char *file, int line, const char *param,
 
        for_each_wanted_builtin (j, tgt_j)
                if (tgt_j->pfn_param_fl)
-                       tgt_j->pfn_param_fl(file, line, param, value);
+                       tgt_j->pfn_param_fl(file, line, param, value, kvi);
 }
 
 void trace2_def_repo_fl(const char *file, int line, struct repository *repo)
index 4ced30c0db368b640fbaba439ad50049ba9041df..40d8c2e02a5e50ce4f24bc4bd656498773e0853e 100644 (file)
--- a/trace2.h
+++ b/trace2.h
@@ -325,6 +325,7 @@ void trace2_thread_exit_fl(const char *file, int line);
 
 #define trace2_thread_exit() trace2_thread_exit_fl(__FILE__, __LINE__)
 
+struct key_value_info;
 /*
  * Emits a "def_param" message containing a key/value pair.
  *
@@ -334,7 +335,7 @@ void trace2_thread_exit_fl(const char *file, int line);
  * `core.abbrev`, `status.showUntrackedFiles`, or `--no-ahead-behind`.
  */
 void trace2_def_param_fl(const char *file, int line, const char *param,
-                        const char *value);
+                        const char *value, const struct key_value_info *kvi);
 
 #define trace2_def_param(param, value) \
        trace2_def_param_fl(__FILE__, __LINE__, (param), (value))
@@ -540,7 +541,7 @@ void trace2_timer_stop(enum trace2_timer_id tid);
  * elsewhere as array indexes).
  *
  * Any values added to this enum be also be added to the
- * `tr2_counter_metadata[]` in `trace2/tr2_tr2_ctr.c`.
+ * `tr2_counter_metadata[]` in `trace2/tr2_ctr.c`.
  */
 enum trace2_counter_id {
        /*
@@ -551,6 +552,12 @@ enum trace2_counter_id {
        TRACE2_COUNTER_ID_TEST1 = 0, /* emits summary event only */
        TRACE2_COUNTER_ID_TEST2,     /* emits summary and thread events */
 
+       TRACE2_COUNTER_ID_PACKED_REFS_JUMPS, /* counts number of jumps */
+
+       /* counts number of fsyncs */
+       TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY,
+       TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH,
+
        /* Add additional counter definitions before here. */
        TRACE2_NUMBER_OF_COUNTERS
 };
index 78cfc15d52dd5800ea5bd610e5db7b0e73b4f8af..d96d908bb9df6fddb22e4dbecfa07882049bdf78 100644 (file)
@@ -4,6 +4,7 @@
 #include "trace2.h"
 #include "trace2/tr2_cfg.h"
 #include "trace2/tr2_sysenv.h"
+#include "wildmatch.h"
 
 static struct strbuf **tr2_cfg_patterns;
 static int tr2_cfg_count_patterns;
@@ -99,7 +100,8 @@ struct tr2_cfg_data {
 /*
  * See if the given config key matches any of our patterns of interest.
  */
-static int tr2_cfg_cb(const char *key, const char *value, void *d)
+static int tr2_cfg_cb(const char *key, const char *value,
+                     const struct config_context *ctx, void *d)
 {
        struct strbuf **s;
        struct tr2_cfg_data *data = (struct tr2_cfg_data *)d;
@@ -108,7 +110,8 @@ static int tr2_cfg_cb(const char *key, const char *value, void *d)
                struct strbuf *buf = *s;
                int wm = wildmatch(buf->buf, key, WM_CASEFOLD);
                if (wm == WM_MATCH) {
-                       trace2_def_param_fl(data->file, data->line, key, value);
+                       trace2_def_param_fl(data->file, data->line, key, value,
+                                           ctx->kvi);
                        return 0;
                }
        }
@@ -126,8 +129,10 @@ void tr2_cfg_list_config_fl(const char *file, int line)
 
 void tr2_list_env_vars_fl(const char *file, int line)
 {
+       struct key_value_info kvi = KVI_INIT;
        struct strbuf **s;
 
+       kvi_from_param(&kvi);
        if (tr2_load_env_vars() <= 0)
                return;
 
@@ -135,15 +140,19 @@ void tr2_list_env_vars_fl(const char *file, int line)
                struct strbuf *buf = *s;
                const char *val = getenv(buf->buf);
                if (val && *val)
-                       trace2_def_param_fl(file, line, buf->buf, val);
+                       trace2_def_param_fl(file, line, buf->buf, val, &kvi);
        }
 }
 
 void tr2_cfg_set_fl(const char *file, int line, const char *key,
                    const char *value)
 {
+       struct key_value_info kvi = KVI_INIT;
+       struct config_context ctx = {
+               .kvi = &kvi,
+       };
        struct tr2_cfg_data data = { file, line };
 
        if (tr2_cfg_load_patterns() > 0)
-               tr2_cfg_cb(key, value, &data);
+               tr2_cfg_cb(key, value, &ctx, &data);
 }
index b342d3b1a3c033bf539037bb5035ae57af119d6d..87cf9034fba4b91b4d569ea4013e13f9d19b4aa9 100644 (file)
@@ -27,6 +27,21 @@ static struct tr2_counter_metadata tr2_counter_metadata[TRACE2_NUMBER_OF_COUNTER
                .name = "test2",
                .want_per_thread_events = 1,
        },
+       [TRACE2_COUNTER_ID_PACKED_REFS_JUMPS] = {
+               .category = "packed-refs",
+               .name = "jumps_made",
+               .want_per_thread_events = 0,
+       },
+       [TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY] = {
+               .category = "fsync",
+               .name = "writeout-only",
+               .want_per_thread_events = 0,
+       },
+       [TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH] = {
+               .category = "fsync",
+               .name = "hardware-flush",
+               .want_per_thread_events = 0,
+       },
 
        /* Add additional metadata before here. */
 };
index 069786cb9274f6ab25324386730962503b834525..f26ec95ab4d867a278e1aacbf337d6eef986355f 100644 (file)
@@ -57,7 +57,8 @@ static struct tr2_sysenv_entry tr2_sysenv_settings[] = {
 };
 /* clang-format on */
 
-static int tr2_sysenv_cb(const char *key, const char *value, void *d)
+static int tr2_sysenv_cb(const char *key, const char *value,
+                        const struct config_context *ctx UNUSED, void *d)
 {
        int k;
 
index bf8745c4f0540cbe0f280e56d3938ec9939413cd..1f626cffea0fc01508beaa65248398faa8c0a8ab 100644 (file)
@@ -69,8 +69,10 @@ typedef void(tr2_tgt_evt_exec_result_fl_t)(const char *file, int line,
                                           uint64_t us_elapsed_absolute,
                                           int exec_id, int code);
 
+struct key_value_info;
 typedef void(tr2_tgt_evt_param_fl_t)(const char *file, int line,
-                                    const char *param, const char *value);
+                                    const char *param, const char *value,
+                                    const struct key_value_info *kvi);
 
 typedef void(tr2_tgt_evt_repo_fl_t)(const char *file, int line,
                                    const struct repository *repo);
index 9e7aab6d510e1205a15ba6cccb552c670ea8b689..53091781eca5dc788e1f9048b0679aae41e6b11a 100644 (file)
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "json-writer.h"
+#include "repository.h"
 #include "run-command.h"
 #include "version.h"
 #include "trace2/tr2_dst.h"
@@ -476,11 +477,11 @@ static void fn_exec_result_fl(const char *file, int line,
 }
 
 static void fn_param_fl(const char *file, int line, const char *param,
-                       const char *value)
+                       const char *value, const struct key_value_info *kvi)
 {
        const char *event_name = "def_param";
        struct json_writer jw = JSON_WRITER_INIT;
-       enum config_scope scope = current_config_scope();
+       enum config_scope scope = kvi->scope;
        const char *scope_name = config_scope_name(scope);
 
        jw_object_begin(&jw, 0);
index 8672c2c2d04c33d70a730119c196649534439446..d25ea131643c0b228280b438d2a38ffcd95f9a0d 100644 (file)
@@ -1,5 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
+#include "repository.h"
 #include "run-command.h"
 #include "quote.h"
 #include "version.h"
@@ -296,10 +297,10 @@ static void fn_exec_result_fl(const char *file, int line,
 }
 
 static void fn_param_fl(const char *file, int line, const char *param,
-                       const char *value)
+                       const char *value, const struct key_value_info *kvi)
 {
        struct strbuf buf_payload = STRBUF_INIT;
-       enum config_scope scope = current_config_scope();
+       enum config_scope scope = kvi->scope;
        const char *scope_name = config_scope_name(scope);
 
        strbuf_addf(&buf_payload, "def_param scope:%s %s=%s", scope_name, param,
index 3f2b2d53118f0820db816d1350413a9f06e7e58d..a6f9a8a193e058fc164a8e9bd8dc823b7a317a85 100644 (file)
@@ -1,5 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
+#include "repository.h"
 #include "run-command.h"
 #include "quote.h"
 #include "version.h"
@@ -438,12 +439,12 @@ static void fn_exec_result_fl(const char *file, int line,
 }
 
 static void fn_param_fl(const char *file, int line, const char *param,
-                       const char *value)
+                       const char *value, const struct key_value_info *kvi)
 {
        const char *event_name = "def_param";
        struct strbuf buf_payload = STRBUF_INIT;
        struct strbuf scope_payload = STRBUF_INIT;
-       enum config_scope scope = current_config_scope();
+       enum config_scope scope = kvi->scope;
        const char *scope_name = config_scope_name(scope);
 
        strbuf_addf(&buf_payload, "%s:%s", param, value);
index 9f46ae12f50f3ac9530db2d53879b03742f769fe..601c9e5036fb27a7f88957559f03821c2fffa4a2 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "thread-utils.h"
 #include "trace.h"
 #include "trace2/tr2_tls.h"
index a2c3ed6f28cc9fedffe50946acdb3594d21f9e7e..f408f9b058dbbc33b1360cf36e1e023b7bba1a54 100644 (file)
--- a/trailer.c
+++ b/trailer.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -482,6 +481,7 @@ static struct {
 };
 
 static int git_trailer_default_config(const char *conf_key, const char *value,
+                                     const struct config_context *ctx UNUSED,
                                      void *cb UNUSED)
 {
        const char *trailer_item, *variable_name;
@@ -514,6 +514,7 @@ static int git_trailer_default_config(const char *conf_key, const char *value,
 }
 
 static int git_trailer_config(const char *conf_key, const char *value,
+                             const struct config_context *ctx UNUSED,
                              void *cb UNUSED)
 {
        const char *trailer_item, *variable_name;
index 76d146ee88b8ff1e96441873ffe8ea79bf6f2d25..49811ef176dbc5af5e33fe47cf93cf1f57719f5e 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "transport.h"
 #include "quote.h"
 #include "run-command.h"
@@ -7,6 +7,8 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "object-name.h"
+#include "repository.h"
 #include "revision.h"
 #include "remote.h"
 #include "string-list.h"
@@ -17,7 +19,6 @@
 #include "refspec.h"
 #include "transport-internal.h"
 #include "protocol.h"
-#include "wrapper.h"
 
 static int debug;
 
index 89a220425ecf0e5a2684f76038827f7e8f0241d1..219af8fd50ed57c0fc0f954965e481b51e7aae72 100644 (file)
@@ -1,5 +1,5 @@
-#include "cache.h"
-#include "alloc.h"
+#include "git-compat-util.h"
+#include "advice.h"
 #include "config.h"
 #include "environment.h"
 #include "hex.h"
 #include "string-list.h"
 #include "oid-array.h"
 #include "sigchain.h"
+#include "trace2.h"
 #include "transport-internal.h"
 #include "protocol.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "color.h"
 #include "bundle-uri.h"
-#include "wrapper.h"
 
 static int transport_use_color = -1;
 static char transport_colors[][COLOR_MAXLEN] = {
@@ -317,7 +318,7 @@ 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;
+       size_t sid_len;
        const char *server_sid;
 
        connect_setup(transport, for_push);
index 69031d7cbae6a88c1fca3242e974d9cd435a4c78..8fc159b86ec02ac54d6c8886351b6c3c0ba058b9 100644 (file)
@@ -1,10 +1,25 @@
 /*
  * Helper functions for tree diff generation
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "hash.h"
 #include "tree.h"
+#include "tree-walk.h"
+
+/*
+ * Some mode bits are also used internally for computations.
+ *
+ * They *must* not overlap with any valid modes, and they *must* not be emitted
+ * to outside world - i.e. appear on disk or network. In other words, it's just
+ * temporary fields, which we internally use, but they have to stay in-house.
+ *
+ * ( such approach is valid, as standard S_IF* fits into 16 bits, and in Git
+ *   codebase mode is `unsigned int` which is assumed to be at least 32 bits )
+ */
+
+#define S_DIFFTREE_IFXMIN_NEQ  0x80000000
 
 /*
  * internal mode marker, saying a tree entry != entry of tp[imin]
@@ -302,7 +317,7 @@ static void skip_uninteresting(struct tree_desc *t, struct strbuf *base,
 
        while (t->size) {
                match = tree_entry_interesting(opt->repo->index, &t->entry,
-                                              base, 0, &opt->pathspec);
+                                              base, &opt->pathspec);
                if (match) {
                        if (match == all_entries_not_interesting)
                                t->size = 0;
index 38b6556478d037b67422e44e49453a7de60d7c9f..29ead71be1731c9e6bd94cf348551d5b4fae78e2 100644 (file)
@@ -1,10 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "tree-walk.h"
-#include "alloc.h"
 #include "dir.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-file.h"
+#include "object-store-ll.h"
+#include "trace2.h"
 #include "tree.h"
 #include "pathspec.h"
 #include "json-writer.h"
@@ -433,7 +434,7 @@ static inline int prune_traversal(struct index_state *istate,
        if (still_interesting < 0)
                return still_interesting;
        return tree_entry_interesting(istate, e, base,
-                                     0, info->pathspec);
+                                     info->pathspec);
 }
 
 int traverse_trees(struct index_state *istate,
@@ -1014,17 +1015,17 @@ static int match_wildcard_base(const struct pathspec_item *item,
 /*
  * Is a tree entry interesting given the pathspec we have?
  *
- * Pre-condition: either baselen == base_offset (i.e. empty path)
+ * Pre-condition: either baselen == 0 (i.e. empty path)
  * or base[baselen-1] == '/' (i.e. with trailing slash).
  */
 static enum interesting do_match(struct index_state *istate,
                                 const struct name_entry *entry,
-                                struct strbuf *base, int base_offset,
+                                struct strbuf *base,
                                 const struct pathspec *ps,
                                 int exclude)
 {
        int i;
-       int pathlen, baselen = base->len - base_offset;
+       int pathlen, baselen = base->len;
        enum interesting never_interesting = ps->has_wildcard ?
                entry_not_interesting : all_entries_not_interesting;
 
@@ -1042,7 +1043,7 @@ static enum interesting do_match(struct index_state *istate,
                    !(ps->magic & PATHSPEC_MAXDEPTH) ||
                    ps->max_depth == -1)
                        return all_entries_interesting;
-               return within_depth(base->buf + base_offset, baselen,
+               return within_depth(base->buf, baselen,
                                    !!S_ISDIR(entry->mode),
                                    ps->max_depth) ?
                        entry_interesting : entry_not_interesting;
@@ -1053,7 +1054,7 @@ static enum interesting do_match(struct index_state *istate,
        for (i = ps->nr - 1; i >= 0; i--) {
                const struct pathspec_item *item = ps->items+i;
                const char *match = item->match;
-               const char *base_str = base->buf + base_offset;
+               const char *base_str = base->buf;
                int matchlen = item->len, matched = 0;
 
                if ((!exclude &&   item->magic & PATHSPEC_EXCLUDE) ||
@@ -1146,9 +1147,9 @@ match_wildcards:
 
                strbuf_add(base, entry->path, pathlen);
 
-               if (!git_fnmatch(item, match, base->buf + base_offset,
+               if (!git_fnmatch(item, match, base->buf,
                                 item->nowildcard_len)) {
-                       strbuf_setlen(base, base_offset + baselen);
+                       strbuf_setlen(base, baselen);
                        goto interesting;
                }
 
@@ -1160,13 +1161,13 @@ match_wildcards:
                 * be performed in the submodule itself.
                 */
                if (ps->recurse_submodules && S_ISGITLINK(entry->mode) &&
-                   !ps_strncmp(item, match, base->buf + base_offset,
+                   !ps_strncmp(item, match, base->buf,
                                item->nowildcard_len)) {
-                       strbuf_setlen(base, base_offset + baselen);
+                       strbuf_setlen(base, baselen);
                        goto interesting;
                }
 
-               strbuf_setlen(base, base_offset + baselen);
+               strbuf_setlen(base, baselen);
 
                /*
                 * Match all directories. We'll try to match files
@@ -1202,9 +1203,9 @@ interesting:
                                return entry_interesting;
 
                        strbuf_add(base, entry->path, pathlen);
-                       ret = match_pathspec_attrs(istate, base->buf + base_offset,
-                                                  base->len - base_offset, item);
-                       strbuf_setlen(base, base_offset + baselen);
+                       ret = match_pathspec_attrs(istate, base->buf,
+                                                  base->len, item);
+                       strbuf_setlen(base, baselen);
                        if (!ret)
                                continue;
                }
@@ -1216,16 +1217,16 @@ interesting:
 /*
  * Is a tree entry interesting given the pathspec we have?
  *
- * Pre-condition: either baselen == base_offset (i.e. empty path)
+ * Pre-condition: either baselen == 0 (i.e. empty path)
  * or base[baselen-1] == '/' (i.e. with trailing slash).
  */
 enum interesting tree_entry_interesting(struct index_state *istate,
                                        const struct name_entry *entry,
-                                       struct strbuf *base, int base_offset,
+                                       struct strbuf *base,
                                        const struct pathspec *ps)
 {
        enum interesting positive, negative;
-       positive = do_match(istate, entry, base, base_offset, ps, 0);
+       positive = do_match(istate, entry, base, ps, 0);
 
        /*
         * case | entry | positive | negative | result
@@ -1262,7 +1263,7 @@ enum interesting tree_entry_interesting(struct index_state *istate,
            positive <= entry_not_interesting) /* #1, #2, #11, #12 */
                return positive;
 
-       negative = do_match(istate, entry, base, base_offset, ps, 1);
+       negative = do_match(istate, entry, base, ps, 1);
 
        /* #8, #18 */
        if (positive == all_entries_interesting &&
index 25fe27e352961f3747ea5d4391cff1b242a127b6..74cdceb3fed258eb7216ebec1fe8a86aef0fa264 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef TREE_WALK_H
 #define TREE_WALK_H
 
-#include "hash.h"
+#include "hash-ll.h"
 
 struct index_state;
+struct repository;
 
 #define MAX_TRAVERSE_TREES 8
 
@@ -223,7 +224,7 @@ enum interesting {
 
 enum interesting tree_entry_interesting(struct index_state *istate,
                                        const struct name_entry *,
-                                       struct strbuf *, int,
+                                       struct strbuf *,
                                        const struct pathspec *ps);
 
 #endif
diff --git a/tree.c b/tree.c
index 2b78708766bc275651d0289fe4646c3bbf19b79c..c745462f968ed11db2cca234c304dedb5b5c23ae 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -1,8 +1,9 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "cache-tree.h"
 #include "hex.h"
 #include "tree.h"
-#include "object-store.h"
+#include "object-name.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "commit.h"
 #include "tag.h"
@@ -31,7 +32,7 @@ int read_tree_at(struct repository *r,
        while (tree_entry(&desc, &entry)) {
                if (retval != all_entries_interesting) {
                        retval = tree_entry_interesting(r->index, &entry,
-                                                       base, 0, pathspec);
+                                                       base, pathspec);
                        if (retval == all_entries_not_interesting)
                                break;
                        if (retval == entry_not_interesting)
@@ -93,14 +94,72 @@ int read_tree(struct repository *r,
        return ret;
 }
 
-int cmp_cache_name_compare(const void *a_, const void *b_)
+int base_name_compare(const char *name1, size_t len1, int mode1,
+                     const char *name2, size_t len2, int mode2)
 {
-       const struct cache_entry *ce1, *ce2;
+       unsigned char c1, c2;
+       size_t len = len1 < len2 ? len1 : len2;
+       int cmp;
+
+       cmp = memcmp(name1, name2, len);
+       if (cmp)
+               return cmp;
+       c1 = name1[len];
+       c2 = name2[len];
+       if (!c1 && S_ISDIR(mode1))
+               c1 = '/';
+       if (!c2 && S_ISDIR(mode2))
+               c2 = '/';
+       return (c1 < c2) ? -1 : (c1 > c2) ? 1 : 0;
+}
+
+/*
+ * df_name_compare() is identical to base_name_compare(), except it
+ * compares conflicting directory/file entries as equal. Note that
+ * while a directory name compares as equal to a regular file, they
+ * then individually compare _differently_ to a filename that has
+ * a dot after the basename (because '\0' < '.' < '/').
+ *
+ * This is used by routines that want to traverse the git namespace
+ * but then handle conflicting entries together when possible.
+ */
+int df_name_compare(const char *name1, size_t len1, int mode1,
+                   const char *name2, size_t len2, int mode2)
+{
+       unsigned char c1, c2;
+       size_t len = len1 < len2 ? len1 : len2;
+       int cmp;
+
+       cmp = memcmp(name1, name2, len);
+       if (cmp)
+               return cmp;
+       /* Directories and files compare equal (same length, same name) */
+       if (len1 == len2)
+               return 0;
+       c1 = name1[len];
+       if (!c1 && S_ISDIR(mode1))
+               c1 = '/';
+       c2 = name2[len];
+       if (!c2 && S_ISDIR(mode2))
+               c2 = '/';
+       if (c1 == '/' && !c2)
+               return 0;
+       if (c2 == '/' && !c1)
+               return 0;
+       return c1 - c2;
+}
 
-       ce1 = *((const struct cache_entry **)a_);
-       ce2 = *((const struct cache_entry **)b_);
-       return cache_name_stage_compare(ce1->name, ce1->ce_namelen, ce_stage(ce1),
-                                 ce2->name, ce2->ce_namelen, ce_stage(ce2));
+int name_compare(const char *name1, size_t len1, const char *name2, size_t len2)
+{
+       size_t min_len = (len1 < len2) ? len1 : len2;
+       int cmp = memcmp(name1, name2, min_len);
+       if (cmp)
+               return cmp;
+       if (len1 < len2)
+               return -1;
+       if (len1 > len2)
+               return 1;
+       return 0;
 }
 
 struct tree *lookup_tree(struct repository *r, const struct object_id *oid)
diff --git a/tree.h b/tree.h
index 6efff003e2120e3cc5a82cda5bde904bfefa786d..1b5ecbda6b335b4962ee2150534dfd8c0a73964c 100644 (file)
--- a/tree.h
+++ b/tree.h
@@ -3,6 +3,7 @@
 
 #include "object.h"
 
+struct pathspec;
 struct repository;
 struct strbuf;
 
@@ -28,7 +29,15 @@ void free_tree_buffer(struct tree *tree);
 /* Parses and returns the tree in the given ent, chasing tags and commits. */
 struct tree *parse_tree_indirect(const struct object_id *oid);
 
-int cmp_cache_name_compare(const void *a_, const void *b_);
+/*
+ * Functions for comparing pathnames
+ */
+int base_name_compare(const char *name1, size_t len1, int mode1,
+                     const char *name2, size_t len2, int mode2);
+int df_name_compare(const char *name1, size_t len1, int mode1,
+                   const char *name2, size_t len2, int mode2);
+int name_compare(const char *name1, size_t len1,
+                const char *name2, size_t len2);
 
 #define READ_TREE_RECURSIVE 1
 typedef int (*read_tree_fn_t)(const struct object_id *, struct strbuf *, const char *, unsigned int, void *);
index 3ded68ecb6df517e6eb03ba1e00641a4894d4420..87517364dc0190acb499ca6d2972e69e1a9fe74e 100644 (file)
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
 #include "strvec.h"
 #include "repository.h"
 #include "config.h"
@@ -6,6 +7,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "name-hash.h"
 #include "tree.h"
 #include "tree-walk.h"
 #include "cache-tree.h"
 #include "progress.h"
 #include "refs.h"
 #include "attr.h"
+#include "read-cache.h"
 #include "split-index.h"
 #include "sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "symlinks.h"
+#include "trace2.h"
 #include "fsmonitor.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "promisor-remote.h"
 #include "entry.h"
 #include "parallel-checkout.h"
index 61c06eb7c506e7753fd291a8a32539d2fc21496b..9b827c307f6d565fe6becf25839f45f81340b8ce 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef UNPACK_TREES_H
 #define UNPACK_TREES_H
 
-#include "cache.h"
+#include "convert.h"
+#include "read-cache-ll.h"
 #include "strvec.h"
 #include "string-list.h"
 #include "tree-walk.h"
index e23f16dfdd220036f3b5bb93d24d8c1b4e7f4b96..94751477ab2d1e1ee28c291d3b1aaaa75e5fe3d4 100644 (file)
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -7,7 +7,8 @@
 #include "pkt-line.h"
 #include "sideband.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "oid-array.h"
 #include "tag.h"
 #include "object.h"
 #include "commit.h"
@@ -22,6 +23,7 @@
 #include "version.h"
 #include "string-list.h"
 #include "strvec.h"
+#include "trace2.h"
 #include "prio-queue.h"
 #include "protocol.h"
 #include "quote.h"
@@ -66,7 +68,7 @@ struct upload_pack_data {
        struct object_array have_obj;
        struct oid_array haves;                                 /* v2 only */
        struct string_list wanted_refs;                         /* v2 only */
-       struct string_list hidden_refs;
+       struct strvec hidden_refs;
 
        struct object_array shallows;
        struct string_list deepen_not;
@@ -117,13 +119,14 @@ struct upload_pack_data {
        unsigned allow_ref_in_want : 1;                         /* v2 only */
        unsigned allow_sideband_all : 1;                        /* v2 only */
        unsigned advertise_sid : 1;
+       unsigned sent_capabilities : 1;
 };
 
 static void upload_pack_data_init(struct upload_pack_data *data)
 {
        struct string_list symref = STRING_LIST_INIT_DUP;
        struct string_list wanted_refs = STRING_LIST_INIT_DUP;
-       struct string_list hidden_refs = STRING_LIST_INIT_DUP;
+       struct strvec hidden_refs = STRVEC_INIT;
        struct object_array want_obj = OBJECT_ARRAY_INIT;
        struct object_array have_obj = OBJECT_ARRAY_INIT;
        struct oid_array haves = OID_ARRAY_INIT;
@@ -158,7 +161,7 @@ static void upload_pack_data_clear(struct upload_pack_data *data)
 {
        string_list_clear(&data->symref, 1);
        string_list_clear(&data->wanted_refs, 1);
-       string_list_clear(&data->hidden_refs, 0);
+       strvec_clear(&data->hidden_refs);
        object_array_clear(&data->want_obj);
        object_array_clear(&data->have_obj);
        oid_array_clear(&data->haves);
@@ -598,11 +601,36 @@ static int get_common_commits(struct upload_pack_data *data,
        }
 }
 
+static int allow_hidden_refs(enum allow_uor allow_uor)
+{
+       if ((allow_uor & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1)
+               return 1;
+       return !(allow_uor & (ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1));
+}
+
+static void for_each_namespaced_ref_1(each_ref_fn fn,
+                                     struct upload_pack_data *data)
+{
+       const char **excludes = NULL;
+       /*
+        * If `data->allow_uor` allows fetching hidden refs, we need to
+        * mark all references (including hidden ones), to check in
+        * `is_our_ref()` below.
+        *
+        * Otherwise, we only care about whether each reference's object
+        * has the OUR_REF bit set or not, so do not need to visit
+        * hidden references.
+        */
+       if (allow_hidden_refs(data->allow_uor))
+               excludes = hidden_refs_to_excludes(&data->hidden_refs);
+
+       for_each_namespaced_ref(excludes, fn, data);
+}
+
+
 static int is_our_ref(struct object *o, enum allow_uor allow_uor)
 {
-       int allow_hidden_ref = (allow_uor &
-                               (ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1));
-       return o->flags & ((allow_hidden_ref ? HIDDEN_REF : 0) | OUR_REF);
+       return o->flags & ((allow_hidden_refs(allow_uor) ? 0 : HIDDEN_REF) | OUR_REF);
 }
 
 /*
@@ -851,7 +879,7 @@ static void deepen(struct upload_pack_data *data, int depth)
                 * marked with OUR_REF.
                 */
                head_ref_namespaced(check_ref, data);
-               for_each_namespaced_ref(check_ref, data);
+               for_each_namespaced_ref_1(check_ref, data);
 
                get_reachable_list(data, &reachable_shallows);
                result = get_shallow_commits(&reachable_shallows,
@@ -1067,7 +1095,7 @@ static void receive_needs(struct upload_pack_data *data,
                const char *features;
                struct object_id oid_buf;
                const char *arg;
-               int feature_len;
+               size_t feature_len;
 
                reset_timeout(data->timeout);
                if (packet_reader_read(reader) != PACKET_READ_NORMAL)
@@ -1166,7 +1194,7 @@ static void receive_needs(struct upload_pack_data *data,
 
 /* return non-zero if the ref is hidden, otherwise 0 */
 static int mark_our_ref(const char *refname, const char *refname_full,
-                       const struct object_id *oid, const struct string_list *hidden_refs)
+                       const struct object_id *oid, const struct strvec *hidden_refs)
 {
        struct object *o = lookup_unknown_object(the_repository, oid);
 
@@ -1203,18 +1231,17 @@ static void format_session_id(struct strbuf *buf, struct upload_pack_data *d) {
                strbuf_addf(buf, " session-id=%s", trace2_session_id());
 }
 
-static int send_ref(const char *refname, const struct object_id *oid,
-                   int flag UNUSED, void *cb_data)
+static void write_v0_ref(struct upload_pack_data *data,
+                       const char *refname, const char *refname_nons,
+                       const struct object_id *oid)
 {
        static const char *capabilities = "multi_ack thin-pack side-band"
                " side-band-64k ofs-delta shallow deepen-since deepen-not"
                " deepen-relative no-progress include-tag multi_ack_detailed";
-       const char *refname_nons = strip_namespace(refname);
        struct object_id peeled;
-       struct upload_pack_data *data = cb_data;
 
        if (mark_our_ref(refname_nons, refname, oid, &data->hidden_refs))
-               return 0;
+               return;
 
        if (capabilities) {
                struct strbuf symref_info = STRBUF_INIT;
@@ -1237,12 +1264,20 @@ static int send_ref(const char *refname, const struct object_id *oid,
                             git_user_agent_sanitized());
                strbuf_release(&symref_info);
                strbuf_release(&session_id);
+               data->sent_capabilities = 1;
        } else {
                packet_fwrite_fmt(stdout, "%s %s\n", oid_to_hex(oid), refname_nons);
        }
        capabilities = NULL;
        if (!peel_iterated_oid(oid, &peeled))
                packet_fwrite_fmt(stdout, "%s %s^{}\n", oid_to_hex(&peeled), refname_nons);
+       return;
+}
+
+static int send_ref(const char *refname, const struct object_id *oid,
+                   int flag UNUSED, void *cb_data)
+{
+       write_v0_ref(cb_data, refname, strip_namespace(refname), oid);
        return 0;
 }
 
@@ -1264,7 +1299,8 @@ static int find_symref(const char *refname,
 }
 
 static int parse_object_filter_config(const char *var, const char *value,
-                                      struct upload_pack_data *data)
+                                     const struct key_value_info *kvi,
+                                     struct upload_pack_data *data)
 {
        struct strbuf buf = STRBUF_INIT;
        const char *sub, *key;
@@ -1291,14 +1327,17 @@ static int parse_object_filter_config(const char *var, const char *value,
                }
                string_list_insert(&data->allowed_filters, buf.buf)->util =
                        (void *)(intptr_t)1;
-               data->tree_filter_max_depth = git_config_ulong(var, value);
+               data->tree_filter_max_depth = git_config_ulong(var, value,
+                                                              kvi);
        }
 
        strbuf_release(&buf);
        return 0;
 }
 
-static int upload_pack_config(const char *var, const char *value, void *cb_data)
+static int upload_pack_config(const char *var, const char *value,
+                             const struct config_context *ctx,
+                             void *cb_data)
 {
        struct upload_pack_data *data = cb_data;
 
@@ -1318,7 +1357,7 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
                else
                        data->allow_uor &= ~ALLOW_ANY_SHA1;
        } else if (!strcmp("uploadpack.keepalive", var)) {
-               data->keepalive = git_config_int(var, value);
+               data->keepalive = git_config_int(var, value, ctx->kvi);
                if (!data->keepalive)
                        data->keepalive = -1;
        } else if (!strcmp("uploadpack.allowfilter", var)) {
@@ -1333,13 +1372,15 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
                data->advertise_sid = git_config_bool(var, value);
        }
 
-       if (parse_object_filter_config(var, value, data) < 0)
+       if (parse_object_filter_config(var, value, ctx->kvi, data) < 0)
                return -1;
 
        return parse_hide_refs_config(var, value, "uploadpack", &data->hidden_refs);
 }
 
-static int upload_pack_protected_config(const char *var, const char *value, void *cb_data)
+static int upload_pack_protected_config(const char *var, const char *value,
+                                       const struct config_context *ctx UNUSED,
+                                       void *cb_data)
 {
        struct upload_pack_data *data = cb_data;
 
@@ -1375,7 +1416,11 @@ void upload_pack(const int advertise_refs, const int stateless_rpc,
                if (advertise_refs)
                        data.no_done = 1;
                head_ref_namespaced(send_ref, &data);
-               for_each_namespaced_ref(send_ref, &data);
+               for_each_namespaced_ref_1(send_ref, &data);
+               if (!data.sent_capabilities) {
+                       const char *refname = "capabilities^{}";
+                       write_v0_ref(&data, refname, refname, null_oid());
+               }
                /*
                 * fflush stdout before calling advertise_shallow_grafts because send_ref
                 * uses stdio.
@@ -1385,7 +1430,7 @@ void upload_pack(const int advertise_refs, const int stateless_rpc,
                packet_flush(1);
        } else {
                head_ref_namespaced(check_ref, &data);
-               for_each_namespaced_ref(check_ref, &data);
+               for_each_namespaced_ref_1(check_ref, &data);
        }
 
        if (!advertise_refs) {
@@ -1450,7 +1495,7 @@ static int parse_want(struct packet_writer *writer, const char *line,
 
 static int parse_want_ref(struct packet_writer *writer, const char *line,
                          struct string_list *wanted_refs,
-                         struct string_list *hidden_refs,
+                         struct strvec *hidden_refs,
                          struct object_array *want_obj)
 {
        const char *refname_nons;
index eba0bdd77fe75bc4c0f836d88f9b7e8c4b91c995..1c45f23adf2c2fe770c147e9bbf0d5a557fcf688 100644 (file)
@@ -551,7 +551,8 @@ static int cmp_matches(const struct urlmatch_item *a,
        return 0;
 }
 
-int urlmatch_config_entry(const char *var, const char *value, void *cb)
+int urlmatch_config_entry(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb)
 {
        struct string_list_item *item;
        struct urlmatch_config *collect = cb;
@@ -565,7 +566,7 @@ int urlmatch_config_entry(const char *var, const char *value, void *cb)
 
        if (!skip_prefix(var, collect->section, &key) || *(key++) != '.') {
                if (collect->cascade_fn)
-                       return collect->cascade_fn(var, value, cb);
+                       return collect->cascade_fn(var, value, ctx, cb);
                return 0; /* not interested */
        }
        dot = strrchr(key, '.');
@@ -609,7 +610,7 @@ int urlmatch_config_entry(const char *var, const char *value, void *cb)
        strbuf_addstr(&synthkey, collect->section);
        strbuf_addch(&synthkey, '.');
        strbuf_addstr(&synthkey, key);
-       retval = collect->collect_fn(synthkey.buf, value, collect->cb);
+       retval = collect->collect_fn(synthkey.buf, value, ctx, collect->cb);
 
        strbuf_release(&synthkey);
        return retval;
index 9f40b00bfb82b1f32bf75e60538be145bbe9d116..5ba85cea1396dd10d18849eb9e6de85c9750403a 100644 (file)
@@ -2,6 +2,7 @@
 #define URL_MATCH_H
 
 #include "string-list.h"
+#include "config.h"
 
 struct url_info {
        /* normalized url on success, must be freed, otherwise NULL */
@@ -48,8 +49,8 @@ struct urlmatch_config {
        const char *key;
 
        void *cb;
-       int (*collect_fn)(const char *var, const char *value, void *cb);
-       int (*cascade_fn)(const char *var, const char *value, void *cb);
+       config_fn_t collect_fn;
+       config_fn_t cascade_fn;
        /*
         * Compare the two matches, the one just discovered and the existing
         * best match and return a negative value if the found item is to be
@@ -70,7 +71,8 @@ struct urlmatch_config {
        .vars = STRING_LIST_INIT_DUP, \
 }
 
-int urlmatch_config_entry(const char *var, const char *value, void *cb);
+int urlmatch_config_entry(const char *var, const char *value,
+                         const struct config_context *ctx, void *cb);
 void urlmatch_config_release(struct urlmatch_config *config);
 
 #endif /* URL_MATCH_H */
diff --git a/usage.c b/usage.c
index 46d99f8bd43a2456bf59337fab2101463c66b54b..09f0ed509b79c5a162f06a7f4cb5c5296d36be56 100644 (file)
--- a/usage.c
+++ b/usage.c
@@ -6,7 +6,6 @@
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "trace2.h"
-#include "wrapper.h"
 
 static void vreportf(const char *prefix, const char *err, va_list params)
 {
index eaec6ebb5e995b726cf1e93f23d716679f2baea9..e399543823bdf2c0c8f24fb87f7622ac4d8a366b 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "userdiff.h"
 #include "attr.h"
@@ -444,7 +443,7 @@ struct userdiff_driver *userdiff_find_by_path(struct index_state *istate,
                check = attr_check_initl("diff", NULL);
        if (!path)
                return NULL;
-       git_check_attr(istate, NULL, path, check);
+       git_check_attr(istate, path, check);
 
        if (ATTR_TRUE(check->items[0].value))
                return &driver_true;
index 7498da96e0e75fec5efbd92567891a5caeb136df..45e676cbca6314d1b65c11e76f754898f060dfda 100644 (file)
@@ -1,6 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
+#include "strbuf.h"
 #include "string-list.h"
+#include "versioncmp.h"
 
 /*
  * versioncmp(): copied from string/strverscmp.c in glibc commit
diff --git a/versioncmp.h b/versioncmp.h
new file mode 100644 (file)
index 0000000..879b510
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef VERSIONCMP_H
+#define VERSIONCMP_H
+
+int versioncmp(const char *s1, const char *s2);
+
+#endif /* VERSIONCMP_H */
index cfbd257fdbae4795d61754383f7e1a932fab862e..65002a7220adc2e60aafe6a29555df1cee167ad0 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -1,10 +1,11 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
 #include "walker.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
+#include "strbuf.h"
 #include "tree.h"
 #include "tree-walk.h"
 #include "tag.h"
index b5ee71c5ebda499899e5f64209611f0484359867..b8cf29e6a1587f5cbb2440a83ef5349fe49d0f48 100644 (file)
@@ -1,8 +1,8 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
+#include "path.h"
 #include "repository.h"
 #include "refs.h"
 #include "setup.h"
@@ -11,7 +11,6 @@
 #include "dir.h"
 #include "wt-status.h"
 #include "config.h"
-#include "wrapper.h"
 
 void free_worktrees(struct worktree **worktrees)
 {
@@ -806,7 +805,7 @@ int init_worktree_config(struct repository *r)
         * If the extension is already enabled, then we can skip the
         * upgrade process.
         */
-       if (repository_format_worktree_config)
+       if (r->repository_format_worktree_config)
                return 0;
        if ((res = git_config_set_gently("extensions.worktreeConfig", "true")))
                return error(_("failed to set extensions.worktreeConfig setting"));
@@ -835,7 +834,7 @@ int init_worktree_config(struct repository *r)
         * Relocate that value to avoid breaking all worktrees with this
         * upgrade to worktree config.
         */
-       if (!git_configset_get_value(&cs, "core.worktree", &core_worktree)) {
+       if (!git_configset_get_value(&cs, "core.worktree", &core_worktree, NULL)) {
                if ((res = move_config_setting("core.worktree", core_worktree,
                                               common_config_file,
                                               main_worktree_file)))
@@ -846,7 +845,7 @@ int init_worktree_config(struct repository *r)
         * Ensure that we use worktree config for the remaining lifetime
         * of the current process.
         */
-       repository_format_worktree_config = 1;
+       r->repository_format_worktree_config = 1;
 
 cleanup:
        git_configset_clear(&cs);
index ee83757590269f063a83c9c89cbd1b64ae22c044..5160c9e28de87af79e561db5917d021ad9a3a562 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
@@ -1,19 +1,19 @@
 /*
  * Various trivial helper wrappers around standard functions
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
 #include "gettext.h"
-#include "wrapper.h"
-
-static intmax_t count_fsync_writeout_only;
-static intmax_t count_fsync_hardware_flush;
+#include "object.h"
+#include "repository.h"
+#include "strbuf.h"
+#include "trace2.h"
 
 #ifdef HAVE_RTLGENRANDOM
 /* This is required to get access to RtlGenRandom. */
 #define SystemFunction036 NTAPI SystemFunction036
-#include <NTSecAPI.h>
+#include <ntsecapi.h>
 #undef SystemFunction036
 #endif
 
@@ -548,7 +548,7 @@ int git_fsync(int fd, enum fsync_action action)
 {
        switch (action) {
        case FSYNC_WRITEOUT_ONLY:
-               count_fsync_writeout_only += 1;
+               trace2_counter_add(TRACE2_COUNTER_ID_FSYNC_WRITEOUT_ONLY, 1);
 
 #ifdef __APPLE__
                /*
@@ -580,7 +580,7 @@ int git_fsync(int fd, enum fsync_action action)
                return -1;
 
        case FSYNC_HARDWARE_FLUSH:
-               count_fsync_hardware_flush += 1;
+               trace2_counter_add(TRACE2_COUNTER_ID_FSYNC_HARDWARE_FLUSH, 1);
 
                /*
                 * On macOS, a special fcntl is required to really flush the
@@ -597,18 +597,6 @@ int git_fsync(int fd, enum fsync_action action)
        }
 }
 
-static void log_trace_fsync_if(const char *key, intmax_t value)
-{
-       if (value)
-               trace2_data_intmax("fsync", the_repository, key, value);
-}
-
-void trace_git_fsync_stats(void)
-{
-       log_trace_fsync_if("fsync/writeout-only", count_fsync_writeout_only);
-       log_trace_fsync_if("fsync/hardware-flush", count_fsync_hardware_flush);
-}
-
 static int warn_if_unremovable(const char *op, const char *file, int rc)
 {
        int err;
index f0c7d0616d6905c3c6b049262dbe56137be9fa8d..79a9c1b5077b4df0bef51538b778abba220740e6 100644 (file)
--- a/wrapper.h
+++ b/wrapper.h
@@ -1,6 +1,42 @@
 #ifndef WRAPPER_H
 #define WRAPPER_H
 
+char *xstrdup(const char *str);
+void *xmalloc(size_t size);
+void *xmallocz(size_t size);
+void *xmallocz_gently(size_t size);
+void *xmemdupz(const void *data, size_t len);
+char *xstrndup(const char *str, size_t len);
+void *xrealloc(void *ptr, size_t size);
+void *xcalloc(size_t nmemb, size_t size);
+void xsetenv(const char *name, const char *value, int overwrite);
+void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
+const char *mmap_os_err(void);
+void *xmmap_gently(void *start, size_t length, int prot, int flags, int fd, off_t offset);
+int xopen(const char *path, int flags, ...);
+ssize_t xread(int fd, void *buf, size_t len);
+ssize_t xwrite(int fd, const void *buf, size_t len);
+ssize_t xpread(int fd, void *buf, size_t len, off_t offset);
+int xdup(int fd);
+FILE *xfopen(const char *path, const char *mode);
+FILE *xfdopen(int fd, const char *mode);
+int xmkstemp(char *temp_filename);
+int xmkstemp_mode(char *temp_filename, int mode);
+char *xgetcwd(void);
+FILE *fopen_for_writing(const char *path);
+FILE *fopen_or_warn(const char *path, const char *mode);
+
+/*
+ * Like strncmp, but only return zero if s is NUL-terminated and exactly len
+ * characters long.  If it is not, consider it greater than t.
+ */
+int xstrncmpz(const char *s, const char *t, size_t len);
+
+__attribute__((format (printf, 3, 4)))
+int xsnprintf(char *dst, size_t max, const char *fmt, ...);
+
+int xgethostname(char *buf, size_t len);
+
 /* 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);
@@ -33,4 +69,74 @@ void write_file(const char *path, const char *fmt, ...);
 /* Return 1 if the file is empty or does not exists, 0 otherwise. */
 int is_empty_or_missing_file(const char *filename);
 
+enum fsync_action {
+       FSYNC_WRITEOUT_ONLY,
+       FSYNC_HARDWARE_FLUSH
+};
+
+/*
+ * Issues an fsync against the specified file according to the specified mode.
+ *
+ * FSYNC_WRITEOUT_ONLY attempts to use interfaces available on some operating
+ * systems to flush the OS cache without issuing a flush command to the storage
+ * controller. If those interfaces are unavailable, the function fails with
+ * ENOSYS.
+ *
+ * FSYNC_HARDWARE_FLUSH does an OS writeout and hardware flush to ensure that
+ * changes are durable. It is not expected to fail.
+ */
+int git_fsync(int fd, enum fsync_action action);
+
+/*
+ * Preserves errno, prints a message, but gives no warning for ENOENT.
+ * Returns 0 on success, which includes trying to unlink an object that does
+ * not exist.
+ */
+int unlink_or_warn(const char *path);
+ /*
+  * Tries to unlink file.  Returns 0 if unlink succeeded
+  * or the file already didn't exist.  Returns -1 and
+  * appends a message to err suitable for
+  * 'error("%s", err->buf)' on error.
+  */
+int unlink_or_msg(const char *file, struct strbuf *err);
+/*
+ * Preserves errno, prints a message, but gives no warning for ENOENT.
+ * Returns 0 on success, which includes trying to remove a directory that does
+ * not exist.
+ */
+int rmdir_or_warn(const char *path);
+/*
+ * Calls the correct function out of {unlink,rmdir}_or_warn based on
+ * the supplied file mode.
+ */
+int remove_or_warn(unsigned int mode, const char *path);
+
+/*
+ * Call access(2), but warn for any error except "missing file"
+ * (ENOENT or ENOTDIR).
+ */
+#define ACCESS_EACCES_OK (1U << 0)
+int access_or_warn(const char *path, int mode, unsigned flag);
+int access_or_die(const char *path, int mode, unsigned flag);
+
+/* Warn on an inaccessible file if errno indicates this is an error */
+int warn_on_fopen_errors(const char *path);
+
+/*
+ * Open with O_NOFOLLOW, or equivalent. Note that the fallback equivalent
+ * may be racy. Do not use this as protection against an attacker who can
+ * simultaneously create paths.
+ */
+int open_nofollow(const char *path, int flags);
+
+void sleep_millisec(int millisec);
+
+/*
+ * Generate len bytes from the system cryptographically secure PRNG.
+ * Returns 0 on success and -1 on error, setting errno.  The inability to
+ * satisfy the full request is an error.
+ */
+int csprng_bytes(void *buf, size_t len);
+
 #endif /* WRAPPER_H */
index cc9e0787a1de50e9032a06d4036835bc9d1b35b9..d8355c0c3e36830f8b9dbd9af696ed3917860c9e 100644 (file)
@@ -1,7 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "run-command.h"
-#include "wrapper.h"
 #include "write-or-die.h"
 
 /*
diff --git a/ws.c b/ws.c
index da3d0e28cbba9cb5e5d459f8e807a9a0fcf42102..9456e2fdbe3766b89497cf740b6280770daf5fd8 100644 (file)
--- a/ws.c
+++ b/ws.c
@@ -3,8 +3,12 @@
  *
  * Copyright (c) 2007 Junio C Hamano
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "attr.h"
+#include "strbuf.h"
+#include "ws.h"
+
+unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
 
 static struct whitespace_rule {
        const char *rule_name;
@@ -79,7 +83,7 @@ unsigned whitespace_rule(struct index_state *istate, const char *pathname)
        if (!attr_whitespace_rule)
                attr_whitespace_rule = attr_check_initl("whitespace", NULL);
 
-       git_check_attr(istate, NULL, pathname, attr_whitespace_rule);
+       git_check_attr(istate, pathname, attr_whitespace_rule);
        value = attr_whitespace_rule->items[0].value;
        if (ATTR_TRUE(value)) {
                /* true (whitespace) */
diff --git a/ws.h b/ws.h
new file mode 100644 (file)
index 0000000..5ba676c
--- /dev/null
+++ b/ws.h
@@ -0,0 +1,33 @@
+#ifndef WS_H
+#define WS_H
+
+struct index_state;
+struct strbuf;
+
+/*
+ * whitespace rules.
+ * used by both diff and apply
+ * last two digits are tab width
+ */
+#define WS_BLANK_AT_EOL         0100
+#define WS_SPACE_BEFORE_TAB     0200
+#define WS_INDENT_WITH_NON_TAB  0400
+#define WS_CR_AT_EOL           01000
+#define WS_BLANK_AT_EOF        02000
+#define WS_TAB_IN_INDENT       04000
+#define WS_TRAILING_SPACE      (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
+#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8)
+#define WS_TAB_WIDTH_MASK        077
+/* All WS_* -- when extended, adapt diff.c emit_symbol */
+#define WS_RULE_MASK           07777
+extern unsigned whitespace_rule_cfg;
+unsigned whitespace_rule(struct index_state *, const char *);
+unsigned parse_whitespace_rule(const char *);
+unsigned ws_check(const char *line, int len, unsigned ws_rule);
+void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
+char *whitespace_error_string(unsigned ws);
+void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
+int ws_blank_line(const char *line, int len);
+#define ws_tab_width(rule)     ((rule) & WS_TAB_WIDTH_MASK)
+
+#endif /* WS_H */
index 4bef09de1ca55adc2046dafe4df8d0aa93b9d37f..5b1378965c9aa37505a23cf9c472f1abe4d8503e 100644 (file)
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
 #include "wt-status.h"
 #include "object.h"
 #include "dir.h"
@@ -6,7 +7,10 @@
 #include "diff.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
+#include "object-name.h"
+#include "path.h"
 #include "revision.h"
 #include "diffcore.h"
 #include "quote.h"
 #include "refs.h"
 #include "submodule.h"
 #include "column.h"
+#include "read-cache.h"
 #include "setup.h"
 #include "strbuf.h"
+#include "trace.h"
+#include "trace2.h"
+#include "tree.h"
 #include "utf8.h"
 #include "worktree.h"
 #include "lockfile.h"
@@ -1019,7 +1027,7 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom
        if (s->display_comment_prefix) {
                size_t len;
                summary_content = strbuf_detach(&summary, &len);
-               strbuf_add_commented_lines(&summary, summary_content, len);
+               strbuf_add_commented_lines(&summary, summary_content, len, comment_line_char);
                free(summary_content);
        }
 
@@ -1094,8 +1102,8 @@ void wt_status_append_cut_line(struct strbuf *buf)
 {
        const char *explanation = _("Do not modify or remove the line above.\nEverything below it will be ignored.");
 
-       strbuf_commented_addf(buf, "%s", cut_line);
-       strbuf_add_commented_lines(buf, explanation, strlen(explanation));
+       strbuf_commented_addf(buf, comment_line_char, "%s", cut_line);
+       strbuf_add_commented_lines(buf, explanation, strlen(explanation), comment_line_char);
 }
 
 void wt_status_add_cut_line(FILE *fp)
@@ -1178,7 +1186,8 @@ static void wt_longstatus_print_tracking(struct wt_status *s)
 
        t_begin = getnanotime();
 
-       if (!format_tracking_info(branch, &sb, s->ahead_behind_flags))
+       if (!format_tracking_info(branch, &sb, s->ahead_behind_flags,
+                                 !s->commit_template))
                return;
 
        if (advice_enabled(ADVICE_STATUS_AHEAD_BEHIND_WARNING) &&
@@ -1785,10 +1794,10 @@ void wt_status_get_state(struct repository *r,
                oidcpy(&state->revert_head_oid, &oid);
        }
        if (!sequencer_get_last_command(r, &action)) {
-               if (action == REPLAY_PICK) {
+               if (action == REPLAY_PICK && !state->cherry_pick_in_progress) {
                        state->cherry_pick_in_progress = 1;
                        oidcpy(&state->cherry_pick_head_oid, null_oid());
-               } else {
+               } else if (action == REPLAY_REVERT && !state->revert_in_progress) {
                        state->revert_in_progress = 1;
                        oidcpy(&state->revert_head_oid, null_oid());
                }
index 0460e03f5edd3538ff6ef6ff46d146aec1d06611..adcea109fa9a54eaa96c67c1b5e8a1689af253af 100644 (file)
@@ -1,7 +1,8 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "strbuf.h"
 #include "xdiff-interface.h"
 #include "xdiff/xtypes.h"
 #include "xdiff/xdiffi.h"
@@ -307,7 +308,8 @@ int xdiff_compare_lines(const char *l1, long s1,
 
 int git_xmerge_style = -1;
 
-int git_xmerge_config(const char *var, const char *value, void *cb)
+int git_xmerge_config(const char *var, const char *value,
+                     const struct config_context *ctx, void *cb)
 {
        if (!strcmp(var, "merge.conflictstyle")) {
                if (!value)
@@ -327,5 +329,5 @@ int git_xmerge_config(const char *var, const char *value, void *cb)
                            value, var);
                return 0;
        }
-       return git_default_config(var, value, cb);
+       return git_default_config(var, value, ctx, cb);
 }
index 3750794afe90c8c7d7951cdd187945c895115781..e6f80df04627ccfe1b3777fe380ef3aa5188769e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef XDIFF_INTERFACE_H
 #define XDIFF_INTERFACE_H
 
-#include "hash.h"
+#include "hash-ll.h"
 #include "xdiff/xdiff.h"
 
 /*
@@ -50,7 +50,9 @@ int buffer_is_binary(const char *ptr, unsigned long size);
 
 void xdiff_set_find_func(xdemitconf_t *xecfg, const char *line, int cflags);
 void xdiff_clear_find_func(xdemitconf_t *xecfg);
-int git_xmerge_config(const char *var, const char *value, void *cb);
+struct config_context;
+int git_xmerge_config(const char *var, const char *value,
+                     const struct config_context *ctx, void *cb);
 extern int git_xmerge_style;
 
 /*